home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************************
-
- Adhesive (C) 1994 George Taylor
- -------------------------------
-
- Title: adhesive.h
-
- Purpose: Access to shared objects
-
- Author: George Taylor
-
- Version: 1.00
-
- ***************************************************************************/
-
- #pragma include_only_once
-
- #ifndef __ADHESIVE
- #define __ADHESIVE
-
- #include "kernel.h" /* needed for _kernel_oserror */
-
-
-
-
-
-
- /* If you are using the 'o.Adhesive' file and CAHG then please skip to the
- end of this file for the procedures provided in 'o.Adhesive'.
- */
-
-
-
-
-
-
-
- typedef unsigned int Adhesive_ObjectNum; /* abstract object number */
- typedef unsigned int Adhesive_EntryNum; /* abstract entry point number */
-
-
- /* flags for an Adhesive_Object */
- /* none currently defined */
- typedef enum {
- Adhesive_Object_DUMMY = 0x0
- } Adhesive_ObjectFlags;
-
- /* header at the start of an object */
- typedef struct {
- unsigned int reloccode; /* B __RelocCode */
- unsigned int initcode; /* B initcode */
- unsigned int finalcode; /* B finalcode */
- Adhesive_ObjectFlags flags; /* misc flags */
- unsigned int reserved[4]; /* reserved entries, must all be 0 */
- unsigned int numbranches; /* number of branches in branch table */
- unsigned int numpairs; /* number of pairs to follow */
- /* Next in memory comes a list of pairs to specify ranges of entry points
- available. Each pair takes two integers.
- unsigned int [numpairs*2]
- */
-
- /* Following this there should be an array.
- unsigned int [num]
- This array should contain 'B procedure' for each entry point.
- */
- } Adhesive_Object;
-
-
-
- /* flags for an Adhesive_Request */
- /* none currently defined */
- typedef enum {
- Adhesive_Request_DUMMY = 0x0
- } Adhesive_RequestFlags;
-
- /* request for an object */
- typedef struct {
- Adhesive_ObjectNum object; /* object number requested, 0 to mark end */
- unsigned int min, /* minimum version */
- max; /* maximum version */
- Adhesive_RequestFlags flags; /* misc flags */
- unsigned int numbranches; /* number of branches in branch table */
- unsigned int numpairs; /* number of pairs to follow */
-
- /* Next in memory comes a list of pairs to specify ranges of entry points
- wanted. Each pair takes two integers.
- unsigned int [numpairs*2]
- */
-
- /* Following this there should be an array.
- unsigned int [X]
- where X depends on the pairs.
- The contents of this array are filled in with branch (B) instructions
- to the entry points of the requested object.
- */
- } Adhesive_Request;
-
-
-
-
-
-
-
-
-
-
-
-
-
- /* If you are using the supplied 'o.Adhesive' file and CAHG
- you will not need to bother with the details of what is above.
- */
-
-
- typedef unsigned int Adhesive_User; /* abstract user handle */
-
- /* Nice and simple interface to Adhesive SWI's. It does not do stack
- checking and does not refer to any external symbols.
- */
-
- /* flags for a user, none currently defined */
- typedef enum {
- Adhesive_UserFlags_DUMMY = 0x0
- } Adhesive_UserFlags;
-
-
- /* structure describing user */
- typedef struct {
- Adhesive_UserFlags flags; /* various flags, undefined bits must be 0 */
- char *name; /* ptr to a name (any length) describing who you are */
- } Adhesive_UserInfo;
-
-
- /* Procedure: adhesive_Register
- *
- * Description: Registers a new user with Adhesive if the passed pointer
- * points to NULL. Else does nothing.
- *
- * Parameters: Adhesive_User *user
- * Pointer to place to put handle, if *user is already
- * a non-zero value then no action is taken.
- * Adhesive_UserInfo *info
- * A description of who you are.
- *
- * Returns: _kernel_oserror *
- * NULL if no error or a pointer to a error block
- * if an error occurred.
- */
- _kernel_oserror *adhesive_Register(Adhesive_User *user,Adhesive_UserInfo *info);
-
-
- /* Procedure: adhesive_Deregister
- *
- * Description: Tell Adhesive you are no longer wanting previously
- * requested objects.
- *
- * Parameters: Adhesive_User *user
- * Pointer to handle, if *user is NULL no action is taken.
- *
- * Returns: _kernel_oserror *
- * Sets *user to 0 regardless of error status.
- *
- * Other Info: You should not use any objects requested using the handle
- * at *user after making this call even if this call returns
- * an error.
- */
- _kernel_oserror *adhesive_Deregister(Adhesive_User *user);
-
-
- /* Procedure: adhesive_Request
- *
- * Description: Request some objects.
- *
- * Parameters: Adhesive_User *user
- * Pointer to handle, if *user is NULL no action is taken.
- * Adhesive_Request *table
- * Request table.
- *
- * Returns: _kernel_oserror *
- *
- */
- _kernel_oserror *adhesive_Request(Adhesive_User *user,Adhesive_Request *table);
-
-
-
- #endif
-