Whamcloud - gitweb
805e1f14eefe3d4c9b5150c2ff0cbce38bb193b9
[tools/e2fsprogs.git] / lib / ss / ss.h
1 /*
2  * Copyright 1987, 1988 by MIT Student Information Processing Board
3  *
4  * Permission to use, copy, modify, and distribute this software and
5  * its documentation for any purpose is hereby granted, provided that
6  * the names of M.I.T. and the M.I.T. S.I.P.B. not be used in
7  * advertising or publicity pertaining to distribution of the software
8  * without specific, written prior permission.  M.I.T. and the
9  * M.I.T. S.I.P.B. make no representations about the suitability of
10  * this software for any purpose.  It is provided "as is" without
11  * express or implied warranty.
12  *
13  * This quote is just too good to not pass on:
14  *
15  *      "BTW, I would have rejected the name Story Server because its
16  *      initials are SS, the name of the secret police in Nazi
17  *      Germany, probably the most despised pair of letters in western
18  *      culture."  --- http://scriptingnewsarchive.userland.com/1999/12/13
19  *
20  * Let no one say political correctness isn't dead....
21  */
22
23 #ifndef _ss_h
24 #define _ss_h __FILE__
25
26 #include <ss/ss_err.h>
27
28 #ifdef __STDC__
29 #define __SS_CONST const
30 #define __SS_PROTO (int, const char * const *, int, void *)
31 #else
32 #define __SS_CONST
33 #define __SS_PROTO ()
34 #endif
35
36 typedef __SS_CONST struct _ss_request_entry {
37     __SS_CONST char * __SS_CONST *command_names; /* whatever */
38     void (* __SS_CONST function) __SS_PROTO; /* foo */
39     __SS_CONST char * __SS_CONST info_string;   /* NULL */
40     int flags;                  /* 0 */
41 } ss_request_entry;
42
43 typedef __SS_CONST struct _ss_request_table {
44     int version;
45     ss_request_entry *requests;
46 } ss_request_table;
47
48 #define SS_RQT_TBL_V2   2
49
50 typedef struct _ss_rp_options { /* DEFAULT VALUES */
51     int version;                /* SS_RP_V1 */
52     void (*unknown) __SS_PROTO; /* call for unknown command */
53     int allow_suspend;
54     int catch_int;
55 } ss_rp_options;
56
57 #define SS_RP_V1 1
58
59 #define SS_OPT_DONT_LIST        0x0001
60 #define SS_OPT_DONT_SUMMARIZE   0x0002
61
62 void ss_help __SS_PROTO;
63 #if 0
64 char *ss_current_request();     /* This is actually a macro */
65 #endif
66 #ifdef __STDC__
67 char *ss_name(int sci_idx);
68 void ss_error (int, long, char const *, ...);
69 void ss_perror (int, long, char const *);
70 int ss_create_invocation(const char *, const char *, void *,
71                          ss_request_table *, int *);
72 void ss_delete_invocation(int);
73 int ss_listen(int);
74 int ss_execute_line(int, char *);
75 void ss_add_request_table(int, ss_request_table *, int, int *);
76 void ss_delete_request_table(int, ss_request_table *, int *);
77 void ss_abort_subsystem(int sci_idx, int code);
78 void ss_quit(int argc, const char * const *argv, int sci_idx, void *infop);
79 void ss_self_identify(int argc, const char * const *argv, int sci_idx, void *infop);
80 void ss_subsystem_name(int argc, const char * const *argv,
81                        int sci_idx, void *infop);
82 void ss_subsystem_version(int argc, const char * const *argv,
83                           int sci_idx, void *infop);
84 void ss_unimplemented(int argc, const char * const *argv,
85                       int sci_idx, void *infop);
86 void ss_set_prompt(int sci_idx, char *new_prompt);
87 char *ss_get_prompt(int sci_idx);
88 void ss_get_readline(int sci_idx);
89 #else
90 char *ss_name();
91 void ss_error ();
92 void ss_perror ();
93 int ss_create_invocation();
94 void ss_delete_invocation();
95 int ss_listen();
96 int ss_execute_line();
97 void ss_add_request_table();
98 void ss_delete_request_table();
99 void ss_abort_subsystem();
100 void ss_quit();
101 void ss_self_identify();
102 void ss_subsystem_name();
103 void ss_subsystem_version();
104 void ss_unimplemented();
105 void ss_set_prompt;
106 char *ss_get_prompt;
107 void ss_get_readline();
108 #endif
109 extern ss_request_table ss_std_requests;
110 #endif /* _ss_h */