MCPcopy Create free account
hub / github.com/OpenPrinting/cups / main

Function main

cups/testlang.c:39–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 */
38
39int /* O - Exit status */
40main(int argc, /* I - Number of command-line arguments */
41 char *argv[]) /* I - Command-line arguments */
42{
43 int i; /* Looping var */
44 const char *opt; /* Current option */
45 int errors = 0; /* Number of errors */
46 int dotests = 1; /* Do standard tests? */
47 const char *lang = NULL; /* Single language test? */
48 cups_lang_t *language = NULL; /* Message catalog */
49
50
51 /*
52 * Parse command-line...
53 */
54
55 _cupsSetLocale(argv);
56
57 for (i = 1; i < argc; i ++)
58 {
59 if (argv[i][0] == '-')
60 {
61 if (!strcmp(argv[i], "--help"))
62 {
63 usage();
64 }
65 else
66 {
67 for (opt = argv[i] + 1; *opt; opt ++)
68 {
69 switch (*opt)
70 {
71 case 'l' :
72 i ++;
73 if (i >= argc)
74 {
75 usage();
76 return (1);
77 }
78
79 lang = argv[i];
80 break;
81
82 case 'p' :
83 i ++;
84 if (i >= argc)
85 {
86 usage();
87 return (1);
88 }
89
90 dotests = 0;
91 errors += show_ppd(argv[i]);
92 break;
93
94 default :
95 usage();
96 return (1);

Callers

nothing calls this directly

Calls 9

_cupsSetLocaleFunction · 0.85
show_ppdFunction · 0.85
cupsLangGetFunction · 0.85
test_stringFunction · 0.85
test_languageFunction · 0.85
cupsDirOpenFunction · 0.85
cupsDirReadFunction · 0.85
cupsDirCloseFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected