/*
    ####             #    #     # #
    #   #            #    #       #          The FreeWare C library for
    #   #  ##   ###  #  # #     # ###             RISC OS machines
    #   # #  # #     # #  #     # #  #   ___________________________________
    #   # ####  ###  ##   #     # #  #
    #   # #        # # #  #     # #  #    Please refer to the accompanying
    ####   ### ####  #  # ##### # ###    documentation for conditions of use
    ________________________________________________________________________

    File:    Module.h
    Author:  Copyright  1993 Jason Howat
    Version: 1.00 (23 Nov 1993)
    Purpose: Veneers for the OS_Module SWI.
*/

#ifndef __dl_module_h
#define __dl_module_h

#ifdef __cplusplus
extern "C" {
#endif

extern os_error *Module_Claim(unsigned size, void **block);
extern os_error *Module_Free(void *block);


/* The following was added for the DeskLib 2.30 [RM/32] release,
   and is NOT present in the original version of DeskLib 2.30. */

extern int  Module_Lookup(char *modname);
/* This, given a module name, returns the module number or '-1' if not found.
*/

extern int  Module_LookupAddress(char *modname);
/* This, given a module name, returns a pointer to the start of the module
   code, or '0' if not found.
*/

typedef struct
{
   int base;
   int length;
   int swichunk;    // zero if no SWIs
   int start;       // zero if no start code
   int initialise;  // zero if no initialise code
   int finalise;    // zero if no finalise code
   int servicecall; // zero if no service call code
   int title;       // pointer to string
   int help;        // pointer to string, zero if none
   int swihandler;  // zero if no SWI handler
   int switable;    // zero if no SWI table
} module_addresses;

extern int  Module_LookupAddresses(char *modname, struct *module_addresses);
/* This, given a module name, will complete the supplied struct block; and it
   will return 0 if failed, 1 if successful.
*/

#ifdef __cplusplus
}
#endif

#endif
