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

  1. #ifndef osmodule_H
  2. #define osmodule_H
  3.  
  4. /* C header file for OSModule
  5.  * written by DefMod (Sep  7 1994) on Wed Sep 14 13:18:17 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  OS_Module
  27. #define OS_Module                               0x1E
  28. #undef  XOS_Module
  29. #define XOS_Module                              0x2001E
  30. #undef  OSModule_Run
  31. #define OSModule_Run                            0x0
  32. #undef  OSModule_Load
  33. #define OSModule_Load                           0x1
  34. #undef  OSModule_Enter
  35. #define OSModule_Enter                          0x2
  36. #undef  OSModule_Reinit
  37. #define OSModule_Reinit                         0x3
  38. #undef  OSModule_Kill
  39. #define OSModule_Kill                           0x4
  40. #undef  OSModule_Info
  41. #define OSModule_Info                           0x5
  42. #undef  OSModule_Alloc
  43. #define OSModule_Alloc                          0x6
  44. #undef  OSModule_Free
  45. #define OSModule_Free                           0x7
  46. #undef  OSModule_Tidy
  47. #define OSModule_Tidy                           0x8
  48. #undef  OSModule_Clear
  49. #define OSModule_Clear                          0x9
  50. #undef  OSModule_AddArea
  51. #define OSModule_AddArea                        0xA
  52. #undef  OSModule_CopyArea
  53. #define OSModule_CopyArea                       0xB
  54. #undef  OSModule_Enumerate
  55. #define OSModule_Enumerate                      0xC
  56. #undef  OSModule_Realloc
  57. #define OSModule_Realloc                        0xD
  58. #undef  OSModule_Instantiate
  59. #define OSModule_Instantiate                    0xE
  60. #undef  OSModule_Rename
  61. #define OSModule_Rename                         0xF
  62. #undef  OSModule_Prefer
  63. #define OSModule_Prefer                         0x10
  64. #undef  OSModule_AddPoduleArea
  65. #define OSModule_AddPoduleArea                  0x11
  66. #undef  OSModule_Lookup
  67. #define OSModule_Lookup                         0x12
  68. #undef  OSModule_EnumerateROM
  69. #define OSModule_EnumerateROM                   0x13
  70. #undef  OSModule_EnumerateROMWithInfo
  71. #define OSModule_EnumerateROMWithInfo           0x14
  72. #undef  Service_UKCommand
  73. #define Service_UKCommand                       0x4
  74. #undef  Service_Error
  75. #define Service_Error                           0x6
  76. #undef  Service_UKByte
  77. #define Service_UKByte                          0x7
  78. #undef  Service_UKWord
  79. #define Service_UKWord                          0x8
  80. #undef  Service_Help
  81. #define Service_Help                            0x9
  82. #undef  Service_UKConfig
  83. #define Service_UKConfig                        0x28
  84. #undef  Service_UKStatus
  85. #define Service_UKStatus                        0x29
  86. #undef  Service_NewApplication
  87. #define Service_NewApplication                  0x2A
  88. #undef  Service_LookupFileType
  89. #define Service_LookupFileType                  0x42
  90. #undef  Service_PostInit
  91. #define Service_PostInit                        0x73
  92. #undef  Service_SyntaxError
  93. #define Service_SyntaxError                     0x8C
  94.  
  95. /************************
  96.  * Constant definitions *
  97.  ************************/
  98. #define osmodule_ENTRY_START                    0
  99. #define osmodule_ENTRY_INIT                     4
  100. #define osmodule_ENTRY_DIE                      8
  101. #define osmodule_ENTRY_SERVICE                  12
  102. #define osmodule_ENTRY_TITLE                    16
  103. #define osmodule_ENTRY_HELP                     20
  104. #define osmodule_ENTRY_TABLE                    24
  105. #define osmodule_ENTRY_SWI_CHUNK                28
  106. #define osmodule_ENTRY_SWI_ENTRY                32
  107. #define osmodule_ENTRY_NAME_TABLE               36
  108. #define osmodule_ENTRY_NAME_CODE                40
  109. #define osmodule_SWI_CHUNK_SIZE                 64
  110. #define osmodule_SWI_SYSTEM_BASE                262144
  111. #define osmodule_SWI_APPLICATION_BASE           524288
  112. #define osmodule_SWI_USER_BASE                  786432
  113. #define osmodule_SECTION_SYSTEM                 (-1)
  114. #define osmodule_SECTION_CARD0                  0
  115. #define osmodule_SECTION_CARD1                  1
  116. #define osmodule_SECTION_CARD2                  2
  117. #define osmodule_SECTION_CARD3                  3
  118. #define osmodule_SECTION_ROM1                   (-2)
  119. #define osmodule_SECTION_ROM2                   (-3)
  120. #define osmodule_SECTION_ROM3                   (-4)
  121. #define osmodule_SECTION_ROM4                   (-5)
  122. #define osmodule_STATUS_UNPLUGGED               (-1)
  123. #define osmodule_STATUS_DORMANT                 0
  124. #define osmodule_STATUS_ACTIVE                  1
  125. #define osmodule_STATUS_RUNNING                 2
  126. #define error_MODULE_NOT_MOD                    0x100u
  127. #define error_MODULE_MH_NO_ROOM                 0x101u
  128. #define error_MODULE_RM_NOT_FOUND               0x102u
  129. #define error_MODULE_CANT_KILL                  0x103u
  130. #define error_MODULE_CANT_KILL2                 0x103u
  131. #define error_MODULE_WIMP_CANT_KILL             0x103u
  132. #define error_MODULE_BAD_MODULE_REASON          0x104u
  133. #define error_MODULE_BAD_DYNAMIC_AREA           0x104u
  134. #define error_MODULE_RM_NOT_FOUND_IN_ROM        0x105u
  135. #define error_MODULE_MODULE_POSTFIX             0x106u
  136. #define error_MODULE_NO_MORE_MODULES            0x107u
  137. #define error_MODULE_NO_MORE_INCARNATIONS       0x108u
  138. #define error_MODULE_POSTFIX_NEEDED             0x109u
  139. #define error_MODULE_INCARNATION_EXISTS         0x10Au
  140. #define error_MODULE_INCARNATION_NOT_FOUND      0x10Bu
  141. #define error_MODULE_CHUNK_NOT_RM               0x10Cu
  142. #define error_MODULE_BAD_RM_HEADER_FIELD        0x10Du
  143. #define error_MODULE_MODULE_TOO_OLD             0x10Eu
  144. #define error_MODULE_MODULE_BAD_SWI             0x10Fu
  145. #define error_MODULE_MODULE_IN_USE              0x110u
  146. #define error_MODULE_BAD_FILING_SYSTEM_OPERATION 0x111u
  147. #define error_MODULE_FILING_SYSTEM_READ_ONLY    0x112u
  148. #define error_MODULE_NOT_ADIR                   0x113u
  149.  
  150. /*************************
  151.  * Function declarations *
  152.  *************************/
  153.  
  154. #ifdef __cplusplus
  155.    extern "C" {
  156. #endif
  157.  
  158. /*************************************************************
  159.  * NOTE: The following functions provide direct access to    *
  160.  *       the SWI's noted in the function description.        *
  161.  *       Please read the relevant PRM section for more       *
  162.  *       information on their input/output parameters.       *
  163.  *************************************************************/
  164.  
  165. /* ------------------------------------------------------------------------
  166.  * Function:      osmodule_run()
  167.  *
  168.  * Description:   Loads, initialises and enters a module
  169.  *
  170.  * Input:         tail - value of R1 on entry
  171.  *
  172.  * Other notes:   Calls SWI 0x1E with R0 = 0x0.
  173.  */
  174.  
  175. extern os_error *xosmodule_run (char *tail);
  176. extern void osmodule_run (char *tail);
  177.  
  178. /* ------------------------------------------------------------------------
  179.  * Function:      osmodule_load()
  180.  *
  181.  * Description:   Loads a module
  182.  *
  183.  * Input:         tail - value of R1 on entry
  184.  *
  185.  * Other notes:   Calls SWI 0x1E with R0 = 0x1.
  186.  */
  187.  
  188. extern os_error *xosmodule_load (char *tail);
  189. extern void osmodule_load (char *tail);
  190.  
  191. /* ------------------------------------------------------------------------
  192.  * Function:      osmodule_enter()
  193.  *
  194.  * Description:   Enters a module
  195.  *
  196.  * Input:         module_name - value of R1 on entry
  197.  *                args - value of R2 on entry
  198.  *
  199.  * Other notes:   Calls SWI 0x1E with R0 = 0x2.
  200.  */
  201.  
  202. extern os_error *xosmodule_enter (char *module_name,
  203.       char *args);
  204. extern void osmodule_enter (char *module_name,
  205.       char *args);
  206.  
  207. /* ------------------------------------------------------------------------
  208.  * Function:      osmodule_reinit()
  209.  *
  210.  * Description:   Reloads a module
  211.  *
  212.  * Input:         tail - value of R1 on entry
  213.  *
  214.  * Other notes:   Calls SWI 0x1E with R0 = 0x3.
  215.  */
  216.  
  217. extern os_error *xosmodule_reinit (char *tail);
  218. extern void osmodule_reinit (char *tail);
  219.  
  220. /* ------------------------------------------------------------------------
  221.  * Function:      osmodule_kill()
  222.  *
  223.  * Description:   Deletes a module
  224.  *
  225.  * Input:         module_name - value of R1 on entry
  226.  *
  227.  * Other notes:   Calls SWI 0x1E with R0 = 0x4.
  228.  */
  229.  
  230. extern os_error *xosmodule_kill (char *module_name);
  231. extern void osmodule_kill (char *module_name);
  232.  
  233. /* ------------------------------------------------------------------------
  234.  * Function:      osmodule_info()
  235.  *
  236.  * Description:   Describes the RMA
  237.  *
  238.  * Output:        max - value of R2 on exit
  239.  *                free - value of R3 on exit (X version only)
  240.  *
  241.  * Returns:       R3 (non-X version only)
  242.  *
  243.  * Other notes:   Calls SWI 0x1E with R0 = 0x5.
  244.  */
  245.  
  246. extern os_error *xosmodule_info (int *max,
  247.       int *free);
  248. extern int osmodule_info (int *max);
  249.  
  250. /* ------------------------------------------------------------------------
  251.  * Function:      osmodule_alloc()
  252.  *
  253.  * Description:   Claims a block of workspace in the RMA
  254.  *
  255.  * Input:         size - value of R3 on entry
  256.  *
  257.  * Output:        blk - value of R2 on exit (X version only)
  258.  *
  259.  * Returns:       R2 (non-X version only)
  260.  *
  261.  * Other notes:   Calls SWI 0x1E with R0 = 0x6.
  262.  */
  263.  
  264. extern os_error *xosmodule_alloc (int size,
  265.       void **blk);
  266. extern void *osmodule_alloc (int size);
  267.  
  268. /* ------------------------------------------------------------------------
  269.  * Function:      osmodule_free()
  270.  *
  271.  * Description:   Frees a block of workspace in the RMA
  272.  *
  273.  * Input:         blk - value of R2 on entry
  274.  *
  275.  * Other notes:   Calls SWI 0x1E with R0 = 0x7.
  276.  */
  277.  
  278. extern os_error *xosmodule_free (void *blk);
  279. extern void osmodule_free (void *blk);
  280.  
  281. /* ------------------------------------------------------------------------
  282.  * Function:      osmodule_tidy()
  283.  *
  284.  * Description:   Tidies modules
  285.  *
  286.  * Other notes:   Calls SWI 0x1E with R0 = 0x8.
  287.  */
  288.  
  289. extern os_error *xosmodule_tidy (void);
  290. extern void osmodule_tidy (void);
  291.  
  292. /* ------------------------------------------------------------------------
  293.  * Function:      osmodule_clear()
  294.  *
  295.  * Description:   Clears all modules
  296.  *
  297.  * Other notes:   Calls SWI 0x1E with R0 = 0x9.
  298.  */
  299.  
  300. extern os_error *xosmodule_clear (void);
  301. extern void osmodule_clear (void);
  302.  
  303. /* ------------------------------------------------------------------------
  304.  * Function:      osmodule_add_area()
  305.  *
  306.  * Description:   Inserts a module from memory
  307.  *
  308.  * Input:         module - value of R1 on entry
  309.  *
  310.  * Other notes:   Calls SWI 0x1E with R0 = 0xA.
  311.  */
  312.  
  313. extern os_error *xosmodule_add_area (byte *module);
  314. extern void osmodule_add_area (byte *module);
  315.  
  316. /* ------------------------------------------------------------------------
  317.  * Function:      osmodule_copy_area()
  318.  *
  319.  * Description:   Inserts a module from memory and moves it into the RMA
  320.  *
  321.  * Input:         module - value of R1 on entry
  322.  *                size - value of R2 on entry
  323.  *
  324.  * Other notes:   Calls SWI 0x1E with R0 = 0xB.
  325.  */
  326.  
  327. extern os_error *xosmodule_copy_area (byte *module,
  328.       int size);
  329. extern void osmodule_copy_area (byte *module,
  330.       int size);
  331.  
  332. /* ------------------------------------------------------------------------
  333.  * Function:      osmodule_enumerate()
  334.  *
  335.  * Description:   Extracts module information
  336.  *
  337.  * Input:         module_no - value of R1 on entry
  338.  *                instance_no - value of R2 on entry
  339.  *
  340.  * Output:        module_no_out - value of R1 on exit (X version only)
  341.  *                instance_no_out - value of R2 on exit
  342.  *                module - value of R3 on exit
  343.  *                workspace - value of R4 on exit
  344.  *                postfix - value of R5 on exit
  345.  *
  346.  * Returns:       R1 (non-X version only)
  347.  *
  348.  * Other notes:   Calls SWI 0x1E with R0 = 0xC.
  349.  */
  350.  
  351. extern os_error *xosmodule_enumerate (int module_no,
  352.       int instance_no,
  353.       int *module_no_out,
  354.       int *instance_no_out,
  355.       byte **module,
  356.       void **workspace,
  357.       char **postfix);
  358. extern int osmodule_enumerate (int module_no,
  359.       int instance_no,
  360.       int *instance_no_out,
  361.       byte **module,
  362.       void **workspace,
  363.       char **postfix);
  364.  
  365. /* ------------------------------------------------------------------------
  366.  * Function:      osmodule_realloc()
  367.  *
  368.  * Description:   Extends a block of workspace in the RMA by a given size
  369.  *
  370.  * Input:         blk - value of R2 on entry
  371.  *                size_increase - value of R3 on entry
  372.  *
  373.  * Output:        blk_out - value of R2 on exit (X version only)
  374.  *
  375.  * Returns:       R2 (non-X version only)
  376.  *
  377.  * Other notes:   Calls SWI 0x1E with R0 = 0xD.
  378.  */
  379.  
  380. extern os_error *xosmodule_realloc (void *blk,
  381.       int size_increase,
  382.       void **blk_out);
  383. extern void *osmodule_realloc (void *blk,
  384.       int size_increase);
  385.  
  386. /* ------------------------------------------------------------------------
  387.  * Function:      osmodule_instantiate()
  388.  *
  389.  * Description:   Creates a new instance of a module
  390.  *
  391.  * Input:         instance_name - value of R1 on entry
  392.  *
  393.  * Other notes:   Calls SWI 0x1E with R0 = 0xE.
  394.  */
  395.  
  396. extern os_error *xosmodule_instantiate (char *instance_name);
  397. extern void osmodule_instantiate (char *instance_name);
  398.  
  399. /* ------------------------------------------------------------------------
  400.  * Function:      osmodule_rename()
  401.  *
  402.  * Description:   Renames an instance of a module
  403.  *
  404.  * Input:         old_name - value of R1 on entry
  405.  *                new_postfix - value of R2 on entry
  406.  *
  407.  * Other notes:   Calls SWI 0x1E with R0 = 0xF.
  408.  */
  409.  
  410. extern os_error *xosmodule_rename (char *old_name,
  411.       char *new_postfix);
  412. extern void osmodule_rename (char *old_name,
  413.       char *new_postfix);
  414.  
  415. /* ------------------------------------------------------------------------
  416.  * Function:      osmodule_prefer()
  417.  *
  418.  * Description:   Selects the preferred instance of a particular module
  419.  *
  420.  * Input:         instance_name - value of R1 on entry
  421.  *
  422.  * Other notes:   Calls SWI 0x1E with R0 = 0x10.
  423.  */
  424.  
  425. extern os_error *xosmodule_prefer (char *instance_name);
  426. extern void osmodule_prefer (char *instance_name);
  427.  
  428. /* ------------------------------------------------------------------------
  429.  * Function:      osmodule_add_podule_area()
  430.  *
  431.  * Description:   Adds an expansion card module
  432.  *
  433.  * Input:         environment - value of R1 on entry
  434.  *                chunk - value of R2 on entry
  435.  *                rom_section - value of R3 on entry
  436.  *
  437.  * Other notes:   Calls SWI 0x1E with R0 = 0x11.
  438.  */
  439.  
  440. extern os_error *xosmodule_add_podule_area (char *environment,
  441.       int chunk,
  442.       int rom_section);
  443. extern void osmodule_add_podule_area (char *environment,
  444.       int chunk,
  445.       int rom_section);
  446.  
  447. /* ------------------------------------------------------------------------
  448.  * Function:      osmodule_lookup()
  449.  *
  450.  * Description:   Looks up a module name
  451.  *
  452.  * Input:         module_name - value of R1 on entry
  453.  *
  454.  * Output:        module_no - value of R1 on exit (X version only)
  455.  *                instance_no - value of R2 on exit
  456.  *                module - value of R3 on exit
  457.  *                workspace - value of R4 on exit
  458.  *                postfix - value of R5 on exit
  459.  *
  460.  * Returns:       R1 (non-X version only)
  461.  *
  462.  * Other notes:   Calls SWI 0x1E with R0 = 0x12.
  463.  */
  464.  
  465. extern os_error *xosmodule_lookup (char *module_name,
  466.       int *module_no,
  467.       int *instance_no,
  468.       byte **module,
  469.       void **workspace,
  470.       char **postfix);
  471. extern int osmodule_lookup (char *module_name,
  472.       int *instance_no,
  473.       byte **module,
  474.       void **workspace,
  475.       char **postfix);
  476.  
  477. /* ------------------------------------------------------------------------
  478.  * Function:      osmodule_enumerate_rom()
  479.  *
  480.  * Description:   Enumerates ROM modules
  481.  *
  482.  * Input:         module_no - value of R1 on entry
  483.  *                section - value of R2 on entry
  484.  *
  485.  * Output:        module_no_out - value of R1 on exit (X version only)
  486.  *                section_out - value of R2 on exit
  487.  *                module_name - value of R3 on exit
  488.  *                status - value of R4 on exit
  489.  *                chunk_no - value of R5 on exit
  490.  *
  491.  * Returns:       R1 (non-X version only)
  492.  *
  493.  * Other notes:   Calls SWI 0x1E with R0 = 0x13.
  494.  */
  495.  
  496. extern os_error *xosmodule_enumerate_rom (int module_no,
  497.       int section,
  498.       int *module_no_out,
  499.       int *section_out,
  500.       char **module_name,
  501.       int *status,
  502.       int *chunk_no);
  503. extern int osmodule_enumerate_rom (int module_no,
  504.       int section,
  505.       int *section_out,
  506.       char **module_name,
  507.       int *status,
  508.       int *chunk_no);
  509.  
  510. /* ------------------------------------------------------------------------
  511.  * Function:      osmodule_enumerate_rom_with_info()
  512.  *
  513.  * Description:   Enumerates ROM modules with version
  514.  *
  515.  * Input:         module_no - value of R1 on entry
  516.  *                section - value of R2 on entry
  517.  *
  518.  * Output:        module_no_out - value of R1 on exit (X version only)
  519.  *                section_out - value of R2 on exit
  520.  *                module_name - value of R3 on exit
  521.  *                status - value of R4 on exit
  522.  *                chunk_no - value of R5 on exit
  523.  *                bcd_version - value of R6 on exit
  524.  *
  525.  * Returns:       R1 (non-X version only)
  526.  *
  527.  * Other notes:   Calls SWI 0x1E with R0 = 0x14.
  528.  */
  529.  
  530. extern os_error *xosmodule_enumerate_rom_with_info (int module_no,
  531.       int section,
  532.       int *module_no_out,
  533.       int *section_out,
  534.       char **module_name,
  535.       int *status,
  536.       int *chunk_no,
  537.       int *bcd_version);
  538. extern int osmodule_enumerate_rom_with_info (int module_no,
  539.       int section,
  540.       int *section_out,
  541.       char **module_name,
  542.       int *status,
  543.       int *chunk_no,
  544.       int *bcd_version);
  545.  
  546. /* ------------------------------------------------------------------------
  547.  * Function:      service_uk_command()
  548.  *
  549.  * Description:   Unknown command
  550.  *
  551.  * Input:         command - value of R0 on entry
  552.  *
  553.  * Output:        error - value of R0 on exit
  554.  *                unclaimed - value of R1 on exit (X version only)
  555.  *
  556.  * Returns:       R1 (non-X version only)
  557.  *
  558.  * Other notes:   Calls SWI 0x30 with R1 = 0x4.
  559.  */
  560.  
  561. extern os_error *xservice_uk_command (char *command,
  562.       os_error **error,
  563.       bool *unclaimed);
  564. extern bool service_uk_command (char *command,
  565.       os_error **error);
  566.  
  567. /* ------------------------------------------------------------------------
  568.  * Function:      service_error()
  569.  *
  570.  * Description:   An error has occurred
  571.  *
  572.  * Input:         error - value of R0 on entry
  573.  *
  574.  * Other notes:   Calls SWI 0x30 with R1 = 0x6.
  575.  */
  576.  
  577. extern os_error *xservice_error (os_error *error);
  578. extern void service_error (os_error *error);
  579.  
  580. /* ------------------------------------------------------------------------
  581.  * Function:      service_uk_byte()
  582.  *
  583.  * Description:   Unknown OS_Byte
  584.  *
  585.  * Input:         byte - value of R2 on entry
  586.  *                arg0 - value of R3 on entry
  587.  *                arg1 - value of R4 on entry
  588.  *
  589.  * Output:        unclaimed - value of R1 on exit (X version only)
  590.  *                res0 - value of R2 on exit
  591.  *                res1 - value of R3 on exit
  592.  *
  593.  * Returns:       R1 (non-X version only)
  594.  *
  595.  * Other notes:   Calls SWI 0x30 with R1 = 0x7.
  596.  */
  597.  
  598. extern os_error *xservice_uk_byte (int byte,
  599.       int arg0,
  600.       int arg1,
  601.       bool *unclaimed,
  602.       int *res0,
  603.       int *res1);
  604. extern bool service_uk_byte (int byte,
  605.       int arg0,
  606.       int arg1,
  607.       int *res0,
  608.       int *res1);
  609.  
  610. /* ------------------------------------------------------------------------
  611.  * Function:      service_uk_word()
  612.  *
  613.  * Description:   Unknown OS_Word
  614.  *
  615.  * Input:         word - value of R2 on entry
  616.  *                block - value of R3 on entry
  617.  *
  618.  * Output:        unclaimed - value of R1 on exit (X version only)
  619.  *
  620.  * Returns:       R1 (non-X version only)
  621.  *
  622.  * Other notes:   Calls SWI 0x30 with R1 = 0x8.
  623.  */
  624.  
  625. extern os_error *xservice_uk_word (int word,
  626.       byte *block,
  627.       bool *unclaimed);
  628. extern bool service_uk_word (int word,
  629.       byte *block);
  630.  
  631. /* ------------------------------------------------------------------------
  632.  * Function:      service_help()
  633.  *
  634.  * Description:   *Help has been called
  635.  *
  636.  * Input:         command - value of R0 on entry
  637.  *
  638.  * Output:        unclaimed - value of R1 on exit (X version only)
  639.  *
  640.  * Returns:       R1 (non-X version only)
  641.  *
  642.  * Other notes:   Calls SWI 0x30 with R1 = 0x9.
  643.  */
  644.  
  645. extern os_error *xservice_help (char *command,
  646.       bool *unclaimed);
  647. extern bool service_help (char *command);
  648.  
  649. /* ------------------------------------------------------------------------
  650.  * Function:      service_uk_config()
  651.  *
  652.  * Description:   Unknown *Configure
  653.  *
  654.  * Input:         tail - value of R0 on entry
  655.  *
  656.  * Output:        error - value of R0 on exit
  657.  *                unclaimed - value of R1 on exit (X version only)
  658.  *
  659.  * Returns:       R1 (non-X version only)
  660.  *
  661.  * Other notes:   Calls SWI 0x30 with R1 = 0x28.
  662.  */
  663.  
  664. extern os_error *xservice_uk_config (char *tail,
  665.       os_error **error,
  666.       bool *unclaimed);
  667. extern bool service_uk_config (char *tail,
  668.       os_error **error);
  669.  
  670. /* ------------------------------------------------------------------------
  671.  * Function:      service_uk_status()
  672.  *
  673.  * Description:   Unknown *Status
  674.  *
  675.  * Input:         tail - value of R0 on entry
  676.  *
  677.  * Output:        unclaimed - value of R1 on exit (X version only)
  678.  *
  679.  * Returns:       R1 (non-X version only)
  680.  *
  681.  * Other notes:   Calls SWI 0x30 with R1 = 0x29.
  682.  */
  683.  
  684. extern os_error *xservice_uk_status (char *tail,
  685.       bool *unclaimed);
  686. extern bool service_uk_status (char *tail);
  687.  
  688. /* ------------------------------------------------------------------------
  689.  * Function:      service_new_application()
  690.  *
  691.  * Description:   Application about to start
  692.  *
  693.  * Output:        unclaimed - value of R1 on exit (X version only)
  694.  *
  695.  * Returns:       R1 (non-X version only)
  696.  *
  697.  * Other notes:   Calls SWI 0x30 with R1 = 0x2A.
  698.  */
  699.  
  700. extern os_error *xservice_new_application (bool *unclaimed);
  701. extern bool service_new_application (void);
  702.  
  703. /* ------------------------------------------------------------------------
  704.  * Function:      service_lookup_file_type()
  705.  *
  706.  * Description:   Look up file type
  707.  *
  708.  * Input:         file_type - value of R2 on entry
  709.  *
  710.  * Output:        unclaimed - value of R1 on exit (X version only)
  711.  *                name1 - value of R2 on exit
  712.  *                name2 - value of R3 on exit
  713.  *
  714.  * Returns:       R1 (non-X version only)
  715.  *
  716.  * Other notes:   Calls SWI 0x30 with R1 = 0x42.
  717.  */
  718.  
  719. extern os_error *xservice_lookup_file_type (bits file_type,
  720.       bool *unclaimed,
  721.       bits *name1,
  722.       bits *name2);
  723. extern bool service_lookup_file_type (bits file_type,
  724.       bits *name1,
  725.       bits *name2);
  726.  
  727. /* ------------------------------------------------------------------------
  728.  * Function:      service_post_init()
  729.  *
  730.  * Description:   All modules have been initialised
  731.  *
  732.  * Other notes:   Calls SWI 0x30 with R1 = 0x73.
  733.  */
  734.  
  735. extern os_error *xservice_post_init (void);
  736. extern void service_post_init (void);
  737.  
  738. /* ------------------------------------------------------------------------
  739.  * Function:      service_syntax_error()
  740.  *
  741.  * Description:   Syntax error translation
  742.  *
  743.  * Input:         offset - value of R2 on entry
  744.  *                base - value of R3 on entry
  745.  *                command - value of R4 on entry
  746.  *
  747.  * Output:        error - value of R0 on exit
  748.  *                unclaimed - value of R1 on exit (X version only)
  749.  *
  750.  * Returns:       R1 (non-X version only)
  751.  *
  752.  * Other notes:   Calls SWI 0x30 with R1 = 0x8C.
  753.  */
  754.  
  755. extern os_error *xservice_syntax_error (int *offset,
  756.       byte *base,
  757.       char *command,
  758.       os_error **error,
  759.       bool *unclaimed);
  760. extern bool service_syntax_error (int *offset,
  761.       byte *base,
  762.       char *command,
  763.       os_error **error);
  764.  
  765. #ifdef __cplusplus
  766.    }
  767. #endif
  768.  
  769. #endif
  770.