/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1985-2011 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#pragma prototyped22/*23* Glenn Fowler24* AT&T Research25*26* command line option parser and usage formatter private definitions27*/2829#ifndef _OPTLIB_H30#define _OPTLIB_H3132#include <ast.h>33#include <cdt.h>3435#define OPT_append 0x00136#define OPT_cache 0x00237#define OPT_functions 0x00438#define OPT_ignore 0x00839#define OPT_long 0x01040#define OPT_minus 0x02041#define OPT_module 0x04042#define OPT_numeric 0x08043#define OPT_old 0x10044#define OPT_plus 0x2004546#define OPT_cache_flag 0x00147#define OPT_cache_invert 0x00248#define OPT_cache_numeric 0x00449#define OPT_cache_optional 0x00850#define OPT_cache_string 0x0105152#define OPT_CACHE 12853#define OPT_FLAGS "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"5455struct Optdisc_s;5657typedef struct Optpass_s58{59char* opts;60char* oopts;61char* id;62char* catalog;63char* release;64char section[4];65unsigned char version;66unsigned char prefix;67unsigned short flags;68} Optpass_t;6970typedef struct Optcache_s71{72struct Optcache_s* next;73Optpass_t pass;74int caching;75unsigned char flags[sizeof(OPT_FLAGS)];76} Optcache_t;7778typedef struct Optstate_s79{80Sfio_t* mp; /* opt_info.msg string stream */81Sfio_t* vp; /* translation string stream */82Sfio_t* xp; /* translation string stream */83Sfio_t* cp; /* compatibility string stream */84Optpass_t pass[8]; /* optjoin() list */85char* argv[2]; /* initial argv copy */86char* strv[3]; /* optstr() argv */87char* str; /* optstr() string */88Sfio_t* strp; /* optstr() stream */89int force; /* force this style */90int pindex; /* prev index for backup */91int poffset; /* prev offset for backup */92int npass; /* # optjoin() passes */93int join; /* optjoin() pass # */94int plus; /* + ok */95int style; /* default opthelp() style */96int width; /* format line width */97int flags; /* display flags */98int emphasis; /* ansi term emphasis ok */99int localized; /* locale initialized */100Dtdisc_t msgdisc; /* msgdict discipline */101Dt_t* msgdict; /* default ast.id catalog msgs */102Optcache_t* cache; /* OPT_cache cache */103char** conformance; /* conformance id vector */104} Optstate_t;105106#define _OPT_PRIVATE_ \107char pad[2*sizeof(void*)]; \108Optstate_t* state;109110#include <error.h>111112extern Optstate_t* optstate(Opt_t*);113114#endif115116117