 
#ifndef stringtbl_DEFINED
#define stringtbl_DEFINED 1
 
#ifndef class_DEFINED
#include <class.h>
#endif /* class_DEFINED */
/* 
 * This file was generated by the Andrew class system preprocessor.
 * Don't make changes to this file as it is created from strtbl.ch and will be
 * overwritten.  Make changes to strtbl.ch instead.
 */ 
 
#ifndef class_StaticInfoOnly
/* 
 * The following information was copied, as-is, from strtbl.ch.
 */ 
 
/* ********************************************************************** *\
 *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
 *        For full copyright information see:'andrew/config/COPYRITE'     *
\* ********************************************************************** */

/*
	$Disclaimer: 
*Permission to use, copy, modify, and distribute this software and its 
*documentation for any purpose is hereby granted without fee, 
*provided that the above copyright notice appear in all copies and that 
*both that copyright notice, this permission notice, and the following 
*disclaimer appear in supporting documentation, and that the names of 
*IBM, Carnegie Mellon University, and other copyright holders, not be 
*used in advertising or publicity pertaining to distribution of the software 
*without specific, written prior permission.
*
*IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 
*DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
*ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 
*SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 
*BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 
*DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
*WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
*ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
*OF THIS SOFTWARE.
* $
*/


 

/*
stringtbl.H

String table data object

	This module supports storage for a set of string values.  (At most 32 strings)
	A bit vector associated with the set specifies which are "selected" (0, 1, or many)
	Strings are checked for backslash and brackets and they are deleted.
	Strings are truncated to 255 character.
	All operations are case sensitive.
	(AddString checks for length and backslash, but the others do not.  Thus
		a string may be added and then not found.)

	An "accession number" is associated with each string.  This will be a small integer;
	counting restarts each time the table is cleared.  The functions with OfEntry in their
	names have the accession number as argument.

	The character string arguments to the functions are tested for NULL or '\0' and
	ignored if so.   In this case, AddString returns 0;  it also returns zero if the table is full.

*/

#define  stringtbl_PROGRAMMERVERSION    1

/* XXX ??? I think there is as yet no way to say I want these only in .eh */
#define MAXSTRINGSINTABLE 32
#define MAXSTRINGENTRYLENGTH 255

#define stringtbl_STRINGSCHANGED 1
#define stringtbl_BITSCHANGED 2







/* 
 * End of information copied from strtbl.ch.
 */ 
 
#endif /* class_StaticInfoOnly *//* 
 * Include the superclass information
 */ 
#define dontDefineRoutinesFor_dataobject
#include "dataobj.ih"
#undef dontDefineRoutinesFor_dataobject

 
 
#ifndef class_StaticInfoOnly
/* 
 * Data structure for stringtbl 
 */ 
struct stringtbl { 
    union {
	struct basicobject_methods *stringtbl_methods;
	struct traced traced;
	struct observable observable;
	struct dataobject dataobject;
    } header;

	char *(item[MAXSTRINGSINTABLE]);	/* pointers to the strings */
	unsigned long highlight;		/* the bits.  bit (1<<i) is for item[i] */
	short used;		/* the first -used- of the elements in -item- have values */
	short numacc;		/* number of accessions */
	short accmap[32];	/* the accession number for each entry */
	boolean ContainsInitialStrings;	/* TRUE until client first changes table */

};

 
/* 
 * End of data structure for stringtbl.
 */ 
 

#endif /* class_StaticInfoOnly */

#ifndef class_StaticInfoOnly

#ifndef stringtbl_PROGRAMMERVERSION
#define stringtbl_PROGRAMMERVERSION 1
#endif /* stringtbl_PROGRAMMERVERSION */

#ifdef stringtbl_VERSION
#undef stringtbl_VERSION
#endif /* stringtbl_VERSION */
#define stringtbl_VERSION ((((stringtbl_PROGRAMMERVERSION << 16) ^ (34 << 8) ^ sizeof(struct stringtbl)) & 0x7ffff) + 0x80000 + (1 << 20))


