mirror of
https://github.com/samba-team/samba.git
synced 2025-08-30 17:49:30 +03:00
s3:printing: make some functions static and use tevent functions
metze
This commit is contained in:
@ -4722,7 +4722,6 @@ bool parse_lpq_entry(enum printing_types printing_type,char *line,
|
|||||||
/* The following definitions come from printing/notify.c */
|
/* The following definitions come from printing/notify.c */
|
||||||
|
|
||||||
int print_queue_snum(const char *qname);
|
int print_queue_snum(const char *qname);
|
||||||
bool print_notify_messages_pending(void);
|
|
||||||
void print_notify_send_messages(struct messaging_context *msg_ctx,
|
void print_notify_send_messages(struct messaging_context *msg_ctx,
|
||||||
unsigned int timeout);
|
unsigned int timeout);
|
||||||
void notify_printer_status_byname(const char *sharename, uint32 status);
|
void notify_printer_status_byname(const char *sharename, uint32 status);
|
||||||
@ -4745,7 +4744,6 @@ void notify_printer_printername(int snum, char *printername);
|
|||||||
void notify_printer_port(int snum, char *port_name);
|
void notify_printer_port(int snum, char *port_name);
|
||||||
void notify_printer_location(int snum, char *location);
|
void notify_printer_location(int snum, char *location);
|
||||||
void notify_printer_byname( const char *printername, uint32 change, const char *value );
|
void notify_printer_byname( const char *printername, uint32 change, const char *value );
|
||||||
bool print_notify_pid_list(const char *printername, TALLOC_CTX *mem_ctx, size_t *p_num_pids, pid_t **pp_pid_list);
|
|
||||||
|
|
||||||
/* The following definitions come from printing/nt_printing.c */
|
/* The following definitions come from printing/nt_printing.c */
|
||||||
|
|
||||||
|
@ -34,7 +34,10 @@ static struct notify_queue {
|
|||||||
size_t buflen;
|
size_t buflen;
|
||||||
} *notify_queue_head = NULL;
|
} *notify_queue_head = NULL;
|
||||||
|
|
||||||
static struct timed_event *notify_event;
|
static struct tevent_timer *notify_event;
|
||||||
|
|
||||||
|
static bool print_notify_pid_list(const char *printername, TALLOC_CTX *mem_ctx,
|
||||||
|
size_t *p_num_pids, pid_t **pp_pid_list);
|
||||||
|
|
||||||
static bool create_send_ctx(void)
|
static bool create_send_ctx(void)
|
||||||
{
|
{
|
||||||
@ -63,7 +66,7 @@ int print_queue_snum(const char *qname)
|
|||||||
Used to decide if we need a short select timeout.
|
Used to decide if we need a short select timeout.
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
|
|
||||||
bool print_notify_messages_pending(void)
|
static bool print_notify_messages_pending(void)
|
||||||
{
|
{
|
||||||
return (notify_queue_head != NULL);
|
return (notify_queue_head != NULL);
|
||||||
}
|
}
|
||||||
@ -219,10 +222,10 @@ void print_notify_send_messages(struct messaging_context *msg_ctx,
|
|||||||
Event handler to send the messages.
|
Event handler to send the messages.
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
|
|
||||||
static void print_notify_event_send_messages(struct event_context *event_ctx,
|
static void print_notify_event_send_messages(struct tevent_context *event_ctx,
|
||||||
struct timed_event *te,
|
struct tevent_timer *te,
|
||||||
struct timeval now,
|
struct timeval now,
|
||||||
void *private_data)
|
void *private_data)
|
||||||
{
|
{
|
||||||
/* Remove this timed event handler. */
|
/* Remove this timed event handler. */
|
||||||
TALLOC_FREE(notify_event);
|
TALLOC_FREE(notify_event);
|
||||||
@ -324,7 +327,7 @@ to notify_queue_head\n", msg->type, msg->field, msg->printer));
|
|||||||
|
|
||||||
if ((notify_event == NULL) && (smbd_event_context() != NULL)) {
|
if ((notify_event == NULL) && (smbd_event_context() != NULL)) {
|
||||||
/* Add an event for 1 second's time to send this queue. */
|
/* Add an event for 1 second's time to send this queue. */
|
||||||
notify_event = event_add_timed(smbd_event_context(), NULL,
|
notify_event = tevent_add_timer(smbd_event_context(), NULL,
|
||||||
timeval_current_ofs(1,0),
|
timeval_current_ofs(1,0),
|
||||||
print_notify_event_send_messages, NULL);
|
print_notify_event_send_messages, NULL);
|
||||||
}
|
}
|
||||||
@ -535,7 +538,8 @@ void notify_printer_byname( const char *printername, uint32 change, const char *
|
|||||||
messages on this print queue. Used in printing/notify to send the messages.
|
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)
|
static 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;
|
struct tdb_print_db *pdb = NULL;
|
||||||
TDB_CONTEXT *tdb = NULL;
|
TDB_CONTEXT *tdb = NULL;
|
||||||
|
Reference in New Issue
Block a user