Documentation Set for Swarm 2.2
Prev | Reference I. Defobj Library | Next

# General

## Name

defobj -- Standard objects for GNU Objective C extensions

## Description

The defobj library supports the style of object-oriented programming that is used throughout Swarm. It defines a specific style for using the Objective C language that includes its own standard conventions for creating objects and for storage allocation, error handling, and debugging support.

## Macros

- `DSIZE(type)`

  Conservative approximation of the number of decimal digits for a object of a given type, not including terminator. signchar + roundup (log (10)/log(2) = 3.3219).

- FCALL_TYPE_COUNT

- `FREEBLOCK(block)`

- `GSTRDUP(str)`

- `M(messageName)`

  Abbreviation for @selector().

- MAKE_CLASS_FUNCTION_NAME

  Name to use for Lisp archiving class-creation function

- MAKE_INSTANCE_FUNCTION_NAME

  Name to use for Lisp archiving object-creation function

- `OFREEBLOCK(obj, block)`

- `OSTRDUP(obj, str)`

- PARSE_FUNCTION_NAME

  Name to use for Lisp archive custom-parse function

- `SFREEBLOCK(block)`

- `SSTRDUP(str)`

- `STRDUP(str)`

- `ZFREEBLOCK(aZone, block)`

- `ZSTRDUP(aZone, str)`

- __swarm_defobj_h

- globalZone

  A zone for allocating global objects.

- `initModule(module)`

  module initialization macro

- scratchZone

  A zone for allocating temporary objects.

## Functions

- `void _obj_formatIDString(char *buffer, id anObject)`

  Function to generate object id string in standard format (Up to 78 characters of the supplied buffer argument could be filled.)

- `void _obj_initModule(void *module)`

  internal module initialization function

- `id defobj_lookup_type(const char *name)`

  Lookup a defobj type object by name.

- `void initDefobj(id <Arguments> arguments)`

- `id nameToObject(const char *name)`

  Get an object from textual pointer description.

- `Class objc_get_class(const char *name)`

  Declaration to enable use of @class declaration for message receiver without compile error.

- `void xexec(id anObject, const char *name)`

  Debug function to perform message on an object.

- `void xfexec(id anObject, const char *name)`

  Debug function to perform message on each member of a collection.

- `void xfprint(id anObject)`

  Print description for each member of a collection on debug output stream.

- `void xfprintid(id anObject)`

  Print id for each member of a collection on debug output stream.

- `void xprint(id anObject)`

  Print description of object on debug output stream.

- `void xprintid(id anObject)`

  Print only the id string for an object on debug output stream.

- `void xsetname(id anObject, const char *name)`

  Set the display name.

- `char *zstrdup(id <Zone> aZone, const char *str)`

## Typedefs

- COMOBJECT

      void *

- JOBJECT

      void *

- call_t

      enum callTypes { ccall, COMcall, JScall, javacall, javastaticcall,  objccall }

- fcall_type_t

      enum {fcall_type_void = 0,
                    fcall_type_boolean,
                    fcall_type_uchar, fcall_type_schar,
                    fcall_type_ushort, fcall_type_sshort,
                    fcall_type_uint, fcall_type_sint,
                    fcall_type_ulong, fcall_type_slong,
                    fcall_type_ulonglong, fcall_type_slonglong,
                    fcall_type_float, fcall_type_double, fcall_type_long_double,
                    fcall_type_object, fcall_type_class,
                    fcall_type_string, fcall_type_selector,
                    fcall_type_jobject, fcall_type_jstring, fcall_type_jselector,
                    fcall_type_iid
                    }

- types_t

      union {
        id object;
        SEL selector;
        Class _class;
        const char *string;
        BOOL boolean;
        char schar;
        unsigned char uchar;
        short sshort;
        unsigned short ushort;
        int sint;
        unsigned int uint;
        long slong;
        unsigned long ulong;
        long long slonglong;
        unsigned long long ulonglong;
        float _float;
        double _double;
        long double _long_double;
        void *iid;
      }

- val_t

      struct {
        fcall_type_t type;
        types_t val;
      }

## Globals

id <Arguments> arguments

  The singleton Arguments object.

id <HDF5Archiver> hdf5Archiver

  The singleton HDF5 system Archiver object.

id <LispArchiver> lispArchiver

  The singleton Lisp system Archiver object.

id <HDF5Archiver> hdf5AppArchiver

  The singleton HDF5 application Archiver object.

id <LispArchiver> lispAppArchiver

  The singleton Lisp application Archiver object.

id <Symbol> t_ByteArray

  Predefined type descriptors for allocated blocks.

id <Symbol> t_LeafObject

  Predefined type descriptors for allocated blocks.

id <Symbol> t_PopulationObject

  Predefined type descriptors for allocated blocks.

id <Symbol> LanguageCOM

  Language tags (e.g. for use in FArguments)

id <Symbol> LanguageJS

  Language tags (e.g. for use in FArguments)

id <Symbol> LanguageJava

  Language tags (e.g. for use in FArguments)

id <Symbol> LanguageObjc

  Language tags (e.g. for use in FArguments)

id _obj_globalZone

  internal variable for globalZone macro

id _obj_scratchZone

  internal variable for scratchZone macro

BOOL _obj_debug

  if true then perform all debug error checking

FILE * _obj_xerror

  output file for error messages

FILE * _obj_xdebug

  output file for debugging messages

Prev | Home | Next
Zone | Up | Collections Library