Lines Matching +full:user +full:- +full:selected
24 This driver is structured for printer firmware that runs in user mode. The
25 user mode printer firmware will read and write data from the kernel mode
28 user space firmware can read or write this status byte using a device file
29 /dev/g_printer . Both blocking and non-blocking read/write calls are supported.
97 gcc prn_example.c -o prn_example
103 # prn_example -read_data
108 # cat data_file | prn_example -write_data
113 # prn_example -get_status
116 Printer is NOT Selected
121 To set printer to Selected/On-line::
123 # prn_example -selected
126 To set printer to Not Selected/Off-line::
128 # prn_example -not_selected
133 # prn_example -paper_out
138 # prn_example -paper_loaded
143 # prn_example -no_error
148 # prn_example -error
171 * 'usage()' - Show program usage.
175 usage(const char *option) /* I - Option string or NULL */
183 fputs("Usage: prn_example -[options]\n", stderr);
186 fputs("-get_status Get the current printer status.\n", stderr);
187 fputs("-selected Set the selected status to selected.\n", stderr);
188 fputs("-not_selected Set the selected status to NOT selected.\n",
190 fputs("-error Set the error status to error.\n", stderr);
191 fputs("-no_error Set the error status to NO error.\n", stderr);
192 fputs("-paper_out Set the paper status to paper out.\n", stderr);
193 fputs("-paper_loaded Set the paper status to paper loaded.\n",
195 fputs("-read_data Read printer data from driver.\n", stderr);
196 fputs("-write_data Write printer sata to driver.\n", stderr);
197 fputs("-NB_read_data (Non-Blocking) Read printer data from driver.\n",
215 return(-1);
237 return(-1);
265 return(-1);
293 return(-1);
295 bytes_read -= retval;
326 return(-1);
359 return(-1);
366 return(-1);
385 return(-1);
394 return(-1);
406 return(-1);
424 return(-1);
429 printf(" Printer is Selected\n");
431 printf(" Printer is NOT Selected\n");
462 if (argv[i][0] != '-') {
466 if (!strcmp(argv[i], "-get_status")) {
471 } else if (!strcmp(argv[i], "-paper_loaded")) {
476 } else if (!strcmp(argv[i], "-paper_out")) {
481 } else if (!strcmp(argv[i], "-selected")) {
486 } else if (!strcmp(argv[i], "-not_selected")) {
491 } else if (!strcmp(argv[i], "-error")) {
496 } else if (!strcmp(argv[i], "-no_error")) {
501 } else if (!strcmp(argv[i], "-read_data")) {
506 } else if (!strcmp(argv[i], "-write_data")) {
511 } else if (!strcmp(argv[i], "-NB_read_data")) {