📄 options.h
字号:
/* From: usage.c line 128 * * optionOnlyUsage - Print usage text for just the options * * Arguments: * pOpts program options descriptor * ex_code exit code for calling exit(3) * * This routine will print only the usage for each option. * This function may be used when the emitted usage must incorporate * information not available to AutoOpts. */extern void optionOnlyUsage( tOptions*, int );/* From: autoopts.c line 1012 * * optionProcess - this is the main option processing routine * * Arguments: * pOpts program options descriptor * argc program arg count * argv program arg vector * * Returns: int - the count of the arguments processed * * This is the main entry point for processing options. It is intended * that this procedure be called once at the beginning of the execution of * a program. Depending on options selected earlier, it is sometimes * necessary to stop and restart option processing, or to select completely * different sets of options. This can be done easily, but you generally * do not want to do this. * * The number of arguments processed always includes the program name. * If one of the arguments is "--", then it is counted and the processing * stops. If an error was encountered and errors are to be tolerated, then * the returned value is the index of the argument causing the error. * A hyphen by itself ("-") will also cause processing to stop and will * @emph{not} be counted among the processed arguments. A hyphen by itself * is treated as an operand. Encountering an operand stops option * processing. */extern int optionProcess( tOptions*, int, char** );/* From: restore.c line 145 * * optionRestore - restore option state from memory copy * * Arguments: * pOpts program options descriptor * * Copy back the option state from saved memory. * The allocated memory is left intact, so this routine can be * called repeatedly without having to call optionSaveState again. * If you are restoring a state that was saved before the first call * to optionProcess(3AO), then you may change the contents of the * argc/argv parameters to optionProcess. */extern void optionRestore( tOptions* );/* From: save.c line 334 * * optionSaveFile - saves the option state to a file * * Arguments: * pOpts program options descriptor * * This routine will save the state of option processing to a file. The name * of that file can be specified with the argument to the @code{--save-opts} * option, or by appending the @code{rcfile} attribute to the last * @code{homerc} attribute. If no @code{rcfile} attribute was specified, it * will default to @code{.@i{programname}rc}. If you wish to specify another * file, you should invoke the @code{SET_OPT_SAVE_OPTS( @i{filename} )} macro. */extern void optionSaveFile( tOptions* );/* From: restore.c line 93 * * optionSaveState - saves the option state to memory * * Arguments: * pOpts program options descriptor * * This routine will allocate enough memory to save the current option * processing state. If this routine has been called before, that memory * will be reused. You may only save one copy of the option state. This * routine may be called before optionProcess(3AO). If you do call it * before the first call to optionProcess, then you may also change the * contents of argc/argv after you call optionRestore(3AO) * * In fact, more strongly put: it is safest to only use this function * before having processed any options. In particular, the saving and * restoring of stacked string arguments and hierarchical values is * disabled. The values are not saved. */extern void optionSaveState( tOptions* );/* From: nested.c line 559 * * optionUnloadNested - Deallocate the memory for a nested value * * Arguments: * pOptVal the hierarchical value * * A nested value needs to be deallocated. The pointer passed in should * have been gotten from a call to @code{configFileLoad()} (See * @pxref{libopts-configFileLoad}). */extern void optionUnloadNested( tOptionValue const * );/* From: version.c line 58 * * optionVersion - return the compiled AutoOpts version number * * Returns: char const* - the version string in constant memory * * Returns the full version string compiled into the library. * The returned string cannot be modified. */extern char const* optionVersion( void );/* From: ../compat/pathfind.c line 34 * * pathfind - fild a file in a list of directories * * Arguments: * path colon separated list of search directories * file the name of the file to look for * mode the mode bits that must be set to match * * Returns: char* - the path to the located file * * the pathfind function is available only if HAVE_PATHFIND is not defined * * pathfind looks for a a file with name "FILE" and "MODE" access * along colon delimited "PATH", and returns the full pathname as a * string, or NULL if not found. If "FILE" contains a slash, then * it is treated as a relative or absolute path and "PATH" is ignored. * * @strong{NOTE}: this function is compiled into @file{libopts} only if * it is not natively supplied. * * The "MODE" argument is a string of option letters chosen from the * list below: * @example * Letter Meaning * r readable * w writable * x executable * f normal file (NOT IMPLEMENTED) * b block special (NOT IMPLEMENTED) * c character special (NOT IMPLEMENTED) * d directory (NOT IMPLEMENTED) * p FIFO (pipe) (NOT IMPLEMENTED) * u set user ID bit (NOT IMPLEMENTED) * g set group ID bit (NOT IMPLEMENTED) * k sticky bit (NOT IMPLEMENTED) * s size nonzero (NOT IMPLEMENTED) * @end example */#ifndef HAVE_PATHFINDextern char* pathfind( char const*, char const*, char const* );#endif /* HAVE_PATHFIND *//* From: streqvcmp.c line 233 * * strequate - map a list of characters to the same value * * Arguments: * ch_list characters to equivalence * * Each character in the input string get mapped to the first character * in the string. * This function name is mapped to option_strequate so as to not conflict * with the POSIX name space. */extern void strequate( char const* );/* From: streqvcmp.c line 143 * * streqvcmp - compare two strings with an equivalence mapping * * Arguments: * str1 first string * str2 second string * * Returns: int - the difference between two differing characters * * Using a character mapping, two strings are compared for "equivalence". * Each input character is mapped to a comparison character and the * mapped-to characters are compared for the two NUL terminated input strings. * This function name is mapped to option_streqvcmp so as to not conflict * with the POSIX name space. */extern int streqvcmp( char const*, char const* );/* From: streqvcmp.c line 180 * * streqvmap - Set the character mappings for the streqv functions * * Arguments: * From Input character * To Mapped-to character * ct compare length * * Set the character mapping. If the count (@code{ct}) is set to zero, then * the map is cleared by setting all entries in the map to their index * value. Otherwise, the "@code{From}" character is mapped to the "@code{To}" * character. If @code{ct} is greater than 1, then @code{From} and @code{To} * are incremented and the process repeated until @code{ct} entries have been * set. For example, * @example * streqvmap( 'a', 'A', 26 ); * @end example * @noindent * will alter the mapping so that all English lower case letters * will map to upper case. * * This function name is mapped to option_streqvmap so as to not conflict * with the POSIX name space. */extern void streqvmap( char, char, int );/* From: streqvcmp.c line 102 * * strneqvcmp - compare two strings with an equivalence mapping * * Arguments: * str1 first string * str2 second string * ct compare length * * Returns: int - the difference between two differing characters * * Using a character mapping, two strings are compared for "equivalence". * Each input character is mapped to a comparison character and the * mapped-to characters are compared for the two NUL terminated input strings. * The comparison is limited to @code{ct} bytes. * This function name is mapped to option_strneqvcmp so as to not conflict * with the POSIX name space. */extern int strneqvcmp( char const*, char const*, int );/* From: streqvcmp.c line 259 * * strtransform - convert a string into its mapped-to value * * Arguments: * dest output string * src input string * * Each character in the input string is mapped and the mapped-to * character is put into the output. * This function name is mapped to option_strtransform so as to not conflict * with the POSIX name space. */extern void strtransform( char*, char const* );/* AutoOpts PRIVATE FUNCTIONS: */tOptProc optionStackArg, optionUnstackArg, optionBooleanVal, optionNumericVal;extern char* ao_string_cook( char*, int* );extern unsigned int ao_string_cook_escape_char( char const*, char*, unsigned int );extern void export_options_to_guile( tOptions* );extern void genshelloptUsage( tOptions*, int );extern void optionBooleanVal( tOptions*, tOptDesc* );extern uintptr_t optionEnumerationVal( tOptions*, tOptDesc*, char const * const *, unsigned int );extern char const* optionKeywordName( tOptDesc*, unsigned int );extern void optionLoadOpt( tOptions*, tOptDesc* );extern ag_bool optionMakePath( char*, int, char const*, char const* );extern void optionNestedVal( tOptions*, tOptDesc* );extern void optionNumericVal( tOptions*, tOptDesc* );extern void optionPagedUsage( tOptions*, tOptDesc* );extern void optionParseShell( tOptions* );extern void optionPrintVersion( tOptions*, tOptDesc* );extern void optionPutShell( tOptions* );extern void optionSetMembers( tOptions*, tOptDesc*, char const * const *, unsigned int );extern void optionStackArg( tOptions*, tOptDesc* );extern void optionUnstackArg( tOptions*, tOptDesc* );extern void optionUsage( tOptions*, int );extern void optionVersionStderr( tOptions*, tOptDesc* );extern void* text_mmap( char const*, int, int, tmap_info_t* );extern int text_munmap( tmap_info_t* );CPLUSPLUS_CLOSER#endif /* AUTOOPTS_OPTIONS_H_GUARD *//* * Local Variables: * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * options.h ends here */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -