| 32 | */ |
| 33 | |
| 34 | int /* O - Exit status */ |
| 35 | main(int argc, /* I - Number of command-line arguments */ |
| 36 | char *argv[]) /* I - Command-line arguments */ |
| 37 | { |
| 38 | int status = 0; /* Exit status */ |
| 39 | cups_file_t *fp; /* Command file */ |
| 40 | char line[1024], /* Line from file */ |
| 41 | *value; /* Value on line */ |
| 42 | int linenum; /* Line number in file */ |
| 43 | ppd_file_t *ppd; /* PPD file */ |
| 44 | |
| 45 | |
| 46 | /* |
| 47 | * Check for valid arguments... |
| 48 | */ |
| 49 | |
| 50 | if (argc != 6 && argc != 7) |
| 51 | { |
| 52 | /* |
| 53 | * We don't have the correct number of arguments; write an error message |
| 54 | * and return. |
| 55 | */ |
| 56 | |
| 57 | _cupsLangPrintf(stderr, |
| 58 | _("Usage: %s job-id user title copies options [file]"), |
| 59 | argv[0]); |
| 60 | return (1); |
| 61 | } |
| 62 | |
| 63 | /* |
| 64 | * Open the PPD file... |
| 65 | */ |
| 66 | |
| 67 | if ((ppd = ppdOpenFile(getenv("PPD"))) == NULL) |
| 68 | { |
| 69 | fputs("ERROR: Unable to open PPD file!\n", stderr); |
| 70 | return (1); |
| 71 | } |
| 72 | |
| 73 | /* |
| 74 | * Open the command file as needed... |
| 75 | */ |
| 76 | |
| 77 | if (argc == 7) |
| 78 | { |
| 79 | if ((fp = cupsFileOpen(argv[6], "r")) == NULL) |
| 80 | { |
| 81 | perror("ERROR: Unable to open command file - "); |
| 82 | return (1); |
| 83 | } |
| 84 | } |
| 85 | else |
| 86 | fp = cupsFileStdin(); |
| 87 | |
| 88 | /* |
| 89 | * Read the commands from the file and send the appropriate commands... |
| 90 | */ |
| 91 |
nothing calls this directly
no test coverage detected