Created
April 3, 2016 20:13
-
-
Save mgarg1/d96a1371874f3215a5dcb638b2b4e8d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define COMMAND(NAME) { #NAME, NAME ## _command } | |
struct command commands[] = | |
{ | |
COMMAND (quit), | |
COMMAND (help), | |
... | |
}; | |
struct command | |
{ | |
char *name; | |
void (*function) (void); | |
}; | |
struct command commands[] = | |
{ | |
{ "quit", quit_command }, | |
{ "help", help_command }, | |
... | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment