| 29 | // |
| 30 | |
| 31 | int // O - Exit status |
| 32 | main(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... |
nothing calls this directly
no test coverage detected