Whamcloud - gitweb
- Added lctl.c which is basically ptlctl/obdctl/debugctl all
[fs/lustre-release.git] / lustre / utils / parser.h
index 8f22505..dead9f5 100644 (file)
@@ -4,6 +4,12 @@
 #define HISTORY        100             /* Don't let history grow unbounded    */
 #define MAXARGS 100
 
+#define CMD_COMPLETE   0
+#define CMD_INCOMPLETE 1
+#define CMD_NONE       2
+#define CMD_AMBIG      3
+#define CMD_HELP       4
+
 typedef struct parser_cmd {
        char    *pc_name;
        int     (* pc_func)(int, char **);
@@ -58,5 +64,10 @@ char *Parser_strarg(char *inp, const char *prompt, const char *deft,
 /* Extracts an integer from a string  with a base */
 int Parser_arg2int(const char *inp, long *result, int base);
 
+/* Convert human readable size string to and int; "1k" -> 1000 */
+int Parser_size(int *sizep, char *str);
+
+/* Convert a string boolean to an int; "enable" -> 1 */
+int Parser_bool(int *b, char *str);
 
 #endif