optlib.h revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
/*
* Glenn Fowler
* AT&T Research
*
* command line option parser and usage formatter private definitions
*/
#ifndef _OPTLIB_H
#define _OPTLIB_H 1
#include <ast.h>
#include <cdt.h>
#define OPT_cache 0x01
#define OPT_functions 0x02
#define OPT_ignore 0x04
#define OPT_long 0x08
#define OPT_old 0x10
#define OPT_plus 0x20
#define OPT_proprietary 0x40
#define OPT_cache_flag 0x01
#define OPT_cache_invert 0x02
#define OPT_cache_numeric 0x04
#define OPT_cache_optional 0x08
#define OPT_cache_string 0x10
#define OPT_CACHE 128
#define OPT_FLAGS "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
struct Optdisc_s;
typedef struct Optpass_s
{
char* opts;
char* oopts;
char* catalog;
unsigned char version;
unsigned char prefix;
unsigned char flags;
unsigned char section;
} Optpass_t;
typedef struct Optcache_s
{
struct Optcache_s* next;
int caching;
} Optcache_t;
typedef struct Optstate_s
{
char* str; /* optstr() string */
int force; /* force this style */
int pindex; /* prev index for backup */
int poffset; /* prev offset for backup */
int npass; /* # optjoin() passes */
int join; /* optjoin() pass # */
int plus; /* + ok */
int style; /* default opthelp() style */
int width; /* format line width */
int flags; /* display flags */
int emphasis; /* ansi term emphasis ok */
} Optstate_t;
#define _OPT_PRIVATE_ \
char pad[2*sizeof(void*)]; \
#include <error.h>
#endif