opt.h
来自「ecg心电信号产生程序」· C头文件 代码 · 共 160 行
H
160 行
/*opt.h version 3.17 - User Include File for options package.OPT is a subroutine library which facilitates the convenient input of parameters to a C or C++ program. Parameters are parsed from a command line, with further facilities for reading options from files, from environment strings, or from an interactive environment. The aim of the opt package is to permit programs to be both user- and programmer- friendly. The package attempts to on the one hand provide a direct and relatively full-featured input interface to the ultimate user of the program, and at the same time impose a minimal amount of work on the programmer to "attach" the package to his or her software. A texinfo file is part of the distribution; or you can view the html documentation at:http://nis-www.lanl.gov/~jt/Software/opt/opt_toc.htmlDownload the lastest version of the source code from:http://nis-www.lanl.gov/~jt/Software/opt is available to the public under the GNU General Public License:http://www.gnu.org/copyleft/gpl.htmlThis SOFTWARE has been authored by an employee of the University ofCalifornia, operator of the Los Alamos National Laboratory underContract No. W-7405-ENG-36 with the U.S. Department of Energy. TheU.S. Government has rights to use, reproduce, and distribute thisSOFTWARE. The public may copy, distribute, prepare derivative worksand publicly display this SOFTWARE without charge, provided that thisNotice and any statement of authorship are reproduced on allcopies. Neither the Government nor the University makes any warranty,express or implied, or assumes any liability or responsibility for theuse of this SOFTWARE. If SOFTWARE is modified to produce derivativeworks, such modified SOFTWARE should be clearly marked, so as not toconfuse it with the version available from LANL.*/#ifndef _OPT_H#define _OPT_H /* Signal that this header file has been included *//* * These are delimiter characters */#define DELIM '-' /* option delimiter character */#define ALTDELIM '/' /* alternate delimiter character */#define OPTFROMFILE '@' /* denotes options are in a file */#define OPTTOFILE '%' /* says to put options in a file */#define DOCUMENT '-' /* write document to file */#define INTERACT '$' /* Flags interactive menu */#define HELPCH '?' /* Help character *//* * These are not available on command line * But may be invoked from a file */#define IGNOREEOL ';' /* Ignore until the end of line */#define RUN '=' /* Says to just run to completion */#define QUITCH '.' /* Quit character *//* * These are not available on command line or from a file * But may be invoked from the menu */#define BANG '!' /* Shell escape character */#define ADDITIONAL_OPTS '+' /* Additional options */typedef enum { INT, UNSINT, LONG, CHAR, INTLEVEL, FLOAT, DOUBLE, FLAG, NEGFLAG, ABSFLAG, ABSNEGFLAG, VSTRING, CSTRING, UNDELIMV, UNDELIMC } opt_TYPE;typedef int (*PFI)();#define OPT_EXT ".opt" /* standard options file extension */#ifndef TRUE#define TRUE 1#define FALSE 0#endif#ifndef ARGCHECK#ifdef __TURBOC__ #define ARGCHECK#endif /* __TURBOC__ */#ifdef __cplusplus #define ARGCHECK#endif /* __cplusplus */#endif /* ARGCHECK */#ifdef ARGCHECK extern int opt_register(char *,opt_TYPE,char,char *); extern void opt_usage_set(char *); extern void opt_title_set(char *); extern void opt_verify_set(PFI); extern void opt_doc_set(PFI); extern void opt_quit_set(PFI); extern void opt_run_set(PFI); extern void opt_help_setf(PFI); extern void opt_help_set(char,char *); extern void opt_ufilter_set(PFI); extern void opt_dfilter_set(PFI); extern void opt_env_set(char *); extern void opt_default_set(char *);#if DISABLE_VARARGS extern void opt_errmess(char *); extern void opt_message(char *); extern void opt_warning(char *); extern void opt_fatal(char *);#else extern void opt_errmess(); extern void opt_message(); extern void opt_warning(); extern void opt_fatal();#endif /* DISABLE_VARARGS */ extern void opt_abort_run(void); extern int opt_begin_run(PFI); extern int getopts(int,char **);#else extern int opt_register(); extern void opt_usage_set(); extern void opt_title_set(); extern void opt_verify_set(); extern void opt_doc_set(); extern void opt_quit_set(); extern void opt_run_set(); extern void opt_help_setf(); extern void opt_help_set(); extern void opt_help_set(); extern void opt_ufilter_set(); extern void opt_dfilter_set(); extern void opt_env_set(); extern void opt_default_set(); extern void opt_errmess(); extern void opt_message(); extern void opt_warning(); extern void opt_fatal(); extern void opt_abort_run(); extern int opt_begin_run(); extern int getopts();#endif /* ARGCHECK *//********************************* * Macro's for registering options */#define optregister(val,typ,c,str) opt_register((char *)&val,typ,c,str)#define optrunset(r) {int r(); opt_run_set( r );}#endif /* _OPT_H */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?