diff options
Diffstat (limited to 'agent/gpg-agent.c')
-rw-r--r-- | agent/gpg-agent.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 061687550..6dcde26af 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -309,6 +309,9 @@ static unsigned long pth_thread_id (void) Functions. */ +/* Allocate a string describing a library version by calling a GETFNC. + This function is expected to be called only once. GETFNC is + expected to have a semantic like gcry_check_version (). */ static char * make_libversion (const char *libname, const char *(*getfnc)(const char*)) { @@ -326,7 +329,9 @@ make_libversion (const char *libname, const char *(*getfnc)(const char*)) return result; } - +/* Return strings describing this program. The case values are + described in common/argparse.c:strusage. The values here override + the default values given by strusage. */ static const char * my_strusage (int level) { @@ -448,6 +453,9 @@ remove_socket (char *name) } } + +/* Cleanup code for this program. This is either called has an atexit + handler or directly. */ static void cleanup (void) { @@ -1268,6 +1276,8 @@ main (int argc, char **argv ) } +/* Exit entry point. This function should be called instead of a + plain exit. */ void agent_exit (int rc) { @@ -1294,6 +1304,11 @@ agent_exit (int rc) } +/* Each thread has its own local variables conveyed by a control + structure usually identified by an argument named CTRL. This + function is called immediately after allocating the control + structure. Its purpose is to setup the default values for that + structure. */ static void agent_init_default_ctrl (ctrl_t ctrl) { @@ -1319,6 +1334,8 @@ agent_init_default_ctrl (ctrl_t ctrl) } +/* Release all resources allocated by default in the control + structure. This is the counterpart to agent_init_default_ctrl. */ static void agent_deinit_default_ctrl (ctrl_t ctrl) { @@ -1720,6 +1737,7 @@ agent_sighup_action (void) } +/* A helper function to handle SIGUSR2. */ static void agent_sigusr2_action (void) { @@ -1730,6 +1748,8 @@ agent_sigusr2_action (void) } +/* The signal handler for this program. It is expected to be run in + its own trhead and not in the context of a signal handler. */ static void handle_signal (int signo) { |