• Home
  • Raw
  • Download

Lines Matching +full:command +full:- +full:line

2  * "lpc" command for CUPS.
4 * Copyright 2007-2014 by Apple Inc.
5 * Copyright 1997-2006 by Easy Software Products.
14 #include <cups/cups-private.h>
29 * 'main()' - Parse options and commands.
33 main(int argc, /* I - Number of command-line arguments */ in main()
34 char *argv[]) /* I - Command-line arguments */ in main()
37 char line[1024], /* Input line from user */ in main() local
52 * Process a single command on the command-line... in main()
60 * Do the command prompt thing... in main()
64 while (fgets(line, sizeof(line), stdin) != NULL) in main()
70 for (params = line + strlen(line) - 1; params >= line;) in main()
74 *params-- = '\0'; in main()
80 for (params = line; isspace(*params & 255); params ++); in main()
82 if (params > line) in main()
83 _cups_strcpy(line, params); in main()
85 if (!line[0]) in main()
99 for (params = line; *params != '\0'; params ++) in main()
104 * Remove whitespace between the command and parameters... in main()
114 if (!compare_strings(line, "quit", 1) || in main()
115 !compare_strings(line, "exit", 2)) in main()
119 do_command(http, line, NULL); in main()
121 do_command(http, line, params); in main()
142 * 'compare_strings()' - Compare two command-line strings.
145 static int /* O - -1 or 1 = no match, 0 = match */
146 compare_strings(const char *s, /* I - Command-line string */ in compare_strings()
147 const char *t, /* I - Option string */ in compare_strings()
148 size_t tmin) /* I - Minimum number of unique chars in option */ in compare_strings()
150 size_t slen; /* Length of command-line string */ in compare_strings()
155 return (-1); in compare_strings()
162 * 'do_command()' - Do an lpc command...
166 do_command(http_t *http, /* I - HTTP connection to server */ in do_command()
167 const char *command, /* I - Command string */ in do_command() argument
168 const char *params) /* I - Parameters for command */ in do_command()
170 if (!compare_strings(command, "status", 4)) in do_command()
172 else if (!compare_strings(command, "help", 1) || !strcmp(command, "?")) in do_command()
177 command); in do_command()
182 * 'show_help()' - Show help messages.
186 show_help(const char *command) /* I - Command to describe or NULL */ in show_help() argument
188 if (!command) in show_help()
195 else if (!compare_strings(command, "help", 1) || !strcmp(command, "?")) in show_help()
197 else if (!compare_strings(command, "status", 4)) in show_help()
200 _cupsLangPrintf(stdout, _("?Invalid help command unknown.")); in show_help()
205 * 'show_prompt()' - Show a localized prompt message.
209 show_prompt(const char *message) /* I - Message string to use */ in show_prompt()
220 …harset(output, (cups_utf8_t *)_cupsLangString(lang, message), sizeof(output), lang->encoding)) > 0) in show_prompt()
229 * 'show_status()' - Show printers.
233 show_status(http_t *http, /* I - HTTP connection to server */ in show_status()
234 const char *dests) /* I - Destinations */ in show_status()
247 int match; /* Non-zero if this job matches */ in show_status()
250 "device-uri", in show_status()
251 "printer-is-accepting-jobs", in show_status()
252 "printer-name", in show_status()
253 "printer-state", in show_status()
254 "queued-job-count" in show_status()
265 * attributes-charset in show_status()
266 * attributes-natural-language in show_status()
272 "requested-attributes", sizeof(requested) / sizeof(requested[0]), in show_status()
286 for (attr = response->attrs; attr != NULL; attr = attr->next) in show_status()
292 while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER) in show_status()
293 attr = attr->next; in show_status()
308 while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER) in show_status()
310 if (!strcmp(attr->name, "device-uri") && in show_status()
311 attr->value_tag == IPP_TAG_URI) in show_status()
312 device = attr->values[0].string.text; in show_status()
313 else if (!strcmp(attr->name, "printer-is-accepting-jobs") && in show_status()
314 attr->value_tag == IPP_TAG_BOOLEAN) in show_status()
315 accepting = attr->values[0].boolean; in show_status()
316 else if (!strcmp(attr->name, "printer-name") && in show_status()
317 attr->value_tag == IPP_TAG_NAME) in show_status()
318 printer = attr->values[0].string.text; in show_status()
319 else if (!strcmp(attr->name, "printer-state") && in show_status()
320 attr->value_tag == IPP_TAG_ENUM) in show_status()
321 pstate = (ipp_pstate_t)attr->values[0].integer; in show_status()
322 else if (!strcmp(attr->name, "queued-job-count") && in show_status()
323 attr->value_tag == IPP_TAG_INTEGER) in show_status()
324 jobcount = attr->values[0].integer; in show_status()
326 attr = attr->next; in show_status()
411 _("\tprinter is on device \'%s\' speed -1"), in show_status()
423 _("\tprinter is on device \'%s\' speed -1"), in show_status()