summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorDavid O'Neill <dmo@samba.org>2000-11-14 15:26:53 +0000
committerDavid O'Neill <dmo@samba.org>2000-11-14 15:26:53 +0000
commitf9680a444bcba72540ab5e23bb44677ef74a9f13 (patch)
treecb75757616cb1aa7262c1b3b291094089ea6d75f /source3/printing
parente0bcc7ff5434e9f858acc6a79d1842d86d37d73e (diff)
downloadsamba-f9680a444bcba72540ab5e23bb44677ef74a9f13.tar.gz
samba-f9680a444bcba72540ab5e23bb44677ef74a9f13.tar.bz2
samba-f9680a444bcba72540ab5e23bb44677ef74a9f13.zip
Changes from APPLIANCE_HEAD:
- merged Tim's vlp (virtual lp) test program. Enable it with -DDEVELOPER or by using ./configure.developer (source/include/smb.h source/configure.developer source/printing/lpq_parse.c source/param/loadparm.c testsuite/printing/.cvsignore testsuite/printing/Makefile.vlp testsuite/printing/vlp.c) (This used to be commit fbcf83140da1823e74f63227f0a95d07c6e76764)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/lpq_parse.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/source3/printing/lpq_parse.c b/source3/printing/lpq_parse.c
index e0b3ed192f..f6bf7f06df 100644
--- a/source3/printing/lpq_parse.c
+++ b/source3/printing/lpq_parse.c
@@ -938,6 +938,51 @@ static char *stat0_strings[] = { "enabled", "online", "idle", "no entries", "fre
static char *stat1_strings[] = { "offline", "disabled", "down", "off", "waiting", "no daemon", NULL };
static char *stat2_strings[] = { "jam", "paper", "error", "responding", "not accepting", "not running", "turned off", NULL };
+#ifdef DEVELOPER
+
+/****************************************************************************
+parse a vlp line
+****************************************************************************/
+static BOOL parse_lpq_vlp(char *line,print_queue_struct *buf,BOOL first)
+{
+ int toknum = 0;
+ fstring tok;
+
+ /* First line is printer status */
+
+ if (!isdigit(line[0])) return False;
+
+ /* Parse a print job entry */
+
+ while(next_token(&line, tok, NULL, sizeof(fstring))) {
+ switch (toknum) {
+ case 0:
+ buf->job = atoi(tok);
+ break;
+ case 1:
+ buf->size = atoi(tok);
+ break;
+ case 2:
+ buf->status = atoi(tok);
+ break;
+ case 3:
+ buf->time = atoi(tok);
+ break;
+ case 4:
+ fstrcpy(buf->user, tok);
+ break;
+ case 5:
+ fstrcpy(buf->file, tok);
+ break;
+ }
+ toknum++;
+ }
+
+ return True;
+}
+
+#endif /* DEVELOPER */
+
/****************************************************************************
parse a lpq line. Choose printing style
****************************************************************************/
@@ -976,6 +1021,12 @@ BOOL parse_lpq_entry(int snum,char *line,
case PRINT_LPROS2:
ret = parse_lpq_os2(line,buf,first);
break;
+#ifdef DEVELOPER
+ case PRINT_VLP:
+ case PRINT_TEST:
+ ret = parse_lpq_vlp(line,buf,first);
+ break;
+#endif /* DEVELOPER */
default:
ret = parse_lpq_bsd(line,buf,first);
break;