00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "config.h"
00032
00037 #define HELPFILE_MAX_LINES 128
00038
00039 #define HELPFILE_CMD_PRINTF 1 // print the line
00040 #define HELPFILE_CMD_EXIT 2 // terminate printing
00041
00042 #define HELPFILE_FLAG_OPER 0x00000001
00043 #define HELPFILE_FLAG_SERVOP 0x00000002
00044 #define HELPFILE_FLAG_SRA 0x00000004
00045
00046 class helpline_t {
00047 private:
00048 u_int32_t flags;
00049 u_int32_t mask;
00050 u_int32_t cmd;
00051 char *text;
00052 helpline_t *next;
00053
00054 public:
00055 helpline_t(void);
00056 helpline_t(u_int32_t, u_int32_t, u_int32_t, char *);
00057
00058 ~helpline_t();
00059
00060 void delchain(void);
00061
00062 inline helpline_t *get_next(void) { return next; }
00063 inline void set_next(helpline_t *x_next) { next = x_next; }
00064
00065 inline u_int32_t get_flags(void) { return flags; }
00066 inline void set_flags(u_int32_t x_flags) { flags = x_flags; }
00067
00068 inline u_int32_t get_mask(void) { return mask; }
00069 inline void set_mask(u_int32_t x_mask) { mask = x_mask; }
00070
00071 inline u_int32_t get_cmd(void) { return cmd; }
00072 inline void set_cmd(u_int32_t x_cmd) { cmd = x_cmd; }
00073
00074 inline char *get_text(void) { return text; }
00075 inline void set_text(char *x_text) { text = x_text; }
00076 };
00077
00078 class helpfile_t {
00079 private:
00080 char *fname;
00081 helpline_t *first;
00082 helpline_t *last;
00083
00084 public:
00085 helpfile_t(void);
00086 ~helpfile_t();
00087
00088 void readfile(char *);
00089 void addline(u_int32_t, u_int32_t, u_int32_t, char *);
00090 void display(u_int32_t);
00091 };
00092
00093 typedef struct {
00094 char *name;
00095 u_int32_t flags;
00096 u_int32_t mask;
00097 } flagmap_t;
00098
00099 void helpfile_parse_if(u_int32_t *, u_int32_t *, char *);