diff options
author | David O'Neill <dmo@samba.org> | 2000-11-14 15:26:53 +0000 |
---|---|---|
committer | David O'Neill <dmo@samba.org> | 2000-11-14 15:26:53 +0000 |
commit | fbcf83140da1823e74f63227f0a95d07c6e76764 (patch) | |
tree | 3ca5d3de02c24b2dd340bb00352172fa2fe7ea3e /source | |
parent | 06e71c9f8be20b84e33e143c3d0b7904225efb45 (diff) | |
download | samba-fbcf83140da1823e74f63227f0a95d07c6e76764.tar.gz samba-fbcf83140da1823e74f63227f0a95d07c6e76764.tar.xz samba-fbcf83140da1823e74f63227f0a95d07c6e76764.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)
Diffstat (limited to 'source')
-rwxr-xr-x | source/configure.developer | 2 | ||||
-rw-r--r-- | source/include/smb.h | 7 | ||||
-rw-r--r-- | source/param/loadparm.c | 16 | ||||
-rw-r--r-- | source/printing/lpq_parse.c | 51 |
4 files changed, 74 insertions, 2 deletions
diff --git a/source/configure.developer b/source/configure.developer index e7c8831f62c..07ce9fcf12a 100755 --- a/source/configure.developer +++ b/source/configure.developer @@ -1,4 +1,4 @@ #!/bin/sh -CFLAGS="-g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -DDEBUG_PASSWORD" +CFLAGS="-g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -DDEBUG_PASSWORD -DDEVELOPER" export CFLAGS ./configure $* diff --git a/source/include/smb.h b/source/include/smb.h index 57a62b7f1f0..a5ace1eb4d3 100644 --- a/source/include/smb.h +++ b/source/include/smb.h @@ -1405,7 +1405,12 @@ enum server_types /* printing types */ enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX, - PRINT_QNX,PRINT_PLP,PRINT_LPRNG,PRINT_SOFTQ,PRINT_CUPS,PRINT_LPRNT,PRINT_LPROS2}; + PRINT_QNX,PRINT_PLP,PRINT_LPRNG,PRINT_SOFTQ, + PRINT_CUPS,PRINT_LPRNT,PRINT_LPROS2 +#ifdef DEVELOPER +,PRINT_TEST,PRINT_VLP +#endif /* DEVELOPER */ +}; /* Remote architectures we know about. */ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_WIN2K, RA_SAMBA}; diff --git a/source/param/loadparm.c b/source/param/loadparm.c index dc2082423b9..9dcd7bbc2e3 100644 --- a/source/param/loadparm.c +++ b/source/param/loadparm.c @@ -561,6 +561,10 @@ static struct enum_list enum_printing[] = { {PRINT_CUPS, "cups"}, {PRINT_LPRNT, "nt"}, {PRINT_LPROS2, "os2"}, +#ifdef DEVELOPER + {PRINT_TEST, "test"}, + {PRINT_TEST, "vlp"}, +#endif /* DEVELOPER */ {-1, NULL} }; @@ -1099,6 +1103,18 @@ static void init_printer_values(void) string_set(&sDefault.szLpresumecommand, "qstat -s -j%j -r"); break; +#ifdef DEVELOPER + case PRINT_TEST: + case PRINT_VLP: + string_set(&sDefault.szPrintcommand, "vlp print %p %s"); + string_set(&sDefault.szLpqcommand, "vlp lpq %p"); + string_set(&sDefault.szLprmcommand, "vlp lprm %p %j"); + string_set(&sDefault.szLppausecommand, "vlp lppause %p %j"); + string_set(&sDefault.szLpresumecommand, "vlp lpresum %p %j"); + string_set(&sDefault.szQueuepausecommand, "vlp queuepause %p"); + string_set(&sDefault.szQueueresumecommand, "vlp queueresume %p"); + break; +#endif /* DEVELOPER */ } } diff --git a/source/printing/lpq_parse.c b/source/printing/lpq_parse.c index e0b3ed192f8..f6bf7f06dfe 100644 --- a/source/printing/lpq_parse.c +++ b/source/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; |