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

Function main

berkeley/lpr.c:30–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 */
29
30int
31main(int argc, /* I - Number of command-line arguments */
32 char *argv[]) /* I - Command-line arguments */
33{
34 int i, j; /* Looping var */
35 int job_id; /* Job ID */
36 char ch; /* Option character */
37 char *printer, /* Destination printer or class */
38 *instance, /* Instance */
39 *opt; /* Option pointer */
40 const char *title; /* Job title */
41 int num_copies; /* Number of copies per file */
42 int num_files; /* Number of files to print */
43 const char *files[1000]; /* Files to print */
44 cups_dest_t *dest; /* Selected destination */
45 int num_options; /* Number of options */
46 cups_option_t *options; /* Options */
47 int deletefile; /* Delete file after print? */
48 char buffer[8192]; /* Copy buffer */
49
50
51 _cupsSetLocale(argv);
52
53 deletefile = 0;
54 printer = NULL;
55 dest = NULL;
56 num_options = 0;
57 options = NULL;
58 num_files = 0;
59 title = NULL;
60
61 for (i = 1; i < argc; i ++)
62 {
63 if (!strcmp(argv[i], "--help"))
64 usage();
65 else if (argv[i][0] == '-')
66 {
67 for (opt = argv[i] + 1; *opt; opt ++)
68 {
69 switch (ch = *opt)
70 {
71 case 'E' : /* Encrypt */
72#ifdef HAVE_TLS
73 cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
74#else
75 _cupsLangPrintf(stderr, _("%s: Sorry, no encryption support."), argv[0]);
76#endif /* HAVE_TLS */
77 break;
78
79 case 'U' : /* Username */
80 if (opt[1] != '\0')
81 {
82 cupsSetUser(opt + 1);
83 opt += strlen(opt) - 1;
84 }
85 else
86 {
87 i ++;

Callers

nothing calls this directly

Calls 15

_cupsSetLocaleFunction · 0.85
cupsSetEncryptionFunction · 0.85
_cupsLangPrintfFunction · 0.85
cupsSetUserFunction · 0.85
cupsSetServerFunction · 0.85
cupsParseOptionsFunction · 0.85
cupsAddOptionFunction · 0.85
cupsUserFunction · 0.85
httpGetHostnameFunction · 0.85
cupsGetNamedDestFunction · 0.85
cupsGetOptionFunction · 0.85
cupsLastErrorFunction · 0.85

Tested by

no test coverage detected