From 63c5da4f5f646d4c989e7760be46de86e3b01efe Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Thu, 28 Nov 2019 18:29:17 -0500 Subject: nserver: ncmd.h: Add find_function. * nserver/src/ncmd.c (test_find_function): New function. (all_tests): Add test_find_function. * nserver/src/ncmd.h (FUNCTIONS): New enum. (find_function): New function declaration. * nserver/tests/ncmd_tests.c (find_function): New function definition. --- nserver/src/ncmd.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'nserver/src/ncmd.h') diff --git a/nserver/src/ncmd.h b/nserver/src/ncmd.h index c1cf9a0..80ca45a 100644 --- a/nserver/src/ncmd.h +++ b/nserver/src/ncmd.h @@ -9,9 +9,21 @@ #define CMD_MIN_SIZE 5 #define CMD_MAX_SIZE 120 +enum FUNCTIONS { + NS_CREATE, + NS_SAMPLE, + NS_MEAN, + NS_DUMP, + NS_DELETE, + NS_LIST, + NS_NOP = -1 +}; + int sanitize(char *cmd); char *check_cmd(char *cmd); struct bstrList *cmd_parts(char *cmd); +int find_function(struct bstrList *cmd_parts); + #endif -- cgit v1.2.3