Add a SQS_QCHANGED option to set_qstate(). This will soon be used by 'lpc'.

Reviewed by:	freebsd-print@bostonradio.org
MFC after:	3 days
This commit is contained in:
Garance A Drosehn 2002-07-12 01:31:46 +00:00
parent 079167d6d7
commit 4c2a399167
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99844
2 changed files with 11 additions and 1 deletions

View File

@ -275,6 +275,7 @@ set_qstate(int action, const char *lfname)
struct stat stbuf;
mode_t chgbits, newbits, oldmask;
const char *failmsg, *okmsg;
static const char *nomsg = "no state msg";
int chres, errsav, fd, res, statres;
/*
@ -298,6 +299,13 @@ set_qstate(int action, const char *lfname)
newbits = LOCK_FILE_MODE;
okmsg = NULL;
failmsg = NULL;
if (action & SQS_QCHANGED) {
chgbits |= LFM_RESET_QUE;
newbits |= LFM_RESET_QUE;
/* The okmsg is not actually printed for this case. */
okmsg = nomsg;
failmsg = "set queue-changed";
}
if (action & SQS_DISABLEQ) {
chgbits |= LFM_QUEUE_DIS;
newbits |= LFM_QUEUE_DIS;
@ -374,7 +382,8 @@ set_qstate(int action, const char *lfname)
case SQS_CHGOK:
case SQS_CREOK:
case SQS_SKIPCREOK:
printf("\t%s\n", okmsg);
if (okmsg != nomsg)
printf("\t%s\n", okmsg);
break;
case SQS_CREFAIL:
printf("\tcannot create lock file: %s\n",

View File

@ -233,6 +233,7 @@ typedef enum { TR_SENDING, TR_RECVING, TR_PRINTING } tr_sendrecv;
#define SQS_STOPP 0x02 /* Stop the printing of jobs */
#define SQS_ENABLEQ 0x10 /* Enable the queuing of new jobs */
#define SQS_STARTP 0x20 /* Start the printing of jobs */
#define SQS_QCHANGED 0x80 /* The queue has changed (new jobs, etc) */
#define SQS_PARMERR -9 /* Invalid parameters from caller */
#define SQS_CREFAIL -3 /* File did not exist, and create failed */