Skip to content

Commit

Permalink
Update Xcode project.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Oct 15, 2024
1 parent d2d060c commit 74aed4c
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 109 deletions.
66 changes: 33 additions & 33 deletions tools/ippfind.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ main(int argc, // I - Number of command-line args
if (logic == IPPFIND_OP_OR)
{
cupsLangPrintf(stderr, _("%s: Cannot use '--and' after '--or'."), "ippfind");
return (usage(stderr));
exit(usage(stderr));
}

if (!current)
{
cupsLangPrintf(stderr, _("%s: Missing expression before '--and'."), "ippfind");
return (usage(stderr));
exit(usage(stderr));
}

temp = NULL;
Expand All @@ -240,7 +240,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing regular expression after '%s'."), "ippfind", "--domain");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_DOMAIN_REGEX, invert, NULL, argv[i], NULL);
Expand All @@ -251,7 +251,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing program after '%s'."), "ippfind", "--exec");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_EXEC, invert, NULL, NULL, argv + i);
Expand All @@ -267,7 +267,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing semi-colon after '%s'."), "ippfind", "--exec");
return (usage(stderr));
exit(usage(stderr));
}

have_output = true;
Expand All @@ -278,15 +278,15 @@ main(int argc, // I - Number of command-line args
}
else if (!strcmp(argv[i], "--help"))
{
return (usage(stdout));
exit(usage(stdout));
}
else if (!strcmp(argv[i], "--host"))
{
i ++;
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing regular expression after '%s'."), "ippfind", "--host");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_HOST_REGEX, invert, NULL, argv[i], NULL);
Expand All @@ -306,7 +306,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing name after '%s'."), "ippfind", "--literal-name");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_NAME_LITERAL, invert, argv[i], NULL, NULL);
Expand All @@ -317,7 +317,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing regular expression after '%s'."), "ippfind", "--name");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_NAME_REGEX, invert, NULL, argv[i], NULL);
Expand All @@ -331,7 +331,7 @@ main(int argc, // I - Number of command-line args
if (!current)
{
cupsLangPrintf(stderr, _("%s: Missing expression before '--or'."), "ippfind");
return (usage(stderr));
exit(usage(stderr));
}

logic = IPPFIND_OP_OR;
Expand Down Expand Up @@ -397,7 +397,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing regular expression after '%s'."), "ippfind", "--path");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_PATH_REGEX, invert, NULL, argv[i], NULL);
Expand All @@ -408,7 +408,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing port range after '%s'."), "ippfind", "--port");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_PORT_RANGE, invert, argv[i], NULL, NULL);
Expand Down Expand Up @@ -442,7 +442,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing key name after '%s'."), "ippfind", "--txt");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_TXT_EXISTS, invert, argv[i], NULL, NULL);
Expand All @@ -455,7 +455,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing regular expression after '%s'."), "ippfind", argv[i - 1]);
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_TXT_REGEX, invert, key, argv[i], NULL);
Expand All @@ -466,20 +466,20 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing regular expression after '%s'."), "ippfind", "--uri");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_URI_REGEX, invert, NULL, argv[i], NULL);
}
else if (!strcmp(argv[i], "--version"))
{
puts(LIBCUPS_VERSION);
return (0);
exit(0);
}
else
{
cupsLangPrintf(stderr, _("%s: Unknown option '%s'."), "ippfind", argv[i]);
return (usage(stderr));
exit(usage(stderr));
}

if (temp)
Expand Down Expand Up @@ -541,7 +541,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing name after '%s'."), "ippfind", "-N");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_NAME_LITERAL, invert, argv[i], NULL, NULL);
Expand All @@ -552,7 +552,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing port range after '%s'."), "ippfind", "-P");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_PORT_RANGE, invert, argv[i], NULL, NULL);
Expand All @@ -563,7 +563,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing timeout after '-T'."), "ippfind");
return (usage(stderr));
exit(usage(stderr));
}

bonjour_timeout = atof(argv[i]);
Expand All @@ -574,7 +574,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing version after '-V'."), "ippfind");
return (usage(stderr));
exit(usage(stderr));
}

if (!strcmp(argv[i], "1.1"))
Expand All @@ -596,7 +596,7 @@ main(int argc, // I - Number of command-line args
else
{
cupsLangPrintf(stderr, _("%s: Unsupported version \"%s\"."), "ippfind", argv[i]);
return (usage(stderr));
exit(usage(stderr));
}
break;

Expand All @@ -605,7 +605,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing regular expression after '%s'."), "ippfind", "-d");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_DOMAIN_REGEX, invert, NULL, argv[i], NULL);
Expand All @@ -616,7 +616,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing regular expression after '%s'."), "ippfind", "-h");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_HOST_REGEX, invert, NULL, argv[i], NULL);
Expand All @@ -632,7 +632,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing regular expression after '%s'."), "ippfind", "-n");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_NAME_REGEX, invert, NULL, argv[i], NULL);
Expand Down Expand Up @@ -663,7 +663,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing key name after '%s'."), "ippfind", "-t");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_TXT_EXISTS, invert, argv[i], NULL, NULL);
Expand All @@ -674,7 +674,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing regular expression after '%s'."), "ippfind", "-u");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_URI_REGEX, invert, NULL, argv[i], NULL);
Expand All @@ -685,7 +685,7 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing program after '%s'."), "ippfind", "-x");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_EXEC, invert, NULL, NULL, argv + i);
Expand All @@ -701,15 +701,15 @@ main(int argc, // I - Number of command-line args
if (i >= argc)
{
cupsLangPrintf(stderr, _("%s: Missing semi-colon after '%s'."), "ippfind", "-x");
return (usage(stderr));
exit(usage(stderr));
}

have_output = true;
break;

default :
cupsLangPrintf(stderr, _("%s: Unknown option '-%c'."), "ippfind", *opt);
return (usage(stderr));
exit(usage(stderr));
}

if (temp)
Expand Down Expand Up @@ -758,7 +758,7 @@ main(int argc, // I - Number of command-line args
if (num_parens >= 100)
{
cupsLangPrintf(stderr, _("%s: Too many parenthesis."), "ippfind");
return (usage(stderr));
exit(usage(stderr));
}

temp = new_expr(IPPFIND_OP_AND, invert, NULL, NULL, NULL);
Expand Down Expand Up @@ -786,7 +786,7 @@ main(int argc, // I - Number of command-line args
if (num_parens <= 0)
{
cupsLangPrintf(stderr, _("%s: Missing open parenthesis."), "ippfind");
return (usage(stderr));
exit(usage(stderr));
}

current = parens[--num_parens];
Expand All @@ -812,7 +812,7 @@ main(int argc, // I - Number of command-line args
if (num_parens > 0)
{
cupsLangPrintf(stderr, _("%s: Missing close parenthesis."), "ippfind");
return (usage(stderr));
exit(usage(stderr));
}

if (!have_output)
Expand Down
Loading

0 comments on commit 74aed4c

Please sign in to comment.