home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_11_07
/
1107070a
< prev
next >
Wrap
Text File
|
1993-05-09
|
1KB
|
60 lines
/******** OBJECTS.C Copyright 1992 Gregory Colvin *********
This program may be distributed free with this notice.
***********************************************************/
#include <assert.h>
#include <string.h>
#include "objects.h"
#ifndef __cplusplus /* Not C++, assume C */
/* Object Stack: */
static Object *ObjectStack[MAX_PUSH];
Object * near *pThis = ObjectStack + MAX_PUSH;
/* Object Class definition: */
void Object_destroy(void)
{
GET_THIS_SAFE(Object);
}
int Object_isA(const char *className)
{ int result = !strcmp("Object",className);
return result;
}
void Object_construct(void)
{
}
void Object_destruct(void)
{
}
ObjectMethods ObjectTable;
void ObjectInitClass(void)
{
if (ObjectTable.initialized)
return;
ObjectTable.name = "Object";
ObjectTable.initialized = 1;
DEF_METHOD(Object,destroy);
DEF_METHOD(Object,isA);
}
#else /* C++ */
const char *Object::classname()
{ return "Object";
}
int Object::isA(const char *className)
{ return !strcmp("Object",className);
}
#endif /* C vs. C++ */