diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2018-11-14 21:01:08 +0200 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2018-11-14 21:03:43 +0200 |
commit | 967ad7898243e083f485a03414fce0018bfce881 (patch) | |
tree | 4f1d0b710ad2a2c700944b4ae1edde4f14855682 /src/actionparser.h | |
parent | 11bcc43a2c9e2787c861debda6b94e0550065402 (diff) | |
download | ck-967ad7898243e083f485a03414fce0018bfce881.tar.gz ck-967ad7898243e083f485a03414fce0018bfce881.tar.bz2 ck-967ad7898243e083f485a03414fce0018bfce881.zip |
Rename actionparser to clparser
Diffstat (limited to 'src/actionparser.h')
-rw-r--r-- | src/actionparser.h | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/src/actionparser.h b/src/actionparser.h deleted file mode 100644 index 24ad763..0000000 --- a/src/actionparser.h +++ /dev/null @@ -1,76 +0,0 @@ -/* actionparser.h - Action parser for ck -------------------------------*- C -*- - * - * This file is part of ck, the config keeper - * - * ----------------------------------------------------------------------------- - * - * Copyright (C) 2018 Anastasis Grammenos - * GPLv3 (see LICENCE for the full notice) - * - * ----------------------------------------------------------------------------- - * - * The code here and in actionparser.c is responsible for parsing - * the user's input from the command line and return a struct - * of the user's options ready to be handled by the rest of the - * procedures. - * - * -------------------------------------------------------------------------- */ -#ifndef ACTIONPARSER_H -#define ACTIONPARSER_H - -#include "cklist.h" - -#define CK_ACTIONS \ - X(INIT) \ - X(ADD) \ - X(DEL) \ - X(EDIT) \ - X(LIST) \ - X(SEARCH) \ - X(RESTORE) \ - X(HELP) - -enum ParseErrors { - PERR_NOERR = 0, -#define X(ACTION) \ - PERR_##ACTION##_WRONG, - CK_ACTIONS -#undef X - PERR_UNKNOWN_ACTION, -}; -typedef enum ParseErrors ParseError; - -enum CkActions { - CK_WRONG_ACTION, -#define X(ACTION) \ - CKA_##ACTION, - CK_ACTIONS -#undef X -}; -typedef enum CkActions CkAction; - -enum ActionParserResults { - APR_OK, - APR_ERR, - APR_HELP, - APR_VERSION -}; -typedef enum ActionParserResults ActionParseResult; - -typedef struct UserOptions UserOpt; -struct UserOptions { - ParseError err; - CkAction action; - char *confDir; - cklist *args; -}; - - -/* Parse cli args, fill UserOpt struct - * and return the result enum */ -int parse_action(int argc, const char **argv, UserOpt *opt); -CkAction parser_get_action(const char *name, char *actionName); -char * get_possible_action_strings(char *dest, CkAction ckAction); -void free_user_opt(UserOpt *opt); - -#endif // ACTIONPARSER_H |