nval.h revision 34f9b3eef6fdadbda0a846aa4d68691ac40eace5
/* : : generated by proto : : */
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#ifndef NV_DEFAULT
#if !defined(__PROTO__)
#include <prototyped.h>
#endif
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
/*
* David Korn
* AT&T Labs
*
* Interface definitions of structures for name-value pairs
* These structures are used for named variables, functions and aliases
*
*/
#include <ast.h>
#include <cdt.h>
#include <option.h>
/* for compatibility with old hash library */
#define HASH_BUCKET 1
#define HASH_NOSCOPE 2
#define HASH_SCOPE 4
/*
* This defines the template for nodes that have their own assignment
* and or lookup functions
*/
struct Namdisc
{
};
struct Namfun
{
char nofree;
unsigned char subshell;
unsigned short dsize;
char *last;
};
struct Nambfun
{
int num;
const char **bnames;
};
/* This is an array template header */
struct Namarray
{
long nelem; /* number of elements */
};
/* The context pointer for declaration command */
struct Namdecl
{
const char *optstring;
};
/* attributes of name-value node attribute flags */
#define NV_DEFAULT 0
/* This defines the attributes for an attributed name-value pair node */
struct Namval
{
char *nvname; /* pointer to name of the node */
unsigned short nvflag; /* attributes */
unsigned short nvsize; /* size or base */
#ifdef _NV_PRIVATE
#else
char *nvalue;
char *nvprivate;
#endif /* _NV_PRIVATE */
};
/* The following attributes are for internal use */
/* The following attributes are valid only when NV_INTEGER is off */
/* The following attributes do not effect the value */
/* The following are used with NV_INTEGER */
/* options for nv_open */
#define NV_ADD 8
/* add node if not found */
#define NV_NOASSIGN 0 /* backward compatibility */
/* numeric types */
#define NV_INT32 (NV_INTEGER)
/* name-value pair macros */
#define nv_offattr(n,f) ((n)->nvflag &= ~(f))
/* The following are operations for associative arrays */
/* The following are for nv_disc */
#define NV_FIRST 1
#define NV_LAST 2
#define NV_POP 3
#define NV_CLONE 4
/* The following are operations for nv_putsub() */
#define ARRAY_BITS 22
/* These are disciplines provided by the library for use with nv_discfun */
#define NV_DCADD 0 /* used to add named disciplines */
#if defined(__EXPORT__) && defined(_DLL)
# ifdef _BLD_shell
# else
# endif /* _BLD_shell */
#endif /* _DLL */
/* prototype for array interface*/
/* name-value pair function prototypes */
#ifdef _DLL
#define __MANGLE__ __LINKAGE__
#endif /* _DLL */
#if 0
/*
* The names of many functions were changed in early '95
* Here is a mapping to the old names
*/
#endif
#endif /* NV_DEFAULT */