Imported Upstream version 1.10.2
[platform/upstream/krb5.git] / src / util / ss / ss.h
1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*
3  * Copyright 1987, 1988 by MIT Student Information Processing Board
4  *
5  * For copyright information, see mit-sipb-copyright.h.
6  */
7
8 #ifndef _ss_h
9 #define _ss_h __FILE__
10
11 #include <errno.h>
12 #include <ss/ss_err.h>
13
14 #ifdef __STDC__
15 #define __SS_CONST const
16 #define __SS_PROTO (int, const char * const *, int, void *)
17 #else
18 #define __SS_CONST
19 #define __SS_PROTO ()
20 #endif
21
22 typedef __SS_CONST struct _ss_request_entry {
23     __SS_CONST char * __SS_CONST *command_names; /* whatever */
24     void (* __SS_CONST function) __SS_PROTO; /* foo */
25     __SS_CONST char * __SS_CONST info_string;   /* NULL */
26     int flags;                  /* 0 */
27 } ss_request_entry;
28
29 typedef __SS_CONST struct _ss_request_table {
30     int version;
31     ss_request_entry *requests;
32 } ss_request_table;
33
34 #define SS_RQT_TBL_V2   2
35
36 typedef struct _ss_rp_options { /* DEFAULT VALUES */
37     int version;                /* SS_RP_V1 */
38     void (*unknown) __SS_PROTO; /* call for unknown command */
39     int allow_suspend;
40     int catch_int;
41 } ss_rp_options;
42
43 #define SS_RP_V1 1
44
45 #define SS_OPT_DONT_LIST        0x0001
46 #define SS_OPT_DONT_SUMMARIZE   0x0002
47
48 void ss_help __SS_PROTO;
49 void ss_list_requests __SS_PROTO;
50 void ss_quit __SS_PROTO;
51 char *ss_current_request();
52 char *ss_name(int);
53 void ss_error (int, long, char const *, ...)
54 #if !defined(__cplusplus) && (__GNUC__ > 2)
55     __attribute__((__format__(__printf__, 3, 4)))
56 #endif
57     ;
58 void ss_perror (int, long, char const *);
59 int ss_listen (int);
60 int ss_create_invocation(char *, char *, char *, ss_request_table *, int *);
61 void ss_delete_invocation(int);
62 void ss_add_info_dir(int , char *, int *);
63 void ss_delete_info_dir(int , char *, int *);
64 int ss_execute_command(int sci_idx, char **);
65 void ss_abort_subsystem(int, int);
66 void ss_set_prompt(int, char *);
67 char *ss_get_prompt(int);
68 void ss_add_request_table(int, ss_request_table *, int, int *);
69 void ss_delete_request_table(int, ss_request_table *, int *);
70 int ss_execute_line (int, char*);
71 extern ss_request_table ss_std_requests;
72 #endif /* _ss_h */