Appendix B. Typedefs and Macros

Constants:

#define FALSE 0

// RWBoolean value (defs.h)

#define TRUE 1

// RWBoolean value (defs.h)

#define rwnil 0

// nil pointer (defs.h)

#define RWTOOLS 0x700

// (The actual current version number) (tooldefs.h)

const RWoffset RWNIL = -1L;

// "no offset" in an RWFile (defs.h)

const size_t RW_NPOS = ~(size_t)0;

// "not found" as index into array (defs.h)

Typedefs:

typedef

unsigned short

RWClassID;

// (defs.h)

Unique for each class

typedef

int

RWBoolean;

// (defs.h)

TRUE or FALSE

typedef

unsigned char

RWByte;

// (defs.h)

Bitflag atomic

typedef

RWCollectable*

RWCollectableP

// (tooldefs.h)

Needed for tokenizing

typedef

unsigned short

RWErrNo

// (defs.h)

Used in error handler

typedef

long

RWoffset;

// (tooldefs.h)

Used for file offsets

typedef

unsigned long

RWspace;

// (tooldefs.h)

Used for file records

typedef

long

RWstoredValue;

// (tooldefs.h)

Used for file offsets

typedef

void*

RWvoid;

// (tooldefs.h)

For arrays of void*'s

Pointers to Functions:

typedef

void

(*RWapplyCollectable)

(RWCollectable*, void*);

typedef

void

(*RWapplyGeneric)

(void*, void*);

typedef

void

(*RWapplyKeyAndValue)

(RWCollectable*, RWCollectable*, void*);

typedef

void

(*RWauditFunction)

(unsigned char, void*);

typedef

void

(*RWdiskTreeApply)

(const char*, RWstoredValue, void*);

typedef

int

(*RWdiskTreeCompare)

(const char*, const char*, size_t);

typedef

RWBoolean

(*RWtestGeneric)

(const void*, const void*);

typedef

RWBoolean

(*RWtestCollectable)

(const RWCollectable*, const void*);

typedef

RWBoolean

(*RWtestCollectablePair)

(const RWCollectable*, constRWCollectable*,void*);

typedef

RWCollectable*

(*RWuserCreator)

();

Enumerations:

enum RWSeverity {RWWARNING, RWDEFAULT, RWFATAL}

The following modify the behavior of member functions or constructors for the classes involved. The value in bold font is the default.

RWCString::enum stripType

{leading,trailing,both}

// where to strip characters

RWCString::enum caseCompare

{exact, ignoreCase}

// ignore case during comparison

RWCString::enum scopeType

{one, all}

// replace how many substrings

RWBTreeOnDisk::enum styleMode

{V6Style, V5Style}

// file format

RWBTreeOnDisk::enum createMode

{autoCreate, create}

//(reuse,make new) btree in file

RWeostream::enum Endian

{ LittleEndian, BigEndian, HostEndian }

// constructor argument

RWLocale::enum CurrSymbol

{ NONE, LOCAL, INTL }

// used in "asString" methods

RWWString::enum stripType

{leading,trailing,both}

// where to strip characters

RWWString::enum caseCompare

{exact, ignoreCase}

// ignore case during comparison

RWWString::enum scopeType

{one, all}

// replace how many substrings

Tools.h++ Public Macros

These macros are defined to be used by programmers as part of the Tools.h++ API.

In file collect.h

// Macro bodies are removed. See RWcollectable in Class Reference 
//and User's Guide.
#define RWDECLARE_ABSTRACT_COLLECTABLE(className)
#define RWDEFINE_ABSTRACT_COLLECTABLE(className)
#define RWDECLARE_COLLECTABLE(className)
#define RWDEFINE_COLLECTABLE(className,id)
#define RWDEFINE_NAMED_COLLECTABLE(className,str)

In file defs.h

// Defined as shown when RWDEBUG is defined, otherwise defined to nothing.
#define RWPOSTCONDITION(a)    assert( (a) != 0 )
#define RWPRECONDITION2(a,b)  assert( (a) != 0 )
#define RWPOSTCONDITION2(a,b) assert( (a) != 0 )
#define RWPRECONDITION2(a,b)  assert((b, (a) !=0))
#define RWPOSTCONDITION2(a,b) assert((b, (a) !=0))
#define RWASSERT(a)           assert( (a) != 0 )

In file edefs.h

