diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2018-11-16 18:05:57 +0200 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2018-11-16 18:05:57 +0200 |
commit | 8eb4df24eb30353bea82268440396e50ed8b1bbc (patch) | |
tree | c885ab94952315f64bd596512cd23d0ef5509b3e /src/clparser.h | |
parent | 2919a5e2c1d33d170bffc93dfeaa6292b9fa3dca (diff) | |
download | ck-8eb4df24eb30353bea82268440396e50ed8b1bbc.tar.gz ck-8eb4df24eb30353bea82268440396e50ed8b1bbc.tar.bz2 ck-8eb4df24eb30353bea82268440396e50ed8b1bbc.zip |
Fix bugs in test-ck and simplify clparser
Diffstat (limited to 'src/clparser.h')
-rw-r--r-- | src/clparser.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/clparser.h b/src/clparser.h index 9b22b87..f6818fa 100644 --- a/src/clparser.h +++ b/src/clparser.h @@ -20,19 +20,20 @@ #include "cklist.h" -#define CK_ACTIONS \ - X(INIT) \ - X(ADD) \ - X(DEL) \ - X(EDIT) \ - X(LIST) \ - X(SEARCH) \ - X(RESTORE) \ - X(HELP) +/* NAME | MIN ACCEPTED ARGS | MAX ACCEPTED ARGS */ +#define CK_ACTIONS \ + X(INIT, 2 , 2) \ + X(ADD, 2, 4) \ + X(DEL, 1, 2) \ + X(EDIT, 1, 2) \ + X(LIST, 1, 6) \ + X(SEARCH, 1, 1) \ + X(RESTORE, 1, 2) \ + X(HELP, 1, 1) enum ParseErrors { PERR_NOERR = 0, -#define X(ACTION) \ +#define X(ACTION, MIN, MAX) \ PERR_##ACTION##_WRONG, CK_ACTIONS #undef X @@ -42,7 +43,7 @@ typedef enum ParseErrors ParseError; enum CkActions { CK_WRONG_ACTION, -#define X(ACTION) \ +#define X(ACTION, MIN, MAX) \ CKA_##ACTION, CK_ACTIONS #undef X |