xref: /illumos-gate/usr/src/cmd/lp/cmd/lpsched/dispatch.h (revision 1a220b56b93ff1dc80855691548503117af4cc10)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
27 /*	  All Rights Reserved  	*/
28 
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.4.1.2	*/
31 
32 # include	<time.h>
33 
34 # include	"lpsched.h"
35 
36 void		s_accept_dest ( char * , MESG * );
37 void		s_alloc_files ( char * , MESG * );
38 void		s_cancel ( char * , MESG * );
39 void		s_cancel_request ( char * , MESG * );
40 void		s_complete_job ( char * , MESG * );
41 void		s_disable_dest ( char * , MESG * );
42 void		s_enable_dest ( char * , MESG * );
43 void		s_end_change_request ( char * , MESG * );
44 void		s_inquire_class ( char * , MESG * );
45 void		s_inquire_printer_status ( char * , MESG * );
46 void		s_inquire_remote_printer ( char * , MESG * );
47 void		s_inquire_request ( char * , MESG * );
48 void		s_inquire_request_rank ( char * , MESG * );
49 void		s_load_class ( char * , MESG * );
50 void		s_load_filter_table ( char * , MESG * );
51 void		s_load_form ( char * , MESG * );
52 void		s_load_printer ( char * , MESG * );
53 void		s_load_printwheel ( char * , MESG * );
54 void		s_load_system ( char * , MESG * );
55 void		s_load_user_file ( char * , MESG * );
56 void		s_mount ( char * , MESG * );
57 void		s_move_dest  ( char * , MESG * );
58 void		s_move_request ( char * , MESG * );
59 void		s_print_request ( char * , MESG * );
60 void		s_quiet_alert ( char * , MESG * );
61 void		s_reject_dest ( char * , MESG * );
62 void		s_send_fault ( char * , MESG * );
63 void		s_clear_fault ( char * , MESG * );
64 void		s_shutdown ( char * , MESG * );
65 void		s_start_change_request ( char * , MESG * );
66 void		s_unload_class ( char * , MESG * );
67 void		s_unload_filter_table ( char * , MESG * );
68 void		s_unload_form ( char * , MESG * );
69 void		s_unload_printer ( char * , MESG * );
70 void		s_unload_printwheel ( char * , MESG * );
71 void		s_unload_system ( char * , MESG * );
72 void		s_unload_user_file ( char * , MESG * );
73 void		s_unmount ( char * , MESG * );
74 void		r_new_child ( char * , MESG * );
75 void		r_send_job ( char * , MESG * );
76 void		s_job_completed ( char * , MESG * );
77 void		s_child_done ( char * , MESG * );
78 void		s_get_fault_message ( char * , MESG * );
79 void		s_max_trays ( char * , MESG *);
80 void		s_mount_tray ( char *, MESG * );
81 void		s_unmount_tray ( char *, MESG *);
82 void		s_paper_changed ( char *, MESG *);
83 void		s_paper_allowed ( char *, MESG *);
84 void		s_pass_peer_connection ( char * , MESG * );
85 
86 /**
87  ** dispatch_table[]
88  **/
89 
90 /*
91  * The dispatch table is used to decide if we should handle
92  * a message and which function should be used to handle it.
93  *
94  * D_ADMIN is set for messages that should be handled
95  * only if it came from an administrator. These entries should
96  * have a corresponding entry for the R_... message case, that
97  * provides a routine for sending back a MNOPERM message to those
98  * that aren't administrators. This is needed because the response
99  * message varies in size with the message type.
100  */
101 
102 typedef struct DISPATCH {
103 	void			(*fncp)();
104 	ushort			flags;
105 }			DISPATCH;
106 
107 #define	D_ADMIN		0x01	/* Only "lp" or "root" can use msg. */
108 #define D_BADMSG	0x02	/* We should never get this message */
109 #define	D_SYSTEM	0x04	/* Only siblings may use this message */
110