// Macro bodies removed. See section on persistence.
#define RWDECLARE_PERSISTABLE_IO(CLASS,ISTR,OSTR)
#define RWDECLARE_PERSISTABLE_TEMPLATE_IO(TEMPLATE, ISTR, OSTR)
#define RWDECLARE_PERSISTABLE_TEMPLATE_IO_2(TEMPLATE, ISTR, OSTR)
#define RWDECLARE_PERSISTABLE_TEMPLATE_IO_3(TEMPLATE, ISTR, OSTR)
#define RWDECLARE_PERSISTABLE_TEMPLATE_IO_4(TEMPLATE, ISTR, OSTR)
#define RWDECLARE_PERSISTABLE(CLASS)
#define RWDECLARE_PERSISTABLE_TEMPLATE(TEMPLATE)
#define RWDECLARE_PERSISTABLE_TEMPLATE_2(TEMPLATE)
#define RWDECLARE_PERSISTABLE_TEMPLATE_3(TEMPLATE)
#define RWDECLARE_PERSISTABLE_TEMPLATE_4(TEMPLATE)

In file epersist.h

// Macro bodies removed. See section on persistence.
#define RWDEFINE_PERSISTABLE_IO(CLASS,ISTR,OSTR)
#define RWDEFINE_PERSISTABLE_TEMPLATE_IO(TEMPLATE,ISTR,OSTR)
#define RWDEFINE_PERSISTABLE_TEMPLATE_IO_2(TEMPLATE,ISTR,OSTR
#define RWDEFINE_PERSISTABLE_TEMPLATE_IO_3(TEMPLATE,ISTR,OSTR)
#define RWDEFINE_PERSISTABLE_TEMPLATE_IO_4(TEMPLATE,ISTR,OSTR)
#define RWDEFINE_PERSISTABLE(CLASS)
#define RWDEFINE_PERSISTABLE_TEMPLATE(TEMPLATE)
#define RWDEFINE_PERSISTABLE_TEMPLATE_2(TEMPLATE)
#define RWDEFINE_PERSISTABLE_TEMPLATE_3(TEMPLATE)
#define RWDEFINE_PERSISTABLE_TEMPLATE_4(TEMPLATE)

In file strmshft.h

// Convenience macros.
#define RW_PROVIDE_DVSTREAM_INSERTER(DerivedOstream,vstreamable)
#define RW_PROVIDE_DVSTREAM_EXTRACTOR(DerivedIstream,vstreamable)

In files tphasht.h, tvhasht.h, tphdict.h, tvhdict.h, tphmmap.h, tvhmmap.h, tphset.h, tvhset.h

// Useful when writing code portable between "current" 
// and "ANSI-compliant" compilers
// See templates.
#define RWDefHArgs(T) ,RWTHasher<T>,equal_to<T>

In files tpsrtvec.h, tvsrtvec.h

// Useful when writing code portable between "current" 
// and "ANSI-compliant" compilers
// See templates.
#define RWDefCArgs(T) ,less<T>

Standard Smalltalk Interface

(activated by defining RW_STD_TYPEDEFS):

typedef     RWBag                         Bag;
typedef     RWBagIterator                 BagIterator;
typedef     RWBinaryTree                  SortedCollection;
typedef     RWBinaryTreeIterator          SortedCollectionIterator;
typedef     RWBitVec                      BitVec
typedef     RWCollectable                 Object;    // All-too-common type!
typedef     RWCollectableDate             Date;
typedef     RWCollectableInt              Integer;
typedef     RWCollectableString           String;
typedef     RWCollectableTime             Time;
typedef     RWCollection                  Collection;
typedef     RWHashDictionary              Dictionary;
typedef     RWHashDictionaryIterator      DictionaryIterator;
typedef     RWIdentityDictionary          IdentityDictionary;
typedef     RWIdentitySet                 IdentitySet;
typedef     RWOrdered                     OrderedCollection;
typedef     RWOrderedIterator             OrderedCollectionIterator;
typedef     RWSequenceable                SequenceableCollection;
typedef     RWSet                         Set;
typedef     RWSetIterator                 SetIterator;
typedef     RWSlistCollectables           LinkedList;
typedef     RWSlistCollectablesIterator   LinkedListIterator;
typedef     RWSlistCollectablesQueue      Queue;
typedef     RWSlistCollectablesStack      Stack;