Whamcloud - gitweb
Many files:
[tools/e2fsprogs.git] / lib / ss / ss.h
1 /*
2  * Copyright 1987, 1988 by MIT Student Information Processing Board
3  *
4  * For copyright information, see copyright.h.
5  */
6
7 #ifndef _ss_h
8 #define _ss_h __FILE__
9
10 #include <ss/copyright.h>
11 #include <ss/ss_err.h>
12
13 extern int errno;
14
15 #ifdef __STDC__
16 #define __SS_CONST const
17 #define __SS_PROTO (int, const char * const *, int, void *)
18 #else
19 #define __SS_CONST
20 #define __SS_PROTO ()
21 #endif
22
23 typedef __SS_CONST struct _ss_request_entry {
24     __SS_CONST char * __SS_CONST *command_names; /* whatever */
25     void (* __SS_CONST function) __SS_PROTO; /* foo */
26     __SS_CONST char * __SS_CONST info_string;   /* NULL */
27     int flags;                  /* 0 */
28 } ss_request_entry;
29
30 typedef __SS_CONST struct _ss_request_table {
31     int version;
32     ss_request_entry *requests;
33 } ss_request_table;
34
35 #define SS_RQT_TBL_V2   2
36
37 typedef struct _ss_rp_options { /* DEFAULT VALUES */
38     int version;                /* SS_RP_V1 */
39     void (*unknown) __SS_PROTO; /* call for unknown command */
40     int allow_suspend;
41     int catch_int;
42 } ss_rp_options;
43
44 #define SS_RP_V1 1
45
46 #define SS_OPT_DONT_LIST        0x0001
47 #define SS_OPT_DONT_SUMMARIZE   0x0002
48
49 void ss_help __SS_PROTO;
50 #if 0
51 char *ss_current_request();     /* This is actually a macro */
52 #endif
53 #ifdef __STDC__
54 char *ss_name(int sci_idx);
55 void ss_error (int, long, char const *, ...);
56 void ss_perror (int, long, char const *);
57 int ss_create_invocation(char *, char *, char *, ss_request_table *, int *);
58 void ss_delete_invocation(int);
59 int ss_listen(int);
60 void ss_add_request_table(int, ss_request_table *, int, int *);
61 void ss_delete_request_table(int, ss_request_table *, int *);
62 void ss_abort_subsystem(int sci_idx, int code);
63 #else
64 char *ss_name();
65 void ss_error ();
66 void ss_perror ();
67 int ss_create_invocation();
68 void ss_delete_invocation();
69 int ss_listen();
70 void ss_add_request_table();
71 void ss_delete_request_table();
72 void ss_abort_subsystem();
73 #endif
74 extern ss_request_table ss_std_requests;
75 #endif /* _ss_h */