/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1985-2012 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* David Korn <[email protected]> *18* Phong Vo <[email protected]> *19* *20***********************************************************************/21/*22* Glenn Fowler23* AT&T Research24*25* command line option parser and usage formatter private definitions26*/2728#ifndef _OPTLIB_H29#define _OPTLIB_H 13031#include <ast.h>32#include <cdt.h>3334#define OPT_cache 0x0135#define OPT_functions 0x0236#define OPT_ignore 0x0437#define OPT_long 0x0838#define OPT_old 0x1039#define OPT_plus 0x2040#define OPT_proprietary 0x404142#define OPT_cache_flag 0x0143#define OPT_cache_invert 0x0244#define OPT_cache_numeric 0x0445#define OPT_cache_optional 0x0846#define OPT_cache_string 0x104748#define OPT_CACHE 12849#define OPT_FLAGS "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"5051struct Optdisc_s;5253typedef struct Optpass_s54{55char* opts;56char* oopts;57char* catalog;58unsigned char version;59unsigned char prefix;60unsigned char flags;61unsigned char section;62} Optpass_t;6364typedef struct Optcache_s65{66struct Optcache_s* next;67Optpass_t pass;68int caching;69unsigned char flags[sizeof(OPT_FLAGS)];70} Optcache_t;7172typedef struct Optstate_s73{74Sfio_t* mp; /* opt_info.msg string stream */75Sfio_t* vp; /* translation string stream */76Sfio_t* xp; /* translation string stream */77Sfio_t* cp; /* compatibility string stream */78Optpass_t pass[8]; /* optjoin() list */79char* argv[2]; /* initial argv copy */80char* strv[3]; /* optstr() argv */81char* str; /* optstr() string */82Sfio_t* strp; /* optstr() stream */83int force; /* force this style */84int pindex; /* prev index for backup */85int poffset; /* prev offset for backup */86int npass; /* # optjoin() passes */87int join; /* optjoin() pass # */88int plus; /* + ok */89int style; /* default opthelp() style */90int width; /* format line width */91int flags; /* display flags */92int emphasis; /* ansi term emphasis ok */93Dtdisc_t msgdisc; /* msgdict discipline */94Dt_t* msgdict; /* default ast.id catalog msgs */95Optcache_t* cache; /* OPT_cache cache */96} Optstate_t;9798#define _OPT_PRIVATE_ \99char pad[2*sizeof(void*)]; \100Optstate_t* state;101102#include <error.h>103104#endif105106107