#define LPRNG_MAXTOK 128 /* PFMA just to keep us from running away. */
fstring tokarr[LPRNG_MAXTOK];
- char *cptr;
+ const char *cptr;
+ char *ptr;
int num_tok = 0;
- pstring line2;
- pstrcpy(line2,line);
- cptr = line2;
+ cptr = line;
while(next_token( &cptr, tokarr[num_tok], " \t", sizeof(fstring)) && (num_tok < LPRNG_MAXTOK))
num_tok++;
* for the current user on the taskbar. Plop in a null.
*/
- if ((cptr = strchr_m(buf->fs_user,'@')) != NULL) {
- *cptr = '\0';
+ if ((ptr = strchr_m(buf->fs_user,'@')) != NULL) {
+ *ptr = '\0';
}
StrnCpy(buf->fs_file,tokarr[LPRNG_FILETOK],sizeof(buf->fs_file)-1);
{
fstring tok[11];
int count=0;
+ const char *cline = line;
/* handle the case of "(standard input)" as a filename */
string_sub(line,"standard input","STDIN",0);
for (count=0;
count<10 &&
- next_token(&line,tok[count],NULL, sizeof(tok[count]));
+ next_token(&cline,tok[count],NULL, sizeof(tok[count]));
count++) ;
/* we must get 6 tokens */
ljplus-2154 user priority 0 Jan 19 08:14 from client
(standard input) 7551 bytes
****************************************************************************/
-static BOOL parse_lpq_hpux(char * line, print_queue_struct *buf, BOOL first)
+static BOOL parse_lpq_hpux(char *line, print_queue_struct *buf, BOOL first)
{
/* must read two lines to process, therefore keep some values static */
static BOOL header_line_ok=False, base_prio_reset=False;
/* to store minimum priority to print, lpstat command should be invoked
with -p option first, to work */
static int base_prio;
-
int count;
char htab = '\011';
+ const char *cline = line;
fstring tok[12];
/* If a line begins with a horizontal TAB, it is a subline type */
all_string_sub(line,"(","\"",0);
all_string_sub(line,")","\"",0);
- for (count=0; count<2 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
+ for (count=0; count<2 && next_token(&cline,tok[count],NULL,sizeof(tok[count])); count++) ;
/* we must get 2 tokens */
if (count < 2) return(False);
/* handle the dash in the job id */
string_sub(line,"-"," ",0);
- for (count=0; count<12 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
+ for (count=0; count<12 && next_token(&cline,tok[count],NULL,sizeof(tok[count])); count++) ;
/* we must get 8 tokens */
if (count < 8) return(False);
fstring tok[9];
int count=0;
char *p;
+ const char *cline = line;
/*
* Handle the dash in the job id, but make sure that we skip over
if((p >= line) && (*p == '-'))
*p = ' ';
- for (count=0; count<9 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++)
+ for (count=0; count<9 && next_token(&cline,tok[count],NULL,sizeof(tok[count])); count++)
;
/* we must get 7 tokens */
{
fstring tok[7];
int count=0;
+ const char *cline;
DEBUG(4,("antes [%s]\n", line));
string_sub(line,"]","",0);
DEBUG(4,("despues 2 [%s]\n", line));
-
-
- for (count=0; count<7 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
+ for (count=0; count<7 && next_token(&cline,tok[count],NULL,sizeof(tok[count])); count++) ;
/* we must get 7 tokens */
if (count < 7)
{
fstring tok[11];
int count=0;
+ const char *cline = line;
/* handle the case of "(standard input)" as a filename */
string_sub(line,"stdin","STDIN",0);
all_string_sub(line,"(","\"",0);
all_string_sub(line,")","\"",0);
- for (count=0; count<11 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
+ for (count=0; count<11 && next_token(&cline,tok[count],NULL,sizeof(tok[count])); count++) ;
/* we must get 11 tokens */
if (count < 11)
{
fstring tok[10];
int count=0;
+ const char *cline = line;
/* mung all the ":"s to spaces*/
string_sub(line,":"," ",0);
- for (count=0; count<10 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
+ for (count=0; count<10 && next_token(&cline,tok[count],NULL,sizeof(tok[count])); count++) ;
/* we must get 9 tokens */
if (count < 9)
{
int toknum = 0;
fstring tok;
+ const char *cline = line;
/* First line is printer status */
/* Parse a print job entry */
- while(next_token(&line, tok, NULL, sizeof(fstring))) {
+ while(next_token(&cline, tok, NULL, sizeof(fstring))) {
switch (toknum) {
case 0:
buf->job = atoi(tok);
/****************************************************************************
parse a lpq line. Choose printing style
****************************************************************************/
+
BOOL parse_lpq_entry(int snum,char *line,
print_queue_struct *buf,
print_status_struct *status,BOOL first)