xref: /illumos-gate/usr/src/lib/krb5/ss/ss.h (revision 89b2a9fbeabf42fa54594df0e5927bcc50a07cc9)
1 /*
2  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #pragma ident	"%Z%%M%	%I%	%E% SMI"
7 /*
8  * Copyright 1987, 1988 by MIT Student Information Processing Board
9  *
10  * For copyright information, see mit-sipb-copyright.h.
11  */
12 
13 #ifndef _ss_h
14 #define _ss_h __FILE__
15 
16 #include <errno.h>
17 #include <ss/ss_err.h>
18 
19 #ifdef __STDC__
20 #define __SS_CONST const
21 #define __SS_PROTO (int, const char * const *, int, void *)
22 #else
23 #define __SS_CONST
24 #define __SS_PROTO ()
25 #endif
26 
27 typedef struct _ss_request_entry {
28     __SS_CONST char * __SS_CONST *command_names; /* whatever */
29     void (* __SS_CONST function) __SS_PROTO; /* foo */
30     char *info_string;		/* Already L10ed cmd message */
31     int flags;			/* 0 */
32 } ss_request_entry;
33 
34 typedef __SS_CONST struct _ss_request_table {
35     int version;
36     ss_request_entry *requests;
37 } ss_request_table;
38 
39 #define SS_RQT_TBL_V2	2
40 
41 typedef struct _ss_rp_options {	/* DEFAULT VALUES */
42     int version;		/* SS_RP_V1 */
43     void (*unknown) __SS_PROTO;	/* call for unknown command */
44     int allow_suspend;
45     int catch_int;
46 } ss_rp_options;
47 
48 #define SS_RP_V1 1
49 
50 #define SS_OPT_DONT_LIST	0x0001
51 #define SS_OPT_DONT_SUMMARIZE	0x0002
52 
53 void ss_help __SS_PROTO;
54 void ss_list_requests __SS_PROTO;
55 void ss_quit __SS_PROTO;
56 char *ss_current_request();
57 char *ss_name(int);
58 void ss_error (int, long, char const *, ...);
59 void ss_perror (int, long, char const *);
60 int ss_listen (int);
61 int ss_create_invocation(char *, char *, char *, ss_request_table *, int *);
62 void ss_delete_invocation(int);
63 void ss_add_info_dir(int , char *, int *);
64 void ss_delete_info_dir(int , char *, int *);
65 int ss_execute_command(int sci_idx, char **);
66 void ss_abort_subsystem(int, int);
67 void ss_set_prompt(int, char *);
68 char *ss_get_prompt(int);
69 void ss_add_request_table(int, ss_request_table *, int, int *);
70 void ss_delete_request_table(int, ss_request_table *, int *);
71 int ss_execute_line (int, char*);
72 extern ss_request_table ss_std_requests;
73 
74 /* toggles the display of debugging messages */
75 void debugDisplaySS(int onOff);
76 
77 #endif /* _ss_h */
78