From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/printing/lpq_parse.c | 28 +++++++-------- source3/printing/notify.c | 12 +++---- source3/printing/nt_printing.c | 72 +++++++++++++++++++------------------- source3/printing/pcap.c | 10 +++--- source3/printing/print_aix.c | 2 +- source3/printing/print_cups.c | 8 ++--- source3/printing/print_generic.c | 2 +- source3/printing/print_iprint.c | 4 +-- source3/printing/print_svid.c | 2 +- source3/printing/printing.c | 74 ++++++++++++++++++++-------------------- source3/printing/printing_db.c | 4 +-- 11 files changed, 109 insertions(+), 109 deletions(-) (limited to 'source3/printing') diff --git a/source3/printing/lpq_parse.c b/source3/printing/lpq_parse.c index d5e9c795ad..50fad6f946 100644 --- a/source3/printing/lpq_parse.c +++ b/source3/printing/lpq_parse.c @@ -102,7 +102,7 @@ Modified to handle file names with spaces, like the parse_lpq_lprng code further below. ****************************************************************************/ -static BOOL parse_lpq_bsd(char *line,print_queue_struct *buf,BOOL first) +static bool parse_lpq_bsd(char *line,print_queue_struct *buf,bool first) { #ifdef OSF1 #define RANKTOK 0 @@ -239,7 +239,7 @@ static time_t LPRng_time(char *time_string) ****************************************************************************/ -static BOOL parse_lpq_lprng(char *line,print_queue_struct *buf,BOOL first) +static bool parse_lpq_lprng(char *line,print_queue_struct *buf,bool first) { #define LPRNG_RANKTOK 0 #define LPRNG_USERTOK 1 @@ -329,7 +329,7 @@ lazer lazer RUNNING 537 6297doc.A kvintus@IE 0 10 2445 1 1 QUEUED 541 P.ps root@IEDVB 22 1 5 ********************************************************************/ -static BOOL parse_lpq_aix(char *line,print_queue_struct *buf,BOOL first) +static bool parse_lpq_aix(char *line,print_queue_struct *buf,bool first) { fstring tok[11]; int count=0; @@ -421,10 +421,10 @@ 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; + static bool header_line_ok=False, base_prio_reset=False; static fstring jobuser; static int jobid; static int jobprio; @@ -547,7 +547,7 @@ dcslw-897 tridge 4712 Dec 20 10:30:30 being held ****************************************************************************/ -static BOOL parse_lpq_sysv(char *line,print_queue_struct *buf,BOOL first) +static bool parse_lpq_sysv(char *line,print_queue_struct *buf,bool first) { fstring tok[9]; int count=0; @@ -630,7 +630,7 @@ Printer: txt (ready) 0002: root [job #3 ] ready 1146 bytes -- standard input -- ****************************************************************************/ -static BOOL parse_lpq_qnx(char *line,print_queue_struct *buf,BOOL first) +static bool parse_lpq_qnx(char *line,print_queue_struct *buf,bool first) { fstring tok[7]; int count=0; @@ -697,7 +697,7 @@ Local Printer 'lp2' (fjall): ****************************************************************************/ -static BOOL parse_lpq_plp(char *line,print_queue_struct *buf,BOOL first) +static bool parse_lpq_plp(char *line,print_queue_struct *buf,bool first) { fstring tok[11]; int count=0; @@ -774,7 +774,7 @@ jmcd Waiting Re: Samba Open Sour 26 32476 1 1 ********************************************************************/ -static BOOL parse_lpq_nt(char *line,print_queue_struct *buf,BOOL first) +static bool parse_lpq_nt(char *line,print_queue_struct *buf,bool first) { #define LPRNT_OWNSIZ 11 #define LPRNT_STATSIZ 9 @@ -857,7 +857,7 @@ JobID File Name Rank Size Status Comment ********************************************************************/ -static BOOL parse_lpq_os2(char *line,print_queue_struct *buf,BOOL first) +static bool parse_lpq_os2(char *line,print_queue_struct *buf,bool first) { #define LPROS2_IDSIZ 5 #define LPROS2_JOBSIZ 15 @@ -937,7 +937,7 @@ static const char *stat2_strings[] = { "jam", "paper", "error", "responding", "n parse a vlp line ****************************************************************************/ -static BOOL parse_lpq_vlp(char *line,print_queue_struct *buf,BOOL first) +static bool parse_lpq_vlp(char *line,print_queue_struct *buf,bool first) { int toknum = 0; fstring tok; @@ -982,11 +982,11 @@ static BOOL parse_lpq_vlp(char *line,print_queue_struct *buf,BOOL first) parse a lpq line. Choose printing style ****************************************************************************/ -BOOL parse_lpq_entry(enum printing_types printing_type,char *line, +bool parse_lpq_entry(enum printing_types printing_type,char *line, print_queue_struct *buf, - print_status_struct *status,BOOL first) + print_status_struct *status,bool first) { - BOOL ret; + bool ret; switch (printing_type) { case PRINT_SYSV: diff --git a/source3/printing/notify.c b/source3/printing/notify.c index 0b51475391..23df17c389 100644 --- a/source3/printing/notify.c +++ b/source3/printing/notify.c @@ -35,7 +35,7 @@ static struct notify_queue { } *notify_queue_head = NULL; -static BOOL create_send_ctx(void) +static bool create_send_ctx(void) { if (!send_ctx) send_ctx = talloc_init("print notify queue"); @@ -62,7 +62,7 @@ int print_queue_snum(const char *qname) Used to decide if we need a short select timeout. *******************************************************************/ -BOOL print_notify_messages_pending(void) +bool print_notify_messages_pending(void) { return (notify_queue_head != NULL); } @@ -71,7 +71,7 @@ BOOL print_notify_messages_pending(void) Flatten data into a message. *******************************************************************/ -static BOOL flatten_message(struct notify_queue *q) +static bool flatten_message(struct notify_queue *q) { struct spoolss_notify_msg *msg = q->msg; uint8 *buf = NULL; @@ -218,7 +218,7 @@ void print_notify_send_messages(struct messaging_context *msg_ctx, deep copy a SPOOLSS_NOTIFY_MSG structure using a TALLOC_CTX *********************************************************************/ -static BOOL copy_notify2_msg( SPOOLSS_NOTIFY_MSG *to, SPOOLSS_NOTIFY_MSG *from ) +static bool copy_notify2_msg( SPOOLSS_NOTIFY_MSG *to, SPOOLSS_NOTIFY_MSG *from ) { if ( !to || !from ) @@ -510,12 +510,12 @@ void notify_printer_byname( const char *printername, uint32 change, const char * messages on this print queue. Used in printing/notify to send the messages. ****************************************************************************/ -BOOL print_notify_pid_list(const char *printername, TALLOC_CTX *mem_ctx, size_t *p_num_pids, pid_t **pp_pid_list) +bool print_notify_pid_list(const char *printername, TALLOC_CTX *mem_ctx, size_t *p_num_pids, pid_t **pp_pid_list) { struct tdb_print_db *pdb = NULL; TDB_CONTEXT *tdb = NULL; TDB_DATA data; - BOOL ret = True; + bool ret = True; size_t i, num_pids, offset; pid_t *pid_list; diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 5e7e2a4ca0..5276c2d78c 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -267,7 +267,7 @@ static TDB_DATA make_printers_secdesc_tdbkey( const char* sharename ) /**************************************************************************** ****************************************************************************/ -static BOOL upgrade_to_version_3(void) +static bool upgrade_to_version_3(void) { TDB_DATA kbuf, newkey, dbuf; @@ -454,7 +454,7 @@ static int sec_desc_upg_fn( TDB_CONTEXT *the_tdb, TDB_DATA key, /******************************************************************* *******************************************************************/ -static BOOL upgrade_to_version_4(void) +static bool upgrade_to_version_4(void) { TALLOC_CTX *ctx; int result; @@ -520,7 +520,7 @@ static int normalize_printers_fn( TDB_CONTEXT *the_tdb, TDB_DATA key, /******************************************************************* *******************************************************************/ -static BOOL upgrade_to_version_5(void) +static bool upgrade_to_version_5(void) { TALLOC_CTX *ctx; int result; @@ -541,7 +541,7 @@ static BOOL upgrade_to_version_5(void) Open the NT printing tdbs. Done once before fork(). ****************************************************************************/ -BOOL nt_printing_init(struct messaging_context *msg_ctx) +bool nt_printing_init(struct messaging_context *msg_ctx) { const char *vstring = "INFO/version"; WERROR win_rc; @@ -697,7 +697,7 @@ static int traverse_counting_printers(TDB_CONTEXT *t, TDB_DATA key, each add or delete printer RPC. Only Microsoft knows why... JRR020119 ********************************************************************/ -uint32 update_c_setprinter(BOOL initialize) +uint32 update_c_setprinter(bool initialize) { int32 c_setprinter; int32 printer_count = 0; @@ -756,7 +756,7 @@ int get_builtin_ntforms(nt_forms_struct **list) get a builtin form struct ****************************************************************************/ -BOOL get_a_builtin_ntform(UNISTR2 *uni_formname,nt_forms_struct *form) +bool get_a_builtin_ntform(UNISTR2 *uni_formname,nt_forms_struct *form) { int i,count; fstring form_name; @@ -849,10 +849,10 @@ int write_ntforms(nt_forms_struct **list, int number) /**************************************************************************** add a form struct at the end of the list ****************************************************************************/ -BOOL add_a_form(nt_forms_struct **list, const FORM *form, int *count) +bool add_a_form(nt_forms_struct **list, const FORM *form, int *count) { int n=0; - BOOL update; + bool update; fstring form_name; /* @@ -898,7 +898,7 @@ BOOL add_a_form(nt_forms_struct **list, const FORM *form, int *count) Delete a named form struct. ****************************************************************************/ -BOOL delete_a_form(nt_forms_struct **list, UNISTR2 *del_name, int *count, WERROR *ret) +bool delete_a_form(nt_forms_struct **list, UNISTR2 *del_name, int *count, WERROR *ret) { pstring key; int n=0; @@ -1268,7 +1268,7 @@ the modification date). Otherwise chose the numerically larger version number. static int file_version_is_newer(connection_struct *conn, fstring new_file, fstring old_file) { - BOOL use_version = True; + bool use_version = True; pstring filepath; uint32 new_major; @@ -2891,7 +2891,7 @@ static void map_dword_into_ctr(REGVAL_CTR *ctr, const char *val_name, } static void map_bool_into_ctr(REGVAL_CTR *ctr, const char *val_name, - BOOL b) + bool b) { uint8 bin_bool = (b ? 1 : 0); regval_ctr_delvalue(ctr, val_name); @@ -2929,10 +2929,10 @@ static void map_single_multi_sz_into_ctr(REGVAL_CTR *ctr, const char *val_name, * Map the NT_PRINTER_INFO_LEVEL_2 data into DsSpooler keys for publishing. * * @param info2 NT_PRINTER_INFO_LEVEL_2 describing printer - gets modified - * @return BOOL indicating success or failure + * @return bool indicating success or failure ***************************************************************************/ -static BOOL map_nt_printer_info2_to_dsspooler(NT_PRINTER_INFO_LEVEL_2 *info2) +static bool map_nt_printer_info2_to_dsspooler(NT_PRINTER_INFO_LEVEL_2 *info2) { REGVAL_CTR *ctr = NULL; fstring longname; @@ -3291,7 +3291,7 @@ WERROR check_published_printers(void) return WERR_OK; } -BOOL is_printer_published(Printer_entry *print_hnd, int snum, +bool is_printer_published(Printer_entry *print_hnd, int snum, struct GUID *guid) { NT_PRINTER_INFO_LEVEL *printer = NULL; @@ -3299,7 +3299,7 @@ BOOL is_printer_published(Printer_entry *print_hnd, int snum, REGISTRY_VALUE *guid_val; WERROR win_rc; int i; - BOOL ret = False; + bool ret = False; win_rc = get_a_printer(print_hnd, &printer, 2, lp_servicename(snum)); @@ -3355,7 +3355,7 @@ WERROR check_published_printers(void) return WERR_OK; } -BOOL is_printer_published(Printer_entry *print_hnd, int snum, +bool is_printer_published(Printer_entry *print_hnd, int snum, struct GUID *guid) { return False; @@ -3656,7 +3656,7 @@ static int unpack_values(NT_PRINTER_DATA *printer_data, const uint8 *buf, int bu static void map_to_os2_driver(fstring drivername) { - static BOOL initialised=False; + static bool initialised=False; static fstring last_from,last_to; char *mapfile = lp_os2_driver_map(); char **lines = NULL; @@ -4077,7 +4077,7 @@ WERROR mod_a_printer(NT_PRINTER_INFO_LEVEL *printer, uint32 level) Initialize printer devmode & data with previously saved driver init values. ****************************************************************************/ -static BOOL set_driver_init_2( NT_PRINTER_INFO_LEVEL_2 *info_ptr ) +static bool set_driver_init_2( NT_PRINTER_INFO_LEVEL_2 *info_ptr ) { int len = 0; pstring key; @@ -4166,9 +4166,9 @@ static BOOL set_driver_init_2( NT_PRINTER_INFO_LEVEL_2 *info_ptr ) is bound to the new printer. ****************************************************************************/ -BOOL set_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level) +bool set_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level) { - BOOL result = False; + bool result = False; switch (level) { case 2: @@ -4188,7 +4188,7 @@ BOOL set_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level) Delete driver init data stored for a specified driver ****************************************************************************/ -BOOL del_driver_init(char *drivername) +bool del_driver_init(char *drivername) { pstring key; @@ -4286,9 +4286,9 @@ static uint32 update_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level) got to keep the endians happy :). ****************************************************************************/ -static BOOL convert_driver_init( TALLOC_CTX *ctx, NT_DEVICEMODE *nt_devmode, uint8 *data, uint32 data_len ) +static bool convert_driver_init( TALLOC_CTX *ctx, NT_DEVICEMODE *nt_devmode, uint8 *data, uint32 data_len ) { - BOOL result = False; + bool result = False; prs_struct ps; DEVICEMODE devmode; @@ -4627,12 +4627,12 @@ uint32 free_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level) to a printer ****************************************************************************/ -BOOL printer_driver_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3 ) +bool printer_driver_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3 ) { int snum; int n_services = lp_numservices(); NT_PRINTER_INFO_LEVEL *printer = NULL; - BOOL in_use = False; + bool in_use = False; if ( !info_3 ) return False; @@ -4703,7 +4703,7 @@ BOOL printer_driver_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3 ) Check to see if a ogiven file is in use by *info *********************************************************************/ -static BOOL drv_file_in_use( char* file, NT_PRINTER_DRIVER_INFO_LEVEL_3 *info ) +static bool drv_file_in_use( char* file, NT_PRINTER_DRIVER_INFO_LEVEL_3 *info ) { int i = 0; @@ -4761,10 +4761,10 @@ static void trim_dependent_file( fstring files[], int idx ) Check if any of the files used by src are also used by drv *********************************************************************/ -static BOOL trim_overlap_drv_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *src, +static bool trim_overlap_drv_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *src, NT_PRINTER_DRIVER_INFO_LEVEL_3 *drv ) { - BOOL in_use = False; + bool in_use = False; int i = 0; if ( !src || !drv ) @@ -4824,7 +4824,7 @@ static BOOL trim_overlap_drv_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *src, which are not in use ****************************************************************************/ -BOOL printer_driver_files_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info ) +bool printer_driver_files_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info ) { int i; int ndrivers; @@ -4893,7 +4893,7 @@ BOOL printer_driver_files_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info ) this. ****************************************************************************/ -static BOOL delete_driver_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3, struct current_user *user ) +static bool delete_driver_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3, struct current_user *user ) { int i = 0; char *s; @@ -5007,7 +5007,7 @@ static BOOL delete_driver_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3, struct ***************************************************************************/ WERROR delete_printer_driver( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3, struct current_user *user, - uint32 version, BOOL delete_files ) + uint32 version, bool delete_files ) { pstring key; const char *arch; @@ -5250,7 +5250,7 @@ static SEC_DESC_BUF *construct_default_printer_sdb(TALLOC_CTX *ctx) Get a security desc for a printer. ****************************************************************************/ -BOOL nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, SEC_DESC_BUF **secdesc_ctr) +bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, SEC_DESC_BUF **secdesc_ctr) { prs_struct ps; TDB_DATA kbuf; @@ -5431,12 +5431,12 @@ void map_printer_permissions(SEC_DESC *sd) 3) "printer admins" (may result in numerous calls to winbind) ****************************************************************************/ -BOOL print_access_check(struct current_user *user, int snum, int access_type) +bool print_access_check(struct current_user *user, int snum, int access_type) { SEC_DESC_BUF *secdesc = NULL; uint32 access_granted; NTSTATUS status; - BOOL result; + bool result; const char *pname; TALLOC_CTX *mem_ctx = NULL; SE_PRIV se_printop = SE_PRINT_OPERATOR; @@ -5530,10 +5530,10 @@ BOOL print_access_check(struct current_user *user, int snum, int access_type) Check the time parameters allow a print operation. *****************************************************************************/ -BOOL print_time_access_check(const char *servicename) +bool print_time_access_check(const char *servicename) { NT_PRINTER_INFO_LEVEL *printer = NULL; - BOOL ok = False; + bool ok = False; time_t now = time(NULL); struct tm *t; uint32 mins; diff --git a/source3/printing/pcap.c b/source3/printing/pcap.c index 6231edf178..aabdb73e2e 100644 --- a/source3/printing/pcap.c +++ b/source3/printing/pcap.c @@ -71,7 +71,7 @@ typedef struct pcap_cache { static pcap_cache_t *pcap_cache = NULL; -BOOL pcap_cache_add(const char *name, const char *comment) +bool pcap_cache_add(const char *name, const char *comment) { pcap_cache_t *p; @@ -100,7 +100,7 @@ static void pcap_cache_destroy(pcap_cache_t *cache) } } -BOOL pcap_cache_loaded(void) +bool pcap_cache_loaded(void) { return (pcap_cache != NULL); } @@ -108,7 +108,7 @@ BOOL pcap_cache_loaded(void) void pcap_cache_reload(void) { const char *pcap_name = lp_printcapname(); - BOOL pcap_reloaded = False; + bool pcap_reloaded = False; pcap_cache_t *tmp_cache = NULL; XFILE *pcap_file; char *pcap_line; @@ -175,7 +175,7 @@ void pcap_cache_reload(void) * this is pure guesswork, but it's better than nothing */ for (*name = *comment = 0, p = pcap_line; p != NULL; p = q) { - BOOL has_punctuation; + bool has_punctuation; if ((q = strchr_m(p, '|')) != NULL) *q++ = 0; @@ -232,7 +232,7 @@ done: } -BOOL pcap_printername_ok(const char *printername) +bool pcap_printername_ok(const char *printername) { pcap_cache_t *p; diff --git a/source3/printing/print_aix.c b/source3/printing/print_aix.c index 63a1592499..15d0740fd2 100644 --- a/source3/printing/print_aix.c +++ b/source3/printing/print_aix.c @@ -27,7 +27,7 @@ #include "includes.h" #ifdef AIX -BOOL aix_cache_reload(void) +bool aix_cache_reload(void) { int iEtat; XFILE *pfile; diff --git a/source3/printing/print_cups.c b/source3/printing/print_cups.c index d95b08c3c6..e9e4e5955f 100644 --- a/source3/printing/print_cups.c +++ b/source3/printing/print_cups.c @@ -74,7 +74,7 @@ static http_t *cups_connect(void) return http; } -BOOL cups_cache_reload(void) +bool cups_cache_reload(void) { http_t *http = NULL; /* HTTP connection to server */ ipp_t *request = NULL, /* IPP Request */ @@ -88,7 +88,7 @@ BOOL cups_cache_reload(void) "printer-name", "printer-info" }; - BOOL ret = False; + bool ret = False; DEBUG(5, ("reloading cups printcap cache\n")); @@ -1197,7 +1197,7 @@ struct printif cups_printif = cups_job_submit, }; -BOOL cups_pull_comment_location(NT_PRINTER_INFO_LEVEL_2 *printer) +bool cups_pull_comment_location(NT_PRINTER_INFO_LEVEL_2 *printer) { http_t *http = NULL; /* HTTP connection to server */ ipp_t *request = NULL, /* IPP Request */ @@ -1214,7 +1214,7 @@ BOOL cups_pull_comment_location(NT_PRINTER_INFO_LEVEL_2 *printer) "printer-info", "printer-location" }; - BOOL ret = False; + bool ret = False; DEBUG(5, ("pulling %s location\n", printer->sharename)); diff --git a/source3/printing/print_generic.c b/source3/printing/print_generic.c index f5bec03a4b..8525d6208b 100644 --- a/source3/printing/print_generic.c +++ b/source3/printing/print_generic.c @@ -28,7 +28,7 @@ run a given print command a null terminated list of value/substitute pairs is provided for local substitution strings ****************************************************************************/ -static int print_run_command(int snum, const char* printername, BOOL do_sub, +static int print_run_command(int snum, const char* printername, bool do_sub, const char *command, int *outfd, ...) { pstring syscmd; diff --git a/source3/printing/print_iprint.c b/source3/printing/print_iprint.c index 82095925b8..18f5e97856 100644 --- a/source3/printing/print_iprint.c +++ b/source3/printing/print_iprint.c @@ -305,7 +305,7 @@ static int iprint_cache_add_printer(http_t *http, return(0); } -BOOL iprint_cache_reload(void) +bool iprint_cache_reload(void) { http_t *http = NULL; /* HTTP connection to server */ ipp_t *request = NULL, /* IPP Request */ @@ -313,7 +313,7 @@ BOOL iprint_cache_reload(void) ipp_attribute_t *attr; /* Current attribute */ cups_lang_t *language = NULL; /* Default language */ int i; - BOOL ret = False; + bool ret = False; DEBUG(5, ("reloading iprint printcap cache\n")); diff --git a/source3/printing/print_svid.c b/source3/printing/print_svid.c index fb7e56794e..7e91d3a677 100644 --- a/source3/printing/print_svid.c +++ b/source3/printing/print_svid.c @@ -34,7 +34,7 @@ #include "includes.h" #if defined(SYSV) || defined(HPUX) -BOOL sysv_cache_reload(void) +bool sysv_cache_reload(void) { char **lines; int i; diff --git a/source3/printing/printing.c b/source3/printing/printing.c index 868a72cb32..af87b8f2c2 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -28,7 +28,7 @@ extern struct current_user current_user; extern userdom_struct current_user_info; /* Current printer interface */ -static BOOL remove_from_jobs_changed(const char* sharename, uint32 jobid); +static bool remove_from_jobs_changed(const char* sharename, uint32 jobid); /* the printing backend revolves around a tdb database that stores the @@ -102,7 +102,7 @@ uint16 pjobid_to_rap(const char* sharename, uint32 jobid) return rap_jobid; } -BOOL rap_to_pjobid(uint16 rap_jobid, fstring sharename, uint32 *pjobid) +bool rap_to_pjobid(uint16 rap_jobid, fstring sharename, uint32 *pjobid) { TDB_DATA data, key; uint8 buf[2]; @@ -177,7 +177,7 @@ static int get_queue_status(const char* sharename, print_status_struct *); Initialise the printing backend. Called once at startup before the fork(). ****************************************************************************/ -BOOL print_backend_init(struct messaging_context *msg_ctx) +bool print_backend_init(struct messaging_context *msg_ctx) { const char *sversion = "INFO/version"; pstring printing_path; @@ -469,7 +469,7 @@ static uint32 map_to_spoolss_status(uint32 lpq_status) static void pjob_store_notify(const char* sharename, uint32 jobid, struct printjob *old_data, struct printjob *new_data) { - BOOL new_job = False; + bool new_job = False; if (!old_data) new_job = True; @@ -512,10 +512,10 @@ static void pjob_store_notify(const char* sharename, uint32 jobid, struct printj Store a job structure back to the database. ****************************************************************************/ -static BOOL pjob_store(const char* sharename, uint32 jobid, struct printjob *pjob) +static bool pjob_store(const char* sharename, uint32 jobid, struct printjob *pjob) { TDB_DATA old_data, new_data; - BOOL ret = False; + bool ret = False; struct tdb_print_db *pdb = get_print_db_byname(sharename); uint8 *buf = NULL; int len, newlen, buflen; @@ -889,7 +889,7 @@ static pid_t get_updating_pid(const char *sharename) in the tdb. ****************************************************************************/ -static void set_updating_pid(const fstring sharename, BOOL updating) +static void set_updating_pid(const fstring sharename, bool updating) { fstring keystr; TDB_DATA key; @@ -1042,12 +1042,12 @@ static void check_job_changed(const char *sharename, TDB_DATA data, uint32 jobid Check if the print queue has been updated recently enough. ****************************************************************************/ -static BOOL print_cache_expired(const char *sharename, BOOL check_pending) +static bool print_cache_expired(const char *sharename, bool check_pending) { fstring key; time_t last_qscan_time, time_now = time(NULL); struct tdb_print_db *pdb = get_print_db_byname(sharename); - BOOL result = False; + bool result = False; if (!pdb) return False; @@ -1439,7 +1439,7 @@ void start_background_queue(void) update the internal database from the system print queue for a queue ****************************************************************************/ -static void print_queue_update(int snum, BOOL force) +static void print_queue_update(int snum, bool force) { fstring key; fstring sharename; @@ -1550,14 +1550,14 @@ static void print_queue_update(int snum, BOOL force) updates only to interested smbd's. ****************************************************************************/ -BOOL print_notify_register_pid(int snum) +bool print_notify_register_pid(int snum) { TDB_DATA data; struct tdb_print_db *pdb = NULL; TDB_CONTEXT *tdb = NULL; const char *printername; uint32 mypid = (uint32)sys_getpid(); - BOOL ret = False; + bool ret = False; size_t i; /* if (snum == -1), then the change notify request was @@ -1641,7 +1641,7 @@ list for printer %s\n", printername)); updates only to interested smbd's. ****************************************************************************/ -BOOL print_notify_deregister_pid(int snum) +bool print_notify_deregister_pid(int snum) { TDB_DATA data; struct tdb_print_db *pdb = NULL; @@ -1649,7 +1649,7 @@ BOOL print_notify_deregister_pid(int snum) const char *printername; uint32 mypid = (uint32)sys_getpid(); size_t i; - BOOL ret = False; + bool ret = False; /* if ( snum == -1 ), we are deregister a print server handle which means to deregister on all print queues */ @@ -1730,10 +1730,10 @@ list for printer %s\n", printername)); Check if a jobid is valid. It is valid if it exists in the database. ****************************************************************************/ -BOOL print_job_exists(const char* sharename, uint32 jobid) +bool print_job_exists(const char* sharename, uint32 jobid) { struct tdb_print_db *pdb = get_print_db_byname(sharename); - BOOL ret; + bool ret; if (!pdb) return False; @@ -1792,7 +1792,7 @@ NT_DEVICEMODE *print_job_devmode(const char* sharename, uint32 jobid) Set the place in the queue for a job. ****************************************************************************/ -BOOL print_job_set_place(const char *sharename, uint32 jobid, int place) +bool print_job_set_place(const char *sharename, uint32 jobid, int place) { DEBUG(2,("print_job_set_place not implemented yet\n")); return False; @@ -1802,7 +1802,7 @@ BOOL print_job_set_place(const char *sharename, uint32 jobid, int place) Set the name of a job. Only possible for owner. ****************************************************************************/ -BOOL print_job_set_name(const char *sharename, uint32 jobid, char *name) +bool print_job_set_name(const char *sharename, uint32 jobid, char *name) { struct printjob *pjob; @@ -1818,13 +1818,13 @@ BOOL print_job_set_name(const char *sharename, uint32 jobid, char *name) Remove a jobid from the 'jobs changed' list. ***************************************************************************/ -static BOOL remove_from_jobs_changed(const char* sharename, uint32 jobid) +static bool remove_from_jobs_changed(const char* sharename, uint32 jobid) { struct tdb_print_db *pdb = get_print_db_byname(sharename); TDB_DATA data, key; size_t job_count, i; - BOOL ret = False; - BOOL gotlock = False; + bool ret = False; + bool gotlock = False; if (!pdb) { return False; @@ -1877,7 +1877,7 @@ static BOOL remove_from_jobs_changed(const char* sharename, uint32 jobid) Delete a print job - don't update queue. ****************************************************************************/ -static BOOL print_job_delete1(int snum, uint32 jobid) +static bool print_job_delete1(int snum, uint32 jobid) { const char* sharename = lp_const_servicename(snum); struct printjob *pjob = print_job_find(sharename, jobid); @@ -1940,7 +1940,7 @@ static BOOL print_job_delete1(int snum, uint32 jobid) Return true if the current user owns the print job. ****************************************************************************/ -static BOOL is_owner(struct current_user *user, const char *servicename, +static bool is_owner(struct current_user *user, const char *servicename, uint32 jobid) { struct printjob *pjob = print_job_find(servicename, jobid); @@ -1960,11 +1960,11 @@ static BOOL is_owner(struct current_user *user, const char *servicename, Delete a print job. ****************************************************************************/ -BOOL print_job_delete(struct current_user *user, int snum, uint32 jobid, WERROR *errcode) +bool print_job_delete(struct current_user *user, int snum, uint32 jobid, WERROR *errcode) { const char* sharename = lp_const_servicename( snum ); struct printjob *pjob; - BOOL owner; + bool owner; char *fname; *errcode = WERR_OK; @@ -2027,7 +2027,7 @@ pause, or resume print job. User name: %s. Printer name: %s.", Pause a job. ****************************************************************************/ -BOOL print_job_pause(struct current_user *user, int snum, uint32 jobid, WERROR *errcode) +bool print_job_pause(struct current_user *user, int snum, uint32 jobid, WERROR *errcode) { const char* sharename = lp_const_servicename(snum); struct printjob *pjob; @@ -2087,7 +2087,7 @@ pause, or resume print job. User name: %s. Printer name: %s.", Resume a job. ****************************************************************************/ -BOOL print_job_resume(struct current_user *user, int snum, uint32 jobid, WERROR *errcode) +bool print_job_resume(struct current_user *user, int snum, uint32 jobid, WERROR *errcode) { const char *sharename = lp_const_servicename(snum); struct printjob *pjob; @@ -2230,7 +2230,7 @@ int print_queue_length(int snum, print_status_struct *pstatus) Allocate a jobid. Hold the lock for as short a time as possible. ***************************************************************************/ -static BOOL allocate_print_jobid(struct tdb_print_db *pdb, int snum, const char *sharename, uint32 *pjobid) +static bool allocate_print_jobid(struct tdb_print_db *pdb, int snum, const char *sharename, uint32 *pjobid) { int i; uint32 jobid; @@ -2296,7 +2296,7 @@ static BOOL allocate_print_jobid(struct tdb_print_db *pdb, int snum, const char Append a jobid to the 'jobs changed' list. ***************************************************************************/ -static BOOL add_to_jobs_changed(struct tdb_print_db *pdb, uint32 jobid) +static bool add_to_jobs_changed(struct tdb_print_db *pdb, uint32 jobid) { TDB_DATA data; uint32 store_jobid; @@ -2473,7 +2473,7 @@ void print_job_endpage(int snum, uint32 jobid) error. ****************************************************************************/ -BOOL print_job_end(int snum, uint32 jobid, enum file_close_type close_type) +bool print_job_end(int snum, uint32 jobid, enum file_close_type close_type) { const char* sharename = lp_const_servicename(snum); struct printjob *pjob; @@ -2550,7 +2550,7 @@ fail: Get a snapshot of jobs in the system without traversing. ****************************************************************************/ -static BOOL get_stored_queue_info(struct tdb_print_db *pdb, int snum, int *pcount, print_queue_struct **ppqueue) +static bool get_stored_queue_info(struct tdb_print_db *pdb, int snum, int *pcount, print_queue_struct **ppqueue) { TDB_DATA data, cgdata; print_queue_struct *queue = NULL; @@ -2560,7 +2560,7 @@ static BOOL get_stored_queue_info(struct tdb_print_db *pdb, int snum, int *pcoun size_t len = 0; uint32 i; int max_reported_jobs = lp_max_reported_jobs(snum); - BOOL ret = False; + bool ret = False; const char* sharename = lp_servicename(snum); /* make sure the database is up to date */ @@ -2731,7 +2731,7 @@ int print_queue_status(int snum, Pause a queue. ****************************************************************************/ -BOOL print_queue_pause(struct current_user *user, int snum, WERROR *errcode) +bool print_queue_pause(struct current_user *user, int snum, WERROR *errcode) { int ret; struct printif *current_printif = get_printer_fns( snum ); @@ -2767,7 +2767,7 @@ BOOL print_queue_pause(struct current_user *user, int snum, WERROR *errcode) Resume a queue. ****************************************************************************/ -BOOL print_queue_resume(struct current_user *user, int snum, WERROR *errcode) +bool print_queue_resume(struct current_user *user, int snum, WERROR *errcode) { int ret; struct printif *current_printif = get_printer_fns( snum ); @@ -2803,12 +2803,12 @@ BOOL print_queue_resume(struct current_user *user, int snum, WERROR *errcode) Purge a queue - implemented by deleting all jobs that we can delete. ****************************************************************************/ -BOOL print_queue_purge(struct current_user *user, int snum, WERROR *errcode) +bool print_queue_purge(struct current_user *user, int snum, WERROR *errcode) { print_queue_struct *queue; print_status_struct status; int njobs, i; - BOOL can_job_admin; + bool can_job_admin; /* Force and update so the count is accurate (i.e. not a cached count) */ print_queue_update(snum, True); @@ -2820,7 +2820,7 @@ BOOL print_queue_purge(struct current_user *user, int snum, WERROR *errcode) become_root(); for (i=0;i