diff options
author | Anastasis Grammenos <anastasis.gramm2@gmail.com> | 2018-09-21 18:43:38 +0300 |
---|---|---|
committer | Anastasis Grammenos <anastasis.gramm2@gmail.com> | 2018-09-21 18:43:38 +0300 |
commit | dba9e5352a9ff792a71fbaede28f013b5d03daae (patch) | |
tree | ca063edee4568912e9d7a6b6ddf09f801005e7fa /src/actionhelper.h | |
parent | 8693064200ad015a6b6d07f99a3170fa89012a71 (diff) | |
download | ck-dba9e5352a9ff792a71fbaede28f013b5d03daae.tar.gz ck-dba9e5352a9ff792a71fbaede28f013b5d03daae.tar.bz2 ck-dba9e5352a9ff792a71fbaede28f013b5d03daae.zip |
Small refactoring in actions
Diffstat (limited to 'src/actionhelper.h')
-rw-r--r-- | src/actionhelper.h | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/src/actionhelper.h b/src/actionhelper.h index 2a47e79..3393ec3 100644 --- a/src/actionhelper.h +++ b/src/actionhelper.h @@ -1,4 +1,3 @@ - /* actionhelper.h - helper functions for ck actions --------------------*- C -*- * * This file is part of ck, the config keeper @@ -12,10 +11,28 @@ * * * -------------------------------------------------------------------------- */ +#ifndef ACTIONHELPER_H +#define ACTIONHELPER_H + #include "actions.h" #include "ckutil.h" #include "cklist.h" +/*******/ +/* ADD */ +/*******/ + +/* if add_err is set, return true + * along with a copy of the error message. + * Pass NULL if you don't care about the message */ +extern int add_err_message(char *err); +extern AddOpt add_make_options(cklist *args); +extern void add_print_opts(AddOpt *opt); +extern void add_make_link(const AddOpt *opt, const Conf *conf); + +/********/ +/* EDIT */ +/********/ typedef enum edit_opt_return_code edit_rc; enum edit_opt_return_code { ERC_OK, @@ -23,13 +40,19 @@ enum edit_opt_return_code { ERC_ERR }; -/* if add_err is set, return true - * along with a copy of the error message. - * Pass NULL if you don't care about the message */ -extern int add_err_message(char *err); +extern edit_rc edit_get_config_or_suggestions(cklist* args, char *ret); +/********/ +/* LIST */ +/********/ +extern ListOpt list_make_options(cklist *args); -extern void add_make_link(const AddOpt *opt, - const Conf *conf); +/*****************/ +/* PRINT RESULTS */ +/*****************/ +#define X(ACTION) \ + extern void print_##ACTION##_result(int ok); +CK_ACTIONS +#undef X -extern edit_rc edit_get_config_or_suggestions(cklist* args, char *ret); +#endif /* ACTIONHELPER_H */ |