Action handling header file. More...
#include "global.h"
Go to the source code of this file.
Data Structures | |
struct | actionlist_t |
Definition of an action . More... | |
Defines | |
#define | ac__Usage_dflt() do { ac__Usage(NULL, 0, NULL); } while (0) |
For convenience: general help, and help for the current action. | |
#define | ac__Usage_this() do { ac__Usage(NULL, 1, (char**)action->name); } while (0) |
Print help for the current action. | |
Typedefs | |
callbacks Action callbacks. | |
typedef int( | action_t )(struct estat *sts) |
Callback that gets called for each entry. | |
typedef int( | work_t )(struct estat *root, int argc, char *argv[]) |
Callback for initializing the action. | |
typedef int( | action_uninit_t )(void) |
One after all progress has been made. | |
Functions | |
int | act__find_action_by_name (const char *cmd, struct actionlist_t **action_p) |
Find the action structure by name. | |
Variables | |
action_t | ac__dispatch |
The action wrapper. | |
work_t | ac__Usage |
The always allowed action - printing general or specific help. | |
struct actionlist_t | action_list [] |
Array of all known actions. | |
struct actionlist_t * | action |
Gets set to the current action after commandline parsing. | |
const int | action_list_count |
How many actions we know. |
Action handling header file.
Definition in file actions.h.
#define ac__Usage_dflt | ( | ) | do { ac__Usage(NULL, 0, NULL); } while (0) |
#define ac__Usage_this | ( | ) | do { ac__Usage(NULL, 1, (char**)action->name); } while (0) |
Print help for the current action.
Definition at line 55 of file actions.h.
Referenced by cm__uncopy(), ign__rign(), ign__work(), main(), prp__g_work(), prp__l_work(), prp__s_work(), res__work(), and rev__work().
Callback that gets called for each entry.
Entries get read from the entry list in global [device, inode] order; in the normal action callback (actionlist_t::local_callback and actionlist_t::repos_feedback) the parent entries are handled after child entries (but the parent struct
estats exist, of course), so that the list of children is correct.
See also waa__update_tree.
The full (wc-based) path can be built as required by ops__build_path().
typedef int( action_uninit_t)(void) |
int act__find_action_by_name | ( | const char * | cmd, | |
struct actionlist_t ** | action_p | |||
) |
Find the action structure by name.
Returns in *
action_p the action matching (a prefix of) cmd.
Find the action structure by name.
Used by commandline parsing - finding the current action, and which help text to show.
Definition at line 68 of file actions.c.
References action_list, action_list_count, actionlist_t::name, and STOPIF_CODE_ERR.
Referenced by ac__Usage(), and main().
action_t ac__dispatch |
The action wrapper.
Definition at line 47 of file actions.h.
Referenced by st__work(), waa___check_dir_for_update(), waa___finish_directory(), waa__build_tree(), waa__update_dir(), and waa__update_tree().
work_t ac__Usage |
struct actionlist_t* action |
Gets set to the current action after commandline parsing.
Definition at line 137 of file ac_list.c.
Referenced by ac__dispatch(), ac__Usage(), au__action(), cb___close(), cb___remover(), cb___store_prop(), df__work(), ign__work(), main(), ops__update_filter_set_bits(), ops__update_single_entry(), prp__s_work(), rev__work(), st__work(), up__add_directory(), up__apply_textdelta(), up__close_file(), up__fetch_decoder(), up__parse_prop(), up__work(), wa__set_warn_option(), wa__summary(), wa__warn(), waa___check_dir_for_update(), waa__find_common_base2(), waa__init(), waa__open(), waa__read_or_build_tree(), and waa__update_tree().
struct actionlist_t action_list[] |
Array of all known actions.
Definition at line 98 of file ac_list.c.
Referenced by ac__Usage(), act__find_action_by_name(), and main().
const int action_list_count |
How many actions we know.
Definition at line 135 of file ac_list.c.
Referenced by ac__Usage(), and act__find_action_by_name().