Whamcloud - gitweb
7a7975cce148f325f53b59ae4a080b5789ef22a9
[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
14 #ifndef _ss_h
15 #define _ss_h __FILE__
16
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 __SS_CONST struct _ss_request_entry {
28     __SS_CONST char * __SS_CONST *command_names; /* whatever */
29     void (* __SS_CONST function) __SS_PROTO; /* foo */
30     __SS_CONST char * __SS_CONST info_string;   /* NULL */
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 #if 0
55 char *ss_current_request();     /* This is actually a macro */
56 #endif
57 #ifdef __STDC__
58 char *ss_name(int sci_idx);
59 void ss_error (int, long, char const *, ...);
60 void ss_perror (int, long, char const *);
61 int ss_create_invocation(const char *, const char *, void *,
62                          ss_request_table *, int *);
63 void ss_delete_invocation(int);
64 int ss_listen(int);
65 int ss_execute_line(int, char *);
66 void ss_add_request_table(int, ss_request_table *, int, int *);
67 void ss_delete_request_table(int, ss_request_table *, int *);
68 void ss_abort_subsystem(int sci_idx, int code);
69 void ss_quit(int argc, const char * const *argv, int sci_idx, void *infop);
70 void ss_self_identify(int argc, const char * const *argv, int sci_idx, void *infop);
71 void ss_subsystem_name(int argc, const char * const *argv,
72                        int sci_idx, void *infop);
73 void ss_subsystem_version(int argc, const char * const *argv,
74                           int sci_idx, void *infop);
75 void ss_unimplemented(int argc, const char * const *argv,
76                       int sci_idx, void *infop);
77 void ss_set_prompt(int sci_idx, char *new_prompt);
78 char *ss_get_prompt(int sci_idx);
79 #else
80 char *ss_name();
81 void ss_error ();
82 void ss_perror ();
83 int ss_create_invocation();
84 void ss_delete_invocation();
85 int ss_listen();
86 int ss_execute_line();
87 void ss_add_request_table();
88 void ss_delete_request_table();
89 void ss_abort_subsystem();
90 void ss_quit();
91 void ss_self_identify();
92 void ss_subsystem_name();
93 void ss_subsystem_version();
94 void ss_unimplemented();
95 void ss_set_prompt;
96 char *ss_get_prompt;
97 #endif
98 extern ss_request_table ss_std_requests;
99 #endif /* _ss_h */