Server IP : 172.67.216.182 / Your IP : 104.23.175.11 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/plugin/innodb_memcached/daemon_memcached/include/memcached/ |
Upload File : |
#ifndef CONFIG_PARSER_H #define CONFIG_PARSER_H #include <stdint.h> #include <stdio.h> #include <memcached/visibility.h> #ifdef __cplusplus extern "C" { #endif /** * The supported datatypes the config file parser can handle */ enum config_datatype { DT_SIZE, DT_FLOAT, DT_BOOL, DT_STRING, DT_CONFIGFILE }; /** * I don't like casting, so let's create a union to keep all the values in */ union config_value { size_t *dt_size; float *dt_float; bool *dt_bool; char **dt_string; }; /** * An entry for a single item in the config file. */ struct config_item { /** The name of the key */ const char* key; /** The datatype for the value */ enum config_datatype datatype; /** Where to store the value from the config file */ union config_value value; /** If the item was found in the config file or not */ bool found; }; /** * Parse the configuration argument and populate the values into the * config items. * * @param str the encoded configuration string * @param items the config items to look for * @param error stream to write error messages to * @return 0 if config successfully parsed * 1 if config successfully parsed, but unknown tokens found * -1 if illegal values was found in the config */ MEMCACHED_PUBLIC_API int parse_config(const char *str, struct config_item items[], FILE *error); #ifdef __cplusplus } #endif #endif