/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1982-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 *
* *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
#ifndef NV_DEFAULT
/*
* 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 */
/*
* This defines the template for nodes that have their own assignment
* and or lookup functions
*/
struct Namdisc
{
};
struct Namfun
{
char nofree;
unsigned char subshell;
char *last;
};
struct Nambfun
{
int num;
const char **bnames;
};
/* This is an array template header */
struct Namarray
{
};
/* The context pointer for declaration command */
struct Namdecl
{
const char *optstring;
void *optinfof;
};
/* attributes of name-value node attribute flags */
#define NV_DEFAULT 0
/* This defines the attributes for an attributed name-value pair node */
struct Namval
{
#if _ast_sizeof_pointer == 8
# if _ast_intswap > 0
unsigned short pad1;
# else
unsigned short pad1;
# endif
#else
#endif
#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 */
/* add node if not found */
/* numeric types */
/* name-value pair macros */
/* The following are operations for associative arrays */
/* The following are for nv_disc */
/* The following are operations for nv_putsub() */
/* These are disciplines provided by the library for use with nv_discfun */
#if defined(__EXPORT__) && defined(_DLL)
# ifdef _BLD_shell
# define extern __EXPORT__
# else
# define extern __IMPORT__
# endif /* _BLD_shell */
#endif /* _DLL */
/* prototype for array interface*/
extern int nv_arraynsub(Namarr_t*);
extern void *nv_associative(Namval_t*,const char*,int);
extern int nv_nextsub(Namval_t*);
/* name-value pair function prototypes */
extern void *nv_context(Namval_t*);
extern Namval_t *nv_lastdict(void);
extern void nv_newattr(Namval_t*,unsigned,int);
extern void nv_newtype(Namval_t*);
extern void nv_setvtree(Namval_t*);
extern int nv_setsize(Namval_t*,int);
extern const Namdisc_t *nv_discfun(int);
#ifdef _DLL
# undef extern
#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 */