diff options
author | Garance A Drosehn <gad@FreeBSD.org> | 2002-06-13 01:55:48 +0000 |
---|---|---|
committer | Garance A Drosehn <gad@FreeBSD.org> | 2002-06-13 01:55:48 +0000 |
commit | e8e715fa62e0a9bcddfc77a931270a7af39a0b3b (patch) | |
tree | 62174a323cfa41c4a76460294d1ddeecd6d65475 /usr.sbin/lpr/common_source/lp.h | |
parent | 635ad5f02151bae056bbef27251519fcf5d8b17f (diff) | |
download | src-e8e715fa62e0a9bcddfc77a931270a7af39a0b3b.tar.gz src-e8e715fa62e0a9bcddfc77a931270a7af39a0b3b.zip |
Almost complete rewrite of the lpc commands 'abort', 'enable', 'disable',
'restart', 'start', 'stop' and 'up'. These are commands which mainly
just alter the access bits on the lock-file of a queue, and they all
now use a central routine to do that. This reduces the amount of code
that is run as the priv userid, and eliminates a number of cases where
error messages were written while that priv uid was in effect.
As far as users are concerned, there should be no noticable difference
in the new versions. In case there *is*, the previous implementations
are still there as 'xabort', 'xenable', etc, so they are available for
instant fallback. If no one reports a problem after a few weeks, then
a later update will remove those x-commands.
Reviewed by: freebsd-audit and freebsd-print@bostonradio.org
MFC after: 10 days
Notes
Notes:
svn path=/head/; revision=98152
Diffstat (limited to 'usr.sbin/lpr/common_source/lp.h')
-rw-r--r-- | usr.sbin/lpr/common_source/lp.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/usr.sbin/lpr/common_source/lp.h b/usr.sbin/lpr/common_source/lp.h index 6faaf4d89929..81ac7aee4afc 100644 --- a/usr.sbin/lpr/common_source/lp.h +++ b/usr.sbin/lpr/common_source/lp.h @@ -223,6 +223,23 @@ typedef enum { TR_SENDING, TR_RECVING, TR_PRINTING } tr_sendrecv; #define TEMP_FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH) /* + * Bit-flags for set_qstate() actions, followed by the return values. + */ +#define SQS_DISABLEQ 0x01 /* Disable the queuing of new jobs */ +#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_PARMERR -9 /* Invalid parameters from caller */ +#define SQS_CREFAIL -3 /* File did not exist, and create failed */ +#define SQS_CHGFAIL -2 /* File exists, but unable to change state */ +#define SQS_STATFAIL -1 /* Unable to stat() the lock file */ +#define SQS_CHGOK 1 /* File existed, and the state was changed */ +#define SQS_CREOK 2 /* File did not exist, but was created OK */ +#define SQS_SKIPCREOK 3 /* File did not exist, and there was */ + /* no need to create it */ + +/* * Command codes used in the protocol. */ #define CMD_CHECK_QUE '\1' @@ -272,6 +289,7 @@ void process(const struct printer *_pp, char *_file); void rmjob(const char *_printer); void rmremote(const struct printer *_pp); void setprintcap(char *_newfile); +int set_qstate(int _action, const char *_lfname); void show(const char *_nfile, const char *_datafile, int _copies); int startdaemon(const struct printer *_pp); char *status_file_name(const struct printer *_pp, char *_buf, |