home *** CD-ROM | disk | FTP | other *** search
- #ifndef sharedclibrary_H
- #define sharedclibrary_H
-
- /* C header file for SharedCLibrary
- * written by DefMod (Sep 16 1994) on Thu Sep 22 16:41:11 1994
- * Copyright © Acorn Computers Ltd, 1994
- */
-
- /*************************************************************************
- * This source file was written by Acorn Computers Limited. It is part *
- * of the OSLib library for writing applications for RISC OS. It may be *
- * used freely in the creation of programs for RISC OS. *
- *************************************************************************/
-
- #ifndef types_H
- #include "types.h"
- #endif
-
- #ifndef os_H
- #include "os.h"
- #endif
-
- /**********************************
- * SWI names and SWI reason codes *
- **********************************/
- #undef SharedCLibrary_LibInitAPCS_A
- #define SharedCLibrary_LibInitAPCS_A 0x80680
- #undef XSharedCLibrary_LibInitAPCS_A
- #define XSharedCLibrary_LibInitAPCS_A 0xA0680
- #undef SharedCLibrary_LibInitAPCS_R
- #define SharedCLibrary_LibInitAPCS_R 0x80681
- #undef XSharedCLibrary_LibInitAPCS_R
- #define XSharedCLibrary_LibInitAPCS_R 0xA0681
- #undef SharedCLibrary_LibInitModule
- #define SharedCLibrary_LibInitModule 0x80682
- #undef XSharedCLibrary_LibInitModule
- #define XSharedCLibrary_LibInitModule 0xA0682
-
- /************************************
- * Structure and union declarations *
- ************************************/
- typedef struct sharedclibrary_stub sharedclibrary_stub;
- typedef struct sharedclibrary_stub_list sharedclibrary_stub_list;
-
- /********************
- * Type definitions *
- ********************/
- struct sharedclibrary_stub
- { int chunk_id;
- byte **entry_vector;
- byte **entry_vector_limit;
- byte *static_data;
- byte *static_data_limit;
- };
-
- struct sharedclibrary_stub_list
- { sharedclibrary_stub stub [UNKNOWN];
- };
-
- #define sharedclibrary_STUB_LIST(N) \
- struct \
- { sharedclibrary_stub stub [N]; \
- }
-
- #define sharedclibrary_SIZEOF_STUB_LIST(N) \
- ((N)*sizeof ((sharedclibrary_stub_list *) NULL)->stub)
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*************************************************************
- * NOTE: The following functions provide direct access to *
- * the SWI's noted in the function description. *
- * Please read the relevant PRM section for more *
- * information on their input/output parameters. *
- *************************************************************/
-
- /* ------------------------------------------------------------------------
- * Function: sharedclibrary_lib_init_apcs_r()
- *
- * Description: Interfaces an application with the Shared C Library
- *
- * Input: stub_list - value of R0 on entry
- * workspace - value of R1 on entry
- * workspace_limit - value of R2 on entry
- * flags - value of R6 on entry
- *
- * Output: stack - value of R1 on exit
- * stack_limit - value of R2 on exit
- * version - value of R6 on exit
- *
- * Other notes: Calls SWI 0x80681 with R3 = 0xFFFFFFFF, R4 = 0x0, R5 = 0xFFFFFFFF.
- */
-
- extern os_error *xsharedclibrary_lib_init_apcs_r (sharedclibrary_stub_list *stub_list,
- void *workspace,
- void *workspace_limit,
- bits flags,
- byte **stack,
- byte **stack_limit,
- int *version);
- extern void sharedclibrary_lib_init_apcs_r (sharedclibrary_stub_list *stub_list,
- void *workspace,
- void *workspace_limit,
- bits flags,
- byte **stack,
- byte **stack_limit,
- int *version);
-
- /* ------------------------------------------------------------------------
- * Function: sharedclibrary_lib_init_module()
- *
- * Description: Interfaces a module with the Shared C Library
- *
- * Input: stub_list - value of R0 on entry
- * workspace - value of R1 on entry
- * workspace_limit - value of R2 on entry
- * clear - value of R3 on entry
- * static_data - value of R4 on entry
- * static_data_limit - value of R5 on entry
- * flags - value of R6 on entry
- *
- * Output: stack - value of R1 on exit
- * stack_limit - value of R2 on exit
- * version - value of R6 on exit
- *
- * Other notes: Calls SWI 0x80682.
- */
-
- extern os_error *xsharedclibrary_lib_init_module (sharedclibrary_stub_list *stub_list,
- void *workspace,
- void *workspace_limit,
- byte *clear,
- byte *static_data,
- byte *static_data_limit,
- bits flags,
- byte **stack,
- byte **stack_limit,
- int *version);
- extern void sharedclibrary_lib_init_module (sharedclibrary_stub_list *stub_list,
- void *workspace,
- void *workspace_limit,
- byte *clear,
- byte *static_data,
- byte *static_data_limit,
- bits flags,
- byte **stack,
- byte **stack_limit,
- int *version);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-