#endif /* class_StaticInfoOnly */
#define stringtbl_StaticLoadOnlyThisClass()  \
{ extern struct classinfo *stringtbl__GetClassInfo(); \
 extern struct classheader *strtbl_classheader_StaticExport; \
  (void) class_EnterInfo(NULL, strtbl_classheader_StaticExport->name, stringtbl__GetClassInfo, NULL, strtbl_classheader_StaticExport->namekey); } 
 
#define stringtbl_StaticLoad()  \
    { \
    dataobject_StaticLoad(); \
    stringtbl_StaticLoadOnlyThisClass();  \
    } 
 
#define stringtbl_StaticEntry  {stringtbl_StaticLoad()} 
 
#define strtbl_StaticEntry  {stringtbl_StaticLoad()} 
 
#ifndef class_StaticInfoOnly
static struct classheader stringtbl_classheader = {
    stringtbl_VERSION,
    "stringtbl",
    "strtbl",
    (struct basicobject_methods *) &class_RoutineStruct,
};

#define stringtbl_CLASSPROCEDURES (stringtbl_classheader.classprocedures)
int strtbl_classref_;
#endif /* class_StaticInfoOnly */

#endif /* stringtbl_DEFINED */

#if !defined(stringtbl_ROUTINESDEFINED) && !defined(dontDefineRoutinesFor_stringtbl) && !defined(class_StaticEntriesOnly)
#define stringtbl_ROUTINESDEFINED

#define stringtbl_Reference(self) \
 (((&(self)->header.traced))->refcount++)
#define stringtbl_UnReference(self) \
 ((((&(self)->header.traced))->refcount>0)?((&(self)->header.traced))->refcount--:0)
#define stringtbl_ReferenceCount(self) \
 (((&(self)->header.traced))->refcount)
#define stringtbl_AddObserver(self,observer) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[0]))) (self,observer))
#define stringtbl_IsObserver(self,observer) \
    ((* ((boolean (*)())((self)->header.stringtbl_methods->routines[1]))) (self,observer))
#define stringtbl_RemoveObserver(self,observer) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[2]))) (self,observer))
#define stringtbl_NotifyObservers(self,value) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[3]))) (self,value))
#define stringtbl_ObservedChanged(self,changed,value) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[4]))) (self,changed,value))
#define stringtbl_AddRecipient(self,trigger,rcvr,func,rock) \
    ((* ((boolean (*)())((self)->header.stringtbl_methods->routines[5]))) (self,trigger,rcvr,func,rock))
#define stringtbl_DeleteRecipient(self,trigger,rcvr) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[6]))) (self,trigger,rcvr))
#define stringtbl_PullTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[7]))) (self,trigger))
#define stringtbl_DisableTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[8]))) (self,trigger))
#define stringtbl_EnableTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[9]))) (self,trigger))
#define stringtbl_DisableCount(self,trigger) \
    ((* ((long (*)())((self)->header.stringtbl_methods->routines[10]))) (self,trigger))
#define stringtbl_Read(self,file,id) \
    ((* ((long (*)())((self)->header.stringtbl_methods->routines[11]))) (self,file,id))
#define stringtbl_Write(self,file,writeid,level) \
    ((* ((long (*)())((self)->header.stringtbl_methods->routines[12]))) (self,file,writeid,level))
#define stringtbl_ReadOtherFormat(self,file,fmt,encoding,description) \
    ((* ((boolean (*)())((self)->header.stringtbl_methods->routines[13]))) (self,file,fmt,encoding,description))
#define stringtbl_WriteOtherFormat(self,file,writeid,level,usagetype,boundary) \
    ((* ((long (*)())((self)->header.stringtbl_methods->routines[14]))) (self,file,writeid,level,usagetype,boundary))
#define stringtbl_GetModified(self) \
    ((* ((long (*)())((self)->header.stringtbl_methods->routines[15]))) (self))
#define stringtbl_SetModified(self) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[16]))) (self))
#define stringtbl_ViewName(self) \
    ((* ((char * (*)())((self)->header.stringtbl_methods->routines[17]))) (self))
#define stringtbl_SetAttributes(self,attributes) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[18]))) (self,attributes))
#define stringtbl_Put(self,property,type,rock) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[19]))) (self,property,type,rock))
#define stringtbl_Get(self,property,type,rock) \
    ((* ((short (*)())((self)->header.stringtbl_methods->routines[20]))) (self,property,type,rock))
