home *** CD-ROM | disk | FTP | other *** search
- /*
- * public.c - Public functions for skeleton class
- *
- * Public Domain
- *
- * Christian E. Hopps.
- *
- */
-
- #include <skeleton_internal.h>
- #include <skeleton.h>
- #include <proto/intuition.h>
-
- /* set this to true if you have registered your class with CATS */
- /* #define SKELETON_PUBLIC */
-
- /* if your class is public (registered with CATS) this would be a */
- /* null-terminated string to identify your class. ie."imageclass" */
- #define SKELETON_ID (NULL)
-
- /* this needs to be a null-terminated string that identfies your */
- /* public superclass, other wise you need to pass a pointer to */
- /* class when you call make class. */
- #define SUPERCLASS_ID ("rootclass")
-
- /* this would be equal to the size of your instance data that the */
- /* "rootclass" should allocate for you. */
- #define SKELETON_INSTANCE_SIZE (0L)
-
- #define SKELETON_FLAGS (0L)
-
-
- Class * Skeleton_init( void )
- {
- Class *class;
-
- class = MakeClass( SKELETON_ID, /* your ID */
- SUPERCLASS_ID, /* superclass string id. */
- NULL, /* superclass ptr if not public */
- SKELETON_INSTANCE_SIZE, /* size of instance data */
- SKELETON_FLAGS ); /* flags (0L for now.) */
-
- if(class == NULL) {
- return(NULL);
- }
- /*
- * set up a pointer to the dispatcher function, if we had not used
- * SAS/C __asm calling conventions with the dispatcher fucntion,
- * we would have put an asembler stub routine in, that would then call
- * the h_SubEntry.
- */
- class->cl_Dispatcher.h_Entry = Skeleton_dispatch;
-
- #ifdef SKELETON_PUBLIC
- AddClass(class);
- #endif
-
- return(class);
- }
-
-
- ULONG Skeleton_free( Class *class )
- {
-
- #ifdef SKELETON_PUBLIC
- RemoveClass(class);
- #endif
-
- return((ULONG) FreeClass(class) );
- }
-