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

Function main

ppdc/ppdhtml.cxx:31–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29//
30
31int // O - Exit status
32main(int argc, // I - Number of command-line arguments
33 char *argv[]) // I - Command-line arguments
34{
35 int i; // Looping var
36 ppdcSource *src; // PPD source file data
37 ppdcDriver *d; // Current driver
38 ppdcGroup *g, // Current group
39 *composite; // Composite of all drivers
40 ppdcOption *o, // Current option
41 *compo; // Composite option
42 ppdcChoice *c; // Current choice
43 char *opt; // Current option char
44 ppdcMediaSize *size; // Current media size
45 char *value; // Value in option
46
47
48 _cupsSetLocale(argv);
49
50 // Scan the command-line...
51 src = new ppdcSource();
52
53 for (i = 1; i < argc; i ++)
54 if (argv[i][0] == '-')
55 {
56 for (opt = argv[i] + 1; *opt; opt ++)
57 switch (*opt)
58 {
59 case 'D' : // Define variable
60 i ++;
61 if (i >= argc)
62 usage();
63
64 if ((value = strchr(argv[i], '=')) != NULL)
65 {
66 *value++ = '\0';
67
68 src->set_variable(argv[i], value);
69 }
70 else
71 src->set_variable(argv[i], "1");
72 break;
73
74 case 'I' : // Include directory...
75 i ++;
76 if (i >= argc)
77 usage();
78
79 ppdcSource::add_include(argv[i]);
80 break;
81
82 default : // Unknown
83 usage();
84 }
85 }
86 else
87 {
88 // Open and load the driver info file...

Callers

nothing calls this directly

Calls 9

_cupsSetLocaleFunction · 0.85
set_variableMethod · 0.80
read_fileMethod · 0.80
firstMethod · 0.80
nextMethod · 0.80
add_optionMethod · 0.80
releaseMethod · 0.80
usageFunction · 0.70
find_optionMethod · 0.45

Tested by

no test coverage detected