#define stringtbl_ListCurrentViews(self,array,size) \
    ((* ((int (*)())((self)->header.stringtbl_methods->routines[21]))) (self,array,size))
#define stringtbl_RestoreModified(self,oldmodified) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[22]))) (self,oldmodified))
#define stringtbl_UniqueID(self) \
 ((long)((&(self)->header.dataobject)))
#define stringtbl_GetWriteID(self) \
 ( ((&(self)->header.dataobject))->writeID )
#define stringtbl_SetWriteID(self,newValue) \
 ( (((&(self)->header.dataobject))->writeID) = (newValue) )
#define stringtbl_GetID(self) \
      ( ((&(self)->header.dataobject))->id )
#define stringtbl_SetID(self,newValue) \
      ( (((&(self)->header.dataobject))->id) = (newValue) )
#define stringtbl_Clear(self) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[23]))) (self))
#define stringtbl_AddString(self,s) \
    ((* ((short (*)())((self)->header.stringtbl_methods->routines[24]))) (self,s))
#define stringtbl_RemoveString(self,s) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[25]))) (self,s))
#define stringtbl_SetBit(self,s,val) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[26]))) (self,s,val))
#define stringtbl_GetBit(self,s) \
    ((* ((boolean (*)())((self)->header.stringtbl_methods->routines[27]))) (self,s))
#define stringtbl_ClearBits(self) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[28]))) (self))
#define stringtbl_RemoveEntry(self,accnum) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[29]))) (self,accnum))
#define stringtbl_SetBitOfEntry(self,accnum,val) \
    ((* ((void (*)())((self)->header.stringtbl_methods->routines[30]))) (self,accnum,val))
#define stringtbl_GetBitOfEntry(self,accnum) \
    ((* ((boolean (*)())((self)->header.stringtbl_methods->routines[31]))) (self,accnum))
#define stringtbl_GetStringOfEntry(self,accnum) \
    ((* ((char * (*)())((self)->header.stringtbl_methods->routines[32]))) (self,accnum))
#define stringtbl_GetEntryOfString(self,string,startIndex) \
    ((* ((short (*)())((self)->header.stringtbl_methods->routines[33]))) (self,string,startIndex))
#define stringtbl_NStrings(self) \
 ((short)((self)->used + 0))
#define stringtbl_IthString(self,i) \
  ((char *)((self)->item[i] + 0))
#define stringtbl_NumAcc(self) \
 ((short)((self)->numacc+0))

#define stringtbl_NewFromObject(self) \
    ((* ((struct stringtbl * (*)())((self)->header.stringtbl_methods->info->procs->routines[0]))) (&stringtbl_classheader, (self)->header.stringtbl_methods->info->versionnumber))
#define stringtbl_New() \
    (*((struct stringtbl * (*)()) (stringtbl_CLASSPROCEDURES->routines[0])))(&stringtbl_classheader,stringtbl_VERSION)
#define stringtbl_Initialize(self) \
    (*((void (*)()) (stringtbl_CLASSPROCEDURES->routines[2])))(&stringtbl_classheader,self, stringtbl_VERSION)

#define stringtbl_Destroy(self) \
    ((* ((void (*)()) ((self)->header.stringtbl_methods->info->procs->routines[1]))) (&stringtbl_classheader, self))
#define stringtbl_Finalize(self) \
    (*((void (*)()) (stringtbl_CLASSPROCEDURES->routines[3])))(&stringtbl_classheader,self)

#define stringtbl_InitializeObject(self) \
    (*((boolean (*)()) (stringtbl_CLASSPROCEDURES->routines[5])))(&stringtbl_classheader,self)
#define stringtbl_FinalizeObject(self) \
    (*((void (*)()) (stringtbl_CLASSPROCEDURES->routines[6])))(&stringtbl_classheader,self)


#endif /* !defined(stringtbl_ROUTINESDEFINED) && !defined(dontDefineRoutinesFor_stringtbl ) && !defined(class_StaticEntriesOnly)*/

