/***********************************************************************
* *
* 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_PRIVATE
/*
* This is the implementation header file for name-value pairs
*/
#define _NV_PRIVATE \
char *nvenv; /* pointer to environment name */
#include <ast.h>
#include <cdt.h>
typedef int (*Nambfp_f)(int, char**, void*);
/* Nodes can have all kinds of values */
union Value
{
const char *cp;
int *ip;
char c;
int i;
unsigned int u;
int16_t s;
};
#include "nval.h"
/* used for arrays */
bound exceeded. Must be a power of 2 */
#if SHOPT_FIXEDARRAY
#endif /* SHOPT_FIXEDARRAY */
/* These flags are used as options to array_get() */
#define ARRAY_ASSIGN 0
struct Namref
{
char *sub;
#if SHOPT_FIXEDARRAY
int curi;
char dim;
#endif /* SHOPT_FIXEDARRAY */
};
/* This describes a user shell function node */
struct Ufunction
{
};
#ifndef ARG_RAW
struct argnod;
#endif /* !ARG_RAW */
/* attributes of Namval_t items */
/* The following attributes are for internal use */
#define NV_ATTRIBUTES (~(NV_NOSCOPE|NV_ARRAY|NV_NOARRAY|NV_IDENT|NV_ASSIGN|NV_REF|NV_VARNAME|NV_STATIC))
/* This following are for use with nodes which are not name-values */
* can modify enviornment */
/* NAMNOD MACROS */
/* ... for attributes */
/* The following are for name references */
#if SHOPT_FIXEDARRAY
#endif /* SHOPT_FIXEDARRAY */
/* ... etc */
#define nv_isnull(np) (!(np)->nvalue.cp && (nv_isattr(np,NV_SHORT|NV_INTEGER)!=(NV_SHORT|NV_INTEGER)) && !_nv_hasget(np))
/* ... for arrays */
extern int array_maxindex(Namval_t*);
extern char *nv_endsubscript(Namval_t*, char*, int);
extern int nv_atypeindex(Namval_t*, const char*);
extern int nv_setnotify(Namval_t*,char **);
extern int nv_unsetnotify(Namval_t*,char **);
extern void nv_optimize(Namval_t*);
extern void nv_outname(Sfio_t*,char*, int);
extern void *nv_diropen(Namval_t*, const char*);
extern char *nv_dirnext(void*);
extern void nv_dirclose(void*);
extern int nv_subsaved(Namval_t*);
extern void nv_newtype(Namval_t*);
extern int nv_istable(Namval_t*);
#if SHOPT_FIXEDARRAY
#endif /* SHOPT_FIXEDARRAY */
extern const Namdisc_t RESTRICTED_disc;
extern char nv_local;
extern const char *nv_discnames[];
extern const char e_subscript[];
extern const char e_nullset[];
extern const char e_notset[];
extern const char e_noparent[];
extern const char e_notelem[];
extern const char e_readonly[];
extern const char e_badfield[];
extern const char e_restricted[];
extern const char e_ident[];
extern const char e_varname[];
extern const char e_noalias[];
extern const char e_noarray[];
extern const char e_notenum[];
extern const char e_nounattr[];
extern const char e_aliname[];
extern const char e_badexport[];
extern const char e_badref[];
extern const char e_badsubscript[];
extern const char e_noref[];
extern const char e_selfref[];
extern const char e_staticfun[];
extern const char e_envmarker[];
extern const char e_badlocale[];
extern const char e_loop[];
extern const char e_redef[];
extern const char e_required[];
extern const char e_badappend[];
extern const char e_unknowntype[];
extern const char e_unknownmap[];
extern const char e_mapchararg[];
extern const char e_subcomvar[];
extern const char e_badtypedef[];
extern const char e_typecompat[];
extern const char e_globalref[];
extern const char e_tolower[];
extern const char e_toupper[];
#endif /* _NV_PRIVATE */