-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandTable.h
More file actions
44 lines (27 loc) · 792 Bytes
/
CommandTable.h
File metadata and controls
44 lines (27 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef COMMAND_TABLE_H_
#define COMMAND_TABLE_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
typedef int (*fpointer)(void *);
typedef struct Command{
const char * title;
const char * helpInfo;
const char * longHelp;
fpointer function;
struct Command * next;
}Command;
unsigned long getTableSize(void);
Command ** getTable(void);
bool initCMDTable(unsigned long size);
unsigned long long getHash(char * str);
Command * genCommand(const char * title, const char * helpInfo, const char * longHelp, fpointer function);
bool appendCommand(const char * title, const char * helpInfo, const char * longHelp, fpointer function);
void replaceNextSpace(char * str);
Command* getCommand(char * title);
bool GetTableStatus(void);
#ifdef __cplusplus
}
#endif
#endif