c-template
|
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <argtable3.h>
#include "../../include/utils/colors.h"
#include "../../include/utils/command_line.h"
#include "../../include/utils/array_len.h"
#include "../../include/utils/logger.h"
#include "../../include/utils/safe_mem.h"
Go to the source code of this file.
Functions | |
command_object * | new_command_object (int argc, char *argv[]) |
intializes a new command_object to have commands loaded into More... | |
int | load_command (command_object *self, command_handler *command) |
loads command handler and makes it executable More... | |
int | execute (command_object *self, char *run) |
checks to see if we have a command named according to run and executes it More... | |
void | free_command_object (command_object *self) |
frees memory allocated for the command_object and sets pointer to null for some reason this is causing an address boundary error More... | |
int | parse_args (int argc, char *argv[], void *argtable[]) |
parses arguments, and checks for any errors More... | |
void | print_help (char *program_name, void *argtable[]) |
formats output More... | |
void | setup_args (const char *version_string) |
setups the default argtable arguments More... | |
char * | get_run_command () |
returns the value of command_to_run More... | |
int execute | ( | command_object * | self, |
char * | run | ||
) |
checks to see if we have a command named according to run and executes it
Definition at line 59 of file command_line.c.
void free_command_object | ( | command_object * | self | ) |
frees memory allocated for the command_object and sets pointer to null for some reason this is causing an address boundary error
frees memory allocated for the command_object and sets pointer to null
Definition at line 74 of file command_line.c.
char* get_run_command | ( | ) |
returns the value of command_to_run
Definition at line 115 of file command_line.c.
int load_command | ( | command_object * | self, |
command_handler * | command | ||
) |
loads command handler and makes it executable
Definition at line 47 of file command_line.c.
command_object* new_command_object | ( | int | argc, |
char * | argv[] | ||
) |
intializes a new command_object to have commands loaded into
Definition at line 14 of file command_line.c.
int parse_args | ( | int | argc, |
char * | argv[], | ||
void * | argtable[] | ||
) |
parses arguments, and checks for any errors
Definition at line 82 of file command_line.c.
void print_help | ( | char * | program_name, |
void * | argtable[] | ||
) |
formats output
Definition at line 99 of file command_line.c.
void setup_args | ( | const char * | version_string | ) |
setups the default argtable arguments
Definition at line 106 of file command_line.c.