c-ipfs/include/ipfs/commands/command_option.h

36 lines
883 B
C
Raw Normal View History

2016-10-27 18:11:34 +00:00
#ifndef __COMMANDS_COMMAND_OPTION_H__
#define __COMMANDS_COMMAND_OPTION_H__
2016-11-07 21:29:30 +00:00
#include <stdint.h>
2016-10-27 18:11:34 +00:00
enum Kind { invalid, boolean, integer, unsignedInt, decimal, str };
struct CommandOption {
char** names;
int name_count;
enum Kind kind;
char* description;
int default_int_val;
int default_bool_val;
uint32_t default_uint_val;
float default_float_val;
char* default_string_val;
};
/***
* Allocate the resources needed for a command option
* @param option the CommandOption to initialize
* @param description a description of this CommandOption
* @returns true(1) on success
*/
int commands_command_option_init(struct CommandOption* option, char* description);
/***
* Cleans up the resources of a CommandOption
* @param option the CommandOption to clean up
* @returns true(1)
*/
int commands_command_option_free(struct CommandOption* option);
2016-10-27 18:11:34 +00:00
#endif /* option_h */