home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / oslib / h / sharedclib < prev    next >
Encoding:
Text File  |  1994-09-22  |  5.0 KB  |  161 lines

  1. #ifndef sharedclibrary_H
  2. #define sharedclibrary_H
  3.  
  4. /* C header file for SharedCLibrary
  5.  * written by DefMod (Sep 16 1994) on Thu Sep 22 16:41:11 1994
  6.  * Copyright © Acorn Computers Ltd, 1994
  7.  */
  8.  
  9. /*************************************************************************
  10.  * This source file was written by Acorn Computers Limited. It is part   *
  11.  * of the OSLib library for writing applications for RISC OS. It may be  *
  12.  * used freely in the creation of programs for RISC OS.                  *
  13.  *************************************************************************/
  14.  
  15. #ifndef types_H
  16.    #include "types.h"
  17. #endif
  18.  
  19. #ifndef os_H
  20.    #include "os.h"
  21. #endif
  22.  
  23. /**********************************
  24.  * SWI names and SWI reason codes *
  25.  **********************************/
  26. #undef  SharedCLibrary_LibInitAPCS_A
  27. #define SharedCLibrary_LibInitAPCS_A            0x80680
  28. #undef  XSharedCLibrary_LibInitAPCS_A
  29. #define XSharedCLibrary_LibInitAPCS_A           0xA0680
  30. #undef  SharedCLibrary_LibInitAPCS_R
  31. #define SharedCLibrary_LibInitAPCS_R            0x80681
  32. #undef  XSharedCLibrary_LibInitAPCS_R
  33. #define XSharedCLibrary_LibInitAPCS_R           0xA0681
  34. #undef  SharedCLibrary_LibInitModule
  35. #define SharedCLibrary_LibInitModule            0x80682
  36. #undef  XSharedCLibrary_LibInitModule
  37. #define XSharedCLibrary_LibInitModule           0xA0682
  38.  
  39. /************************************
  40.  * Structure and union declarations *
  41.  ************************************/
  42. typedef struct sharedclibrary_stub              sharedclibrary_stub;
  43. typedef struct sharedclibrary_stub_list         sharedclibrary_stub_list;
  44.  
  45. /********************
  46.  * Type definitions *
  47.  ********************/
  48. struct sharedclibrary_stub
  49.    {  int chunk_id;
  50.       byte **entry_vector;
  51.       byte **entry_vector_limit;
  52.       byte *static_data;
  53.       byte *static_data_limit;
  54.    };
  55.  
  56. struct sharedclibrary_stub_list
  57.    {  sharedclibrary_stub stub [UNKNOWN];
  58.    };
  59.  
  60. #define sharedclibrary_STUB_LIST(N) \
  61.    struct \
  62.       {  sharedclibrary_stub stub [N]; \
  63.       }
  64.  
  65. #define sharedclibrary_SIZEOF_STUB_LIST(N) \
  66.    ((N)*sizeof ((sharedclibrary_stub_list *) NULL)->stub)
  67.  
  68. /*************************
  69.  * Function declarations *
  70.  *************************/
  71.  
  72. #ifdef __cplusplus
  73.    extern "C" {
  74. #endif
  75.  
  76. /*************************************************************
  77.  * NOTE: The following functions provide direct access to    *
  78.  *       the SWI's noted in the function description.        *
  79.  *       Please read the relevant PRM section for more       *
  80.  *       information on their input/output parameters.       *
  81.  *************************************************************/
  82.  
  83. /* ------------------------------------------------------------------------
  84.  * Function:      sharedclibrary_lib_init_apcs_r()
  85.  *
  86.  * Description:   Interfaces an application with the Shared C Library
  87.  *
  88.  * Input:         stub_list - value of R0 on entry
  89.  *                workspace - value of R1 on entry
  90.  *                workspace_limit - value of R2 on entry
  91.  *                flags - value of R6 on entry
  92.  *
  93.  * Output:        stack - value of R1 on exit
  94.  *                stack_limit - value of R2 on exit
  95.  *                version - value of R6 on exit
  96.  *
  97.  * Other notes:   Calls SWI 0x80681 with R3 = 0xFFFFFFFF, R4 = 0x0, R5 = 0xFFFFFFFF.
  98.  */
  99.  
  100. extern os_error *xsharedclibrary_lib_init_apcs_r (sharedclibrary_stub_list *stub_list,
  101.       void *workspace,
  102.       void *workspace_limit,
  103.       bits flags,
  104.       byte **stack,
  105.       byte **stack_limit,
  106.       int *version);
  107. extern void sharedclibrary_lib_init_apcs_r (sharedclibrary_stub_list *stub_list,
  108.       void *workspace,
  109.       void *workspace_limit,
  110.       bits flags,
  111.       byte **stack,
  112.       byte **stack_limit,
  113.       int *version);
  114.  
  115. /* ------------------------------------------------------------------------
  116.  * Function:      sharedclibrary_lib_init_module()
  117.  *
  118.  * Description:   Interfaces a module with the Shared C Library
  119.  *
  120.  * Input:         stub_list - value of R0 on entry
  121.  *                workspace - value of R1 on entry
  122.  *                workspace_limit - value of R2 on entry
  123.  *                clear - value of R3 on entry
  124.  *                static_data - value of R4 on entry
  125.  *                static_data_limit - value of R5 on entry
  126.  *                flags - value of R6 on entry
  127.  *
  128.  * Output:        stack - value of R1 on exit
  129.  *                stack_limit - value of R2 on exit
  130.  *                version - value of R6 on exit
  131.  *
  132.  * Other notes:   Calls SWI 0x80682.
  133.  */
  134.  
  135. extern os_error *xsharedclibrary_lib_init_module (sharedclibrary_stub_list *stub_list,
  136.       void *workspace,
  137.       void *workspace_limit,
  138.       byte *clear,
  139.       byte *static_data,
  140.       byte *static_data_limit,
  141.       bits flags,
  142.       byte **stack,
  143.       byte **stack_limit,
  144.       int *version);
  145. extern void sharedclibrary_lib_init_module (sharedclibrary_stub_list *stub_list,
  146.       void *workspace,
  147.       void *workspace_limit,
  148.       byte *clear,
  149.       byte *static_data,
  150.       byte *static_data_limit,
  151.       bits flags,
  152.       byte **stack,
  153.       byte **stack_limit,
  154.       int *version);
  155.  
  156. #ifdef __cplusplus
  157.    }
  158. #endif
  159.  
  160. #endif
  161.