monet_options.h

来自「这个是内存数据库中的一个管理工具」· C头文件 代码 · 共 62 行

H
62
字号
#ifndef _MO_H_#define _MO_H_#include "monet_utils.h"#ifndef HAVE_GETOPT_LONG#  include "monet_getopt.h"#else# ifdef HAVE_GETOPT_H#  include "getopt.h"# endif#endiftypedef enum opt_kind {	opt_builtin = 0,	opt_config = 1,	opt_cmdline = 2} opt_kind;typedef struct opt {	opt_kind kind;	char *name;	char *value;} opt;#ifdef __cplusplusextern "C" {#endif/* mo_print_options will print the option set on stderr */mutils_export void mo_print_options(opt *set, int setlen);/* mo_find_option, finds the option with the given name in the option set   (set,setlen). */mutils_export char *mo_find_option(opt *set, int setlen, const char *name);/* the option values can contain ${prefix} and ${exec_prefix}, these   will be substituted using the mo_substitute function.  The return   value is a newly allocated buffer, it is the caller's responsibility to free the buffer. */mutils_export char *mo_substitute(opt *set, int setlen, char *name);/* mo_system_config will add the options from the system config file   (returns the new setlen) */mutils_export int mo_system_config(opt **Set, int setlen);/* mo_builtin_settings, will place the builtin settings into a new   option set (returns the length of this set). */mutils_export int mo_builtin_settings(opt **Set);/* mo_add_option will add a single option to the option set    (returns new length) */mutils_export int mo_add_option(opt **Set, int setlen, opt_kind kind, const char *name, const char *value);/* mo_free_options will free the resouces take by the options set */mutils_export void mo_free_options(opt *set, int setlen);#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?