📄 dmalloc_argv.h
字号:
*/externint argv_error_type;/* * Set to 1 (the default) if you want the library look for associated * arguments from the associated program's environmental variable. If * set the 0 then no environmental variable will be used. If you are * running program foo then the library will look for the * environmental variable ARGV_foo and will add those to the argument * list specified on the command line. By default they will be * inserted in front of those on the command line unless the * argv_env_after_b is set to 1. * * NOTE: this is set by argv_process automatically. If you do not * want this behavior, you should use argv_process_no_env. */externint argv_process_env_b;/* * Set to 1 if you want the library to append the arguments from the * program's environmental variable after those specified on the * command line. If set the 0 (the default) then they will be * inserted before those specified on the command line. See * argv_process_env_b for more information. * * NOTE: this is set by argv_process automatically. If you do not * want this behavior, you should use argv_process_no_env. */externint argv_env_after_b;/* * int argv_process_no_env * * DESCRIPTION: * * Process the user arguments with an argv_t structure array. Like * argv_process_args but without the processing of the argv * environmental variables. * * RETURNS: * * Success - 0 * * Failure - -1 * * ARGUMENTS: * * args - Array of argv_t structures. * * arg_c - Number of arguments in the argv array. * * argv - Array of character pointers terminated by 0L. */externint argv_process_no_env(argv_t *args, const int arg_c, char **argv);/* * int argv_process * * DESCRIPTION: * * Processes a number of arguments depending on the argument array. * This routine will not modify the argv array in any way. * * NOTE: it will modify the args array by setting various flags in the * type field. returns 0 if no error else -1. * * ARGUMENTS: * * args - Array of argv_t structures that we are using to process the * user argument array. If null then an empty array is used. * * argc - Number of arguments in the argv argument array. * * argv - Array of character pointer arguments terminated by a 0L. */externint argv_process(argv_t *args, const int argc, char **argv);/* * int argv_usage * * DESCRIPTION: * * Print the standard usage messages for our argument array. You can * specify whether you want to see a short or long usage messages. * * NOTE: if this is called before argv_process then the program name * may be invalid. * * RETURNS: * * Success - 0 * * Failure - -1 * * ARGUMENTS: * * args - Our argument array to print the usage messages about. If * null then an empty array is used. * * which - Either ARGV_USAGE_SHORT (for short usage messages), * ARGV_USAGE_LONG (for long usage messages), or ARGV_USAGE_DEFAULT * (the user's default either long or short). */externint argv_usage(const argv_t *args, const int which);/* * int argv_was_used * * DESCRIPTION: * * See if an argument was used in a previous call to argv_process. * * RETURNS: * * 1 if yes it was used, else 0 if not. * * ARGUMENTS: * * args - Argument list to search. * * short_arg - Short argument to see if it was used. */externint argv_was_used(const argv_t *args, const char short_arg);/* * int argv_long_was_used * * DESCRIPTION: * * See if a long argument was used in a previous call to argv_process. * * RETURNS: * * 1 if yes it was used, else 0 if not. * * ARGUMENTS: * * args - Argument list to search. * * long_arg - Long argument to see if it was used. */externint argv_long_was_used(const argv_t *args, const char *long_arg);/* * int argv_entry_was_used * * DESCRIPTION: * * See if an entry in the argument array was used in a previous call * to argv_process. * * RETURNS: * * 1 if yes it was used, else 0 if not. * * ARGUMENTS: * * argv_entry_p - Pointer to an entry in a argv_t list. */externint argv_entry_was_used(const argv_t *argv_entry_p);/* * void argv_cleanup * * DESCRIPTION: * * Frees up any allocations associated with the argument array during * argv_process. This should be done at the end of the program or * after all the arguments have been referenced. * * RETURNS: * * None. * * ARGUMENTS: * * args - Argument array we are cleaning up. */externvoid argv_cleanup(const argv_t *args);/* * int argv_copy_args * * DESCRIPTION: * * Copy all the arguements (not including the 0th) one after the other * into the user specified buffer. * * NOTE: you can get the 0th argument from argv_argv[0] or * argv_program. * * RETURNS: * * Success - 0 * * Failure - -1 * * ARGUMENTS: * * buf - Buffer to copy all of the user arguments into. * * buf_size - Size of the buffer. */externint argv_copy_args(char *buf, const int buf_size);/* * int argv_value_string * * DESCRIPTION: * * Convert the value of a RC entry to its string equivalent in the * buffer provided. * * RETURNS: * * Length of bytes copied into the buffer. * * ARGUMENTS: * * argv_entry_p - Pointer to an entry in a argv_t list. * * buf - Buffer to convert the value into. * * buf_size - Size of the buffer. */externint argv_value_string(const argv_t *argv_entry_p, char *buf, const int buf_size);/* * int argv_type_info * * DESCRIPTION: * * Get internal information about the type of the argument. * * RETURNS: * * The name of the type. * * ARGUMENTS: * * type - Number of argument type. * * size_p - Pointer to an unsigned integer which, if not NULL, will be * set with the size of the type. * * desc_p - Pointer to a constant character pointer which, if not * NULL, will be pointed to a description of the type. */externconst char *argv_type_info(const unsigned int type, unsigned int *size_p, const char **desc_p);/*<<<<<<<<<< This is end of the auto-generated output from fillproto. */#endif /* ! __ARGV_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -