#include <stdio.h>#include <unistd.h>#include "config.h"#include <stdlib.h>#include <string.h>#include "include/cmd_prompt.h"#include "macros.h"#include "mc_platform.h"#include "commands.x.h"#include "include/agent.h"Go to the source code of this file.
Functions | |
| cmd_prompt_p | cmd_prompt_Initialize (mc_platform_p mc_platform) |
| int | cmd_prompt_Destroy (cmd_prompt_p cmd_prompt) |
| void | cmd_prompt_Start (mc_platform_p mc_platform) |
| void * | cmd_prompt_Thread (void *arg) |
| int | split_string (char ***args, const char *buf) |
| int | process_command (command_t *cmd) |
| int | exec_command (command_t cmd, mc_platform_p global) |
| int | dealloc_command (command_t *cmd) |
| int | handler_QUIT (void *arg, mc_platform_p global) |
| int | handler_HELP (void *arg, mc_platform_p global) |
| int | handler_SEND (void *arg, mc_platform_p global) |
| int | handler_PRINT_CONNECTLIST (void *arg, mc_platform_p global) |
| int | handler_PRINTLIST_MESSAGE (void *arg, mc_platform_p global) |
| int | handler_PRINTLIST_AGENTS (void *arg, mc_platform_p global) |
| int | handler_FLUSH_AGENTS (void *arg, mc_platform_p global) |
| int | handler_COMPOSE_SEND (void *arg, mc_platform_p global) |
| int cmd_prompt_Destroy | ( | cmd_prompt_p | cmd_prompt | ) |
Definition at line 130 of file cmd_prompt.c.
References MC_SUCCESS.
Referenced by mc_platform_Destroy().
| cmd_prompt_p cmd_prompt_Initialize | ( | mc_platform_p | mc_platform | ) |
Definition at line 122 of file cmd_prompt.c.
Referenced by mc_platform_Initialize().
| void cmd_prompt_Start | ( | mc_platform_p | mc_platform | ) |
Definition at line 137 of file cmd_prompt.c.
References mc_platform_s::cmd_prompt, cmd_prompt_Thread(), MC_THREAD_CP, mc_platform_s::stack_size, cmd_prompt_s::thread, and THREAD_CREATE.
Referenced by mc_platform_Initialize().
| void* cmd_prompt_Thread | ( | void * | arg | ) |
Definition at line 169 of file cmd_prompt.c.
References command_s::args, buf, dealloc_command(), exec_command(), command_s::index, command_s::num_args, process_command(), and split_string().
Referenced by cmd_prompt_Start().
| int dealloc_command | ( | command_t * | cmd | ) |
Definition at line 322 of file cmd_prompt.c.
References command_s::args, and command_s::num_args.
Referenced by cmd_prompt_Thread().
| int exec_command | ( | command_t | cmd, | |
| mc_platform_p | global | |||
| ) |
Definition at line 306 of file cmd_prompt.c.
References command_s::args, cmd_handlers, command_s::index, and command_s::num_args.
Referenced by cmd_prompt_Thread().
| int handler_COMPOSE_SEND | ( | void * | arg, | |
| mc_platform_p | global | |||
| ) |
Definition at line 427 of file cmd_prompt.c.
References mc_platform_s::agency, command_s::args, command_descriptions, mc_platform_s::hostname, MC_AddAgent(), MC_ComposeAgentFromFile(), and command_s::num_args.
| int handler_FLUSH_AGENTS | ( | void * | arg, | |
| mc_platform_p | global | |||
| ) |
Definition at line 419 of file cmd_prompt.c.
References agent_Destroy(), mc_platform_s::agent_queue, ListClearCB(), ListWRLock(), and ListWRUnlock().
| int handler_HELP | ( | void * | arg, | |
| mc_platform_p | global | |||
| ) |
Definition at line 346 of file cmd_prompt.c.
References command_s::args, command_cmds, command_descriptions, and command_s::num_args.
| int handler_PRINT_CONNECTLIST | ( | void * | arg, | |
| mc_platform_p | global | |||
| ) |
Definition at line 395 of file cmd_prompt.c.
References connection_Print(), mc_platform_s::connection_queue, ListForEachCB(), ListRDLock(), and ListRDUnlock().
| int handler_PRINTLIST_AGENTS | ( | void * | arg, | |
| mc_platform_p | global | |||
| ) |
Definition at line 411 of file cmd_prompt.c.
References agent_Print(), mc_platform_s::agent_queue, ListForEachCB(), ListRDLock(), and ListRDUnlock().
| int handler_PRINTLIST_MESSAGE | ( | void * | arg, | |
| mc_platform_p | global | |||
| ) |
Definition at line 403 of file cmd_prompt.c.
References ListForEachCB(), ListRDLock(), ListRDUnlock(), message_Print(), and mc_platform_s::message_queue.
| int handler_QUIT | ( | void * | arg, | |
| mc_platform_p | global | |||
| ) |
Definition at line 337 of file cmd_prompt.c.
References COND_BROADCAST, MUTEX_LOCK, MUTEX_UNLOCK, mc_platform_s::quit, mc_platform_s::quit_cond, and mc_platform_s::quit_lock.
| int handler_SEND | ( | void * | arg, | |
| mc_platform_p | global | |||
| ) |
Definition at line 384 of file cmd_prompt.c.
References command_s::args, command_descriptions, MC_SendAgentFile(), and command_s::num_args.
| int process_command | ( | command_t * | cmd | ) |
Definition at line 288 of file cmd_prompt.c.
References command_s::args, command_cmds, command_s::index, and command_s::num_args.
Referenced by cmd_prompt_Thread().
| int split_string | ( | char *** | args, | |
| const char * | buf | |||
| ) |
Definition at line 240 of file cmd_prompt.c.
Referenced by cmd_prompt_Thread().
1.6.3