diff options
| author | vivek <vivek@cumulusnetworks.com> | 2015-12-08 17:01:20 -0800 |
|---|---|---|
| committer | vivek <vivek@cumulusnetworks.com> | 2015-12-08 17:01:20 -0800 |
| commit | 3d63d59fd1ac70e3bdfc243a40d1cfbc5c547ac6 (patch) | |
| tree | 2a90fc4f84ed361d8509a52aa33e1b9a926adcdf /lib/command.h | |
| parent | 1c8481370f49d491d5afe84af9bf8613b257afb2 (diff) | |
| parent | ef16372d77e3822c13f23370e55a280b784aeef2 (diff) | |
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Diffstat (limited to 'lib/command.h')
| -rw-r--r-- | lib/command.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/command.h b/lib/command.h index 4eb31a6947..f9f4c7e397 100644 --- a/lib/command.h +++ b/lib/command.h @@ -437,6 +437,17 @@ struct cmd_token #endif /* VTYSH_EXTRACT_PL */ /* Some macroes */ + +/* + * Sometimes #defines create maximum values that + * need to have strings created from them that + * allow the parser to match against them. + * These macros allow that. + */ +#define CMD_CREATE_STR(s) CMD_CREATE_STR_HELPER(s) +#define CMD_CREATE_STR_HELPER(s) #s +#define CMD_RANGE_STR(a,s) "<" CMD_CREATE_STR(a) "-" CMD_CREATE_STR(s) ">" + #define CMD_OPTION(S) ((S[0]) == '[') #define CMD_VARIABLE(S) (((S[0]) >= 'A' && (S[0]) <= 'Z') || ((S[0]) == '<')) #define CMD_VARARG(S) ((S[0]) == '.') |
