/*
 * $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 */

#ident	"$Header: symbols.h 1.1 89/10/25 $"

typedef void * opaque_ptr;		/* opaque data ptr type */

/*
 *  Create a new symbol table.
 */
extern opaque_ptr
create_symtab(
	/* unsigned hashsize;		-- #of hash entries for symbol table */
);

/*
 *  Search for the given symbol in the symbol table.
 *  Returns:
 *	A pointer to the data associated with the symbol, if the symbol is
 *	found.  Otherwise NULL is returned.
 */
extern opaque_ptr
search_symtab(
	/* opaque_ptr sym_tablep;	-- ptr to symbol table */
	/* char *sym_namep;		-- ptr to symbol name */
);

/*
 *  Search for the given symbol in the symbol table.
 *  Returns:
 *	A pointer to the data associated with the symbol, if the symbol is
 *	found.  Otherwise NULL is returned.
 */
extern opaque_ptr
search_symtab3(
	/* opaque_ptr sym_tablep;	-- ptr to symbol table */
	/* char *sym_namep;		-- ptr to symbol name */
	/* opaque_ptr symbolp;		-- ptr to where to return symbol ptr */
);

/*
 *  Insert the named symbol in the given symbol table.
 *  Returns:
 *	NULL is returned if the symbol was not previously present in the
 *	given symbol table (and the insertion was therefore successful).
 *	Otherwise, a pointer to the data associated with the symbol (that
 *	already existed in the symbol table) is returned.
 */
extern opaque_ptr
insert_symtab(
	/* opaque_ptr sym_tablep;	-- ptr to symbol table */
	/* char *sym_namep;		-- ptr to symbol name */
	/* opaque_ptr sym_datap;	-- ptr to data to be assoc. w/symbol */
);

/*
 *  Get the first symbol to be inserted into the given symbol table.
 *  Returns:
 *	An opaque pointer to the first symbol in the symbol table (if at least
 *	one symbol exists in the symbol table).  If successful, *sym_namepp
 *	is updated to point to the name of the symbol, and *sym_datapp is
 *	updated as an opaque pointer to the data associated with the symbol.
 *
 *	Otherwise, NULL is returned.
 */
extern opaque_ptr
first_symtab(
	/* opaque_ptr sym_tablep;	-- ptr to symbol table */
	/* char *sym_namepp;		-- ptr to where to return symbol name */
	/* opaque_ptr sym_datapp;	-- ptr to where to return assoc. data */
);

/*
 *  Get the last symbol to be inserted into the given symbol table.
 *  Returns:
 *	An opaque pointer to the last symbol in the symbol table (if at least
 *	one symbol exists in the symbol table).  If successful, *sym_namepp
 *	is updated to point to the name of the symbol, and *sym_datapp is
 *	updated as an opaque pointer to the data associated with the symbol.
 *
 *	Otherwise, NULL is returned.
 */
extern opaque_ptr
last_symtab(
	/* opaque_ptr sym_tablep;	-- ptr to symbol table */
	/* char *sym_namepp;		-- ptr to where to return symbol name */
	/* opaque_ptr sym_datapp;	-- ptr to where to return assoc. data */
);

/*
 *  Get the next symbol temporally created before the given symbol.
 *  Returns:
 *	An opaque pointer to the next symbol temporally created before the
 *	given current symbol (if there is one).  If successful, *sym_namepp
 *	is updated to point to the name of the next symbol, and *sym_datapp
 *	is updated as an opaque pointer to the data associated with the next
 *	symbol.
 *
 *	Otherwise, NULL is returned.
 */
extern opaque_ptr
prev_symtab(
	/* opaque_ptr symbolp;		-- ptr to current symbol */
	/* char **sym_namepp;		-- ptr to where to return symbol name */
	/* opaque_ptr *sym_datapp;	-- ptr to where to return assoc. data */
);

/*
 *  Get the next symbol temporally created after the given symbol.
 *  Returns:
 *	An opaque pointer to the next symbol temporally created after the
 *	given current symbol (if there is one).  If successful, *sym_namepp
 *	is updated to point to the name of the next symbol, and *sym_datapp
 *	is updated as an opaque pointer to the data associated with the next
 *	symbol.
 *
 *	Otherwise, NULL is returned.
 */
extern opaque_ptr
next_symtab(
	/* opaque_ptr symbolp;		-- ptr to current symbol */
	/* char **sym_namepp;		-- ptr to where to return symbol name */
	/* opaque_ptr *sym_datapp;	-- ptr to where to return assoc. data */
);

/*
 *  Make the symbol 'tomovep' appear to have been temporally created
 *  just before the symbol 'symbolp' in the given symbol table.
 */
extern void
before_symtab(
	/* opaque_ptr sym_tablep;	-- ptr to symbol table */
	/* opaque_ptr symbolp;		-- ptr to current symbol */
	/* opaque_ptr tomovep;		-- ptr to symbol to be moved */
);
