home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / oslib / h / os < prev    next >
Encoding:
Text File  |  1994-09-26  |  187.1 KB  |  5,832 lines

  1. #ifndef os_H
  2. #define os_H
  3.  
  4. /* C header file for OS
  5.  * written by DefMod (Sep 16 1994) on Mon Sep 26 15:59:19 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. /**********************************
  20.  * SWI names and SWI reason codes *
  21.  **********************************/
  22. #undef  OS_WriteC
  23. #define OS_WriteC                               0x0
  24. #undef  XOS_WriteC
  25. #define XOS_WriteC                              0x20000
  26. #undef  WrchV
  27. #define WrchV                                   0x3
  28. #undef  OS_WriteS
  29. #define OS_WriteS                               0x1
  30. #undef  XOS_WriteS
  31. #define XOS_WriteS                              0x20001
  32. #undef  OS_Write0
  33. #define OS_Write0                               0x2
  34. #undef  XOS_Write0
  35. #define XOS_Write0                              0x20002
  36. #undef  OS_NewLine
  37. #define OS_NewLine                              0x3
  38. #undef  XOS_NewLine
  39. #define XOS_NewLine                             0x20003
  40. #undef  OS_ReadC
  41. #define OS_ReadC                                0x4
  42. #undef  XOS_ReadC
  43. #define XOS_ReadC                               0x20004
  44. #undef  RdchV
  45. #define RdchV                                   0x4
  46. #undef  OS_CLI
  47. #define OS_CLI                                  0x5
  48. #undef  XOS_CLI
  49. #define XOS_CLI                                 0x20005
  50. #undef  CLIV
  51. #define CLIV                                    0x5
  52. #undef  OS_ReadLine
  53. #define OS_ReadLine                             0xE
  54. #undef  XOS_ReadLine
  55. #define XOS_ReadLine                            0x2000E
  56. #undef  OS_ReadLineGivenEcho
  57. #define OS_ReadLineGivenEcho                    0xE
  58. #undef  XOS_ReadLineGivenEcho
  59. #define XOS_ReadLineGivenEcho                   0x2000E
  60. #undef  OS_ReadLineSuppressInvalid
  61. #define OS_ReadLineSuppressInvalid              0xE
  62. #undef  XOS_ReadLineSuppressInvalid
  63. #define XOS_ReadLineSuppressInvalid             0x2000E
  64. #undef  OS_ReadLineGivenEchoSuppressInvalid
  65. #define OS_ReadLineGivenEchoSuppressInvalid     0xE
  66. #undef  XOS_ReadLineGivenEchoSuppressInvalid
  67. #define XOS_ReadLineGivenEchoSuppressInvalid    0x2000E
  68. #undef  ReadLineV
  69. #define ReadLineV                               0xE
  70. #undef  OS_Control
  71. #define OS_Control                              0xF
  72. #undef  XOS_Control
  73. #define XOS_Control                             0x2000F
  74. #undef  OS_GetEnv
  75. #define OS_GetEnv                               0x10
  76. #undef  XOS_GetEnv
  77. #define XOS_GetEnv                              0x20010
  78. #undef  OS_Exit
  79. #define OS_Exit                                 0x11
  80. #undef  XOS_Exit
  81. #define XOS_Exit                                0x20011
  82. #undef  OS_SetEnv
  83. #define OS_SetEnv                               0x12
  84. #undef  XOS_SetEnv
  85. #define XOS_SetEnv                              0x20012
  86. #undef  OS_IntOn
  87. #define OS_IntOn                                0x13
  88. #undef  XOS_IntOn
  89. #define XOS_IntOn                               0x20013
  90. #undef  OS_IntOff
  91. #define OS_IntOff                               0x14
  92. #undef  XOS_IntOff
  93. #define XOS_IntOff                              0x20014
  94. #undef  IrqV
  95. #define IrqV                                    0x2
  96. #undef  OS_CallBack
  97. #define OS_CallBack                             0x15
  98. #undef  XOS_CallBack
  99. #define XOS_CallBack                            0x20015
  100. #undef  OS_EnterOS
  101. #define OS_EnterOS                              0x16
  102. #undef  XOS_EnterOS
  103. #define XOS_EnterOS                             0x20016
  104. #undef  OS_BreakPt
  105. #define OS_BreakPt                              0x17
  106. #undef  XOS_BreakPt
  107. #define XOS_BreakPt                             0x20017
  108. #undef  OS_BreakCtrl
  109. #define OS_BreakCtrl                            0x18
  110. #undef  XOS_BreakCtrl
  111. #define XOS_BreakCtrl                           0x20018
  112. #undef  OS_UnusedSWI
  113. #define OS_UnusedSWI                            0x19
  114. #undef  XOS_UnusedSWI
  115. #define XOS_UnusedSWI                           0x20019
  116. #undef  UKSWIV
  117. #define UKSWIV                                  0x18
  118. #undef  OS_UpdateMEMC
  119. #define OS_UpdateMEMC                           0x1A
  120. #undef  XOS_UpdateMEMC
  121. #define XOS_UpdateMEMC                          0x2001A
  122. #undef  OS_SetCallBack
  123. #define OS_SetCallBack                          0x1B
  124. #undef  XOS_SetCallBack
  125. #define XOS_SetCallBack                         0x2001B
  126. #undef  OS_Mouse
  127. #define OS_Mouse                                0x1C
  128. #undef  XOS_Mouse
  129. #define XOS_Mouse                               0x2001C
  130. #undef  MouseV
  131. #define MouseV                                  0x1A
  132. #undef  OS_Claim
  133. #define OS_Claim                                0x1F
  134. #undef  XOS_Claim
  135. #define XOS_Claim                               0x2001F
  136. #undef  OS_Release
  137. #define OS_Release                              0x20
  138. #undef  XOS_Release
  139. #define XOS_Release                             0x20020
  140. #undef  OS_ReadUnsigned
  141. #define OS_ReadUnsigned                         0x21
  142. #undef  XOS_ReadUnsigned
  143. #define XOS_ReadUnsigned                        0x20021
  144. #undef  OS_GenerateEvent
  145. #define OS_GenerateEvent                        0x22
  146. #undef  XOS_GenerateEvent
  147. #define XOS_GenerateEvent                       0x20022
  148. #undef  EventV
  149. #define EventV                                  0x10
  150. #undef  OS_ReadVarVal
  151. #define OS_ReadVarVal                           0x23
  152. #undef  XOS_ReadVarVal
  153. #define XOS_ReadVarVal                          0x20023
  154. #undef  OS_SetVarVal
  155. #define OS_SetVarVal                            0x24
  156. #undef  XOS_SetVarVal
  157. #define XOS_SetVarVal                           0x20024
  158. #undef  OS_GSInit
  159. #define OS_GSInit                               0x25
  160. #undef  XOS_GSInit
  161. #define XOS_GSInit                              0x20025
  162. #undef  OS_GSRead
  163. #define OS_GSRead                               0x26
  164. #undef  XOS_GSRead
  165. #define XOS_GSRead                              0x20026
  166. #undef  OS_GSTrans
  167. #define OS_GSTrans                              0x27
  168. #undef  XOS_GSTrans
  169. #define XOS_GSTrans                             0x20027
  170. #undef  OS_BinaryToDecimal
  171. #define OS_BinaryToDecimal                      0x28
  172. #undef  XOS_BinaryToDecimal
  173. #define XOS_BinaryToDecimal                     0x20028
  174. #undef  OS_ChangeDynamicArea
  175. #define OS_ChangeDynamicArea                    0x2A
  176. #undef  XOS_ChangeDynamicArea
  177. #define XOS_ChangeDynamicArea                   0x2002A
  178. #undef  OS_GenerateError
  179. #define OS_GenerateError                        0x2B
  180. #undef  XOS_GenerateError
  181. #define XOS_GenerateError                       0x2002B
  182. #undef  ErrorV
  183. #define ErrorV                                  0x1
  184. #undef  OS_ReadEscapeState
  185. #define OS_ReadEscapeState                      0x2C
  186. #undef  XOS_ReadEscapeState
  187. #define XOS_ReadEscapeState                     0x2002C
  188. #undef  OS_EvaluateExpression
  189. #define OS_EvaluateExpression                   0x2D
  190. #undef  XOS_EvaluateExpression
  191. #define XOS_EvaluateExpression                  0x2002D
  192. #undef  OS_ReadPalette
  193. #define OS_ReadPalette                          0x2F
  194. #undef  XOS_ReadPalette
  195. #define XOS_ReadPalette                         0x2002F
  196. #undef  PaletteV
  197. #define PaletteV                                0x23
  198. #undef  PaletteV_ReadEntry
  199. #define PaletteV_ReadEntry                      0x1
  200. #undef  PaletteV_SetEntry
  201. #define PaletteV_SetEntry                       0x2
  202. #undef  PaletteV_SetOn
  203. #define PaletteV_SetOn                          0x3
  204. #undef  PaletteV_SetOff
  205. #define PaletteV_SetOff                         0x4
  206. #undef  PaletteV_Default
  207. #define PaletteV_Default                        0x5
  208. #undef  PaletteV_ReadEntries
  209. #define PaletteV_ReadEntries                    0x7
  210. #undef  PaletteV_WriteEntries
  211. #define PaletteV_WriteEntries                   0x8
  212. #undef  PaletteV_SetGammaCorrections
  213. #define PaletteV_SetGammaCorrections            0x9
  214. #undef  OS_ServiceCall
  215. #define OS_ServiceCall                          0x30
  216. #undef  XOS_ServiceCall
  217. #define XOS_ServiceCall                         0x20030
  218. #undef  OS_ReadVduVariables
  219. #define OS_ReadVduVariables                     0x31
  220. #undef  XOS_ReadVduVariables
  221. #define XOS_ReadVduVariables                    0x20031
  222. #undef  OS_ReadPoint
  223. #define OS_ReadPoint                            0x32
  224. #undef  XOS_ReadPoint
  225. #define XOS_ReadPoint                           0x20032
  226. #undef  OS_UpCall
  227. #define OS_UpCall                               0x33
  228. #undef  XOS_UpCall
  229. #define XOS_UpCall                              0x20033
  230. #undef  UpCallV
  231. #define UpCallV                                 0x1D
  232. #undef  OS_CallAVector
  233. #define OS_CallAVector                          0x34
  234. #undef  XOS_CallAVector
  235. #define XOS_CallAVector                         0x20034
  236. #undef  OS_ReadModeVariable
  237. #define OS_ReadModeVariable                     0x35
  238. #undef  XOS_ReadModeVariable
  239. #define XOS_ReadModeVariable                    0x20035
  240. #undef  OS_RemoveCursors
  241. #define OS_RemoveCursors                        0x36
  242. #undef  XOS_RemoveCursors
  243. #define XOS_RemoveCursors                       0x20036
  244. #undef  OS_RestoreCursors
  245. #define OS_RestoreCursors                       0x37
  246. #undef  XOS_RestoreCursors
  247. #define XOS_RestoreCursors                      0x20037
  248. #undef  OS_SWINumberToString
  249. #define OS_SWINumberToString                    0x38
  250. #undef  XOS_SWINumberToString
  251. #define XOS_SWINumberToString                   0x20038
  252. #undef  OS_SWINumberFromString
  253. #define OS_SWINumberFromString                  0x39
  254. #undef  XOS_SWINumberFromString
  255. #define XOS_SWINumberFromString                 0x20039
  256. #undef  OS_ValidateAddress
  257. #define OS_ValidateAddress                      0x3A
  258. #undef  XOS_ValidateAddress
  259. #define XOS_ValidateAddress                     0x2003A
  260. #undef  OS_CallAfter
  261. #define OS_CallAfter                            0x3B
  262. #undef  XOS_CallAfter
  263. #define XOS_CallAfter                           0x2003B
  264. #undef  OS_CallEvery
  265. #define OS_CallEvery                            0x3C
  266. #undef  XOS_CallEvery
  267. #define XOS_CallEvery                           0x2003C
  268. #undef  OS_RemoveTickerEvent
  269. #define OS_RemoveTickerEvent                    0x3D
  270. #undef  XOS_RemoveTickerEvent
  271. #define XOS_RemoveTickerEvent                   0x2003D
  272. #undef  TickerV
  273. #define TickerV                                 0x1C
  274. #undef  OS_InstallKeyHandler
  275. #define OS_InstallKeyHandler                    0x3E
  276. #undef  XOS_InstallKeyHandler
  277. #define XOS_InstallKeyHandler                   0x2003E
  278. #undef  KeyV
  279. #define KeyV                                    0x13
  280. #undef  KeyV_Present
  281. #define KeyV_Present                            0x0
  282. #undef  KeyV_TransitionUp
  283. #define KeyV_TransitionUp                       0x1
  284. #undef  KeyV_TransitionDown
  285. #define KeyV_TransitionDown                     0x2
  286. #undef  KeyV_LEDState
  287. #define KeyV_LEDState                           0x3
  288. #undef  KeyV_EnableDrivers
  289. #define KeyV_EnableDrivers                      0x4
  290. #undef  OS_CheckModeValid
  291. #define OS_CheckModeValid                       0x3F
  292. #undef  XOS_CheckModeValid
  293. #define XOS_CheckModeValid                      0x2003F
  294. #undef  OS_ChangeEnvironment
  295. #define OS_ChangeEnvironment                    0x40
  296. #undef  XOS_ChangeEnvironment
  297. #define XOS_ChangeEnvironment                   0x20040
  298. #undef  ChangeEnvironmentV
  299. #define ChangeEnvironmentV                      0x1E
  300. #undef  OS_ClaimScreenMemory
  301. #define OS_ClaimScreenMemory                    0x41
  302. #undef  XOS_ClaimScreenMemory
  303. #define XOS_ClaimScreenMemory                   0x20041
  304. #undef  OSClaimScreenMemory_Alloc
  305. #define OSClaimScreenMemory_Alloc               0x1
  306. #undef  OSClaimScreenMemory_Free
  307. #define OSClaimScreenMemory_Free                0x0
  308. #undef  OS_ReadMonotonicTime
  309. #define OS_ReadMonotonicTime                    0x42
  310. #undef  XOS_ReadMonotonicTime
  311. #define XOS_ReadMonotonicTime                   0x20042
  312. #undef  OS_SubstituteArgs
  313. #define OS_SubstituteArgs                       0x43
  314. #undef  XOS_SubstituteArgs
  315. #define XOS_SubstituteArgs                      0x20043
  316. #undef  OS_PrettyPrint
  317. #define OS_PrettyPrint                          0x44
  318. #undef  XOS_PrettyPrint
  319. #define XOS_PrettyPrint                         0x20044
  320. #undef  OS_Plot
  321. #define OS_Plot                                 0x45
  322. #undef  XOS_Plot
  323. #define XOS_Plot                                0x20045
  324. #undef  UKPLOTV
  325. #define UKPLOTV                                 0x19
  326. #undef  OS_WriteN
  327. #define OS_WriteN                               0x46
  328. #undef  XOS_WriteN
  329. #define XOS_WriteN                              0x20046
  330. #undef  OS_AddToVector
  331. #define OS_AddToVector                          0x47
  332. #undef  XOS_AddToVector
  333. #define XOS_AddToVector                         0x20047
  334. #undef  OS_WriteEnv
  335. #define OS_WriteEnv                             0x48
  336. #undef  XOS_WriteEnv
  337. #define XOS_WriteEnv                            0x20048
  338. #undef  OS_ReadArgs
  339. #define OS_ReadArgs                             0x49
  340. #undef  XOS_ReadArgs
  341. #define XOS_ReadArgs                            0x20049
  342. #undef  OS_ReadRAMFsLimits
  343. #define OS_ReadRAMFsLimits                      0x4A
  344. #undef  XOS_ReadRAMFsLimits
  345. #define XOS_ReadRAMFsLimits                     0x2004A
  346. #undef  OS_ClaimDeviceVector
  347. #define OS_ClaimDeviceVector                    0x4B
  348. #undef  XOS_ClaimDeviceVector
  349. #define XOS_ClaimDeviceVector                   0x2004B
  350. #undef  OS_ReleaseDeviceVector
  351. #define OS_ReleaseDeviceVector                  0x4C
  352. #undef  XOS_ReleaseDeviceVector
  353. #define XOS_ReleaseDeviceVector                 0x2004C
  354. #undef  OS_DelinkApplication
  355. #define OS_DelinkApplication                    0x4D
  356. #undef  XOS_DelinkApplication
  357. #define XOS_DelinkApplication                   0x2004D
  358. #undef  OS_RelinkApplication
  359. #define OS_RelinkApplication                    0x4E
  360. #undef  XOS_RelinkApplication
  361. #define XOS_RelinkApplication                   0x2004E
  362. #undef  OS_HeapSort
  363. #define OS_HeapSort                             0x4F
  364. #undef  XOS_HeapSort
  365. #define XOS_HeapSort                            0x2004F
  366. #undef  OS_ExitAndDie
  367. #define OS_ExitAndDie                           0x50
  368. #undef  XOS_ExitAndDie
  369. #define XOS_ExitAndDie                          0x20050
  370. #undef  OS_ReadMemMapInfo
  371. #define OS_ReadMemMapInfo                       0x51
  372. #undef  XOS_ReadMemMapInfo
  373. #define XOS_ReadMemMapInfo                      0x20051
  374. #undef  OS_ReadMemMapEntries
  375. #define OS_ReadMemMapEntries                    0x52
  376. #undef  XOS_ReadMemMapEntries
  377. #define XOS_ReadMemMapEntries                   0x20052
  378. #undef  OS_SetMemMapEntries
  379. #define OS_SetMemMapEntries                     0x53
  380. #undef  XOS_SetMemMapEntries
  381. #define XOS_SetMemMapEntries                    0x20053
  382. #undef  OS_AddCallBack
  383. #define OS_AddCallBack                          0x54
  384. #undef  XOS_AddCallBack
  385. #define XOS_AddCallBack                         0x20054
  386. #undef  OS_ReadDefaultHandler
  387. #define OS_ReadDefaultHandler                   0x55
  388. #undef  XOS_ReadDefaultHandler
  389. #define XOS_ReadDefaultHandler                  0x20055
  390. #undef  OS_SetECFOrigin
  391. #define OS_SetECFOrigin                         0x56
  392. #undef  XOS_SetECFOrigin
  393. #define XOS_SetECFOrigin                        0x20056
  394. #undef  OS_Confirm
  395. #define OS_Confirm                              0x59
  396. #undef  XOS_Confirm
  397. #define XOS_Confirm                             0x20059
  398. #undef  OS_ChangedBox
  399. #define OS_ChangedBox                           0x5A
  400. #undef  XOS_ChangedBox
  401. #define XOS_ChangedBox                          0x2005A
  402. #undef  OS_CRC
  403. #define OS_CRC                                  0x5B
  404. #undef  XOS_CRC
  405. #define XOS_CRC                                 0x2005B
  406. #undef  OS_ReadDynamicArea
  407. #define OS_ReadDynamicArea                      0x5C
  408. #undef  XOS_ReadDynamicArea
  409. #define XOS_ReadDynamicArea                     0x2005C
  410. #undef  OS_PrintChar
  411. #define OS_PrintChar                            0x5D
  412. #undef  XOS_PrintChar
  413. #define XOS_PrintChar                           0x2005D
  414. #undef  OS_ChangeRedirection
  415. #define OS_ChangeRedirection                    0x5E
  416. #undef  XOS_ChangeRedirection
  417. #define XOS_ChangeRedirection                   0x2005E
  418. #undef  OS_RemoveCallBack
  419. #define OS_RemoveCallBack                       0x5F
  420. #undef  XOS_RemoveCallBack
  421. #define XOS_RemoveCallBack                      0x2005F
  422. #undef  OS_FindMemMapEntries
  423. #define OS_FindMemMapEntries                    0x60
  424. #undef  XOS_FindMemMapEntries
  425. #define XOS_FindMemMapEntries                   0x20060
  426. #undef  OS_SetColour
  427. #define OS_SetColour                            0x61
  428. #undef  XOS_SetColour
  429. #define XOS_SetColour                           0x20061
  430. #undef  OS_ReadColour
  431. #define OS_ReadColour                           0x61
  432. #undef  XOS_ReadColour
  433. #define XOS_ReadColour                          0x20061
  434. #undef  OS_Pointer
  435. #define OS_Pointer                              0x64
  436. #undef  XOS_Pointer
  437. #define XOS_Pointer                             0x20064
  438. #undef  OSPointer_Get
  439. #define OSPointer_Get                           0x0
  440. #undef  OSPointer_Set
  441. #define OSPointer_Set                           0x1
  442. #undef  PointerV
  443. #define PointerV                                0x26
  444. #undef  PointerV_Status
  445. #define PointerV_Status                         0x0
  446. #undef  PointerV_Enumerate
  447. #define PointerV_Enumerate                      0x1
  448. #undef  PointerV_Selected
  449. #define PointerV_Selected                       0x2
  450. #undef  OS_ScreenMode
  451. #define OS_ScreenMode                           0x65
  452. #undef  XOS_ScreenMode
  453. #define XOS_ScreenMode                          0x20065
  454. #undef  OSScreenMode_Select
  455. #define OSScreenMode_Select                     0x0
  456. #undef  OSScreenMode_Current
  457. #define OSScreenMode_Current                    0x1
  458. #undef  OSScreenMode_Enumerate
  459. #define OSScreenMode_Enumerate                  0x2
  460. #undef  OS_DynamicArea
  461. #define OS_DynamicArea                          0x66
  462. #undef  XOS_DynamicArea
  463. #define XOS_DynamicArea                         0x20066
  464. #undef  OSDynamicArea_Create
  465. #define OSDynamicArea_Create                    0x0
  466. #undef  OSDynamicArea_Delete
  467. #define OSDynamicArea_Delete                    0x1
  468. #undef  OSDynamicArea_Read
  469. #define OSDynamicArea_Read                      0x2
  470. #undef  OSDynamicArea_Enumerate
  471. #define OSDynamicArea_Enumerate                 0x3
  472. #undef  OSDynamicArea_Renumber
  473. #define OSDynamicArea_Renumber                  0x4
  474. #undef  OS_Memory
  475. #define OS_Memory                               0x68
  476. #undef  XOS_Memory
  477. #define XOS_Memory                              0x20068
  478. #undef  OSMemory_PageOp
  479. #define OSMemory_PageOp                         0x0
  480. #undef  OSMemory_ReadArrangementTableSize
  481. #define OSMemory_ReadArrangementTableSize       0x6
  482. #undef  OSMemory_ReadArrangementTable
  483. #define OSMemory_ReadArrangementTable           0x7
  484. #undef  OSMemory_ReadSize
  485. #define OSMemory_ReadSize                       0x8
  486. #undef  OSMemory_ReadController
  487. #define OSMemory_ReadController                 0x9
  488. #undef  OS_ClaimProcessorVector
  489. #define OS_ClaimProcessorVector                 0x69
  490. #undef  XOS_ClaimProcessorVector
  491. #define XOS_ClaimProcessorVector                0x20069
  492. #undef  OSClaimProcessorVector_Alloc
  493. #define OSClaimProcessorVector_Alloc            0x100
  494. #undef  OSClaimProcessorVector_Free
  495. #define OSClaimProcessorVector_Free             0x0
  496. #undef  OS_Reset
  497. #define OS_Reset                                0x6A
  498. #undef  XOS_Reset
  499. #define XOS_Reset                               0x2006A
  500. #undef  OS_MMUControl
  501. #define OS_MMUControl                           0x6B
  502. #undef  XOS_MMUControl
  503. #define XOS_MMUControl                          0x2006B
  504. #undef  OS_ConvertStandardDateAndTime
  505. #define OS_ConvertStandardDateAndTime           0xC0
  506. #undef  XOS_ConvertStandardDateAndTime
  507. #define XOS_ConvertStandardDateAndTime          0x200C0
  508. #undef  OS_ConvertDateAndTime
  509. #define OS_ConvertDateAndTime                   0xC1
  510. #undef  XOS_ConvertDateAndTime
  511. #define XOS_ConvertDateAndTime                  0x200C1
  512. #undef  OS_ConvertHex1
  513. #define OS_ConvertHex1                          0xD0
  514. #undef  XOS_ConvertHex1
  515. #define XOS_ConvertHex1                         0x200D0
  516. #undef  OS_ConvertHex2
  517. #define OS_ConvertHex2                          0xD1
  518. #undef  XOS_ConvertHex2
  519. #define XOS_ConvertHex2                         0x200D1
  520. #undef  OS_ConvertHex4
  521. #define OS_ConvertHex4                          0xD2
  522. #undef  XOS_ConvertHex4
  523. #define XOS_ConvertHex4                         0x200D2
  524. #undef  OS_ConvertHex6
  525. #define OS_ConvertHex6                          0xD3
  526. #undef  XOS_ConvertHex6
  527. #define XOS_ConvertHex6                         0x200D3
  528. #undef  OS_ConvertHex8
  529. #define OS_ConvertHex8                          0xD4
  530. #undef  XOS_ConvertHex8
  531. #define XOS_ConvertHex8                         0x200D4
  532. #undef  OS_ConvertCardinal1
  533. #define OS_ConvertCardinal1                     0xD5
  534. #undef  XOS_ConvertCardinal1
  535. #define XOS_ConvertCardinal1                    0x200D5
  536. #undef  OS_ConvertCardinal2
  537. #define OS_ConvertCardinal2                     0xD6
  538. #undef  XOS_ConvertCardinal2
  539. #define XOS_ConvertCardinal2                    0x200D6
  540. #undef  OS_ConvertCardinal3
  541. #define OS_ConvertCardinal3                     0xD7
  542. #undef  XOS_ConvertCardinal3
  543. #define XOS_ConvertCardinal3                    0x200D7
  544. #undef  OS_ConvertCardinal4
  545. #define OS_ConvertCardinal4                     0xD8
  546. #undef  XOS_ConvertCardinal4
  547. #define XOS_ConvertCardinal4                    0x200D8
  548. #undef  OS_ConvertInteger1
  549. #define OS_ConvertInteger1                      0xD9
  550. #undef  XOS_ConvertInteger1
  551. #define XOS_ConvertInteger1                     0x200D9
  552. #undef  OS_ConvertInteger2
  553. #define OS_ConvertInteger2                      0xDA
  554. #undef  XOS_ConvertInteger2
  555. #define XOS_ConvertInteger2                     0x200DA
  556. #undef  OS_ConvertInteger3
  557. #define OS_ConvertInteger3                      0xDB
  558. #undef  XOS_ConvertInteger3
  559. #define XOS_ConvertInteger3                     0x200DB
  560. #undef  OS_ConvertInteger4
  561. #define OS_ConvertInteger4                      0xDC
  562. #undef  XOS_ConvertInteger4
  563. #define XOS_ConvertInteger4                     0x200DC
  564. #undef  OS_ConvertBinary1
  565. #define OS_ConvertBinary1                       0xDD
  566. #undef  XOS_ConvertBinary1
  567. #define XOS_ConvertBinary1                      0x200DD
  568. #undef  OS_ConvertBinary2
  569. #define OS_ConvertBinary2                       0xDE
  570. #undef  XOS_ConvertBinary2
  571. #define XOS_ConvertBinary2                      0x200DE
  572. #undef  OS_ConvertBinary3
  573. #define OS_ConvertBinary3                       0xDF
  574. #undef  XOS_ConvertBinary3
  575. #define XOS_ConvertBinary3                      0x200DF
  576. #undef  OS_ConvertBinary4
  577. #define OS_ConvertBinary4                       0xE0
  578. #undef  XOS_ConvertBinary4
  579. #define XOS_ConvertBinary4                      0x200E0
  580. #undef  OS_ConvertSpacedCardinal1
  581. #define OS_ConvertSpacedCardinal1               0xE1
  582. #undef  XOS_ConvertSpacedCardinal1
  583. #define XOS_ConvertSpacedCardinal1              0x200E1
  584. #undef  OS_ConvertSpacedCardinal2
  585. #define OS_ConvertSpacedCardinal2               0xE2
  586. #undef  XOS_ConvertSpacedCardinal2
  587. #define XOS_ConvertSpacedCardinal2              0x200E2
  588. #undef  OS_ConvertSpacedCardinal3
  589. #define OS_ConvertSpacedCardinal3               0xE3
  590. #undef  XOS_ConvertSpacedCardinal3
  591. #define XOS_ConvertSpacedCardinal3              0x200E3
  592. #undef  OS_ConvertSpacedCardinal4
  593. #define OS_ConvertSpacedCardinal4               0xE4
  594. #undef  XOS_ConvertSpacedCardinal4
  595. #define XOS_ConvertSpacedCardinal4              0x200E4
  596. #undef  OS_ConvertSpacedInteger1
  597. #define OS_ConvertSpacedInteger1                0xE5
  598. #undef  XOS_ConvertSpacedInteger1
  599. #define XOS_ConvertSpacedInteger1               0x200E5
  600. #undef  OS_ConvertSpacedInteger2
  601. #define OS_ConvertSpacedInteger2                0xE6
  602. #undef  XOS_ConvertSpacedInteger2
  603. #define XOS_ConvertSpacedInteger2               0x200E6
  604. #undef  OS_ConvertSpacedInteger3
  605. #define OS_ConvertSpacedInteger3                0xE7
  606. #undef  XOS_ConvertSpacedInteger3
  607. #define XOS_ConvertSpacedInteger3               0x200E7
  608. #undef  OS_ConvertSpacedInteger4
  609. #define OS_ConvertSpacedInteger4                0xE8
  610. #undef  XOS_ConvertSpacedInteger4
  611. #define XOS_ConvertSpacedInteger4               0x200E8
  612. #undef  OS_ConvertFixedNetStation
  613. #define OS_ConvertFixedNetStation               0xE9
  614. #undef  XOS_ConvertFixedNetStation
  615. #define XOS_ConvertFixedNetStation              0x200E9
  616. #undef  OS_ConvertNetStation
  617. #define OS_ConvertNetStation                    0xEA
  618. #undef  XOS_ConvertNetStation
  619. #define XOS_ConvertNetStation                   0x200EA
  620. #undef  OS_ConvertFixedFileSize
  621. #define OS_ConvertFixedFileSize                 0xEB
  622. #undef  XOS_ConvertFixedFileSize
  623. #define XOS_ConvertFixedFileSize                0x200EB
  624. #undef  OS_ConvertFileSize
  625. #define OS_ConvertFileSize                      0xEC
  626. #undef  XOS_ConvertFileSize
  627. #define XOS_ConvertFileSize                     0x200EC
  628. #undef  OS_WriteI
  629. #define OS_WriteI                               0x100
  630. #undef  XOS_WriteI
  631. #define XOS_WriteI                              0x20100
  632. #undef  OS_Null
  633. #define OS_Null                                 0x100
  634. #undef  XOS_Null
  635. #define XOS_Null                                0x20100
  636. #undef  OS_CharToPrinter
  637. #define OS_CharToPrinter                        0x101
  638. #undef  XOS_CharToPrinter
  639. #define XOS_CharToPrinter                       0x20101
  640. #undef  OS_PrinterOn
  641. #define OS_PrinterOn                            0x102
  642. #undef  XOS_PrinterOn
  643. #define XOS_PrinterOn                           0x20102
  644. #undef  OS_PrinterOff
  645. #define OS_PrinterOff                           0x103
  646. #undef  XOS_PrinterOff
  647. #define XOS_PrinterOff                          0x20103
  648. #undef  OS_SplitCursors
  649. #define OS_SplitCursors                         0x104
  650. #undef  XOS_SplitCursors
  651. #define XOS_SplitCursors                        0x20104
  652. #undef  OS_JoinCursors
  653. #define OS_JoinCursors                          0x105
  654. #undef  XOS_JoinCursors
  655. #define XOS_JoinCursors                         0x20105
  656. #undef  OS_VDUOn
  657. #define OS_VDUOn                                0x106
  658. #undef  XOS_VDUOn
  659. #define XOS_VDUOn                               0x20106
  660. #undef  OS_Bell
  661. #define OS_Bell                                 0x107
  662. #undef  XOS_Bell
  663. #define XOS_Bell                                0x20107
  664. #undef  OS_Backspace
  665. #define OS_Backspace                            0x108
  666. #undef  XOS_Backspace
  667. #define XOS_Backspace                           0x20108
  668. #undef  OS_Tab
  669. #define OS_Tab                                  0x109
  670. #undef  XOS_Tab
  671. #define XOS_Tab                                 0x20109
  672. #undef  OS_LineFeed
  673. #define OS_LineFeed                             0x10A
  674. #undef  XOS_LineFeed
  675. #define XOS_LineFeed                            0x2010A
  676. #undef  OS_VerticalTab
  677. #define OS_VerticalTab                          0x10B
  678. #undef  XOS_VerticalTab
  679. #define XOS_VerticalTab                         0x2010B
  680. #undef  OS_ClS
  681. #define OS_ClS                                  0x10C
  682. #undef  XOS_ClS
  683. #define XOS_ClS                                 0x2010C
  684. #undef  OS_Return
  685. #define OS_Return                               0x10D
  686. #undef  XOS_Return
  687. #define XOS_Return                              0x2010D
  688. #undef  OS_PageModeOn
  689. #define OS_PageModeOn                           0x10E
  690. #undef  XOS_PageModeOn
  691. #define XOS_PageModeOn                          0x2010E
  692. #undef  OS_PageModeOff
  693. #define OS_PageModeOff                          0x10F
  694. #undef  XOS_PageModeOff
  695. #define XOS_PageModeOff                         0x2010F
  696. #undef  OS_ClG
  697. #define OS_ClG                                  0x110
  698. #undef  XOS_ClG
  699. #define XOS_ClG                                 0x20110
  700. #undef  OS_SetTextColour
  701. #define OS_SetTextColour                        0x111
  702. #undef  XOS_SetTextColour
  703. #define XOS_SetTextColour                       0x20111
  704. #undef  OS_SetGCOL
  705. #define OS_SetGCOL                              0x112
  706. #undef  XOS_SetGCOL
  707. #define XOS_SetGCOL                             0x20112
  708. #undef  OS_SetPalette
  709. #define OS_SetPalette                           0x113
  710. #undef  XOS_SetPalette
  711. #define XOS_SetPalette                          0x20113
  712. #undef  OS_ResetColours
  713. #define OS_ResetColours                         0x114
  714. #undef  XOS_ResetColours
  715. #define XOS_ResetColours                        0x20114
  716. #undef  OS_VDUOff
  717. #define OS_VDUOff                               0x115
  718. #undef  XOS_VDUOff
  719. #define XOS_VDUOff                              0x20115
  720. #undef  OS_SetMode
  721. #define OS_SetMode                              0x116
  722. #undef  XOS_SetMode
  723. #define XOS_SetMode                             0x20116
  724. #undef  OS_Misc
  725. #define OS_Misc                                 0x117
  726. #undef  XOS_Misc
  727. #define XOS_Misc                                0x20117
  728. #undef  OS_SetGraphicsWindow
  729. #define OS_SetGraphicsWindow                    0x118
  730. #undef  XOS_SetGraphicsWindow
  731. #define XOS_SetGraphicsWindow                   0x20118
  732. #undef  OS_PlotVDU
  733. #define OS_PlotVDU                              0x119
  734. #undef  XOS_PlotVDU
  735. #define XOS_PlotVDU                             0x20119
  736. #undef  OS_ResetWindows
  737. #define OS_ResetWindows                         0x11A
  738. #undef  XOS_ResetWindows
  739. #define XOS_ResetWindows                        0x2011A
  740. #undef  OS_Escape
  741. #define OS_Escape                               0x11B
  742. #undef  XOS_Escape
  743. #define XOS_Escape                              0x2011B
  744. #undef  OS_SetTextWindow
  745. #define OS_SetTextWindow                        0x11C
  746. #undef  XOS_SetTextWindow
  747. #define XOS_SetTextWindow                       0x2011C
  748. #undef  OS_SetGraphicsOrigin
  749. #define OS_SetGraphicsOrigin                    0x11D
  750. #undef  XOS_SetGraphicsOrigin
  751. #define XOS_SetGraphicsOrigin                   0x2011D
  752. #undef  OS_HomeTextCursor
  753. #define OS_HomeTextCursor                       0x11E
  754. #undef  XOS_HomeTextCursor
  755. #define XOS_HomeTextCursor                      0x2011E
  756. #undef  OS_SetTextCursor
  757. #define OS_SetTextCursor                        0x11F
  758. #undef  XOS_SetTextCursor
  759. #define XOS_SetTextCursor                       0x2011F
  760. #undef  OS_Space
  761. #define OS_Space                                0x120
  762. #undef  XOS_Space
  763. #define XOS_Space                               0x20120
  764. #undef  OS_Delete
  765. #define OS_Delete                               0x17F
  766. #undef  XOS_Delete
  767. #define XOS_Delete                              0x2017F
  768. #undef  UserV
  769. #define UserV                                   0x0
  770. #undef  UKVDU23V
  771. #define UKVDU23V                                0x17
  772. #undef  VDUXV
  773. #define VDUXV                                   0x1B
  774. #undef  Service_ReleaseFIQ
  775. #define Service_ReleaseFIQ                      0xB
  776. #undef  Service_ClaimFIQ
  777. #define Service_ClaimFIQ                        0xC
  778. #undef  Service_Reset
  779. #define Service_Reset                           0x27
  780. #undef  Service_KeyHandler
  781. #define Service_KeyHandler                      0x44
  782. #undef  Service_ModeChange
  783. #define Service_ModeChange                      0x46
  784. #undef  Service_ClaimFIQInBackground
  785. #define Service_ClaimFIQInBackground            0x47
  786. #undef  Service_MemoryMoved
  787. #define Service_MemoryMoved                     0x4E
  788. #undef  Service_PreModeChange
  789. #define Service_PreModeChange                   0x4D
  790. #undef  Service_ModeExtension
  791. #define Service_ModeExtension                   0x50
  792. #undef  Service_ModeTranslation
  793. #define Service_ModeTranslation                 0x51
  794. #undef  Service_ValidateAddress
  795. #define Service_ValidateAddress                 0x6D
  796. #undef  Service_MonitorLeadTranslation
  797. #define Service_MonitorLeadTranslation          0x76
  798. #undef  Service_ModeChanging
  799. #define Service_ModeChanging                    0x89
  800. #undef  Service_EnumerateScreenModes
  801. #define Service_EnumerateScreenModes            0x8D
  802. #undef  Service_PagesUnsafe
  803. #define Service_PagesUnsafe                     0x8E
  804. #undef  Service_PagesSafe
  805. #define Service_PagesSafe                       0x8F
  806. #undef  Service_DynamicAreaCreate
  807. #define Service_DynamicAreaCreate               0x90
  808. #undef  Service_DynamicAreaRemove
  809. #define Service_DynamicAreaRemove               0x91
  810. #undef  Service_DynamicAreaRenumber
  811. #define Service_DynamicAreaRenumber             0x92
  812. #undef  Event_CharInput
  813. #define Event_CharInput                         0x2
  814. #undef  Event_VSync
  815. #define Event_VSync                             0x4
  816. #undef  Event_IntervalTimer
  817. #define Event_IntervalTimer                     0x5
  818. #undef  Event_Escape
  819. #define Event_Escape                            0x6
  820. #undef  Event_User
  821. #define Event_User                              0x9
  822. #undef  Event_MouseTransition
  823. #define Event_MouseTransition                   0xA
  824. #undef  Event_KeyTransition
  825. #define Event_KeyTransition                     0xB
  826. #undef  UpCall_MoveMemoryRequest
  827. #define UpCall_MoveMemoryRequest                0x101
  828.  
  829. /************************************
  830.  * Structure and union declarations *
  831.  ************************************/
  832. typedef struct os_mode_                         *os_mode;
  833. typedef struct os_colour_pair                   os_colour_pair;
  834. typedef struct os_palette                       os_palette;
  835. typedef struct os_sprite_palette                os_sprite_palette;
  836. typedef struct os_ecf                           os_ecf;
  837. typedef struct os_correction_table              os_correction_table;
  838. typedef struct os_bcd_date_and_time             os_bcd_date_and_time;
  839. typedef struct os_station_number                os_station_number;
  840. typedef struct os_box                           os_box;
  841. typedef struct os_factors                       os_factors;
  842. typedef struct os_change_box                    os_change_box;
  843. typedef struct os_error                         os_error;
  844. typedef struct os_coord                         os_coord;
  845. typedef struct os_trfm                          os_trfm;
  846. typedef struct os_hom_trfm                      os_hom_trfm;
  847. typedef struct os_pgm                           os_pgm;
  848. typedef struct os_register_block                os_register_block;
  849. typedef struct os_vdu_var_list                  os_vdu_var_list;
  850. typedef struct os_key_handler                   os_key_handler;
  851. typedef struct os_gi                            os_gi;
  852. typedef struct os_gs                            os_gs;
  853. typedef struct os_mem_map_request               os_mem_map_request;
  854. typedef struct os_mem_map_request_list          os_mem_map_request_list;
  855. typedef struct os_page_block                    os_page_block;
  856. typedef struct pointerv_record                  pointerv_record;
  857. typedef struct os_mode_block                    os_mode_block;
  858. typedef struct os_mode_selector                 os_mode_selector;
  859.  
  860. /********************
  861.  * Type definitions *
  862.  ********************/
  863. typedef int os_t;
  864.  
  865. typedef byte os_f;
  866.  
  867. typedef byte os_gcol;
  868.  
  869. typedef byte os_tint;
  870.  
  871. typedef byte os_action;
  872.  
  873. typedef bits os_colour;
  874.  
  875. typedef int os_colour_number;
  876.  
  877. struct os_colour_pair
  878.    {  os_colour on;
  879.       os_colour off;
  880.    };
  881.  
  882. struct os_palette
  883.    {  os_colour entries [UNKNOWN];
  884.    };
  885.  
  886. #define os_PALETTE(N) \
  887.    struct \
  888.       {  os_colour entries [N]; \
  889.       }
  890.  
  891. #define os_SIZEOF_PALETTE(N) \
  892.    ((N)*sizeof ((os_palette *) NULL)->entries)
  893.  
  894. struct os_sprite_palette
  895.    {  os_colour_pair entries [UNKNOWN];
  896.    };
  897.  
  898. #define os_SPRITE_PALETTE(N) \
  899.    struct \
  900.       {  os_colour_pair entries [N]; \
  901.       }
  902.  
  903. #define os_SIZEOF_SPRITE_PALETTE(N) \
  904.    ((N)*sizeof ((os_sprite_palette *) NULL)->entries)
  905.  
  906. struct os_ecf
  907.    {  bits ecf [8];
  908.    };
  909.  
  910. struct os_correction_table
  911.    {  byte gamma [256];
  912.    };
  913.  
  914. struct os_bcd_date_and_time
  915.    {  byte year;
  916.       byte month;
  917.       byte date;
  918.       byte weekday;
  919.       byte hour;
  920.       byte minute;
  921.       byte second;
  922.    };
  923.  
  924. struct os_station_number
  925.    {  int station;
  926.       int net;
  927.    };
  928.  
  929. struct os_box
  930.    {  int x0;
  931.       int y0;
  932.       int x1;
  933.       int y1;
  934.    };
  935.  
  936. struct os_factors
  937.    {  int xmul;
  938.       int ymul;
  939.       int xdiv;
  940.       int ydiv;
  941.    };
  942.  
  943. struct os_change_box
  944.    {  int state;
  945.       os_box box;
  946.    };
  947.  
  948. struct os_error
  949.    {  bits errnum;
  950.       char errmess [252];
  951.    };
  952.  
  953. typedef byte os_date_and_time [5];
  954.  
  955. struct os_coord
  956.    {  int x;
  957.       int y;
  958.    };
  959.  
  960. struct os_trfm
  961.    {  int entries [3] [2];
  962.    };
  963.  
  964. struct os_hom_trfm
  965.    {  int entries [2] [2];
  966.    };
  967.  
  968. struct os_pgm
  969.    {  os_coord coords [4];
  970.    };
  971.  
  972. struct os_register_block
  973.    {  int registers [16];
  974.    };
  975.  
  976. struct os_vdu_var_list
  977.    {  int var [UNKNOWN];
  978.    };
  979.  
  980. #define os_VDU_VAR_LIST(N) \
  981.    struct \
  982.       {  int var [N]; \
  983.       }
  984.  
  985. #define os_SIZEOF_VDU_VAR_LIST(N) \
  986.    ((N)*sizeof ((os_vdu_var_list *) NULL)->var)
  987.  
  988. struct os_key_handler
  989.    {  byte k [UNKNOWN];
  990.    };
  991.  
  992. #define os_KEY_HANDLER(N) \
  993.    struct \
  994.       {  byte k [N]; \
  995.       }
  996.  
  997. #define os_SIZEOF_KEY_HANDLER(N) \
  998.    ((N)*sizeof ((os_key_handler *) NULL)->k)
  999.  
  1000. struct os_gi
  1001.    {  byte type;
  1002.       byte i [4];
  1003.    };
  1004.  
  1005. struct os_gs
  1006.    {  short size;
  1007.       char s [UNKNOWN];
  1008.    };
  1009.  
  1010. #define os_GS(N) \
  1011.    struct \
  1012.       {  short size; \
  1013.          char s [N]; \
  1014.       }
  1015.  
  1016. #define os_SIZEOF_GS(N) \
  1017.    (offsetof (os_gs, s) + \
  1018.          (N)*sizeof ((os_gs *) NULL)->s)
  1019.  
  1020. struct os_mem_map_request
  1021.    {  int page_no;
  1022.       byte *map;
  1023.       bits access;
  1024.    };
  1025.  
  1026. struct os_mem_map_request_list
  1027.    {  os_mem_map_request requests [UNKNOWN];
  1028.    };
  1029.  
  1030. #define os_MEM_MAP_REQUEST_LIST(N) \
  1031.    struct \
  1032.       {  os_mem_map_request requests [N]; \
  1033.       }
  1034.  
  1035. #define os_SIZEOF_MEM_MAP_REQUEST_LIST(N) \
  1036.    ((N)*sizeof ((os_mem_map_request_list *) NULL)->requests)
  1037.  
  1038. struct os_page_block
  1039.    {  int page_no;
  1040.       byte *log_addr;
  1041.       byte *phys_addr;
  1042.    };
  1043.  
  1044. struct pointerv_record
  1045.    {  pointerv_record *next;
  1046.       bits flags;
  1047.       int pointer_type;
  1048.       char name [30];
  1049.    };
  1050.  
  1051. struct os_mode_block
  1052.    {  int size;
  1053.       bits flags;
  1054.       int xres;
  1055.       int yres;
  1056.       int log2_bpp;
  1057.       int frame_rate;
  1058.       char name [UNKNOWN];
  1059.    };
  1060.  
  1061. #define os_MODE_BLOCK(N) \
  1062.    struct \
  1063.       {  int size; \
  1064.          bits flags; \
  1065.          int xres; \
  1066.          int yres; \
  1067.          int log2_bpp; \
  1068.          int frame_rate; \
  1069.          char name [N]; \
  1070.       }
  1071.  
  1072. #define os_SIZEOF_MODE_BLOCK(N) \
  1073.    (offsetof (os_mode_block, name) + \
  1074.          (N)*sizeof ((os_mode_block *) NULL)->name)
  1075.  
  1076. struct os_mode_selector
  1077.    {  bits flags;
  1078.       int xres;
  1079.       int yres;
  1080.       int log2_bpp;
  1081.       int frame_rate;
  1082.       struct
  1083.       {  int var;
  1084.          int val;
  1085.       }
  1086.       modevars [UNKNOWN];
  1087.    };
  1088.  
  1089. #define os_MODE_SELECTOR(N) \
  1090.    struct \
  1091.       {  bits flags; \
  1092.          int xres; \
  1093.          int yres; \
  1094.          int log2_bpp; \
  1095.          int frame_rate; \
  1096.          struct \
  1097.          {  int var; \
  1098.             int val; \
  1099.          } \
  1100.          modevars [N]; \
  1101.       }
  1102.  
  1103. #define os_SIZEOF_MODE_SELECTOR(N) \
  1104.    (offsetof (os_mode_selector, modevars) + \
  1105.          (N)*sizeof ((os_mode_selector *) NULL)->modevars)
  1106.  
  1107. /************************
  1108.  * Constant definitions *
  1109.  ************************/
  1110. #define os_ERROR_LIMIT                          252
  1111. #define os_FILE_NAME_LIMIT                      256
  1112. #define os_CLI_LIMIT                            256
  1113. #define os_RSHIFT                               8
  1114. #define os_GSHIFT                               16
  1115. #define os_BSHIFT                               24
  1116. #define os_R                                    0xFF00u
  1117. #define os_G                                    0xFF0000u
  1118. #define os_B                                    0xFF000000u
  1119. #define os_COLOUR_RANGE                         255
  1120. #define os_MODE1BPP90X45                        ((os_mode) 0)
  1121. #define os_MODE2BPP90X45                        ((os_mode) 8)
  1122. #define os_MODE4BPP90X45                        ((os_mode) 12)
  1123. #define os_MODE8BPP90X45                        ((os_mode) 15)
  1124. #define os_MODE2BPP45X45                        ((os_mode) 1)
  1125. #define os_MODE4BPP45X45                        ((os_mode) 9)
  1126. #define os_MODE8BPP45X45                        ((os_mode) 13)
  1127. #define os_MODE1BPP90X90                        ((os_mode) 25)
  1128. #define os_MODE2BPP90X90                        ((os_mode) 26)
  1129. #define os_MODE4BPP90X90                        ((os_mode) 27)
  1130. #define os_MODE8BPP90X90                        ((os_mode) 28)
  1131. #define os_INCH                                 180
  1132. #define os_VDU_NULL                             ((char) '\x00')
  1133. #define os_VDU_CHAR_TO_PRINTER                  ((char) '\x01')
  1134. #define os_VDU_PRINTER_ON                       ((char) '\x02')
  1135. #define os_VDU_PRINTER_OFF                      ((char) '\x03')
  1136. #define os_VDU_GRAPH_TEXT_OFF                   ((char) '\x04')
  1137. #define os_VDU_GRAPH_TEXT_ON                    ((char) '\x05')
  1138. #define os_VDU_SCREEN_ON                        ((char) '\x06')
  1139. #define os_VDU_BELL                             ((char) '\x07')
  1140. #define os_VDU_BACKSPACE                        ((char) '\x08')
  1141. #define os_VDU_TAB                              ((char) '\x09')
  1142. #define os_VDU_LINEFEED                         ((char) '\x0A')
  1143. #define os_VDU_VERTICAL_TAB                     ((char) '\x0B')
  1144. #define os_VDU_CLS                              ((char) '\x0C')
  1145. #define os_VDU_RETURN                           ((char) '\x0D')
  1146. #define os_VDU_PAGE_MODE_ON                     ((char) '\x0E')
  1147. #define os_VDU_PAGE_MODE_OFF                    ((char) '\x0F')
  1148. #define os_VDU_CLG                              ((char) '\x10')
  1149. #define os_VDU_SET_TEXT_COLOUR                  ((char) '\x11')
  1150. #define os_VDU_SET_GCOL                         ((char) '\x12')
  1151. #define os_VDU_SET_PALETTE                      ((char) '\x13')
  1152. #define os_VDU_RESET_COLOURS                    ((char) '\x14')
  1153. #define os_VDU_SCREEN_OFF                       ((char) '\x15')
  1154. #define os_VDU_MODE                             ((char) '\x16')
  1155. #define os_VDU_MISC                             ((char) '\x17')
  1156. #define os_VDU_SET_GRAPHICS_WINDOW              ((char) '\x18')
  1157. #define os_VDU_PLOT                             ((char) '\x19')
  1158. #define os_VDU_RESET_WINDOWS                    ((char) '\x1A')
  1159. #define os_VDU_ESCAPE                           ((char) '\x1B')
  1160. #define os_VDU_SET_TEXT_WINDOW                  ((char) '\x1C')
  1161. #define os_VDU_SET_GRAPHICS_ORIGIN              ((char) '\x1D')
  1162. #define os_VDU_HOME_TEXT_CURSOR                 ((char) '\x1E')
  1163. #define os_VDU_SET_TEXT_CURSOR                  ((char) '\x1F')
  1164. #define os_VDU_DELETE                           ((char) '\x7F')
  1165. #define os_MISC_INTERLACE                       ((char) '\x00')
  1166. #define os_MISC_CURSOR                          ((char) '\x01')
  1167. #define os_MISC_SET_ECF1                        ((char) '\x02')
  1168. #define os_MISC_SET_ECF2                        ((char) '\x03')
  1169. #define os_MISC_SET_ECF3                        ((char) '\x04')
  1170. #define os_MISC_SET_ECF4                        ((char) '\x05')
  1171. #define os_MISC_SET_DOT_STYLE                   ((char) '\x06')
  1172. #define os_MISC_SCROLL                          ((char) '\x07')
  1173. #define os_MISC_CLEAR_REGION                    ((char) '\x08')
  1174. #define os_MISC_SET_ON                          ((char) '\x09')
  1175. #define os_MISC_SET_OFF                         ((char) '\x0A')
  1176. #define os_MISC_SET_BBCECF                      ((char) '\x0B')
  1177. #define os_MISC_SET_UNPACKED_ECF1               ((char) '\x0C')
  1178. #define os_MISC_SET_UNPACKED_ECF2               ((char) '\x0D')
  1179. #define os_MISC_SET_UNPACKED_ECF3               ((char) '\x0E')
  1180. #define os_MISC_SET_UNPACKED_ECF4               ((char) '\x0F')
  1181. #define os_MISC_SET_CURSOR_MOVEMENT             ((char) '\x10')
  1182. #define os_MISC_MISC                            ((char) '\x11')
  1183. #define os_MISC_SET_TEXT_FG_TINT                ((char) '\x00')
  1184. #define os_MISC_SET_TEXT_BG_TINT                ((char) '\x01')
  1185. #define os_MISC_SET_GRAPHICS_FG_TINT            ((char) '\x02')
  1186. #define os_MISC_SET_GRAPHICS_BG_TINT            ((char) '\x03')
  1187. #define os_MISC_SET_ECF_INTERPRETATION          ((char) '\x04')
  1188. #define os_MISC_INVERT_TEXT                     ((char) '\x05')
  1189. #define os_MISC_SET_ECF_ORIGIN                  ((char) '\x06')
  1190. #define os_MISC_SET_CHAR_SIZE                   ((char) '\x07')
  1191. #define os_ACTION_OVERWRITE                     ((os_action) 0)
  1192. #define os_ACTION_DISJOIN                       ((os_action) 1)
  1193. #define os_ACTION_CONJOIN                       ((os_action) 2)
  1194. #define os_ACTION_EXCLUSIVE_DISJOIN             ((os_action) 3)
  1195. #define os_ACTION_INVERT                        ((os_action) 4)
  1196. #define os_ACTION_IDENTITY                      ((os_action) 5)
  1197. #define os_ACTION_CONJOIN_NEGATION              ((os_action) 6)
  1198. #define os_ACTION_DISJOIN_NEGATION              ((os_action) 7)
  1199. #define os_ACTION_USE_MASK                      ((os_action) 8)
  1200. #define os_ACTION_USE_ECF1                      ((os_action) 16)
  1201. #define os_ACTION_USE_ECF2                      ((os_action) 32)
  1202. #define os_ACTION_USE_ECF3                      ((os_action) 48)
  1203. #define os_ACTION_USE_ECF4                      ((os_action) 64)
  1204. #define os_ACTION_USE_GIANT_ECF                 ((os_action) 80)
  1205. #define os_ACTION_USE_SPRITE_PALETTE            ((os_action) 32)
  1206. #define os_GCOL_SET_FG                          ((os_gcol) 0)
  1207. #define os_GCOL_SET_BG                          ((os_gcol) 128)
  1208. #define os_PLOT_SOLID                           0
  1209. #define os_PLOT_SOLID_EX_END                    8
  1210. #define os_PLOT_DOTTED                          16
  1211. #define os_PLOT_DOTTED_EX_END                   24
  1212. #define os_PLOT_SOLID_EX_START                  32
  1213. #define os_PLOT_SOLID_EX_BOTH                   40
  1214. #define os_PLOT_DOTTED_EX_START                 48
  1215. #define os_PLOT_DOTTED_EX_BOTH                  56
  1216. #define os_PLOT_POINT                           64
  1217. #define os_PLOT_HORIZONTAL_TO_NON_BG            72
  1218. #define os_PLOT_TRIANGLE                        80
  1219. #define os_PLOT_RIGHT_TO_BG                     88
  1220. #define os_PLOT_RECTANGLE                       96
  1221. #define os_PLOT_HORIZONTAL_TO_FG                104
  1222. #define os_PLOT_PARALLELOGRAM                   112
  1223. #define os_PLOT_RIGHT_TO_NON_FG                 120
  1224. #define os_PLOT_FLOOD_TO_NON_BG                 128
  1225. #define os_PLOT_FLOOD_TO_FG                     136
  1226. #define os_PLOT_CIRCLE_OUTLINE                  144
  1227. #define os_PLOT_CIRCLE                          152
  1228. #define os_PLOT_ARC                             160
  1229. #define os_PLOT_SEGMENT                         168
  1230. #define os_PLOT_SECTOR                          176
  1231. #define os_PLOT_BLOCK                           184
  1232. #define os_PLOT_ELLIPSE_OUTLINE                 192
  1233. #define os_PLOT_ELLIPSE                         200
  1234. #define os_MOVE_BY                              0
  1235. #define os_PLOT_BY                              1
  1236. #define os_PLOT_INVERSE_BY                      2
  1237. #define os_PLOT_BG_BY                           3
  1238. #define os_MOVE_TO                              4
  1239. #define os_PLOT_TO                              5
  1240. #define os_PLOT_INVERSE_TO                      6
  1241. #define os_PLOT_BG_TO                           7
  1242. #define os_VARTYPE_STRING                       0
  1243. #define os_VARTYPE_NUMBER                       1
  1244. #define os_VARTYPE_MACRO                        2
  1245. #define os_VARTYPE_EXPANDED                     3
  1246. #define os_VARTYPE_LITERAL_STRING               4
  1247. #define os_VARTYPE_CODE                         16
  1248. #define os_MODEVAR_MODE_FLAGS                   0
  1249. #define os_MODEVAR_RSCREEN                      1
  1250. #define os_MODEVAR_BSCREEN                      2
  1251. #define os_MODEVAR_NCOLOUR                      3
  1252. #define os_MODEVAR_XEIG_FACTOR                  4
  1253. #define os_MODEVAR_YEIG_FACTOR                  5
  1254. #define os_MODEVAR_LINE_LENGTH                  6
  1255. #define os_MODEVAR_SCREEN_SIZE                  7
  1256. #define os_MODEVAR_YSHIFT_FACTOR                8
  1257. #define os_MODEVAR_LOG2_BPP                     9
  1258. #define os_MODEVAR_LOG2_BPC                     10
  1259. #define os_MODEVAR_XWIND_LIMIT                  11
  1260. #define os_MODEVAR_YWIND_LIMIT                  12
  1261. #define os_VDUVAR_GWL_COL                       128
  1262. #define os_VDUVAR_GWB_ROW                       129
  1263. #define os_VDUVAR_GWR_COL                       130
  1264. #define os_VDUVAR_GWT_ROW                       131
  1265. #define os_VDUVAR_TWL_COL                       132
  1266. #define os_VDUVAR_TWB_ROW                       133
  1267. #define os_VDUVAR_TWR_COL                       134
  1268. #define os_VDUVAR_TWT_ROW                       135
  1269. #define os_VDUVAR_ORGX                          136
  1270. #define os_VDUVAR_ORGY                          137
  1271. #define os_VDUVAR_GCSX                          138
  1272. #define os_VDUVAR_GCSY                          139
  1273. #define os_VDUVAR_OLDER_CSX                     140
  1274. #define os_VDUVAR_OLDER_CSY                     141
  1275. #define os_VDUVAR_OLD_CSX                       142
  1276. #define os_VDUVAR_OLD_CSY                       143
  1277. #define os_VDUVAR_GCS_IX                        144
  1278. #define os_VDUVAR_GCS_IY                        145
  1279. #define os_VDUVAR_NEW_PTX                       146
  1280. #define os_VDUVAR_NEW_PTY                       147
  1281. #define os_VDUVAR_SCREEN_START                  148
  1282. #define os_VDUVAR_DISPLAY_START                 149
  1283. #define os_VDUVAR_TOTAL_SCREEN_SIZE             150
  1284. #define os_VDUVAR_GPLFMD                        151
  1285. #define os_VDUVAR_GPLBMD                        152
  1286. #define os_VDUVAR_GFCOL                         153
  1287. #define os_VDUVAR_GBCOL                         154
  1288. #define os_VDUVAR_TFORE_COL                     155
  1289. #define os_VDUVAR_TBACK_COL                     156
  1290. #define os_VDUVAR_GF_TINT                       157
  1291. #define os_VDUVAR_GB_TINT                       158
  1292. #define os_VDUVAR_TF_TINT                       159
  1293. #define os_VDUVAR_TB_TINT                       160
  1294. #define os_VDUVAR_MAX_MODE                      161
  1295. #define os_VDUVAR_GCHAR_SIZEX                   162
  1296. #define os_VDUVAR_GCHAR_SIZEY                   163
  1297. #define os_VDUVAR_GCHAR_SPACEX                  164
  1298. #define os_VDUVAR_GCHAR_SPACEY                  165
  1299. #define os_VDUVAR_HLINE_ADDR                    166
  1300. #define os_VDUVAR_TCHAR_SIZEX                   167
  1301. #define os_VDUVAR_TCHAR_SIZEY                   168
  1302. #define os_VDUVAR_TCHAR_SPACEX                  169
  1303. #define os_VDUVAR_TCHAR_SPACEY                  170
  1304. #define os_VDUVAR_GCOL_ORA_EOR_ADDR             171
  1305. #define os_VDUVAR_VIDC_CLOCK_SPEED              172
  1306. #define os_VDUVAR_WINDOW_WIDTH                  256
  1307. #define os_VDUVAR_WINDOW_HEIGHT                 257
  1308. #define os_FOREGROUND                           0x0u
  1309. #define os_BACKGROUND                           0x80u
  1310. #define os_COLOUR_TRANSPARENT                   ((os_colour) -1)
  1311. #define os_COLOUR_RED                           ((os_colour) 65280)
  1312. #define os_COLOUR_GREEN                         ((os_colour) 16711680)
  1313. #define os_COLOUR_BLUE                          ((os_colour) -16777216)
  1314. #define os_COLOUR_CYAN                          ((os_colour) -65536)
  1315. #define os_COLOUR_MAGENTA                       ((os_colour) -16711936)
  1316. #define os_COLOUR_YELLOW                        ((os_colour) 16776960)
  1317. #define os_COLOUR_WHITE                         ((os_colour) -256)
  1318. #define os_COLOUR_VERY_LIGHT_GREY               ((os_colour) -572662528)
  1319. #define os_COLOUR_LIGHT_GREY                    ((os_colour) -1145324800)
  1320. #define os_COLOUR_MID_LIGHT_GREY                ((os_colour) -1717987072)
  1321. #define os_COLOUR_MID_DARK_GREY                 ((os_colour) 2004317952)
  1322. #define os_COLOUR_DARK_GREY                     ((os_colour) 1431655680)
  1323. #define os_COLOUR_VERY_DARK_GREY                ((os_colour) 858993408)
  1324. #define os_COLOUR_BLACK                         ((os_colour) 0)
  1325. #define os_COLOUR_DARK_BLUE                     ((os_colour) -1723596800)
  1326. #define os_COLOUR_LIGHT_YELLOW                  ((os_colour) 15658496)
  1327. #define os_COLOUR_LIGHT_GREEN                   ((os_colour) 13369344)
  1328. #define os_COLOUR_LIGHT_RED                     ((os_colour) 56576)
  1329. #define os_COLOUR_CREAM                         ((os_colour) -1141969408)
  1330. #define os_COLOUR_DARK_GREEN                    ((os_colour) 8934656)
  1331. #define os_COLOUR_ORANGE                        ((os_colour) 12320512)
  1332. #define os_COLOUR_LIGHT_BLUE                    ((os_colour) -4521984)
  1333. #define os_DEVICE_PRINTER_BUSY                  0
  1334. #define os_DEVICE_SERIAL_RINGING                1
  1335. #define os_DEVICE_PRINTER_ACKNOWLEDGE           2
  1336. #define os_DEVICE_VSYNC                         3
  1337. #define os_DEVICE_POWER_ON                      4
  1338. #define os_DEVICE_IOC_TIMER0                    5
  1339. #define os_DEVICE_IOC_TIMER1                    6
  1340. #define os_DEVICE_FIQ_DOWNGRADE                 7
  1341. #define os_DEVICE_EXPANSION_FIQ_DOWNGRADE       8
  1342. #define os_DEVICE_SOUND_BUFFER                  9
  1343. #define os_DEVICE_SERIAL_CONTROLLER             10
  1344. #define os_DEVICE_HARD_DISC_CONTROLLER          11
  1345. #define os_DEVICE_FLOPPY_DISC_CHANGED           12
  1346. #define os_DEVICE_EXPANSION_CARD                13
  1347. #define os_DEVICE_KEYBOARD_TX_EMPTY             14
  1348. #define os_DEVICE_KEYBOARD_RX_FULL              15
  1349. #define os_DEVICE_PRINTER                       0
  1350. #define os_DEVICE_BATTERY_WARNING               1
  1351. #define os_DEVICE_FLOPPY_DISC_INDEX             2
  1352. #define os_DEVICE_IDE_DISC                      11
  1353. #define os_ERROR_NUMBER_SHIFT                   0
  1354. #define os_ERROR_NUMBER                         0xFFu
  1355. #define os_ERROR_SOURCE_SHIFT                   8
  1356. #define os_ERROR_SOURCE                         0xFFFF00u
  1357. #define os_ERROR_CATEGORY_SHIFT                 24
  1358. #define os_ERROR_CATEGORY                       0x7000000u
  1359. #define os_CATEGORY_UNCLASSIFIED                0
  1360. #define os_CATEGORY_INFORMATION                 1
  1361. #define os_CATEGORY_WARNING                     2
  1362. #define os_CATEGORY_SYSTEM                      3
  1363. #define os_GLOBAL_ESCAPE                        1
  1364. #define os_GLOBAL_FATAL                         2
  1365. #define os_GLOBAL_IS_AFIL                       3
  1366. #define os_GLOBAL_ISNT_FIL                      4
  1367. #define os_GLOBAL_IS_ADIR                       5
  1368. #define os_GLOBAL_ISNT_DIR                      6
  1369. #define os_GLOBAL_NO_FILE                       7
  1370. #define os_GLOBAL_NO_DIR                        8
  1371. #define os_GLOBAL_NO_ANY                        9
  1372. #define os_GLOBAL_TYPS_BAD                      10
  1373. #define os_GLOBAL_BAD_REN                       11
  1374. #define os_GLOBAL_BAD_ACC                       12
  1375. #define os_GLOBAL_OPN_FILS                      13
  1376. #define os_GLOBAL_BAD_NAME                      14
  1377. #define os_GLOBAL_LONG_NAM                      15
  1378. #define os_GLOBAL_CHANNEL                       16
  1379. #define os_GLOBAL_BAD_SWI                       17
  1380. #define os_GLOBAL_MOD_IN_US                     18
  1381. #define os_GLOBAL_STR_OFLO                      19
  1382. #define os_GLOBAL_NUM_OFLO                      20
  1383. #define os_GLOBAL_BUF_OFLO                      21
  1384. #define os_GLOBAL_BAD_STN                       22
  1385. #define os_GLOBAL_BAD_NET                       23
  1386. #define os_GLOBAL_FULL_NET                      24
  1387. #define os_GLOBAL_NO_ECO                        25
  1388. #define os_GLOBAL_BAD_READ                      26
  1389. #define os_GLOBAL_BAD_WRT                       27
  1390. #define os_GLOBAL_DATA_LST                      28
  1391. #define os_GLOBAL_BAD_FS_OP                     29
  1392. #define os_GLOBAL_FS_NO_RD                      30
  1393. #define os_GLOBAL_FS_NO_WRT                     31
  1394. #define os_GLOBAL_FS_IN_USE                     32
  1395. #define os_GLOBAL_BAD_ADDRESS                   33
  1396. #define os_GLOBAL_NO_STORE                      34
  1397. #define os_GLOBAL_RAM_LOADC                     35
  1398. #define os_GLOBAL_DDS0                          36
  1399. #define os_GLOBAL_DDS1                          37
  1400. #define os_GLOBAL_DDS2                          38
  1401. #define os_GLOBAL_DDS3                          39
  1402. #define os_GLOBAL_CSDS                          40
  1403. #define os_GLOBAL_LDS                           41
  1404. #define os_GLOBAL_URDS                          42
  1405. #define os_GLOBAL_DR                            43
  1406. #define os_GLOBAL_APP                           44
  1407. #define os_GLOBAL_EX_DT                         45
  1408. #define os_GLOBAL_EX_LD_EX                      46
  1409. #define os_GLOBAL_USE_DESK                      47
  1410. #define os_GLOBAL_APP_QUIT                      48
  1411. #define os_GLOBAL_NO_MEM                        49
  1412. #define os_GLOBAL_BAD_HARD                      50
  1413. #define os_GLOBAL_BAD_PARM                      51
  1414. #define os_GLOBAL_NO_WIMP                       52
  1415. #define error_ESCAPE                            0x11u
  1416. #define error_BAD_MODE                          0x19u
  1417. #define error_IS_ADIR                           0xA8u
  1418. #define error_TYPES_DONT_MATCH                  0xAFu
  1419. #define error_BAD_RENAME                        0xB0u
  1420. #define error_BAD_COPY                          0xB1u
  1421. #define error_OUTSIDE_FILE                      0xB7u
  1422. #define error_ACCESS_VIOLATION                  0xBDu
  1423. #define error_TOO_MANY_OPEN_FILES               0xC0u
  1424. #define error_NOT_OPEN_FOR_UPDATE               0xC1u
  1425. #define error_FILE_OPEN                         0xC2u
  1426. #define error_OBJECT_LOCKED                     0xC3u
  1427. #define error_ALREADY_EXISTS                    0xC4u
  1428. #define error_BAD_FILE_NAME                     0xCCu
  1429. #define error_FILE_NOT_FOUND                    0xD6u
  1430. #define error_SYNTAX                            0xDCu
  1431. #define error_BAD_NO_PARMS                      0xDCu
  1432. #define error_TOO_MANY_PARMS                    0xDCu
  1433. #define error_CHANNEL                           0xDEu
  1434. #define error_END_OF_FILE                       0xDFu
  1435. #define error_BAD_FILING_SYSTEM_NAME            0xF8u
  1436. #define error_UNKNOWN_FILING_SYSTEM             0xF8u
  1437. #define error_BAD_KEY                           0xFBu
  1438. #define error_BAD_ADDRESS                       0xFCu
  1439. #define error_BAD_STRING                        0xFDu
  1440. #define error_BAD_ALIAS_STRING                  0xFDu
  1441. #define error_BAD_PARM_STRING                   0xFDu
  1442. #define error_WILD_CARDS                        0xFDu
  1443. #define error_BAD_COMMAND                       0xFEu
  1444. #define error_BAD_MAC_VAL                       0x120u
  1445. #define error_BAD_VAR_NAM                       0x121u
  1446. #define error_BAD_VAR_TYPE                      0x122u
  1447. #define error_VAR_NO_ROOM                       0x123u
  1448. #define error_VAR_CANT_FIND                     0x124u
  1449. #define error_VAR_TOO_LONG                      0x125u
  1450. #define error_REDIRECT_FAIL                     0x140u
  1451. #define error_STACK_FULL                        0x141u
  1452. #define error_BAD_HEX                           0x160u
  1453. #define error_BAD_EXPR                          0x161u
  1454. #define error_BAD_BRA                           0x162u
  1455. #define error_STK_OFLO                          0x163u
  1456. #define error_MISS_OPN                          0x164u
  1457. #define error_MISS_OPR                          0x165u
  1458. #define error_BAD_BITS                          0x166u
  1459. #define error_STR_OFLO                          0x167u
  1460. #define error_BAD_ITM                           0x168u
  1461. #define error_DIV_ZERO                          0x169u
  1462. #define error_BAD_BASE                          0x16Au
  1463. #define error_BAD_NUMB                          0x16Bu
  1464. #define error_NUMB_TOO_BIG                      0x16Cu
  1465. #define error_BAD_CLAIM_NUM                     0x1A1u
  1466. #define error_BAD_RELEASE                       0x1A2u
  1467. #define error_BAD_DEV_NO                        0x1A3u
  1468. #define error_BAD_DEV_VEC_REL                   0x1A4u
  1469. #define error_BAD_ENV_NUMBER                    0x1B0u
  1470. #define error_CANT_CANCEL_QUIT                  0x1B1u
  1471. #define error_CH_DYNAM_CAO                      0x1C0u
  1472. #define error_CH_DYNAM_NOT_ALL_MOVED            0x1C1u
  1473. #define error_APL_WSPACE_IN_USE                 0x1C2u
  1474. #define error_RAM_FS_UNCHANGEABLE               0x1C3u
  1475. #define error_OSCLI_LONG_LINE                   0x1E0u
  1476. #define error_OSCLI_TOO_HARD                    0x1E1u
  1477. #define error_RC_EXC                            0x1E2u
  1478. #define error_RC_NEGATIVE                       0x1E2u
  1479. #define error_SYS_HEAP_FULL                     0x1E3u
  1480. #define error_BUFF_OVERFLOW                     0x1E4u
  1481. #define error_BAD_TIME                          0x1E5u
  1482. #define error_NO_SUCH_SWI                       0x1E6u
  1483. #define error_UNIMPLEMENTED                     0x1E7u
  1484. #define error_OUT_OF_RANGE                      0x1E8u
  1485. #define error_NO_OSCLI_SPECIALS                 0x1E9u
  1486. #define error_BAD_PARAMETERS                    0x1EAu
  1487. #define error_ARG_REPEATED                      0x1EBu
  1488. #define error_BAD_READ_SYS_INFO                 0x1ECu
  1489. #define error_CDAT_STACK_OVERFLOW               0x2C0u
  1490. #define error_CDAT_BUFFER_OVERFLOW              0x2C1u
  1491. #define error_CDAT_BAD_FIELD                    0x2C2u
  1492. #define error_CANT_START_APPLICATION            0x600u
  1493. #define error_BAD_COMMAND_OPTION                0x601u
  1494. #define error_UNKNOWN_SERIAL_OP                 0x602u
  1495. #define error_BAD_HARD                          0x603u
  1496. #define os_READ_CONTROL_TERMINATED              0x80000000u
  1497. #define os_READ_BYTE                            0x40000000u
  1498. #define os_READ_LIMITED                         0x20000000u
  1499. #define os_DESTROY_VAR                          (-1)
  1500. #define os_GS_TERMINATE_ON_SPACE                0x20000000u
  1501. #define os_GS_RETAIN_STICK                      0x40000000u
  1502. #define os_GS_RETAIN_DOUBLE_QUOTE               0x80000000u
  1503. #define keyv_TYPE_ARCHIMEDES                    1
  1504. #define keyv_TYPE_PCAT                          2
  1505. #define os_CURRENT_MODE                         ((os_mode) -1)
  1506. #define os_NONEXISTENT_MODE                     (-1)
  1507. #define os_NOT_ENOUGH_MEMORY_FOR_MODE           (-2)
  1508. #define os_NO_ALTERNATIVE_MODE                  ((os_mode) -2)
  1509. #define os_HANDLER_MEMORY_LIMIT                 0
  1510. #define os_HANDLER_UNDEFINED_INSTRUCTION        1
  1511. #define os_HANDLER_PREFETCH_ABORT               2
  1512. #define os_HANDLER_DATA_ABORT                   3
  1513. #define os_HANDLER_ADDRESS_EXCEPTION            4
  1514. #define os_HANDLER_OTHER_EXCEPTIONS             5
  1515. #define os_HANDLER_ERROR                        6
  1516. #define os_HANDLER_CALL_BACK                    7
  1517. #define os_HANDLER_BREAK_PT                     8
  1518. #define os_HANDLER_ESCAPE                       9
  1519. #define os_HANDLER_EVENT                        10
  1520. #define os_HANDLER_EXIT                         11
  1521. #define os_HANDLER_UNUSED_SWI                   12
  1522. #define os_HANDLER_EXCEPTION_REGISTERS          13
  1523. #define os_HANDLER_APPLICATION_SPACE            14
  1524. #define os_HANDLER_CAO                          15
  1525. #define os_HANDLER_UP_CALL                      16
  1526. #define os_SORT_CARDINAL                        ((void *) 0)
  1527. #define os_SORT_INTEGER                         ((void *) 1)
  1528. #define os_SORT_CARDINAL_POINTER                ((void *) 2)
  1529. #define os_SORT_INTEGER_POINTER                 ((void *) 3)
  1530. #define os_SORT_CI_STRING                       ((void *) 4)
  1531. #define os_SORT_STRING                          ((void *) 5)
  1532. #define os_SORT_GIVEN_WORKSPACE                 0x20000000u
  1533. #define os_SORT_BUILD_ARRAY                     0x40000000u
  1534. #define os_SORT_OBJECTS                         0x80000000u
  1535. #define os_AREA_ACCESS_READ_WRITE               0x0u
  1536. #define os_AREA_ACCESS_READ_ONLY                0x1u
  1537. #define os_AREA_ACCESS_NONE                     0x3u
  1538. #define os_AREA_ACCESS_SHIFT                    0
  1539. #define os_AREA_NOT_BUFFERABLE                  0x10u
  1540. #define os_AREA_NOT_CACHEABLE                   0x20u
  1541. #define os_AREA_DOUBLY_MAPPED                   0x40u
  1542. #define os_AREA_NO_USER_DRAG                    0x80u
  1543. #define os_AREA_NEEDS_GIVEN_PAGES               0x100u
  1544. #define os_DYNAMIC_AREA_APPLICATION_SPACE       (-1)
  1545. #define os_DYNAMIC_AREA_SYSTEM_HEAP             0
  1546. #define os_DYNAMIC_AREA_RMA                     1
  1547. #define os_DYNAMIC_AREA_SCREEN_MEMORY           2
  1548. #define os_DYNAMIC_AREA_SYSTEM_SPRITES          3
  1549. #define os_DYNAMIC_AREA_FONT_CACHE              4
  1550. #define os_DYNAMIC_AREA_RAM_DISC                5
  1551. #define os_DYNAMIC_AREA_FREE_POOL               6
  1552. #define os_COLOUR_SET_BG                        0x10u
  1553. #define os_COLOUR_GIVEN_PATTERN                 0x20u
  1554. #define os_COLOUR_SET_TEXT                      0x40u
  1555. #define os_COLOUR_READ                          0x80u
  1556. #define pointerv_TYPE_QUADRATURE                0
  1557. #define pointerv_TYPE_MICROSOFT                 1
  1558. #define pointerv_TYPE_MOUSE_SYSTEMS             2
  1559. #define osdynamicarea_ALLOCATE_AREA             (-1)
  1560. #define osdynamicarea_ALLOCATE_BASE             ((byte *) -1)
  1561. #define osmemory_GIVEN_PAGE_NO                  0x100u
  1562. #define osmemory_GIVEN_LOG_ADDR                 0x200u
  1563. #define osmemory_GIVEN_PHYS_ADDR                0x400u
  1564. #define osmemory_RETURN_PAGE_NO                 0x800u
  1565. #define osmemory_RETURN_LOG_ADDR                0x1000u
  1566. #define osmemory_RETURN_PHYS_ADDR               0x2000u
  1567. #define osmemory_CACHE                          0xC000u
  1568. #define osmemory_CACHE_SHIFT                    14
  1569. #define osmemory_CACHE_DISABLE                  0x2u
  1570. #define osmemory_CACHE_ENABLE                   0x3u
  1571. #define osmemory_TYPE                           0xF00u
  1572. #define osmemory_TYPE_SHIFT                     8
  1573. #define osmemory_TYPE_DRAM                      0x1u
  1574. #define osmemory_TYPE_VRAM                      0x2u
  1575. #define osmemory_TYPE_ROM                       0x3u
  1576. #define osmemory_TYPE_IO                        0x4u
  1577. #define osmemory_CONTROLLER_NO                  0xFu
  1578. #define osmemory_CONTROLLER_NO_SHIFT            0
  1579. #define osmemory_CONTROLLER_TYPE                0xFFFFFFF0u
  1580. #define osmemory_CONTROLLER_TYPE_SHIFT          8
  1581. #define osmemory_CONTROLLER_TYPE_EASI           0x0u
  1582. #define osmemory_CONTROLLER_TYPE_EASI_SPACE     0x1u
  1583. #define osmemory_CONTROLLER_TYPE_VIDC1          0x2u
  1584. #define osmemory_CONTROLLER_TYPE_VIDC20         0x3u
  1585. #define os_HEX1_LIMIT                           1
  1586. #define os_HEX2_LIMIT                           2
  1587. #define os_HEX4_LIMIT                           4
  1588. #define os_HEX6_LIMIT                           6
  1589. #define os_HEX8_LIMIT                           8
  1590. #define os_CARDINAL1_LIMIT                      3
  1591. #define os_CARDINAL2_LIMIT                      5
  1592. #define os_CARDINAL3_LIMIT                      8
  1593. #define os_CARDINAL4_LIMIT                      10
  1594. #define os_INTEGER1_LIMIT                       4
  1595. #define os_INTEGER2_LIMIT                       6
  1596. #define os_INTEGER3_LIMIT                       8
  1597. #define os_INTEGER4_LIMIT                       11
  1598. #define os_BINARY1_LIMIT                        8
  1599. #define os_BINARY2_LIMIT                        16
  1600. #define os_BINARY3_LIMIT                        24
  1601. #define os_BINARY4_LIMIT                        32
  1602. #define os_SPACED_CARDINAL1_LIMIT               3
  1603. #define os_SPACED_CARDINAL2_LIMIT               6
  1604. #define os_SPACED_CARDINAL3_LIMIT               10
  1605. #define os_SPACED_CARDINAL4_LIMIT               13
  1606. #define os_SPACED_INTEGER1_LIMIT                4
  1607. #define os_SPACED_INTEGER2_LIMIT                7
  1608. #define os_SPACED_INTEGER3_LIMIT                10
  1609. #define os_SPACED_INTEGER4_LIMIT                14
  1610. #define os_FIXED_NET_STATION_LIMIT              7
  1611. #define os_NET_STATION_LIMIT                    7
  1612. #define os_FIXED_FILE_SIZE_LIMIT                11
  1613. #define os_FILE_SIZE_LIMIT                      11
  1614. #define os_TRANSITION_MOUSE_RIGHT               0x1u
  1615. #define os_TRANSITION_MOUSE_MIDDLE              0x2u
  1616. #define os_TRANSITION_MOUSE_LEFT                0x4u
  1617. #define os_TRANSITION_KEY_ESCAPE                ((byte) 0)
  1618. #define os_TRANSITION_KEY_F1                    ((byte) 1)
  1619. #define os_TRANSITION_KEY_F2                    ((byte) 2)
  1620. #define os_TRANSITION_KEY_F3                    ((byte) 3)
  1621. #define os_TRANSITION_KEY_F4                    ((byte) 4)
  1622. #define os_TRANSITION_KEY_F5                    ((byte) 5)
  1623. #define os_TRANSITION_KEY_F6                    ((byte) 6)
  1624. #define os_TRANSITION_KEY_F7                    ((byte) 7)
  1625. #define os_TRANSITION_KEY_F8                    ((byte) 8)
  1626. #define os_TRANSITION_KEY_F9                    ((byte) 9)
  1627. #define os_TRANSITION_KEY_F10                   ((byte) 10)
  1628. #define os_TRANSITION_KEY_F11                   ((byte) 11)
  1629. #define os_TRANSITION_KEY_F12                   ((byte) 12)
  1630. #define os_TRANSITION_KEY_PRINT                 ((byte) 13)
  1631. #define os_TRANSITION_KEY_SCROLL_LOCK           ((byte) 14)
  1632. #define os_TRANSITION_KEY_BREAK                 ((byte) 15)
  1633. #define os_TRANSITION_KEY_GRAVE                 ((byte) 16)
  1634. #define os_TRANSITION_KEY1                      ((byte) 17)
  1635. #define os_TRANSITION_KEY2                      ((byte) 18)
  1636. #define os_TRANSITION_KEY3                      ((byte) 19)
  1637. #define os_TRANSITION_KEY4                      ((byte) 20)
  1638. #define os_TRANSITION_KEY5                      ((byte) 21)
  1639. #define os_TRANSITION_KEY6                      ((byte) 22)
  1640. #define os_TRANSITION_KEY7                      ((byte) 23)
  1641. #define os_TRANSITION_KEY8                      ((byte) 24)
  1642. #define os_TRANSITION_KEY9                      ((byte) 25)
  1643. #define os_TRANSITION_KEY0                      ((byte) 26)
  1644. #define os_TRANSITION_KEY_HYPHEN                ((byte) 27)
  1645. #define os_TRANSITION_KEY_EQUALS                ((byte) 28)
  1646. #define os_TRANSITION_KEY_POUND                 ((byte) 29)
  1647. #define os_TRANSITION_KEY_BACKSPACE             ((byte) 30)
  1648. #define os_TRANSITION_KEY_INSERT                ((byte) 31)
  1649. #define os_TRANSITION_KEY_HOME                  ((byte) 32)
  1650. #define os_TRANSITION_KEY_PAGE_UP               ((byte) 33)
  1651. #define os_TRANSITION_KEY_NUM_LOCK              ((byte) 34)
  1652. #define os_TRANSITION_KEY_KEYPAD_SLASH          ((byte) 35)
  1653. #define os_TRANSITION_KEY_KEYPAD_STAR           ((byte) 36)
  1654. #define os_TRANSITION_KEY_KEYPAD_HASH           ((byte) 37)
  1655. #define os_TRANSITION_KEY_TAB                   ((byte) 38)
  1656. #define os_TRANSITION_KEYQ                      ((byte) 39)
  1657. #define os_TRANSITION_KEYW                      ((byte) 40)
  1658. #define os_TRANSITION_KEYE                      ((byte) 41)
  1659. #define os_TRANSITION_KEYR                      ((byte) 42)
  1660. #define os_TRANSITION_KEYT                      ((byte) 43)
  1661. #define os_TRANSITION_KEYY                      ((byte) 44)
  1662. #define os_TRANSITION_KEYU                      ((byte) 45)
  1663. #define os_TRANSITION_KEYI                      ((byte) 46)
  1664. #define os_TRANSITION_KEYO                      ((byte) 47)
  1665. #define os_TRANSITION_KEYP                      ((byte) 48)
  1666. #define os_TRANSITION_KEY_SQUARE_BRA            ((byte) 49)
  1667. #define os_TRANSITION_KEY_SQUARE_KET            ((byte) 50)
  1668. #define os_TRANSITION_KEY_BACKSLASH             ((byte) 51)
  1669. #define os_TRANSITION_KEY_DELETE                ((byte) 52)
  1670. #define os_TRANSITION_KEY_COPY                  ((byte) 53)
  1671. #define os_TRANSITION_KEY_PAGE_DOWN             ((byte) 54)
  1672. #define os_TRANSITION_KEY_KEYPAD7               ((byte) 55)
  1673. #define os_TRANSITION_KEY_KEYPAD8               ((byte) 56)
  1674. #define os_TRANSITION_KEY_KEYPAD9               ((byte) 57)
  1675. #define os_TRANSITION_KEY_KEYPAD_MINUS          ((byte) 58)
  1676. #define os_TRANSITION_KEY_LEFT_CONTROL          ((byte) 59)
  1677. #define os_TRANSITION_KEYA                      ((byte) 60)
  1678. #define os_TRANSITION_KEYS                      ((byte) 61)
  1679. #define os_TRANSITION_KEYD                      ((byte) 62)
  1680. #define os_TRANSITION_KEYF                      ((byte) 63)
  1681. #define os_TRANSITION_KEYG                      ((byte) 64)
  1682. #define os_TRANSITION_KEYH                      ((byte) 65)
  1683. #define os_TRANSITION_KEYJ                      ((byte) 66)
  1684. #define os_TRANSITION_KEYK                      ((byte) 67)
  1685. #define os_TRANSITION_KEYL                      ((byte) 68)
  1686. #define os_TRANSITION_KEY_SEMICOLON             ((byte) 69)
  1687. #define os_TRANSITION_KEY_ACUTE                 ((byte) 70)
  1688. #define os_TRANSITION_KEY_RETURN                ((byte) 71)
  1689. #define os_TRANSITION_KEY_KEYPAD4               ((byte) 72)
  1690. #define os_TRANSITION_KEY_KEYPAD5               ((byte) 73)
  1691. #define os_TRANSITION_KEY_KEYPAD6               ((byte) 74)
  1692. #define os_TRANSITION_KEY_KEYPAD_PLUS           ((byte) 75)
  1693. #define os_TRANSITION_KEY_LEFT_SHIFT            ((byte) 76)
  1694. #define os_TRANSITION_KEYZ                      ((byte) 78)
  1695. #define os_TRANSITION_KEYX                      ((byte) 79)
  1696. #define os_TRANSITION_KEYC                      ((byte) 80)
  1697. #define os_TRANSITION_KEYV                      ((byte) 81)
  1698. #define os_TRANSITION_KEYB                      ((byte) 82)
  1699. #define os_TRANSITION_KEYN                      ((byte) 83)
  1700. #define os_TRANSITION_KEYM                      ((byte) 84)
  1701. #define os_TRANSITION_KEY_COMMA                 ((byte) 85)
  1702. #define os_TRANSITION_KEY_POINT                 ((byte) 86)
  1703. #define os_TRANSITION_KEY_SLASH                 ((byte) 87)
  1704. #define os_TRANSITION_KEY_RIGHT_SHIFT           ((byte) 88)
  1705. #define os_TRANSITION_KEY_UP                    ((byte) 89)
  1706. #define os_TRANSITION_KEY_KEYPAD1               ((byte) 90)
  1707. #define os_TRANSITION_KEY_KEYPAD2               ((byte) 91)
  1708. #define os_TRANSITION_KEY_KEYPAD3               ((byte) 92)
  1709. #define os_TRANSITION_KEY_CAPS_LOCK             ((byte) 93)
  1710. #define os_TRANSITION_KEY_LEFT_ALT              ((byte) 94)
  1711. #define os_TRANSITION_KEY_SPACE                 ((byte) 95)
  1712. #define os_TRANSITION_KEY_RIGHT_ALT             ((byte) 96)
  1713. #define os_TRANSITION_KEY_RIGHT_CONTROL         ((byte) 97)
  1714. #define os_TRANSITION_KEY_LEFT                  ((byte) 98)
  1715. #define os_TRANSITION_KEY_DOWN                  ((byte) 99)
  1716. #define os_TRANSITION_KEY_RIGHT                 ((byte) 100)
  1717. #define os_TRANSITION_KEY_KEYPAD0               ((byte) 101)
  1718. #define os_TRANSITION_KEY_KEYPAD_POINT          ((byte) 102)
  1719. #define os_TRANSITION_KEY_ENTER                 ((byte) 103)
  1720. #define os_TRANSITION_UP                        0
  1721. #define os_TRANSITION_DOWN                      1
  1722.  
  1723. /*************************
  1724.  * Function declarations *
  1725.  *************************/
  1726.  
  1727. #ifdef __cplusplus
  1728.    extern "C" {
  1729. #endif
  1730.  
  1731. /*************************************************************
  1732.  * NOTE: The following functions provide direct access to    *
  1733.  *       the SWI's noted in the function description.        *
  1734.  *       Please read the relevant PRM section for more       *
  1735.  *       information on their input/output parameters.       *
  1736.  *************************************************************/
  1737.  
  1738. /* ------------------------------------------------------------------------
  1739.  * Function:      os_writec()
  1740.  *
  1741.  * Description:   Writes a character to all of the active output streams
  1742.  *
  1743.  * Input:         c - value of R0 on entry
  1744.  *
  1745.  * Other notes:   Calls SWI 0x0.
  1746.  */
  1747.  
  1748. extern os_error *xos_writec (char c);
  1749. extern void os_writec (char c);
  1750.  
  1751. /* ------------------------------------------------------------------------
  1752.  * Function:      wrchv()
  1753.  *
  1754.  * Description:   OS_WriteC vector
  1755.  *
  1756.  * Input:         c - value of R0 on entry
  1757.  *
  1758.  * Other notes:   Calls SWI 0x34 with R9 = 0x3.
  1759.  */
  1760.  
  1761. extern os_error *xwrchv (char c);
  1762. extern void wrchv (char c);
  1763.  
  1764. /* ------------------------------------------------------------------------
  1765.  * Function:      os_write0()
  1766.  *
  1767.  * Description:   Writes a string to all of the active output streams
  1768.  *
  1769.  * Input:         s - value of R0 on entry
  1770.  *
  1771.  * Other notes:   Calls SWI 0x2.
  1772.  */
  1773.  
  1774. extern os_error *xos_write0 (char *s);
  1775. extern void os_write0 (char *s);
  1776.  
  1777. /* ------------------------------------------------------------------------
  1778.  * Function:      os_new_line()
  1779.  *
  1780.  * Description:   Writes a line feed followed by a carriage return to all
  1781.  *                of the active output streams
  1782.  *
  1783.  * Other notes:   Calls SWI 0x3.
  1784.  */
  1785.  
  1786. extern os_error *xos_new_line (void);
  1787. extern void os_new_line (void);
  1788.  
  1789. /* ------------------------------------------------------------------------
  1790.  * Function:      os_readc()
  1791.  *
  1792.  * Description:   Reads a character from the input stream
  1793.  *
  1794.  * Output:        c - value of R0 on exit
  1795.  *                psr - processor status register on exit (X version only)
  1796.  *
  1797.  * Returns:       psr (non-X version only)
  1798.  *
  1799.  * Other notes:   Calls SWI 0x4.
  1800.  */
  1801.  
  1802. extern os_error *xos_readc (char *c,
  1803.       bits *psr);
  1804. extern bits os_readc (char *c);
  1805.  
  1806. /* ------------------------------------------------------------------------
  1807.  * Function:      rdchv()
  1808.  *
  1809.  * Description:   OS_ReadC vector
  1810.  *
  1811.  * Output:        c - value of R0 on exit
  1812.  *                psr - processor status register on exit (X version only)
  1813.  *
  1814.  * Returns:       psr (non-X version only)
  1815.  *
  1816.  * Other notes:   Calls SWI 0x34 with R9 = 0x4.
  1817.  */
  1818.  
  1819. extern os_error *xrdchv (char *c,
  1820.       bits *psr);
  1821. extern bits rdchv (char *c);
  1822.  
  1823. /* ------------------------------------------------------------------------
  1824.  * Function:      os_cli()
  1825.  *
  1826.  * Description:   Processes a supervisor command
  1827.  *
  1828.  * Input:         command - value of R0 on entry
  1829.  *
  1830.  * Other notes:   Calls SWI 0x5.
  1831.  */
  1832.  
  1833. extern os_error *xos_cli (char *command);
  1834. extern void os_cli (char *command);
  1835.  
  1836. /* ------------------------------------------------------------------------
  1837.  * Function:      cliv()
  1838.  *
  1839.  * Description:   OS_CLI vector
  1840.  *
  1841.  * Input:         command - value of R0 on entry
  1842.  *
  1843.  * Other notes:   Calls SWI 0x34 with R9 = 0x5.
  1844.  */
  1845.  
  1846. extern os_error *xcliv (char *command);
  1847. extern void cliv (char *command);
  1848.  
  1849. /* ------------------------------------------------------------------------
  1850.  * Function:      os_read_line()
  1851.  *
  1852.  * Description:   Reads a line from the input stream
  1853.  *
  1854.  * Input:         buffer - value of R0 on entry
  1855.  *                size - value of R1 on entry
  1856.  *                min_char - value of R2 on entry
  1857.  *                max_char - value of R3 on entry
  1858.  *
  1859.  * Output:        used - value of R1 on exit
  1860.  *                psr - processor status register on exit (X version only)
  1861.  *
  1862.  * Returns:       psr (non-X version only)
  1863.  *
  1864.  * Other notes:   Calls SWI 0xE.
  1865.  */
  1866.  
  1867. extern os_error *xos_read_line (char *buffer,
  1868.       int size,
  1869.       char min_char,
  1870.       char max_char,
  1871.       int *used,
  1872.       bits *psr);
  1873. extern bits os_read_line (char *buffer,
  1874.       int size,
  1875.       char min_char,
  1876.       char max_char,
  1877.       int *used);
  1878.  
  1879. /* ------------------------------------------------------------------------
  1880.  * Function:      os_read_line_given_echo()
  1881.  *
  1882.  * Description:   Reads a line from the input stream, using the given echo
  1883.  *                character
  1884.  *
  1885.  * Input:         buffer - value of R0 on entry
  1886.  *                size - value of R1 on entry
  1887.  *                min_char - value of R2 on entry
  1888.  *                max_char - value of R3 on entry
  1889.  *                echo - value of R4 on entry
  1890.  *
  1891.  * Output:        used - value of R1 on exit
  1892.  *                psr - processor status register on exit (X version only)
  1893.  *
  1894.  * Returns:       psr (non-X version only)
  1895.  *
  1896.  * Other notes:   Calls SWI 0xE with R0 |= 0x40000000.
  1897.  */
  1898.  
  1899. extern os_error *xos_read_line_given_echo (char *buffer,
  1900.       int size,
  1901.       char min_char,
  1902.       char max_char,
  1903.       char echo,
  1904.       int *used,
  1905.       bits *psr);
  1906. extern bits os_read_line_given_echo (char *buffer,
  1907.       int size,
  1908.       char min_char,
  1909.       char max_char,
  1910.       char echo,
  1911.       int *used);
  1912.  
  1913. /* ------------------------------------------------------------------------
  1914.  * Function:      os_read_line_suppress_invalid()
  1915.  *
  1916.  * Description:   Reads a line from the input stream, not echoing invalid
  1917.  *                characters
  1918.  *
  1919.  * Input:         buffer - value of R0 on entry
  1920.  *                size - value of R1 on entry
  1921.  *                min_char - value of R2 on entry
  1922.  *                max_char - value of R3 on entry
  1923.  *
  1924.  * Output:        used - value of R1 on exit
  1925.  *                psr - processor status register on exit (X version only)
  1926.  *
  1927.  * Returns:       psr (non-X version only)
  1928.  *
  1929.  * Other notes:   Calls SWI 0xE with R0 |= 0x80000000.
  1930.  */
  1931.  
  1932. extern os_error *xos_read_line_suppress_invalid (char *buffer,
  1933.       int size,
  1934.       char min_char,
  1935.       char max_char,
  1936.       int *used,
  1937.       bits *psr);
  1938. extern bits os_read_line_suppress_invalid (char *buffer,
  1939.       int size,
  1940.       char min_char,
  1941.       char max_char,
  1942.       int *used);
  1943.  
  1944. /* ------------------------------------------------------------------------
  1945.  * Function:      os_read_line_given_echo_suppress_invalid()
  1946.  *
  1947.  * Description:   Reads a line from the input stream, using the given echo
  1948.  *                character and not echoing invalid characters
  1949.  *
  1950.  * Input:         buffer - value of R0 on entry
  1951.  *                size - value of R1 on entry
  1952.  *                min_char - value of R2 on entry
  1953.  *                max_char - value of R3 on entry
  1954.  *                echo - value of R4 on entry
  1955.  *
  1956.  * Output:        used - value of R1 on exit
  1957.  *                psr - processor status register on exit (X version only)
  1958.  *
  1959.  * Returns:       psr (non-X version only)
  1960.  *
  1961.  * Other notes:   Calls SWI 0xE with R0 |= 0xC0000000.
  1962.  */
  1963.  
  1964. extern os_error *xos_read_line_given_echo_suppress_invalid (char *buffer,
  1965.       int size,
  1966.       char min_char,
  1967.       char max_char,
  1968.       char echo,
  1969.       int *used,
  1970.       bits *psr);
  1971. extern bits os_read_line_given_echo_suppress_invalid (char *buffer,
  1972.       int size,
  1973.       char min_char,
  1974.       char max_char,
  1975.       char echo,
  1976.       int *used);
  1977.  
  1978. /* ------------------------------------------------------------------------
  1979.  * Function:      readlinev()
  1980.  *
  1981.  * Description:   OS_ReadLine vector
  1982.  *
  1983.  * Input:         buffer - value of R0 on entry
  1984.  *                size - value of R1 on entry
  1985.  *                min_char - value of R2 on entry
  1986.  *                max_char - value of R3 on entry
  1987.  *                echo - value of R4 on entry
  1988.  *
  1989.  * Output:        used - value of R1 on exit
  1990.  *                psr - processor status register on exit (X version only)
  1991.  *
  1992.  * Returns:       psr (non-X version only)
  1993.  *
  1994.  * Other notes:   Calls SWI 0x34 with R9 = 0xE.
  1995.  */
  1996.  
  1997. extern os_error *xreadlinev (char *buffer,
  1998.       int size,
  1999.       char min_char,
  2000.       char max_char,
  2001.       char echo,
  2002.       int *used,
  2003.       bits *psr);
  2004. extern bits readlinev (char *buffer,
  2005.       int size,
  2006.       char min_char,
  2007.       char max_char,
  2008.       char echo,
  2009.       int *used);
  2010.  
  2011. /* ------------------------------------------------------------------------
  2012.  * Function:      os_control()
  2013.  *
  2014.  * Description:   Reads/writes handler addresses (prefer
  2015.  *                OS_ChangeEnvironment)
  2016.  *
  2017.  * Input:         error_handler - value of R0 on entry
  2018.  *                error_buffer - value of R1 on entry
  2019.  *                escape_handler - value of R2 on entry
  2020.  *                event_handler - value of R3 on entry
  2021.  *
  2022.  * Output:        old_error_handler - value of R0 on exit
  2023.  *                old_error_buffer - value of R1 on exit
  2024.  *                old_escape_handler - value of R2 on exit
  2025.  *                old_event_handler - value of R3 on exit
  2026.  *
  2027.  * Other notes:   Calls SWI 0xF.
  2028.  */
  2029.  
  2030. extern os_error *xos_control (void *error_handler,
  2031.       os_error *error_buffer,
  2032.       void *escape_handler,
  2033.       void *event_handler,
  2034.       void **old_error_handler,
  2035.       os_error **old_error_buffer,
  2036.       void **old_escape_handler,
  2037.       void **old_event_handler);
  2038. extern void os_control (void *error_handler,
  2039.       os_error *error_buffer,
  2040.       void *escape_handler,
  2041.       void *event_handler,
  2042.       void **old_error_handler,
  2043.       os_error **old_error_buffer,
  2044.       void **old_escape_handler,
  2045.       void **old_event_handler);
  2046.  
  2047. /* ------------------------------------------------------------------------
  2048.  * Function:      os_get_env()
  2049.  *
  2050.  * Description:   Reads environment parameters
  2051.  *
  2052.  * Output:        command - value of R0 on exit (X version only)
  2053.  *                ram_limit - value of R1 on exit
  2054.  *                start - value of R2 on exit
  2055.  *
  2056.  * Returns:       R0 (non-X version only)
  2057.  *
  2058.  * Other notes:   Calls SWI 0x10.
  2059.  */
  2060.  
  2061. extern os_error *xos_get_env (char **command,
  2062.       byte **ram_limit,
  2063.       os_date_and_time **start);
  2064. extern char *os_get_env (byte **ram_limit,
  2065.       os_date_and_time **start);
  2066.  
  2067. /* ------------------------------------------------------------------------
  2068.  * Function:      os_exit()
  2069.  *
  2070.  * Description:   Passes control to the most recent exit handler
  2071.  *
  2072.  * Input:         error - value of R0 on entry
  2073.  *                rc - value of R2 on entry
  2074.  *
  2075.  * Other notes:   Calls SWI 0x11 with R1 = 0x58454241.
  2076.  */
  2077.  
  2078. extern os_error *xos_exit (os_error *error,
  2079.       int rc);
  2080. extern void os_exit (os_error *error,
  2081.       int rc);
  2082.  
  2083. /* ------------------------------------------------------------------------
  2084.  * Function:      os_set_env()
  2085.  *
  2086.  * Description:   Sets environment parameters (prefer OS_ChangeEnvironment)
  2087.  *
  2088.  * Input:         exit_handler - value of R0 on entry
  2089.  *                ram_limit - value of R1 on entry
  2090.  *                undefined_instruction_handler - value of R4 on entry
  2091.  *                prefetch_abort_handler - value of R5 on entry
  2092.  *                data_abort_handler - value of R6 on entry
  2093.  *                address_exception_handler - value of R7 on entry
  2094.  *
  2095.  * Output:        old_exit_handler - value of R0 on exit
  2096.  *                old_ram_limit - value of R1 on exit
  2097.  *                old_undefined_instruction_handler - value of R4 on exit
  2098.  *                old_prefetch_abort_handler - value of R5 on exit
  2099.  *                old_data_abort_handler - value of R6 on exit
  2100.  *                old_address_exception_handler - value of R7 on exit
  2101.  *
  2102.  * Other notes:   Calls SWI 0x12.
  2103.  */
  2104.  
  2105. extern os_error *xos_set_env (void *exit_handler,
  2106.       byte *ram_limit,
  2107.       void *undefined_instruction_handler,
  2108.       void *prefetch_abort_handler,
  2109.       void *data_abort_handler,
  2110.       void *address_exception_handler,
  2111.       void **old_exit_handler,
  2112.       byte **old_ram_limit,
  2113.       void **old_undefined_instruction_handler,
  2114.       void **old_prefetch_abort_handler,
  2115.       void **old_data_abort_handler,
  2116.       void **old_address_exception_handler);
  2117. extern void os_set_env (void *exit_handler,
  2118.       byte *ram_limit,
  2119.       void *undefined_instruction_handler,
  2120.       void *prefetch_abort_handler,
  2121.       void *data_abort_handler,
  2122.       void *address_exception_handler,
  2123.       void **old_exit_handler,
  2124.       byte **old_ram_limit,
  2125.       void **old_undefined_instruction_handler,
  2126.       void **old_prefetch_abort_handler,
  2127.       void **old_data_abort_handler,
  2128.       void **old_address_exception_handler);
  2129.  
  2130. /* ------------------------------------------------------------------------
  2131.  * Function:      os_call_back()
  2132.  *
  2133.  * Description:   Sets up the callback handler (prefer
  2134.  *                OS_ChangeEnvironment)
  2135.  *
  2136.  * Input:         register_block - value of R0 on entry
  2137.  *                call_back_handler - value of R1 on entry
  2138.  *
  2139.  * Output:        old_register_block - value of R0 on exit
  2140.  *                old_call_back_handler - value of R1 on exit
  2141.  *
  2142.  * Other notes:   Calls SWI 0x15.
  2143.  */
  2144.  
  2145. extern os_error *xos_call_back (os_register_block *register_block,
  2146.       void *call_back_handler,
  2147.       os_register_block **old_register_block,
  2148.       void **old_call_back_handler);
  2149. extern void os_call_back (os_register_block *register_block,
  2150.       void *call_back_handler,
  2151.       os_register_block **old_register_block,
  2152.       void **old_call_back_handler);
  2153.  
  2154. /* ------------------------------------------------------------------------
  2155.  * Function:      os_break_pt()
  2156.  *
  2157.  * Description:   Causes a break point trap to occur and the break point
  2158.  *                handler to be entered
  2159.  *
  2160.  * Other notes:   Calls SWI 0x17.
  2161.  */
  2162.  
  2163. extern os_error *xos_break_pt (void);
  2164. extern void os_break_pt (void);
  2165.  
  2166. /* ------------------------------------------------------------------------
  2167.  * Function:      os_break_ctrl()
  2168.  *
  2169.  * Description:   Sets up the break point handler (prefer
  2170.  *                OS_ChangeEnvironment)
  2171.  *
  2172.  * Input:         register_block - value of R0 on entry
  2173.  *                break_pt_handler - value of R1 on entry
  2174.  *
  2175.  * Output:        old_register_block - value of R0 on exit
  2176.  *                old_break_pt_handler - value of R1 on exit
  2177.  *
  2178.  * Other notes:   Calls SWI 0x18.
  2179.  */
  2180.  
  2181. extern os_error *xos_break_ctrl (os_register_block *register_block,
  2182.       void *break_pt_handler,
  2183.       os_register_block **old_register_block,
  2184.       void **old_break_pt_handler);
  2185. extern void os_break_ctrl (os_register_block *register_block,
  2186.       void *break_pt_handler,
  2187.       os_register_block **old_register_block,
  2188.       void **old_break_pt_handler);
  2189.  
  2190. /* ------------------------------------------------------------------------
  2191.  * Function:      os_unused_swi()
  2192.  *
  2193.  * Description:   Sets up the handler for unused SWI's (prefer
  2194.  *                OS_ChangeEnvironment)
  2195.  *
  2196.  * Input:         unused_swi_handler - value of R0 on entry
  2197.  *
  2198.  * Output:        old_unused_swi_handler - value of R0 on exit (X version only)
  2199.  *
  2200.  * Returns:       R0 (non-X version only)
  2201.  *
  2202.  * Other notes:   Calls SWI 0x19.
  2203.  */
  2204.  
  2205. extern os_error *xos_unused_swi (void *unused_swi_handler,
  2206.       void **old_unused_swi_handler);
  2207. extern void *os_unused_swi (void *unused_swi_handler);
  2208.  
  2209. /* ------------------------------------------------------------------------
  2210.  * Function:      os_update_memc()
  2211.  *
  2212.  * Description:   Reads or alters the contents of the MEMC control register
  2213.  *
  2214.  * Input:         value - value of R0 on entry
  2215.  *                mask - value of R1 on entry
  2216.  *
  2217.  * Output:        old_value - value of R0 on exit (X version only)
  2218.  *
  2219.  * Returns:       R0 (non-X version only)
  2220.  *
  2221.  * Other notes:   Calls SWI 0x1A.
  2222.  */
  2223.  
  2224. extern os_error *xos_update_memc (bits value,
  2225.       bits mask,
  2226.       bits *old_value);
  2227. extern bits os_update_memc (bits value,
  2228.       bits mask);
  2229.  
  2230. /* ------------------------------------------------------------------------
  2231.  * Function:      os_set_call_back()
  2232.  *
  2233.  * Description:   Causes a call to the callback handler
  2234.  *
  2235.  * Other notes:   Calls SWI 0x1B.
  2236.  */
  2237.  
  2238. extern os_error *xos_set_call_back (void);
  2239. extern void os_set_call_back (void);
  2240.  
  2241. /* ------------------------------------------------------------------------
  2242.  * Function:      os_mouse()
  2243.  *
  2244.  * Description:   Reads a mouse state from the buffer
  2245.  *
  2246.  * Output:        x - value of R0 on exit
  2247.  *                y - value of R1 on exit
  2248.  *                buttons - value of R2 on exit
  2249.  *                t - value of R3 on exit
  2250.  *
  2251.  * Other notes:   Calls SWI 0x1C.
  2252.  */
  2253.  
  2254. extern os_error *xos_mouse (int *x,
  2255.       int *y,
  2256.       bits *buttons,
  2257.       os_t *t);
  2258. extern void os_mouse (int *x,
  2259.       int *y,
  2260.       bits *buttons,
  2261.       os_t *t);
  2262.  
  2263. /* ------------------------------------------------------------------------
  2264.  * Function:      mousev()
  2265.  *
  2266.  * Description:   OS_Mouse vector
  2267.  *
  2268.  * Output:        x - value of R0 on exit
  2269.  *                y - value of R1 on exit
  2270.  *                buttons - value of R2 on exit
  2271.  *                t - value of R3 on exit
  2272.  *
  2273.  * Other notes:   Calls SWI 0x34 with R9 = 0x1A.
  2274.  */
  2275.  
  2276. extern os_error *xmousev (int *x,
  2277.       int *y,
  2278.       bits *buttons,
  2279.       os_t *t);
  2280. extern void mousev (int *x,
  2281.       int *y,
  2282.       bits *buttons,
  2283.       os_t *t);
  2284.  
  2285. /* ------------------------------------------------------------------------
  2286.  * Function:      os_claim()
  2287.  *
  2288.  * Description:   Adds a routine to the list of those that claim a vector
  2289.  *
  2290.  * Input:         vector - value of R0 on entry
  2291.  *                routine - value of R1 on entry
  2292.  *                handle - value of R2 on entry
  2293.  *
  2294.  * Other notes:   Calls SWI 0x1F.
  2295.  */
  2296.  
  2297. extern os_error *xos_claim (int vector,
  2298.       void *routine,
  2299.       byte *handle);
  2300. extern void os_claim (int vector,
  2301.       void *routine,
  2302.       byte *handle);
  2303.  
  2304. /* ------------------------------------------------------------------------
  2305.  * Function:      os_release()
  2306.  *
  2307.  * Description:   Removes a routine from the list of those that claim a
  2308.  *                vector
  2309.  *
  2310.  * Input:         vector - value of R0 on entry
  2311.  *                routine - value of R1 on entry
  2312.  *                handle - value of R2 on entry
  2313.  *
  2314.  * Other notes:   Calls SWI 0x20.
  2315.  */
  2316.  
  2317. extern os_error *xos_release (int vector,
  2318.       void *routine,
  2319.       byte *handle);
  2320. extern void os_release (int vector,
  2321.       void *routine,
  2322.       byte *handle);
  2323.  
  2324. /* ------------------------------------------------------------------------
  2325.  * Function:      os_read_unsigned()
  2326.  *
  2327.  * Description:   Converts a string to an unsigned number
  2328.  *
  2329.  * Input:         flags - value of R0 on entry
  2330.  *                number - value of R1 on entry
  2331.  *                limit - value of R2 on entry
  2332.  *
  2333.  * Output:        end - value of R1 on exit
  2334.  *                value - value of R2 on exit (X version only)
  2335.  *
  2336.  * Returns:       R2 (non-X version only)
  2337.  *
  2338.  * Other notes:   Calls SWI 0x21.
  2339.  */
  2340.  
  2341. extern os_error *xos_read_unsigned (bits flags,
  2342.       char *number,
  2343.       int limit,
  2344.       char **end,
  2345.       int *value);
  2346. extern int os_read_unsigned (bits flags,
  2347.       char *number,
  2348.       int limit,
  2349.       char **end);
  2350.  
  2351. /* ------------------------------------------------------------------------
  2352.  * Function:      os_read_var_val()
  2353.  *
  2354.  * Description:   Reads a variable value
  2355.  *
  2356.  * Input:         var - value of R0 on entry
  2357.  *                value - value of R1 on entry
  2358.  *                size - value of R2 on entry
  2359.  *                context - value of R3 on entry
  2360.  *                var_type - value of R4 on entry
  2361.  *
  2362.  * Output:        used - value of R2 on exit
  2363.  *                context_out - value of R3 on exit (X version only)
  2364.  *                var_type_out - value of R4 on exit
  2365.  *
  2366.  * Returns:       R3 (non-X version only)
  2367.  *
  2368.  * Other notes:   Calls SWI 0x23.
  2369.  */
  2370.  
  2371. extern os_error *xos_read_var_val (char *var,
  2372.       char *value,
  2373.       int size,
  2374.       int context,
  2375.       int var_type,
  2376.       int *used,
  2377.       int *context_out,
  2378.       int *var_type_out);
  2379. extern int os_read_var_val (char *var,
  2380.       char *value,
  2381.       int size,
  2382.       int context,
  2383.       int var_type,
  2384.       int *used,
  2385.       int *var_type_out);
  2386.  
  2387. /* ------------------------------------------------------------------------
  2388.  * Function:      os_set_var_val()
  2389.  *
  2390.  * Description:   Writes a variable value
  2391.  *
  2392.  * Input:         var - value of R0 on entry
  2393.  *                value - value of R1 on entry
  2394.  *                size - value of R2 on entry
  2395.  *                context - value of R3 on entry
  2396.  *                var_type - value of R4 on entry
  2397.  *
  2398.  * Output:        context_out - value of R3 on exit (X version only)
  2399.  *                var_type_out - value of R4 on exit
  2400.  *
  2401.  * Returns:       R3 (non-X version only)
  2402.  *
  2403.  * Other notes:   Calls SWI 0x24.
  2404.  */
  2405.  
  2406. extern os_error *xos_set_var_val (char *var,
  2407.       byte *value,
  2408.       int size,
  2409.       int context,
  2410.       int var_type,
  2411.       int *context_out,
  2412.       int *var_type_out);
  2413. extern int os_set_var_val (char *var,
  2414.       byte *value,
  2415.       int size,
  2416.       int context,
  2417.       int var_type,
  2418.       int *var_type_out);
  2419.  
  2420. /* ------------------------------------------------------------------------
  2421.  * Function:      os_gs_init()
  2422.  *
  2423.  * Description:   Initialises context for use by OS_GSRead
  2424.  *
  2425.  * Input:         s - value of R0 on entry
  2426.  *                flags - value of R2 on entry
  2427.  *
  2428.  * Output:        context1 - value of R0 on exit
  2429.  *                context2 - value of R2 on exit
  2430.  *
  2431.  * Other notes:   Calls SWI 0x25.
  2432.  */
  2433.  
  2434. extern os_error *xos_gs_init (char *s,
  2435.       bits flags,
  2436.       int *context1,
  2437.       int *context2);
  2438. extern void os_gs_init (char *s,
  2439.       bits flags,
  2440.       int *context1,
  2441.       int *context2);
  2442.  
  2443. /* ------------------------------------------------------------------------
  2444.  * Function:      os_gs_read()
  2445.  *
  2446.  * Description:   Returns a character from a string which has been
  2447.  *                initialised by OS_GSInit
  2448.  *
  2449.  * Input:         context1 - value of R0 on entry
  2450.  *                context2 - value of R2 on entry
  2451.  *
  2452.  * Output:        context1_out - value of R0 on exit
  2453.  *                c - value of R1 on exit
  2454.  *                context2_out - value of R2 on exit
  2455.  *                psr - processor status register on exit (X version only)
  2456.  *
  2457.  * Returns:       psr (non-X version only)
  2458.  *
  2459.  * Other notes:   Calls SWI 0x26.
  2460.  */
  2461.  
  2462. extern os_error *xos_gs_read (int context1,
  2463.       int context2,
  2464.       int *context1_out,
  2465.       char *c,
  2466.       int *context2_out,
  2467.       bits *psr);
  2468. extern bits os_gs_read (int context1,
  2469.       int context2,
  2470.       int *context1_out,
  2471.       char *c,
  2472.       int *context2_out);
  2473.  
  2474. /* ------------------------------------------------------------------------
  2475.  * Function:      os_gs_trans()
  2476.  *
  2477.  * Description:   Equivalent to a call to OS_GSInit and repeated calls to
  2478.  *                OS_GSRead
  2479.  *
  2480.  * Input:         s - value of R0 on entry
  2481.  *                buffer - value of R1 on entry
  2482.  *                size - value of R2 on entry
  2483.  *
  2484.  * Output:        end - value of R0 on exit
  2485.  *                psr - processor status register on exit (X version only)
  2486.  *
  2487.  * Returns:       psr (non-X version only)
  2488.  *
  2489.  * Other notes:   Calls SWI 0x27.
  2490.  */
  2491.  
  2492. extern os_error *xos_gs_trans (char *s,
  2493.       char *buffer,
  2494.       int size,
  2495.       char **end,
  2496.       bits *psr);
  2497. extern bits os_gs_trans (char *s,
  2498.       char *buffer,
  2499.       int size,
  2500.       char **end);
  2501.  
  2502. /* ------------------------------------------------------------------------
  2503.  * Function:      os_binary_to_decimal()
  2504.  *
  2505.  * Description:   Converts a signed number to a string
  2506.  *
  2507.  * Input:         i - value of R0 on entry
  2508.  *                buffer - value of R1 on entry
  2509.  *                size - value of R2 on entry
  2510.  *
  2511.  * Output:        used - value of R2 on exit
  2512.  *
  2513.  * Other notes:   Calls SWI 0x28.
  2514.  */
  2515.  
  2516. extern os_error *xos_binary_to_decimal (int i,
  2517.       char *buffer,
  2518.       int size,
  2519.       int *used);
  2520. extern void os_binary_to_decimal (int i,
  2521.       char *buffer,
  2522.       int size,
  2523.       int *used);
  2524.  
  2525. /* ------------------------------------------------------------------------
  2526.  * Function:      os_change_dynamic_area()
  2527.  *
  2528.  * Description:   Alters the space sllocation of a dynamic area
  2529.  *
  2530.  * Input:         area_type - value of R0 on entry
  2531.  *                change - value of R1 on entry
  2532.  *
  2533.  * Output:        change_out - value of R1 on exit (X version only)
  2534.  *
  2535.  * Returns:       R1 (non-X version only)
  2536.  *
  2537.  * Other notes:   Calls SWI 0x2A.
  2538.  */
  2539.  
  2540. extern os_error *xos_change_dynamic_area (int area_type,
  2541.       int change,
  2542.       int *change_out);
  2543. extern int os_change_dynamic_area (int area_type,
  2544.       int change);
  2545.  
  2546. /* ------------------------------------------------------------------------
  2547.  * Function:      os_generate_error()
  2548.  *
  2549.  * Description:   Generates an error and invokes the error handler
  2550.  *
  2551.  * Input:         error - value of R0 on entry
  2552.  *
  2553.  * Other notes:   Calls SWI 0x2B.
  2554.  */
  2555.  
  2556. extern os_error *xos_generate_error (os_error *error);
  2557. extern void os_generate_error (os_error *error);
  2558.  
  2559. /* ------------------------------------------------------------------------
  2560.  * Function:      errorv()
  2561.  *
  2562.  * Description:   OS_GenerateError vector
  2563.  *
  2564.  * Other notes:   Calls SWI 0x34 with R9 = 0x1.
  2565.  */
  2566.  
  2567. extern os_error *xerrorv (void);
  2568. extern void errorv (void);
  2569.  
  2570. /* ------------------------------------------------------------------------
  2571.  * Function:      os_read_escape_state()
  2572.  *
  2573.  * Description:   Checks whether an escape condition has occurred
  2574.  *
  2575.  * Output:        psr - processor status register on exit (X version only)
  2576.  *
  2577.  * Returns:       psr (non-X version only)
  2578.  *
  2579.  * Other notes:   Calls SWI 0x2C.
  2580.  */
  2581.  
  2582. extern os_error *xos_read_escape_state (bits *psr);
  2583. extern bits os_read_escape_state (void);
  2584.  
  2585. /* ------------------------------------------------------------------------
  2586.  * Function:      os_evaluate_expression()
  2587.  *
  2588.  * Description:   Evaluates a string expression and returns an integer or
  2589.  *                string result
  2590.  *
  2591.  * Input:         expr - value of R0 on entry
  2592.  *                buffer - value of R1 on entry
  2593.  *                size - value of R2 on entry
  2594.  *
  2595.  * Output:        expr_is_str - value of R1 on exit
  2596.  *                int_value_or_str_used - value of R2 on exit
  2597.  *
  2598.  * Other notes:   Calls SWI 0x2D.
  2599.  */
  2600.  
  2601. extern os_error *xos_evaluate_expression (char *expr,
  2602.       char *buffer,
  2603.       int size,
  2604.       bool *expr_is_str,
  2605.       int *int_value_or_str_used);
  2606. extern void os_evaluate_expression (char *expr,
  2607.       char *buffer,
  2608.       int size,
  2609.       bool *expr_is_str,
  2610.       int *int_value_or_str_used);
  2611.  
  2612. /* ------------------------------------------------------------------------
  2613.  * Function:      os_read_palette()
  2614.  *
  2615.  * Description:   Reads the palette setting of a colour
  2616.  *
  2617.  * Input:         entry - value of R0 on entry
  2618.  *                colour_type - value of R1 on entry
  2619.  *
  2620.  * Output:        on - value of R2 on exit
  2621.  *                off - value of R3 on exit
  2622.  *
  2623.  * Other notes:   Calls SWI 0x2F.
  2624.  */
  2625.  
  2626. extern os_error *xos_read_palette (os_colour_number entry,
  2627.       int colour_type,
  2628.       os_colour *on,
  2629.       os_colour *off);
  2630. extern void os_read_palette (os_colour_number entry,
  2631.       int colour_type,
  2632.       os_colour *on,
  2633.       os_colour *off);
  2634.  
  2635. /* ------------------------------------------------------------------------
  2636.  * Function:      palettev_read_entry()
  2637.  *
  2638.  * Description:   Reads the palette
  2639.  *
  2640.  * Input:         entry - value of R0 on entry
  2641.  *                colour_type - value of R1 on entry
  2642.  *
  2643.  * Output:        on - value of R2 on exit
  2644.  *                off - value of R3 on exit
  2645.  *                incomplete - value of R4 on exit (X version only)
  2646.  *
  2647.  * Returns:       R4 (non-X version only)
  2648.  *
  2649.  * Other notes:   Calls SWI 0x34 with R4 = 0x1, R9 = 0x23.
  2650.  */
  2651.  
  2652. extern os_error *xpalettev_read_entry (os_colour_number entry,
  2653.       int colour_type,
  2654.       os_colour *on,
  2655.       os_colour *off,
  2656.       bool *incomplete);
  2657. extern bool palettev_read_entry (os_colour_number entry,
  2658.       int colour_type,
  2659.       os_colour *on,
  2660.       os_colour *off);
  2661.  
  2662. /* ------------------------------------------------------------------------
  2663.  * Function:      palettev_set_entry()
  2664.  *
  2665.  * Description:   Sets the palette
  2666.  *
  2667.  * Input:         entry - value of R0 on entry
  2668.  *                colour_type - value of R1 on entry
  2669.  *                on - value of R2 on entry
  2670.  *                off - value of R3 on entry
  2671.  *
  2672.  * Output:        incomplete - value of R4 on exit (X version only)
  2673.  *
  2674.  * Returns:       R4 (non-X version only)
  2675.  *
  2676.  * Other notes:   Calls SWI 0x34 with R4 = 0x2, R9 = 0x23.
  2677.  */
  2678.  
  2679. extern os_error *xpalettev_set_entry (os_colour_number entry,
  2680.       int colour_type,
  2681.       os_colour on,
  2682.       os_colour off,
  2683.       bool *incomplete);
  2684. extern bool palettev_set_entry (os_colour_number entry,
  2685.       int colour_type,
  2686.       os_colour on,
  2687.       os_colour off);
  2688.  
  2689. /* ------------------------------------------------------------------------
  2690.  * Function:      palettev_set_on()
  2691.  *
  2692.  * Description:   Sets the flash state to on
  2693.  *
  2694.  * Output:        incomplete - value of R4 on exit (X version only)
  2695.  *
  2696.  * Returns:       R4 (non-X version only)
  2697.  *
  2698.  * Other notes:   Calls SWI 0x34 with R4 = 0x3, R9 = 0x23.
  2699.  */
  2700.  
  2701. extern os_error *xpalettev_set_on (bool *incomplete);
  2702. extern bool palettev_set_on (void);
  2703.  
  2704. /* ------------------------------------------------------------------------
  2705.  * Function:      palettev_set_off()
  2706.  *
  2707.  * Description:   Sets the flash state to off
  2708.  *
  2709.  * Output:        incomplete - value of R4 on exit (X version only)
  2710.  *
  2711.  * Returns:       R4 (non-X version only)
  2712.  *
  2713.  * Other notes:   Calls SWI 0x34 with R4 = 0x4, R9 = 0x23.
  2714.  */
  2715.  
  2716. extern os_error *xpalettev_set_off (bool *incomplete);
  2717. extern bool palettev_set_off (void);
  2718.  
  2719. /* ------------------------------------------------------------------------
  2720.  * Function:      palettev_default()
  2721.  *
  2722.  * Description:   Sets the palette to the default
  2723.  *
  2724.  * Output:        incomplete - value of R4 on exit (X version only)
  2725.  *
  2726.  * Returns:       R4 (non-X version only)
  2727.  *
  2728.  * Other notes:   Calls SWI 0x34 with R4 = 0x5, R9 = 0x23.
  2729.  */
  2730.  
  2731. extern os_error *xpalettev_default (bool *incomplete);
  2732. extern bool palettev_default (void);
  2733.  
  2734. /* ------------------------------------------------------------------------
  2735.  * Function:      palettev_read_entries()
  2736.  *
  2737.  * Description:   Reads palette entries
  2738.  *
  2739.  * Input:         entry_list - value of R0 on entry
  2740.  *                colour_type_and_entry_count - value of R1 on entry
  2741.  *                on - value of R2 on entry
  2742.  *                off - value of R3 on entry
  2743.  *
  2744.  * Output:        incomplete - value of R4 on exit (X version only)
  2745.  *
  2746.  * Returns:       R4 (non-X version only)
  2747.  *
  2748.  * Other notes:   Calls SWI 0x34 with R4 = 0x7, R9 = 0x23.
  2749.  */
  2750.  
  2751. extern os_error *xpalettev_read_entries (int *entry_list,
  2752.       bits colour_type_and_entry_count,
  2753.       os_palette *on,
  2754.       os_palette *off,
  2755.       bool *incomplete);
  2756. extern bool palettev_read_entries (int *entry_list,
  2757.       bits colour_type_and_entry_count,
  2758.       os_palette *on,
  2759.       os_palette *off);
  2760.  
  2761. /* ------------------------------------------------------------------------
  2762.  * Function:      palettev_write_entries()
  2763.  *
  2764.  * Description:   Writes palette entries
  2765.  *
  2766.  * Input:         entry_list - value of R0 on entry
  2767.  *                colour_type_and_entry_count - value of R1 on entry
  2768.  *                palette - value of R2 on entry
  2769.  *
  2770.  * Output:        incomplete - value of R4 on exit (X version only)
  2771.  *
  2772.  * Returns:       R4 (non-X version only)
  2773.  *
  2774.  * Other notes:   Calls SWI 0x34 with R4 = 0x8, R9 = 0x23.
  2775.  */
  2776.  
  2777. extern os_error *xpalettev_write_entries (int *entry_list,
  2778.       bits colour_type_and_entry_count,
  2779.       os_palette *palette,
  2780.       bool *incomplete);
  2781. extern bool palettev_write_entries (int *entry_list,
  2782.       bits colour_type_and_entry_count,
  2783.       os_palette *palette);
  2784.  
  2785. /* ------------------------------------------------------------------------
  2786.  * Function:      palettev_set_gamma_corrections()
  2787.  *
  2788.  * Description:   Sets the gamma correction tables
  2789.  *
  2790.  * Input:         red_table - value of R0 on entry
  2791.  *                green_table - value of R1 on entry
  2792.  *                blue_table - value of R2 on entry
  2793.  *
  2794.  * Output:        incomplete - value of R4 on exit (X version only)
  2795.  *
  2796.  * Returns:       R4 (non-X version only)
  2797.  *
  2798.  * Other notes:   Calls SWI 0x34 with R4 = 0x9.
  2799.  */
  2800.  
  2801. extern os_error *xpalettev_set_gamma_corrections (os_correction_table *red_table,
  2802.       os_correction_table *green_table,
  2803.       os_correction_table *blue_table,
  2804.       bool *incomplete);
  2805. extern bool palettev_set_gamma_corrections (os_correction_table *red_table,
  2806.       os_correction_table *green_table,
  2807.       os_correction_table *blue_table);
  2808.  
  2809. /* ------------------------------------------------------------------------
  2810.  * Function:      os_read_vdu_variables()
  2811.  *
  2812.  * Description:   Reads a series of VDU variables
  2813.  *
  2814.  * Input:         var_list - value of R0 on entry
  2815.  *                value_list - value of R1 on entry
  2816.  *
  2817.  * Other notes:   Calls SWI 0x31.
  2818.  */
  2819.  
  2820. extern os_error *xos_read_vdu_variables (os_vdu_var_list *var_list,
  2821.       int *value_list);
  2822. extern void os_read_vdu_variables (os_vdu_var_list *var_list,
  2823.       int *value_list);
  2824.  
  2825. /* ------------------------------------------------------------------------
  2826.  * Function:      os_read_point()
  2827.  *
  2828.  * Description:   Reads the colour of a point
  2829.  *
  2830.  * Input:         x - value of R0 on entry
  2831.  *                y - value of R1 on entry
  2832.  *
  2833.  * Output:        gcol - value of R2 on exit
  2834.  *                tint - value of R3 on exit
  2835.  *                off_screen - value of R4 on exit (X version only)
  2836.  *
  2837.  * Returns:       R4 (non-X version only)
  2838.  *
  2839.  * Other notes:   Calls SWI 0x32.
  2840.  */
  2841.  
  2842. extern os_error *xos_read_point (int x,
  2843.       int y,
  2844.       os_gcol *gcol,
  2845.       os_tint *tint,
  2846.       bool *off_screen);
  2847. extern bool os_read_point (int x,
  2848.       int y,
  2849.       os_gcol *gcol,
  2850.       os_tint *tint);
  2851.  
  2852. /* ------------------------------------------------------------------------
  2853.  * Function:      os_read_mode_variable()
  2854.  *
  2855.  * Description:   Reads information about a screen mode
  2856.  *
  2857.  * Input:         mode - value of R0 on entry
  2858.  *                var - value of R1 on entry
  2859.  *
  2860.  * Output:        var_val - value of R2 on exit
  2861.  *                psr - processor status register on exit (X version only)
  2862.  *
  2863.  * Returns:       psr (non-X version only)
  2864.  *
  2865.  * Other notes:   Calls SWI 0x35.
  2866.  */
  2867.  
  2868. extern os_error *xos_read_mode_variable (os_mode mode,
  2869.       int var,
  2870.       int *var_val,
  2871.       bits *psr);
  2872. extern bits os_read_mode_variable (os_mode mode,
  2873.       int var,
  2874.       int *var_val);
  2875.  
  2876. /* ------------------------------------------------------------------------
  2877.  * Function:      os_remove_cursors()
  2878.  *
  2879.  * Description:   Removes the cursors from the screen
  2880.  *
  2881.  * Other notes:   Calls SWI 0x36.
  2882.  */
  2883.  
  2884. extern os_error *xos_remove_cursors (void);
  2885. extern void os_remove_cursors (void);
  2886.  
  2887. /* ------------------------------------------------------------------------
  2888.  * Function:      os_restore_cursors()
  2889.  *
  2890.  * Description:   Restores the cursors to the screen
  2891.  *
  2892.  * Other notes:   Calls SWI 0x37.
  2893.  */
  2894.  
  2895. extern os_error *xos_restore_cursors (void);
  2896. extern void os_restore_cursors (void);
  2897.  
  2898. /* ------------------------------------------------------------------------
  2899.  * Function:      os_swi_number_to_string()
  2900.  *
  2901.  * Description:   Converts a SWI number to a string containing its name
  2902.  *
  2903.  * Input:         swi - value of R0 on entry
  2904.  *                buffer - value of R1 on entry
  2905.  *                size - value of R2 on entry
  2906.  *
  2907.  * Output:        used - value of R2 on exit
  2908.  *
  2909.  * Other notes:   Calls SWI 0x38.
  2910.  */
  2911.  
  2912. extern os_error *xos_swi_number_to_string (int swi,
  2913.       char *buffer,
  2914.       int size,
  2915.       int *used);
  2916. extern void os_swi_number_to_string (int swi,
  2917.       char *buffer,
  2918.       int size,
  2919.       int *used);
  2920.  
  2921. /* ------------------------------------------------------------------------
  2922.  * Function:      os_swi_number_from_string()
  2923.  *
  2924.  * Description:   Converts a string to a SWI number if valid
  2925.  *
  2926.  * Input:         swi_name - value of R1 on entry
  2927.  *
  2928.  * Output:        swi - value of R0 on exit (X version only)
  2929.  *
  2930.  * Returns:       R0 (non-X version only)
  2931.  *
  2932.  * Other notes:   Calls SWI 0x39.
  2933.  */
  2934.  
  2935. extern os_error *xos_swi_number_from_string (char *swi_name,
  2936.       int *swi);
  2937. extern int os_swi_number_from_string (char *swi_name);
  2938.  
  2939. /* ------------------------------------------------------------------------
  2940.  * Function:      os_validate_address()
  2941.  *
  2942.  * Description:   Checks that a range of address are in logical RAM
  2943.  *
  2944.  * Input:         min - value of R0 on entry
  2945.  *                max - value of R1 on entry
  2946.  *
  2947.  * Output:        psr - processor status register on exit (X version only)
  2948.  *
  2949.  * Returns:       psr (non-X version only)
  2950.  *
  2951.  * Other notes:   Calls SWI 0x3A.
  2952.  */
  2953.  
  2954. extern os_error *xos_validate_address (byte *min,
  2955.       byte *max,
  2956.       bits *psr);
  2957. extern bits os_validate_address (byte *min,
  2958.       byte *max);
  2959.  
  2960. /* ------------------------------------------------------------------------
  2961.  * Function:      os_call_after()
  2962.  *
  2963.  * Description:   Calls a specified address after a delay
  2964.  *
  2965.  * Input:         delay - value of R0 on entry
  2966.  *                code - value of R1 on entry
  2967.  *                handle - value of R2 on entry
  2968.  *
  2969.  * Other notes:   Calls SWI 0x3B.
  2970.  */
  2971.  
  2972. extern os_error *xos_call_after (int delay,
  2973.       void *code,
  2974.       byte *handle);
  2975. extern void os_call_after (int delay,
  2976.       void *code,
  2977.       byte *handle);
  2978.  
  2979. /* ------------------------------------------------------------------------
  2980.  * Function:      os_call_every()
  2981.  *
  2982.  * Description:   Calls a specified address every time a delay elapses
  2983.  *
  2984.  * Input:         delay - value of R0 on entry
  2985.  *                code - value of R1 on entry
  2986.  *                handle - value of R2 on entry
  2987.  *
  2988.  * Other notes:   Calls SWI 0x3C.
  2989.  */
  2990.  
  2991. extern os_error *xos_call_every (int delay,
  2992.       void *code,
  2993.       byte *handle);
  2994. extern void os_call_every (int delay,
  2995.       void *code,
  2996.       byte *handle);
  2997.  
  2998. /* ------------------------------------------------------------------------
  2999.  * Function:      os_remove_ticker_event()
  3000.  *
  3001.  * Description:   Removes a given call address and handle value from the
  3002.  *                ticker event list
  3003.  *
  3004.  * Input:         code - value of R0 on entry
  3005.  *                handle - value of R1 on entry
  3006.  *
  3007.  * Other notes:   Calls SWI 0x3D.
  3008.  */
  3009.  
  3010. extern os_error *xos_remove_ticker_event (void *code,
  3011.       byte *handle);
  3012. extern void os_remove_ticker_event (void *code,
  3013.       byte *handle);
  3014.  
  3015. /* ------------------------------------------------------------------------
  3016.  * Function:      tickerv()
  3017.  *
  3018.  * Description:   Called every centisecond
  3019.  *
  3020.  * Other notes:   Calls SWI 0x34 with R9 = 0x1C.
  3021.  */
  3022.  
  3023. extern os_error *xtickerv (void);
  3024. extern void tickerv (void);
  3025.  
  3026. /* ------------------------------------------------------------------------
  3027.  * Function:      os_install_key_handler()
  3028.  *
  3029.  * Description:   Installs a key handler or reads the address of the
  3030.  *                current one
  3031.  *
  3032.  * Input:         key_handler - value of R0 on entry
  3033.  *
  3034.  * Output:        old_key_handler - value of R0 on exit (X version only)
  3035.  *
  3036.  * Returns:       R0 (non-X version only)
  3037.  *
  3038.  * Other notes:   Calls SWI 0x3E.
  3039.  */
  3040.  
  3041. extern os_error *xos_install_key_handler (os_key_handler *key_handler,
  3042.       os_key_handler **old_key_handler);
  3043. extern os_key_handler *os_install_key_handler (os_key_handler *key_handler);
  3044.  
  3045. /* ------------------------------------------------------------------------
  3046.  * Function:      keyv_present()
  3047.  *
  3048.  * Description:   The given keyboard is present
  3049.  *
  3050.  * Input:         keyboard_type - value of R1 on entry
  3051.  *
  3052.  * Other notes:   Calls SWI 0x34 with R0 = 0x0, R9 = 0x13.
  3053.  */
  3054.  
  3055. extern os_error *xkeyv_present (int keyboard_type);
  3056. extern void keyv_present (int keyboard_type);
  3057.  
  3058. /* ------------------------------------------------------------------------
  3059.  * Function:      keyv_transition_up()
  3060.  *
  3061.  * Description:   Key released
  3062.  *
  3063.  * Input:         key - value of R1 on entry
  3064.  *
  3065.  * Other notes:   Calls SWI 0x34 with R0 = 0x1, R9 = 0x13.
  3066.  */
  3067.  
  3068. extern os_error *xkeyv_transition_up (int key);
  3069. extern void keyv_transition_up (int key);
  3070.  
  3071. /* ------------------------------------------------------------------------
  3072.  * Function:      keyv_transition_down()
  3073.  *
  3074.  * Description:   Key pressed
  3075.  *
  3076.  * Input:         key - value of R1 on entry
  3077.  *
  3078.  * Other notes:   Calls SWI 0x34 with R0 = 0x2, R9 = 0x13.
  3079.  */
  3080.  
  3081. extern os_error *xkeyv_transition_down (int key);
  3082. extern void keyv_transition_down (int key);
  3083.  
  3084. /* ------------------------------------------------------------------------
  3085.  * Function:      keyv_led_state()
  3086.  *
  3087.  * Description:   Notifies driver of LED state
  3088.  *
  3089.  * Input:         flags - value of R1 on entry
  3090.  *
  3091.  * Other notes:   Calls SWI 0x34 with R0 = 0x3, R9 = 0x13.
  3092.  */
  3093.  
  3094. extern os_error *xkeyv_led_state (bits flags);
  3095. extern void keyv_led_state (bits flags);
  3096.  
  3097. /* ------------------------------------------------------------------------
  3098.  * Function:      keyv_enable_drivers()
  3099.  *
  3100.  * Description:   Enables keyboard device drivers
  3101.  *
  3102.  * Other notes:   Calls SWI 0x34 with R0 = 0x4, R9 = 0x13.
  3103.  */
  3104.  
  3105. extern os_error *xkeyv_enable_drivers (void);
  3106. extern void keyv_enable_drivers (void);
  3107.  
  3108. /* ------------------------------------------------------------------------
  3109.  * Function:      os_check_mode_valid()
  3110.  *
  3111.  * Description:   Checks if it is possible to change into a specified mode
  3112.  *
  3113.  * Input:         mode - value of R0 on entry
  3114.  *
  3115.  * Output:        mode_status - value of R0 on exit
  3116.  *                alternative_mode - value of R1 on exit
  3117.  *                psr - processor status register on exit (X version only)
  3118.  *
  3119.  * Returns:       psr (non-X version only)
  3120.  *
  3121.  * Other notes:   Calls SWI 0x3F.
  3122.  */
  3123.  
  3124. extern os_error *xos_check_mode_valid (os_mode mode,
  3125.       int *mode_status,
  3126.       os_mode *alternative_mode,
  3127.       bits *psr);
  3128. extern bits os_check_mode_valid (os_mode mode,
  3129.       int *mode_status,
  3130.       os_mode *alternative_mode);
  3131.  
  3132. /* ------------------------------------------------------------------------
  3133.  * Function:      os_change_environment()
  3134.  *
  3135.  * Description:   Installs a handler
  3136.  *
  3137.  * Input:         handler_type - value of R0 on entry
  3138.  *                handler - value of R1 on entry
  3139.  *                handle - value of R2 on entry
  3140.  *                buffer - value of R3 on entry
  3141.  *
  3142.  * Output:        old_handler - value of R1 on exit (X version only)
  3143.  *                old_handle - value of R2 on exit
  3144.  *                old_buffer - value of R3 on exit
  3145.  *
  3146.  * Returns:       R1 (non-X version only)
  3147.  *
  3148.  * Other notes:   Calls SWI 0x40.
  3149.  */
  3150.  
  3151. extern os_error *xos_change_environment (int handler_type,
  3152.       void *handler,
  3153.       byte *handle,
  3154.       byte *buffer,
  3155.       void **old_handler,
  3156.       byte **old_handle,
  3157.       byte **old_buffer);
  3158. extern void *os_change_environment (int handler_type,
  3159.       void *handler,
  3160.       byte *handle,
  3161.       byte *buffer,
  3162.       byte **old_handle,
  3163.       byte **old_buffer);
  3164.  
  3165. /* ------------------------------------------------------------------------
  3166.  * Function:      changeenvironmentv()
  3167.  *
  3168.  * Description:   OS_ChangeEnvironment vector
  3169.  *
  3170.  * Input:         handler_type - value of R0 on entry
  3171.  *                handler - value of R1 on entry
  3172.  *                handle - value of R2 on entry
  3173.  *                buffer - value of R3 on entry
  3174.  *
  3175.  * Output:        old_handler - value of R1 on exit
  3176.  *                old_handle - value of R2 on exit
  3177.  *                old_buffer - value of R3 on exit
  3178.  *
  3179.  * Other notes:   Calls SWI 0x34 with R9 = 0x1E.
  3180.  */
  3181.  
  3182. extern os_error *xchangeenvironmentv (int handler_type,
  3183.       void *handler,
  3184.       byte *handle,
  3185.       byte *buffer,
  3186.       void **old_handler,
  3187.       byte **old_handle,
  3188.       byte **old_buffer);
  3189. extern void changeenvironmentv (int handler_type,
  3190.       void *handler,
  3191.       byte *handle,
  3192.       byte *buffer,
  3193.       void **old_handler,
  3194.       byte **old_handle,
  3195.       byte **old_buffer);
  3196.  
  3197. /* ------------------------------------------------------------------------
  3198.  * Function:      osclaimscreenmemory_alloc()
  3199.  *
  3200.  * Description:   Claims spare screen memory
  3201.  *
  3202.  * Input:         size - value of R1 on entry
  3203.  *
  3204.  * Output:        size_out - value of R1 on exit
  3205.  *                blk - value of R2 on exit
  3206.  *                psr - processor status register on exit (X version only)
  3207.  *
  3208.  * Returns:       psr (non-X version only)
  3209.  *
  3210.  * Other notes:   Calls SWI 0x41 with R0 = 0x1.
  3211.  */
  3212.  
  3213. extern os_error *xosclaimscreenmemory_alloc (int size,
  3214.       int *size_out,
  3215.       void **blk,
  3216.       bits *psr);
  3217. extern bits osclaimscreenmemory_alloc (int size,
  3218.       int *size_out,
  3219.       void **blk);
  3220.  
  3221. /* ------------------------------------------------------------------------
  3222.  * Function:      osclaimscreenmemory_free()
  3223.  *
  3224.  * Description:   Releases spare screen memory
  3225.  *
  3226.  * Other notes:   Calls SWI 0x41 with R0 = 0x0.
  3227.  */
  3228.  
  3229. extern os_error *xosclaimscreenmemory_free (void);
  3230. extern void osclaimscreenmemory_free (void);
  3231.  
  3232. /* ------------------------------------------------------------------------
  3233.  * Function:      os_read_monotonic_time()
  3234.  *
  3235.  * Description:   Returns the number of centiseconds since the last hard
  3236.  *                reset
  3237.  *
  3238.  * Output:        t - value of R0 on exit (X version only)
  3239.  *
  3240.  * Returns:       R0 (non-X version only)
  3241.  *
  3242.  * Other notes:   Calls SWI 0x42.
  3243.  */
  3244.  
  3245. extern os_error *xos_read_monotonic_time (os_t *t);
  3246. extern os_t os_read_monotonic_time (void);
  3247.  
  3248. /* ------------------------------------------------------------------------
  3249.  * Function:      os_substitute_args()
  3250.  *
  3251.  * Description:   Substitutes command line arguments
  3252.  *
  3253.  * Input:         args - value of R0 on entry
  3254.  *                buffer - value of R1 on entry
  3255.  *                size - value of R2 on entry
  3256.  *                source - value of R3 on entry
  3257.  *                source_size - value of R4 on entry
  3258.  *
  3259.  * Output:        used - value of R2 on exit
  3260.  *
  3261.  * Other notes:   Calls SWI 0x43.
  3262.  */
  3263.  
  3264. extern os_error *xos_substitute_args (char *args,
  3265.       char *buffer,
  3266.       int size,
  3267.       char *source,
  3268.       int source_size,
  3269.       int *used);
  3270. extern void os_substitute_args (char *args,
  3271.       char *buffer,
  3272.       int size,
  3273.       char *source,
  3274.       int source_size,
  3275.       int *used);
  3276.  
  3277. /* ------------------------------------------------------------------------
  3278.  * Function:      os_pretty_print()
  3279.  *
  3280.  * Description:   Writes a string with some formatting to all of the active
  3281.  *                output streams
  3282.  *
  3283.  * Input:         string - value of R0 on entry
  3284.  *                dictionary - value of R1 on entry
  3285.  *                special - value of R2 on entry
  3286.  *
  3287.  * Other notes:   Calls SWI 0x44.
  3288.  */
  3289.  
  3290. extern os_error *xos_pretty_print (char *string,
  3291.       byte *dictionary,
  3292.       char *special);
  3293. extern void os_pretty_print (char *string,
  3294.       byte *dictionary,
  3295.       char *special);
  3296.  
  3297. /* ------------------------------------------------------------------------
  3298.  * Function:      os_plot()
  3299.  *
  3300.  * Description:   Direct VDU call to general plot command
  3301.  *
  3302.  * Input:         plot_code - value of R0 on entry
  3303.  *                x - value of R1 on entry
  3304.  *                y - value of R2 on entry
  3305.  *
  3306.  * Other notes:   Calls SWI 0x45.
  3307.  */
  3308.  
  3309. extern os_error *xos_plot (int plot_code,
  3310.       int x,
  3311.       int y);
  3312. extern void os_plot (int plot_code,
  3313.       int x,
  3314.       int y);
  3315.  
  3316. /* ------------------------------------------------------------------------
  3317.  * Function:      ukplotv()
  3318.  *
  3319.  * Description:   Called when an unknown OS_Plot command is issued
  3320.  *
  3321.  * Input:         plot_code - value of R0 on entry
  3322.  *
  3323.  * Other notes:   Calls SWI 0x34 with R9 = 0x19.
  3324.  */
  3325.  
  3326. extern os_error *xukplotv (int plot_code);
  3327. extern void ukplotv (int plot_code);
  3328.  
  3329. /* ------------------------------------------------------------------------
  3330.  * Function:      os_writen()
  3331.  *
  3332.  * Description:   Writes a counted string to all of the active output
  3333.  *                streams
  3334.  *
  3335.  * Input:         s - value of R0 on entry
  3336.  *                size - value of R1 on entry
  3337.  *
  3338.  * Other notes:   Calls SWI 0x46.
  3339.  */
  3340.  
  3341. extern os_error *xos_writen (char *s,
  3342.       int size);
  3343. extern void os_writen (char *s,
  3344.       int size);
  3345.  
  3346. /* ------------------------------------------------------------------------
  3347.  * Function:      os_add_to_vector()
  3348.  *
  3349.  * Description:   Adds a routine to the list of those that claim a vector
  3350.  *
  3351.  * Input:         vector - value of R0 on entry
  3352.  *                routine - value of R1 on entry
  3353.  *                handle - value of R2 on entry
  3354.  *
  3355.  * Other notes:   Calls SWI 0x47.
  3356.  */
  3357.  
  3358. extern os_error *xos_add_to_vector (int vector,
  3359.       void *routine,
  3360.       byte *handle);
  3361. extern void os_add_to_vector (int vector,
  3362.       void *routine,
  3363.       byte *handle);
  3364.  
  3365. /* ------------------------------------------------------------------------
  3366.  * Function:      os_write_env()
  3367.  *
  3368.  * Description:   Sets the program environment command string and start
  3369.  *                time
  3370.  *
  3371.  * Input:         command - value of R0 on entry
  3372.  *                start - value of R1 on entry
  3373.  *
  3374.  * Other notes:   Calls SWI 0x48.
  3375.  */
  3376.  
  3377. extern os_error *xos_write_env (char *command,
  3378.       os_date_and_time *start);
  3379. extern void os_write_env (char *command,
  3380.       os_date_and_time *start);
  3381.  
  3382. /* ------------------------------------------------------------------------
  3383.  * Function:      os_read_args()
  3384.  *
  3385.  * Description:   Given a keyword definition, scans a command string
  3386.  *
  3387.  * Input:         keywords - value of R0 on entry
  3388.  *                input - value of R1 on entry
  3389.  *                buffer - value of R2 on entry
  3390.  *                size - value of R3 on entry
  3391.  *
  3392.  * Output:        spare - value of R3 on exit
  3393.  *
  3394.  * Other notes:   Calls SWI 0x49.
  3395.  */
  3396.  
  3397. extern os_error *xos_read_args (char *keywords,
  3398.       char *input,
  3399.       char *buffer,
  3400.       int size,
  3401.       int *spare);
  3402. extern void os_read_args (char *keywords,
  3403.       char *input,
  3404.       char *buffer,
  3405.       int size,
  3406.       int *spare);
  3407.  
  3408. /* ------------------------------------------------------------------------
  3409.  * Function:      os_read_ram_fs_limits()
  3410.  *
  3411.  * Description:   Gets the current limits of the RM filing system
  3412.  *
  3413.  * Output:        start - value of R0 on exit
  3414.  *                end - value of R1 on exit
  3415.  *
  3416.  * Other notes:   Calls SWI 0x4A.
  3417.  */
  3418.  
  3419. extern os_error *xos_read_ram_fs_limits (byte **start,
  3420.       char **end);
  3421. extern void os_read_ram_fs_limits (byte **start,
  3422.       char **end);
  3423.  
  3424. /* ------------------------------------------------------------------------
  3425.  * Function:      os_claim_device_vector()
  3426.  *
  3427.  * Description:   Claims a device vector
  3428.  *
  3429.  * Input:         device - value of R0 on entry
  3430.  *                driver - value of R1 on entry
  3431.  *                handle - value of R2 on entry
  3432.  *                status - value of R3 on entry
  3433.  *                mask - value of R4 on entry
  3434.  *
  3435.  * Other notes:   Calls SWI 0x4B.
  3436.  */
  3437.  
  3438. extern os_error *xos_claim_device_vector (int device,
  3439.       void *driver,
  3440.       byte *handle,
  3441.       int *status,
  3442.       bits mask);
  3443. extern void os_claim_device_vector (int device,
  3444.       void *driver,
  3445.       byte *handle,
  3446.       int *status,
  3447.       bits mask);
  3448.  
  3449. /* ------------------------------------------------------------------------
  3450.  * Function:      os_release_device_vector()
  3451.  *
  3452.  * Description:   Releases a device vector
  3453.  *
  3454.  * Input:         device - value of R0 on entry
  3455.  *                driver - value of R1 on entry
  3456.  *                handle - value of R2 on entry
  3457.  *                status - value of R3 on entry
  3458.  *                mask - value of R4 on entry
  3459.  *
  3460.  * Other notes:   Calls SWI 0x4C.
  3461.  */
  3462.  
  3463. extern os_error *xos_release_device_vector (int device,
  3464.       void *driver,
  3465.       byte *handle,
  3466.       int *status,
  3467.       bits mask);
  3468. extern void os_release_device_vector (int device,
  3469.       void *driver,
  3470.       byte *handle,
  3471.       int *status,
  3472.       bits mask);
  3473.  
  3474. /* ------------------------------------------------------------------------
  3475.  * Function:      os_delink_application()
  3476.  *
  3477.  * Description:   Removes any vectors that an application is using
  3478.  *
  3479.  * Input:         buffer - value of R0 on entry
  3480.  *                size - value of R1 on entry
  3481.  *
  3482.  * Output:        used - value of R1 on exit
  3483.  *
  3484.  * Other notes:   Calls SWI 0x4D.
  3485.  */
  3486.  
  3487. extern os_error *xos_delink_application (byte *buffer,
  3488.       int size,
  3489.       int *used);
  3490. extern void os_delink_application (byte *buffer,
  3491.       int size,
  3492.       int *used);
  3493.  
  3494. /* ------------------------------------------------------------------------
  3495.  * Function:      os_relink_application()
  3496.  *
  3497.  * Description:   Restores from a buffer any vectors that an application is
  3498.  *                using
  3499.  *
  3500.  * Input:         buffer - value of R0 on entry
  3501.  *
  3502.  * Other notes:   Calls SWI 0x4E.
  3503.  */
  3504.  
  3505. extern os_error *xos_relink_application (byte *buffer);
  3506. extern void os_relink_application (byte *buffer);
  3507.  
  3508. /* ------------------------------------------------------------------------
  3509.  * Function:      os_heap_sort()
  3510.  *
  3511.  * Description:   Heap-sorts a list of objects
  3512.  *
  3513.  * Input:         count - value of R0 on entry
  3514.  *                array - value of R1 on entry
  3515.  *                compare_fn - value of R2 on entry
  3516.  *                handle - value of R3 on entry
  3517.  *                objects - value of R4 on entry
  3518.  *                object_size - value of R5 on entry
  3519.  *                workspace - value of R6 on entry
  3520.  *
  3521.  * Other notes:   Calls SWI 0x4F.
  3522.  */
  3523.  
  3524. extern os_error *xos_heap_sort (int count,
  3525.       int *array,
  3526.       void *compare_fn,
  3527.       byte *handle,
  3528.       byte *objects,
  3529.       int object_size,
  3530.       void *workspace);
  3531. extern void os_heap_sort (int count,
  3532.       int *array,
  3533.       void *compare_fn,
  3534.       byte *handle,
  3535.       byte *objects,
  3536.       int object_size,
  3537.       void *workspace);
  3538.  
  3539. /* ------------------------------------------------------------------------
  3540.  * Function:      os_exit_and_die()
  3541.  *
  3542.  * Description:   Kills a module and passes control to the most recent exit
  3543.  *                handler
  3544.  *
  3545.  * Input:         error - value of R0 on entry
  3546.  *                rc - value of R2 on entry
  3547.  *                module_name - value of R3 on entry
  3548.  *
  3549.  * Other notes:   Calls SWI 0x50 with R1 = 0x58454241.
  3550.  */
  3551.  
  3552. extern os_error *xos_exit_and_die (os_error *error,
  3553.       int rc,
  3554.       char *module_name);
  3555. extern void os_exit_and_die (os_error *error,
  3556.       int rc,
  3557.       char *module_name);
  3558.  
  3559. /* ------------------------------------------------------------------------
  3560.  * Function:      os_read_mem_map_info()
  3561.  *
  3562.  * Description:   Reads the page size and count
  3563.  *
  3564.  * Output:        page_size - value of R0 on exit
  3565.  *                page_count - value of R1 on exit
  3566.  *
  3567.  * Other notes:   Calls SWI 0x51.
  3568.  */
  3569.  
  3570. extern os_error *xos_read_mem_map_info (int *page_size,
  3571.       int *page_count);
  3572. extern void os_read_mem_map_info (int *page_size,
  3573.       int *page_count);
  3574.  
  3575. /* ------------------------------------------------------------------------
  3576.  * Function:      os_read_mem_map_entries()
  3577.  *
  3578.  * Description:   Reads by page number the logical to physical memory
  3579.  *                mapping used by MEMC
  3580.  *
  3581.  * Input:         request_list - value of R0 on entry
  3582.  *
  3583.  * Other notes:   Calls SWI 0x52.
  3584.  */
  3585.  
  3586. extern os_error *xos_read_mem_map_entries (os_mem_map_request_list *request_list);
  3587. extern void os_read_mem_map_entries (os_mem_map_request_list *request_list);
  3588.  
  3589. /* ------------------------------------------------------------------------
  3590.  * Function:      os_set_mem_map_entries()
  3591.  *
  3592.  * Description:   Writes the logical to physical memory mapping used by
  3593.  *                MEMC
  3594.  *
  3595.  * Input:         request_list - value of R0 on entry
  3596.  *
  3597.  * Other notes:   Calls SWI 0x53.
  3598.  */
  3599.  
  3600. extern os_error *xos_set_mem_map_entries (os_mem_map_request_list *request_list);
  3601. extern void os_set_mem_map_entries (os_mem_map_request_list *request_list);
  3602.  
  3603. /* ------------------------------------------------------------------------
  3604.  * Function:      os_add_call_back()
  3605.  *
  3606.  * Description:   Adds a transient callback to the list
  3607.  *
  3608.  * Input:         call_back - value of R0 on entry
  3609.  *                handle - value of R1 on entry
  3610.  *
  3611.  * Other notes:   Calls SWI 0x54.
  3612.  */
  3613.  
  3614. extern os_error *xos_add_call_back (void *call_back,
  3615.       byte *handle);
  3616. extern void os_add_call_back (void *call_back,
  3617.       byte *handle);
  3618.  
  3619. /* ------------------------------------------------------------------------
  3620.  * Function:      os_read_default_handler()
  3621.  *
  3622.  * Description:   Gets the address of the default handler
  3623.  *
  3624.  * Input:         handler_type - value of R0 on entry
  3625.  *
  3626.  * Output:        handler - value of R1 on exit
  3627.  *                handle - value of R2 on exit
  3628.  *                buffer - value of R3 on exit
  3629.  *
  3630.  * Other notes:   Calls SWI 0x55.
  3631.  */
  3632.  
  3633. extern os_error *xos_read_default_handler (int handler_type,
  3634.       void **handler,
  3635.       byte **handle,
  3636.       byte **buffer);
  3637. extern void os_read_default_handler (int handler_type,
  3638.       void **handler,
  3639.       byte **handle,
  3640.       byte **buffer);
  3641.  
  3642. /* ------------------------------------------------------------------------
  3643.  * Function:      os_set_ecf_origin()
  3644.  *
  3645.  * Description:   Sets the origin of the ECF patterns
  3646.  *
  3647.  * Input:         x - value of R0 on entry
  3648.  *                y - value of R1 on entry
  3649.  *
  3650.  * Other notes:   Calls SWI 0x56.
  3651.  */
  3652.  
  3653. extern os_error *xos_set_ecf_origin (int x,
  3654.       int y);
  3655. extern void os_set_ecf_origin (int x,
  3656.       int y);
  3657.  
  3658. /* ------------------------------------------------------------------------
  3659.  * Function:      os_confirm()
  3660.  *
  3661.  * Description:   Gets a yes or no answer
  3662.  *
  3663.  * Output:        key - value of R0 on exit
  3664.  *                psr - processor status register on exit (X version only)
  3665.  *
  3666.  * Returns:       psr (non-X version only)
  3667.  *
  3668.  * Other notes:   Calls SWI 0x59.
  3669.  */
  3670.  
  3671. extern os_error *xos_confirm (char *key,
  3672.       bits *psr);
  3673. extern bits os_confirm (char *key);
  3674.  
  3675. /* ------------------------------------------------------------------------
  3676.  * Function:      os_changed_box()
  3677.  *
  3678.  * Description:   Determines which area of the screen has changed
  3679.  *
  3680.  * Input:         state - value of R0 on entry
  3681.  *
  3682.  * Output:        old_state - value of R0 on exit (X version only)
  3683.  *                change_box - value of R1 on exit
  3684.  *
  3685.  * Returns:       R0 (non-X version only)
  3686.  *
  3687.  * Other notes:   Calls SWI 0x5A.
  3688.  */
  3689.  
  3690. extern os_error *xos_changed_box (int state,
  3691.       int *old_state,
  3692.       os_change_box **change_box);
  3693. extern int os_changed_box (int state,
  3694.       os_change_box **change_box);
  3695.  
  3696. /* ------------------------------------------------------------------------
  3697.  * Function:      os_crc()
  3698.  *
  3699.  * Description:   Calculates the cyclic redundancy check for a block of
  3700.  *                data
  3701.  *
  3702.  * Input:         crc_in - value of R0 on entry
  3703.  *                block - value of R1 on entry
  3704.  *                end - value of R2 on entry
  3705.  *                stride - value of R3 on entry
  3706.  *
  3707.  * Output:        crc - value of R0 on exit (X version only)
  3708.  *
  3709.  * Returns:       R0 (non-X version only)
  3710.  *
  3711.  * Other notes:   Calls SWI 0x5B.
  3712.  */
  3713.  
  3714. extern os_error *xos_crc (int crc_in,
  3715.       byte *block,
  3716.       char *end,
  3717.       int stride,
  3718.       int *crc);
  3719. extern int os_crc (int crc_in,
  3720.       byte *block,
  3721.       char *end,
  3722.       int stride);
  3723.  
  3724. /* ------------------------------------------------------------------------
  3725.  * Function:      os_read_dynamic_area()
  3726.  *
  3727.  * Description:   Reads the space allocation of a dynamic area
  3728.  *
  3729.  * Input:         area - value of R0 on entry
  3730.  *
  3731.  * Output:        area_start - value of R0 on exit (X version only)
  3732.  *                size - value of R1 on exit
  3733.  *                size_limit - value of R2 on exit
  3734.  *
  3735.  * Returns:       R0 (non-X version only)
  3736.  *
  3737.  * Other notes:   Calls SWI 0x5C.
  3738.  */
  3739.  
  3740. extern os_error *xos_read_dynamic_area (int area,
  3741.       byte **area_start,
  3742.       int *size,
  3743.       int *size_limit);
  3744. extern byte *os_read_dynamic_area (int area,
  3745.       int *size,
  3746.       int *size_limit);
  3747.  
  3748. /* ------------------------------------------------------------------------
  3749.  * Function:      os_print_char()
  3750.  *
  3751.  * Description:   Sends a character to the printer stream
  3752.  *
  3753.  * Input:         c - value of R0 on entry
  3754.  *
  3755.  * Other notes:   Calls SWI 0x5D.
  3756.  */
  3757.  
  3758. extern os_error *xos_print_char (char c);
  3759. extern void os_print_char (char c);
  3760.  
  3761. /* ------------------------------------------------------------------------
  3762.  * Function:      os_change_redirection()
  3763.  *
  3764.  * Description:   Reads or writes OS_CLI input/output redirection handles
  3765.  *
  3766.  * Input:         input - value of R0 on entry
  3767.  *                output - value of R1 on entry
  3768.  *
  3769.  * Output:        old_input - value of R0 on exit
  3770.  *                old_output - value of R1 on exit
  3771.  *
  3772.  * Other notes:   Calls SWI 0x5E.
  3773.  */
  3774.  
  3775. extern os_error *xos_change_redirection (os_f input,
  3776.       os_f output,
  3777.       os_f *old_input,
  3778.       os_f *old_output);
  3779. extern void os_change_redirection (os_f input,
  3780.       os_f output,
  3781.       os_f *old_input,
  3782.       os_f *old_output);
  3783.  
  3784. /* ------------------------------------------------------------------------
  3785.  * Function:      os_remove_call_back()
  3786.  *
  3787.  * Description:   Removes a transient callback from the list
  3788.  *
  3789.  * Input:         call_back - value of R0 on entry
  3790.  *                handle - value of R1 on entry
  3791.  *
  3792.  * Other notes:   Calls SWI 0x5F.
  3793.  */
  3794.  
  3795. extern os_error *xos_remove_call_back (void *call_back,
  3796.       byte *handle);
  3797. extern void os_remove_call_back (void *call_back,
  3798.       byte *handle);
  3799.  
  3800. /* ------------------------------------------------------------------------
  3801.  * Function:      os_find_mem_map_entries()
  3802.  *
  3803.  * Description:   Reads by logical address the logical to physical memory
  3804.  *                mapping used by MEMC
  3805.  *
  3806.  * Input:         request_list - value of R0 on entry
  3807.  *
  3808.  * Other notes:   Calls SWI 0x60.
  3809.  */
  3810.  
  3811. extern os_error *xos_find_mem_map_entries (os_mem_map_request_list *request_list);
  3812. extern void os_find_mem_map_entries (os_mem_map_request_list *request_list);
  3813.  
  3814. /* ------------------------------------------------------------------------
  3815.  * Function:      os_set_colour()
  3816.  *
  3817.  * Description:   Sets the current colour or colour pattern
  3818.  *
  3819.  * Input:         flags - value of R0 on entry
  3820.  *                colour_number - value of R1 on entry
  3821.  *
  3822.  * Other notes:   Calls SWI 0x61.
  3823.  */
  3824.  
  3825. extern os_error *xos_set_colour (bits flags,
  3826.       os_colour_number colour_number);
  3827. extern void os_set_colour (bits flags,
  3828.       os_colour_number colour_number);
  3829.  
  3830. /* ------------------------------------------------------------------------
  3831.  * Function:      os_read_colour()
  3832.  *
  3833.  * Description:   Reads the current colour or colour pattern
  3834.  *
  3835.  * Input:         flags - value of R0 on entry
  3836.  *                pattern - value of R1 on entry
  3837.  *
  3838.  * Output:        flags_out - value of R0 on exit
  3839.  *                colour_number - value of R1 on exit (X version only)
  3840.  *
  3841.  * Returns:       R1 (non-X version only)
  3842.  *
  3843.  * Other notes:   Calls SWI 0x61 with R0 |= 0x80.
  3844.  */
  3845.  
  3846. extern os_error *xos_read_colour (bits flags,
  3847.       os_ecf *pattern,
  3848.       bits *flags_out,
  3849.       os_colour_number *colour_number);
  3850. extern os_colour_number os_read_colour (bits flags,
  3851.       os_ecf *pattern,
  3852.       bits *flags_out);
  3853.  
  3854. /* ------------------------------------------------------------------------
  3855.  * Function:      ospointer_get()
  3856.  *
  3857.  * Description:   Gets the currently selected pointer device type
  3858.  *
  3859.  * Output:        pointer_type - value of R0 on exit (X version only)
  3860.  *
  3861.  * Returns:       R0 (non-X version only)
  3862.  *
  3863.  * Other notes:   Calls SWI 0x64 with R0 = 0x0.
  3864.  */
  3865.  
  3866. extern os_error *xospointer_get (int *pointer_type);
  3867. extern int ospointer_get (void);
  3868.  
  3869. /* ------------------------------------------------------------------------
  3870.  * Function:      ospointer_set()
  3871.  *
  3872.  * Description:   Sets the currently selected pointer device type
  3873.  *
  3874.  * Input:         pointer_type - value of R1 on entry
  3875.  *
  3876.  * Other notes:   Calls SWI 0x64 with R0 = 0x1.
  3877.  */
  3878.  
  3879. extern os_error *xospointer_set (int pointer_type);
  3880. extern void ospointer_set (int pointer_type);
  3881.  
  3882. /* ------------------------------------------------------------------------
  3883.  * Function:      pointerv_status()
  3884.  *
  3885.  * Description:   Requests status of pointer device
  3886.  *
  3887.  * Input:         pointer_type - value of R1 on entry
  3888.  *
  3889.  * Output:        xmove - value of R2 on exit
  3890.  *                ymove - value of R3 on exit
  3891.  *
  3892.  * Other notes:   Calls SWI 0x34 with R0 = 0x0, R9 = 0x26.
  3893.  */
  3894.  
  3895. extern os_error *xpointerv_status (int pointer_type,
  3896.       int *xmove,
  3897.       int *ymove);
  3898. extern void pointerv_status (int pointer_type,
  3899.       int *xmove,
  3900.       int *ymove);
  3901.  
  3902. /* ------------------------------------------------------------------------
  3903.  * Function:      pointerv_enumerate()
  3904.  *
  3905.  * Description:   Enumerates pointer device types
  3906.  *
  3907.  * Input:         record - value of R1 on entry
  3908.  *
  3909.  * Output:        record_out - value of R1 on exit (X version only)
  3910.  *
  3911.  * Returns:       R1 (non-X version only)
  3912.  *
  3913.  * Other notes:   Calls SWI 0x34 with R0 = 0x1, R9 = 0x26.
  3914.  */
  3915.  
  3916. extern os_error *xpointerv_enumerate (pointerv_record *record,
  3917.       pointerv_record **record_out);
  3918. extern pointerv_record *pointerv_enumerate (pointerv_record *record);
  3919.  
  3920. /* ------------------------------------------------------------------------
  3921.  * Function:      pointerv_selected()
  3922.  *
  3923.  * Description:   Pointer device type selected
  3924.  *
  3925.  * Input:         pointer_type - value of R1 on entry
  3926.  *
  3927.  * Other notes:   Calls SWI 0x34 with R0 = 0x2, R9 = 0x26.
  3928.  */
  3929.  
  3930. extern os_error *xpointerv_selected (int pointer_type);
  3931. extern void pointerv_selected (int pointer_type);
  3932.  
  3933. /* ------------------------------------------------------------------------
  3934.  * Function:      osscreenmode_select()
  3935.  *
  3936.  * Description:   Selects a screen mode
  3937.  *
  3938.  * Input:         mode - value of R1 on entry
  3939.  *
  3940.  * Other notes:   Calls SWI 0x65 with R0 = 0x0.
  3941.  */
  3942.  
  3943. extern os_error *xosscreenmode_select (os_mode mode);
  3944. extern void osscreenmode_select (os_mode mode);
  3945.  
  3946. /* ------------------------------------------------------------------------
  3947.  * Function:      osscreenmode_current()
  3948.  *
  3949.  * Description:   Returns the mode specifier for the current mode
  3950.  *
  3951.  * Output:        mode - value of R1 on exit (X version only)
  3952.  *
  3953.  * Returns:       R1 (non-X version only)
  3954.  *
  3955.  * Other notes:   Calls SWI 0x65 with R0 = 0x1.
  3956.  */
  3957.  
  3958. extern os_error *xosscreenmode_current (os_mode *mode);
  3959. extern os_mode osscreenmode_current (void);
  3960.  
  3961. /* ------------------------------------------------------------------------
  3962.  * Function:      osscreenmode_enumerate()
  3963.  *
  3964.  * Description:   Enumerates the available screen modes
  3965.  *
  3966.  * Input:         context - value of R2 on entry
  3967.  *                block - value of R6 on entry
  3968.  *                block_size - value of R7 on entry
  3969.  *
  3970.  * Output:        complete - value of R1 on exit (X version only)
  3971.  *                context_out - value of R2 on exit
  3972.  *                end - value of R6 on exit
  3973.  *                free - value of R7 on exit
  3974.  *
  3975.  * Returns:       R1 (non-X version only)
  3976.  *
  3977.  * Other notes:   Calls SWI 0x65 with R0 = 0x2.
  3978.  */
  3979.  
  3980. extern os_error *xosscreenmode_enumerate (int context,
  3981.       os_mode_block *block,
  3982.       int block_size,
  3983.       bool *complete,
  3984.       int *context_out,
  3985.       byte **end,
  3986.       int *free);
  3987. extern bool osscreenmode_enumerate (int context,
  3988.       os_mode_block *block,
  3989.       int block_size,
  3990.       int *context_out,
  3991.       byte **end,
  3992.       int *free);
  3993.  
  3994. /* ------------------------------------------------------------------------
  3995.  * Function:      osdynamicarea_create()
  3996.  *
  3997.  * Description:   Creates a new dynamic area
  3998.  *
  3999.  * Input:         area - value of R1 on entry
  4000.  *                size - value of R2 on entry
  4001.  *                base_address - value of R3 on entry
  4002.  *                flags - value of R4 on entry
  4003.  *                size_limit - value of R5 on entry
  4004.  *                handler - value of R6 on entry
  4005.  *                workspace - value of R7 on entry
  4006.  *                description - value of R8 on entry
  4007.  *
  4008.  * Output:        area_out - value of R1 on exit (X version only)
  4009.  *                base_address_out - value of R3 on exit
  4010.  *                size_limit_out - value of R5 on exit
  4011.  *
  4012.  * Returns:       R1 (non-X version only)
  4013.  *
  4014.  * Other notes:   Calls SWI 0x66 with R0 = 0x0.
  4015.  */
  4016.  
  4017. extern os_error *xosdynamicarea_create (int area,
  4018.       int size,
  4019.       byte *base_address,
  4020.       bits flags,
  4021.       int size_limit,
  4022.       void *handler,
  4023.       void *workspace,
  4024.       char *description,
  4025.       int *area_out,
  4026.       byte **base_address_out,
  4027.       int *size_limit_out);
  4028. extern int osdynamicarea_create (int area,
  4029.       int size,
  4030.       byte *base_address,
  4031.       bits flags,
  4032.       int size_limit,
  4033.       void *handler,
  4034.       void *workspace,
  4035.       char *description,
  4036.       byte **base_address_out,
  4037.       int *size_limit_out);
  4038.  
  4039. /* ------------------------------------------------------------------------
  4040.  * Function:      osdynamicarea_delete()
  4041.  *
  4042.  * Description:   Removes a previously created dynamic area
  4043.  *
  4044.  * Input:         area - value of R1 on entry
  4045.  *
  4046.  * Other notes:   Calls SWI 0x66 with R0 = 0x1.
  4047.  */
  4048.  
  4049. extern os_error *xosdynamicarea_delete (int area);
  4050. extern void osdynamicarea_delete (int area);
  4051.  
  4052. /* ------------------------------------------------------------------------
  4053.  * Function:      osdynamicarea_read()
  4054.  *
  4055.  * Description:   Returns information on a dynamic area
  4056.  *
  4057.  * Input:         area - value of R1 on entry
  4058.  *
  4059.  * Output:        size - value of R2 on exit
  4060.  *                base_address - value of R3 on exit
  4061.  *                flags - value of R4 on exit
  4062.  *                size_limit - value of R5 on exit
  4063.  *                handler - value of R6 on exit
  4064.  *                workspace - value of R7 on exit
  4065.  *                description - value of R8 on exit
  4066.  *
  4067.  * Other notes:   Calls SWI 0x66 with R0 = 0x2.
  4068.  */
  4069.  
  4070. extern os_error *xosdynamicarea_read (int area,
  4071.       int *size,
  4072.       byte **base_address,
  4073.       bits *flags,
  4074.       int *size_limit,
  4075.       void **handler,
  4076.       void **workspace,
  4077.       char **description);
  4078. extern void osdynamicarea_read (int area,
  4079.       int *size,
  4080.       byte **base_address,
  4081.       bits *flags,
  4082.       int *size_limit,
  4083.       void **handler,
  4084.       void **workspace,
  4085.       char **description);
  4086.  
  4087. /* ------------------------------------------------------------------------
  4088.  * Function:      osdynamicarea_enumerate()
  4089.  *
  4090.  * Description:   Enumerates dynamic areas
  4091.  *
  4092.  * Input:         context - value of R1 on entry
  4093.  *
  4094.  * Output:        context_out - value of R1 on exit (X version only)
  4095.  *
  4096.  * Returns:       R1 (non-X version only)
  4097.  *
  4098.  * Other notes:   Calls SWI 0x66 with R0 = 0x3.
  4099.  */
  4100.  
  4101. extern os_error *xosdynamicarea_enumerate (int context,
  4102.       int *context_out);
  4103. extern int osdynamicarea_enumerate (int context);
  4104.  
  4105. /* ------------------------------------------------------------------------
  4106.  * Function:      osdynamicarea_renumber()
  4107.  *
  4108.  * Description:   Renumbers dynamic areas
  4109.  *
  4110.  * Input:         old_area - value of R1 on entry
  4111.  *                new_area - value of R2 on entry
  4112.  *
  4113.  * Other notes:   Calls SWI 0x66 with R0 = 0x4.
  4114.  */
  4115.  
  4116. extern os_error *xosdynamicarea_renumber (int old_area,
  4117.       int new_area);
  4118. extern void osdynamicarea_renumber (int old_area,
  4119.       int new_area);
  4120.  
  4121. /* ------------------------------------------------------------------------
  4122.  * Function:      osmemory_page_op()
  4123.  *
  4124.  * Description:   General page block operations
  4125.  *
  4126.  * Input:         flags - value of R0 on entry
  4127.  *                page_block - value of R1 on entry
  4128.  *                page_count - value of R2 on entry
  4129.  *
  4130.  * Other notes:   Calls SWI 0x68 with R0 |= 0x0.
  4131.  */
  4132.  
  4133. extern os_error *xosmemory_page_op (bits flags,
  4134.       os_page_block *page_block,
  4135.       int page_count);
  4136. extern void osmemory_page_op (bits flags,
  4137.       os_page_block *page_block,
  4138.       int page_count);
  4139.  
  4140. /* ------------------------------------------------------------------------
  4141.  * Function:      osmemory_read_arrangement_table_size()
  4142.  *
  4143.  * Description:   Reads the size of the physical memory arrangement table
  4144.  *
  4145.  * Output:        table_size - value of R1 on exit (X version only)
  4146.  *                page_size - value of R2 on exit
  4147.  *
  4148.  * Returns:       R1 (non-X version only)
  4149.  *
  4150.  * Other notes:   Calls SWI 0x68 with R0 = 0x6.
  4151.  */
  4152.  
  4153. extern os_error *xosmemory_read_arrangement_table_size (int *table_size,
  4154.       int *page_size);
  4155. extern int osmemory_read_arrangement_table_size (int *page_size);
  4156.  
  4157. /* ------------------------------------------------------------------------
  4158.  * Function:      osmemory_read_arrangement_table()
  4159.  *
  4160.  * Description:   Read the physical memory arrangement table
  4161.  *
  4162.  * Input:         arrangement_table - value of R1 on entry
  4163.  *
  4164.  * Other notes:   Calls SWI 0x68 with R0 = 0x7.
  4165.  */
  4166.  
  4167. extern os_error *xosmemory_read_arrangement_table (byte *arrangement_table);
  4168. extern void osmemory_read_arrangement_table (byte *arrangement_table);
  4169.  
  4170. /* ------------------------------------------------------------------------
  4171.  * Function:      osmemory_read_size()
  4172.  *
  4173.  * Description:   Reads the amount of a specified type of memory available
  4174.  *                on the computer
  4175.  *
  4176.  * Input:         type - value of R0 on entry
  4177.  *
  4178.  * Output:        page_count - value of R1 on exit (X version only)
  4179.  *                page_size - value of R2 on exit
  4180.  *
  4181.  * Returns:       R1 (non-X version only)
  4182.  *
  4183.  * Other notes:   Calls SWI 0x68 with R0 |= 0x8.
  4184.  */
  4185.  
  4186. extern os_error *xosmemory_read_size (bits type,
  4187.       int *page_count,
  4188.       int *page_size);
  4189. extern int osmemory_read_size (bits type,
  4190.       int *page_size);
  4191.  
  4192. /* ------------------------------------------------------------------------
  4193.  * Function:      osmemory_read_controller()
  4194.  *
  4195.  * Description:   Reads controller presence and base address
  4196.  *
  4197.  * Input:         controller - value of R1 on entry
  4198.  *
  4199.  * Output:        controller_addr - value of R1 on exit
  4200.  *
  4201.  * Other notes:   Calls SWI 0x68 with R0 = 0x9.
  4202.  */
  4203.  
  4204. extern os_error *xosmemory_read_controller (bits controller,
  4205.       void **controller_addr);
  4206. extern void osmemory_read_controller (bits controller,
  4207.       void **controller_addr);
  4208.  
  4209. /* ------------------------------------------------------------------------
  4210.  * Function:      osclaimprocessorvector_alloc()
  4211.  *
  4212.  * Description:   Claims a processor vector
  4213.  *
  4214.  * Input:         vector - value of R0 on entry
  4215.  *                routine - value of R1 on entry
  4216.  *
  4217.  * Output:        old_routine - value of R1 on exit (X version only)
  4218.  *
  4219.  * Returns:       R1 (non-X version only)
  4220.  *
  4221.  * Other notes:   Calls SWI 0x69 with R0 |= 0x100.
  4222.  */
  4223.  
  4224. extern os_error *xosclaimprocessorvector_alloc (bits vector,
  4225.       void *routine,
  4226.       void **old_routine);
  4227. extern void *osclaimprocessorvector_alloc (bits vector,
  4228.       void *routine);
  4229.  
  4230. /* ------------------------------------------------------------------------
  4231.  * Function:      osclaimprocessorvector_free()
  4232.  *
  4233.  * Description:   Releases a processor vector
  4234.  *
  4235.  * Input:         vector - value of R0 on entry
  4236.  *                old_routine - value of R2 on entry
  4237.  *
  4238.  * Other notes:   Calls SWI 0x69 with R0 |= 0x0.
  4239.  */
  4240.  
  4241. extern os_error *xosclaimprocessorvector_free (bits vector,
  4242.       void *old_routine);
  4243. extern void osclaimprocessorvector_free (bits vector,
  4244.       void *old_routine);
  4245.  
  4246. /* ------------------------------------------------------------------------
  4247.  * Function:      os_reset()
  4248.  *
  4249.  * Description:   Performs a hard reset
  4250.  *
  4251.  * Other notes:   Calls SWI 0x6A.
  4252.  */
  4253.  
  4254. extern os_error *xos_reset (void);
  4255. extern void os_reset (void);
  4256.  
  4257. /* ------------------------------------------------------------------------
  4258.  * Function:      os_mmu_control()
  4259.  *
  4260.  * Description:   Modifies the ARM MMU (prefer Cache_Control)
  4261.  *
  4262.  * Input:         eor_mask - value of R1 on entry
  4263.  *                and_mask - value of R2 on entry
  4264.  *
  4265.  * Output:        old_value - value of R1 on exit (X version only)
  4266.  *
  4267.  * Returns:       R1 (non-X version only)
  4268.  *
  4269.  * Other notes:   Calls SWI 0x6B with R0 = 0x0.
  4270.  */
  4271.  
  4272. extern os_error *xos_mmu_control (bits eor_mask,
  4273.       bits and_mask,
  4274.       bits *old_value);
  4275. extern bits os_mmu_control (bits eor_mask,
  4276.       bits and_mask);
  4277.  
  4278. /* ------------------------------------------------------------------------
  4279.  * Function:      os_convert_standard_date_and_time()
  4280.  *
  4281.  * Description:   Converts a 5-byte time into a string (prefer
  4282.  *                Territory_ConvertStandardDateAndTime)
  4283.  *
  4284.  * Input:         date_and_time - value of R0 on entry
  4285.  *                buffer - value of R1 on entry
  4286.  *                size - value of R2 on entry
  4287.  *
  4288.  * Output:        end - value of R1 on exit
  4289.  *
  4290.  * Other notes:   Calls SWI 0xC0.
  4291.  */
  4292.  
  4293. extern os_error *xos_convert_standard_date_and_time (os_date_and_time *date_and_time,
  4294.       char *buffer,
  4295.       int size,
  4296.       char **end);
  4297. extern void os_convert_standard_date_and_time (os_date_and_time *date_and_time,
  4298.       char *buffer,
  4299.       int size,
  4300.       char **end);
  4301.  
  4302. /* ------------------------------------------------------------------------
  4303.  * Function:      os_convert_date_and_time()
  4304.  *
  4305.  * Description:   Converts a 5-byte time into a string using a supplied
  4306.  *                format string (prefer Territory_ConvertDateAndTime)
  4307.  *
  4308.  * Input:         date_and_time - value of R0 on entry
  4309.  *                buffer - value of R1 on entry
  4310.  *                size - value of R2 on entry
  4311.  *
  4312.  * Output:        end - value of R1 on exit
  4313.  *
  4314.  * Other notes:   Calls SWI 0xC1.
  4315.  */
  4316.  
  4317. extern os_error *xos_convert_date_and_time (os_date_and_time *date_and_time,
  4318.       char *buffer,
  4319.       int size,
  4320.       char **end);
  4321. extern void os_convert_date_and_time (os_date_and_time *date_and_time,
  4322.       char *buffer,
  4323.       int size,
  4324.       char **end);
  4325.  
  4326. /* ------------------------------------------------------------------------
  4327.  * Function:      os_convert_hex1()
  4328.  *
  4329.  * Description:   Converts a number into a 1-digit hexadecimal string
  4330.  *
  4331.  * Input:         value - value of R0 on entry
  4332.  *                buffer - value of R1 on entry
  4333.  *                size - value of R2 on entry
  4334.  *
  4335.  * Output:        end - value of R1 on exit
  4336.  *
  4337.  * Other notes:   Calls SWI 0xD0.
  4338.  */
  4339.  
  4340. extern os_error *xos_convert_hex1 (int value,
  4341.       char *buffer,
  4342.       int size,
  4343.       char **end);
  4344. extern void os_convert_hex1 (int value,
  4345.       char *buffer,
  4346.       int size,
  4347.       char **end);
  4348.  
  4349. /* ------------------------------------------------------------------------
  4350.  * Function:      os_convert_hex2()
  4351.  *
  4352.  * Description:   Converts a number into a 2-digit hexadecimal string
  4353.  *
  4354.  * Input:         value - value of R0 on entry
  4355.  *                buffer - value of R1 on entry
  4356.  *                size - value of R2 on entry
  4357.  *
  4358.  * Output:        end - value of R1 on exit
  4359.  *
  4360.  * Other notes:   Calls SWI 0xD1.
  4361.  */
  4362.  
  4363. extern os_error *xos_convert_hex2 (int value,
  4364.       char *buffer,
  4365.       int size,
  4366.       char **end);
  4367. extern void os_convert_hex2 (int value,
  4368.       char *buffer,
  4369.       int size,
  4370.       char **end);
  4371.  
  4372. /* ------------------------------------------------------------------------
  4373.  * Function:      os_convert_hex4()
  4374.  *
  4375.  * Description:   Converts a number into a 4-digit hexadecimal string
  4376.  *
  4377.  * Input:         value - value of R0 on entry
  4378.  *                buffer - value of R1 on entry
  4379.  *                size - value of R2 on entry
  4380.  *
  4381.  * Output:        end - value of R1 on exit
  4382.  *
  4383.  * Other notes:   Calls SWI 0xD2.
  4384.  */
  4385.  
  4386. extern os_error *xos_convert_hex4 (int value,
  4387.       char *buffer,
  4388.       int size,
  4389.       char **end);
  4390. extern void os_convert_hex4 (int value,
  4391.       char *buffer,
  4392.       int size,
  4393.       char **end);
  4394.  
  4395. /* ------------------------------------------------------------------------
  4396.  * Function:      os_convert_hex6()
  4397.  *
  4398.  * Description:   Converts a number into a 6-digit hexadecimal string
  4399.  *
  4400.  * Input:         value - value of R0 on entry
  4401.  *                buffer - value of R1 on entry
  4402.  *                size - value of R2 on entry
  4403.  *
  4404.  * Output:        end - value of R1 on exit
  4405.  *
  4406.  * Other notes:   Calls SWI 0xD3.
  4407.  */
  4408.  
  4409. extern os_error *xos_convert_hex6 (int value,
  4410.       char *buffer,
  4411.       int size,
  4412.       char **end);
  4413. extern void os_convert_hex6 (int value,
  4414.       char *buffer,
  4415.       int size,
  4416.       char **end);
  4417.  
  4418. /* ------------------------------------------------------------------------
  4419.  * Function:      os_convert_hex8()
  4420.  *
  4421.  * Description:   Converts a number into an 8-digit hexadecimal string
  4422.  *
  4423.  * Input:         value - value of R0 on entry
  4424.  *                buffer - value of R1 on entry
  4425.  *                size - value of R2 on entry
  4426.  *
  4427.  * Output:        end - value of R1 on exit
  4428.  *
  4429.  * Other notes:   Calls SWI 0xD4.
  4430.  */
  4431.  
  4432. extern os_error *xos_convert_hex8 (int value,
  4433.       char *buffer,
  4434.       int size,
  4435.       char **end);
  4436. extern void os_convert_hex8 (int value,
  4437.       char *buffer,
  4438.       int size,
  4439.       char **end);
  4440.  
  4441. /* ------------------------------------------------------------------------
  4442.  * Function:      os_convert_cardinal1()
  4443.  *
  4444.  * Description:   Converts a 1-byte number into an unsigned decimal string
  4445.  *
  4446.  * Input:         value - value of R0 on entry
  4447.  *                buffer - value of R1 on entry
  4448.  *                size - value of R2 on entry
  4449.  *
  4450.  * Output:        end - value of R1 on exit
  4451.  *
  4452.  * Other notes:   Calls SWI 0xD5.
  4453.  */
  4454.  
  4455. extern os_error *xos_convert_cardinal1 (int value,
  4456.       char *buffer,
  4457.       int size,
  4458.       char **end);
  4459. extern void os_convert_cardinal1 (int value,
  4460.       char *buffer,
  4461.       int size,
  4462.       char **end);
  4463.  
  4464. /* ------------------------------------------------------------------------
  4465.  * Function:      os_convert_cardinal2()
  4466.  *
  4467.  * Description:   Converts a 2-byte number into an unsigned decimal string
  4468.  *
  4469.  * Input:         value - value of R0 on entry
  4470.  *                buffer - value of R1 on entry
  4471.  *                size - value of R2 on entry
  4472.  *
  4473.  * Output:        end - value of R1 on exit
  4474.  *
  4475.  * Other notes:   Calls SWI 0xD6.
  4476.  */
  4477.  
  4478. extern os_error *xos_convert_cardinal2 (int value,
  4479.       char *buffer,
  4480.       int size,
  4481.       char **end);
  4482. extern void os_convert_cardinal2 (int value,
  4483.       char *buffer,
  4484.       int size,
  4485.       char **end);
  4486.  
  4487. /* ------------------------------------------------------------------------
  4488.  * Function:      os_convert_cardinal3()
  4489.  *
  4490.  * Description:   Converts a 3-byte number into an unsigned decimal string
  4491.  *
  4492.  * Input:         value - value of R0 on entry
  4493.  *                buffer - value of R1 on entry
  4494.  *                size - value of R2 on entry
  4495.  *
  4496.  * Output:        end - value of R1 on exit
  4497.  *
  4498.  * Other notes:   Calls SWI 0xD7.
  4499.  */
  4500.  
  4501. extern os_error *xos_convert_cardinal3 (int value,
  4502.       char *buffer,
  4503.       int size,
  4504.       char **end);
  4505. extern void os_convert_cardinal3 (int value,
  4506.       char *buffer,
  4507.       int size,
  4508.       char **end);
  4509.  
  4510. /* ------------------------------------------------------------------------
  4511.  * Function:      os_convert_cardinal4()
  4512.  *
  4513.  * Description:   Converts a 4-byte number into an unsigned decimal string
  4514.  *
  4515.  * Input:         value - value of R0 on entry
  4516.  *                buffer - value of R1 on entry
  4517.  *                size - value of R2 on entry
  4518.  *
  4519.  * Output:        end - value of R1 on exit
  4520.  *
  4521.  * Other notes:   Calls SWI 0xD8.
  4522.  */
  4523.  
  4524. extern os_error *xos_convert_cardinal4 (int value,
  4525.       char *buffer,
  4526.       int size,
  4527.       char **end);
  4528. extern void os_convert_cardinal4 (int value,
  4529.       char *buffer,
  4530.       int size,
  4531.       char **end);
  4532.  
  4533. /* ------------------------------------------------------------------------
  4534.  * Function:      os_convert_integer1()
  4535.  *
  4536.  * Description:   Converts a 1-byte number into a signed decimal string
  4537.  *
  4538.  * Input:         value - value of R0 on entry
  4539.  *                buffer - value of R1 on entry
  4540.  *                size - value of R2 on entry
  4541.  *
  4542.  * Output:        end - value of R1 on exit
  4543.  *
  4544.  * Other notes:   Calls SWI 0xD9.
  4545.  */
  4546.  
  4547. extern os_error *xos_convert_integer1 (int value,
  4548.       char *buffer,
  4549.       int size,
  4550.       char **end);
  4551. extern void os_convert_integer1 (int value,
  4552.       char *buffer,
  4553.       int size,
  4554.       char **end);
  4555.  
  4556. /* ------------------------------------------------------------------------
  4557.  * Function:      os_convert_integer2()
  4558.  *
  4559.  * Description:   Converts a 2-byte number into a signed decimal string
  4560.  *
  4561.  * Input:         value - value of R0 on entry
  4562.  *                buffer - value of R1 on entry
  4563.  *                size - value of R2 on entry
  4564.  *
  4565.  * Output:        end - value of R1 on exit
  4566.  *
  4567.  * Other notes:   Calls SWI 0xDA.
  4568.  */
  4569.  
  4570. extern os_error *xos_convert_integer2 (int value,
  4571.       char *buffer,
  4572.       int size,
  4573.       char **end);
  4574. extern void os_convert_integer2 (int value,
  4575.       char *buffer,
  4576.       int size,
  4577.       char **end);
  4578.  
  4579. /* ------------------------------------------------------------------------
  4580.  * Function:      os_convert_integer3()
  4581.  *
  4582.  * Description:   Converts a 3-byte number into a signed decimal string
  4583.  *
  4584.  * Input:         value - value of R0 on entry
  4585.  *                buffer - value of R1 on entry
  4586.  *                size - value of R2 on entry
  4587.  *
  4588.  * Output:        end - value of R1 on exit
  4589.  *
  4590.  * Other notes:   Calls SWI 0xDB.
  4591.  */
  4592.  
  4593. extern os_error *xos_convert_integer3 (int value,
  4594.       char *buffer,
  4595.       int size,
  4596.       char **end);
  4597. extern void os_convert_integer3 (int value,
  4598.       char *buffer,
  4599.       int size,
  4600.       char **end);
  4601.  
  4602. /* ------------------------------------------------------------------------
  4603.  * Function:      os_convert_integer4()
  4604.  *
  4605.  * Description:   Converts a 4-byte number into a signed decimal string
  4606.  *
  4607.  * Input:         value - value of R0 on entry
  4608.  *                buffer - value of R1 on entry
  4609.  *                size - value of R2 on entry
  4610.  *
  4611.  * Output:        end - value of R1 on exit
  4612.  *
  4613.  * Other notes:   Calls SWI 0xDC.
  4614.  */
  4615.  
  4616. extern os_error *xos_convert_integer4 (int value,
  4617.       char *buffer,
  4618.       int size,
  4619.       char **end);
  4620. extern void os_convert_integer4 (int value,
  4621.       char *buffer,
  4622.       int size,
  4623.       char **end);
  4624.  
  4625. /* ------------------------------------------------------------------------
  4626.  * Function:      os_convert_binary1()
  4627.  *
  4628.  * Description:   Converts a 1-byte number into an unsigned binary string
  4629.  *
  4630.  * Input:         value - value of R0 on entry
  4631.  *                buffer - value of R1 on entry
  4632.  *                size - value of R2 on entry
  4633.  *
  4634.  * Output:        end - value of R1 on exit
  4635.  *
  4636.  * Other notes:   Calls SWI 0xDD.
  4637.  */
  4638.  
  4639. extern os_error *xos_convert_binary1 (int value,
  4640.       char *buffer,
  4641.       int size,
  4642.       char **end);
  4643. extern void os_convert_binary1 (int value,
  4644.       char *buffer,
  4645.       int size,
  4646.       char **end);
  4647.  
  4648. /* ------------------------------------------------------------------------
  4649.  * Function:      os_convert_binary2()
  4650.  *
  4651.  * Description:   Converts a 2-byte number into an unsigned binary string
  4652.  *
  4653.  * Input:         value - value of R0 on entry
  4654.  *                buffer - value of R1 on entry
  4655.  *                size - value of R2 on entry
  4656.  *
  4657.  * Output:        end - value of R1 on exit
  4658.  *
  4659.  * Other notes:   Calls SWI 0xDE.
  4660.  */
  4661.  
  4662. extern os_error *xos_convert_binary2 (int value,
  4663.       char *buffer,
  4664.       int size,
  4665.       char **end);
  4666. extern void os_convert_binary2 (int value,
  4667.       char *buffer,
  4668.       int size,
  4669.       char **end);
  4670.  
  4671. /* ------------------------------------------------------------------------
  4672.  * Function:      os_convert_binary3()
  4673.  *
  4674.  * Description:   Converts a 3-byte number into an unsigned binary string
  4675.  *
  4676.  * Input:         value - value of R0 on entry
  4677.  *                buffer - value of R1 on entry
  4678.  *                size - value of R2 on entry
  4679.  *
  4680.  * Output:        end - value of R1 on exit
  4681.  *
  4682.  * Other notes:   Calls SWI 0xDF.
  4683.  */
  4684.  
  4685. extern os_error *xos_convert_binary3 (int value,
  4686.       char *buffer,
  4687.       int size,
  4688.       char **end);
  4689. extern void os_convert_binary3 (int value,
  4690.       char *buffer,
  4691.       int size,
  4692.       char **end);
  4693.  
  4694. /* ------------------------------------------------------------------------
  4695.  * Function:      os_convert_binary4()
  4696.  *
  4697.  * Description:   Converts a 4-byte number into an unsigned binary string
  4698.  *
  4699.  * Input:         value - value of R0 on entry
  4700.  *                buffer - value of R1 on entry
  4701.  *                size - value of R2 on entry
  4702.  *
  4703.  * Output:        end - value of R1 on exit
  4704.  *
  4705.  * Other notes:   Calls SWI 0xE0.
  4706.  */
  4707.  
  4708. extern os_error *xos_convert_binary4 (int value,
  4709.       char *buffer,
  4710.       int size,
  4711.       char **end);
  4712. extern void os_convert_binary4 (int value,
  4713.       char *buffer,
  4714.       int size,
  4715.       char **end);
  4716.  
  4717. /* ------------------------------------------------------------------------
  4718.  * Function:      os_convert_spaced_cardinal1()
  4719.  *
  4720.  * Description:   Converts a 1-byte number into a spaced unsigned decimal
  4721.  *                string
  4722.  *
  4723.  * Input:         value - value of R0 on entry
  4724.  *                buffer - value of R1 on entry
  4725.  *                size - value of R2 on entry
  4726.  *
  4727.  * Output:        end - value of R1 on exit
  4728.  *
  4729.  * Other notes:   Calls SWI 0xE1.
  4730.  */
  4731.  
  4732. extern os_error *xos_convert_spaced_cardinal1 (int value,
  4733.       char *buffer,
  4734.       int size,
  4735.       char **end);
  4736. extern void os_convert_spaced_cardinal1 (int value,
  4737.       char *buffer,
  4738.       int size,
  4739.       char **end);
  4740.  
  4741. /* ------------------------------------------------------------------------
  4742.  * Function:      os_convert_spaced_cardinal2()
  4743.  *
  4744.  * Description:   Converts a 2-byte number into a spaced unsigned decimal
  4745.  *                string
  4746.  *
  4747.  * Input:         value - value of R0 on entry
  4748.  *                buffer - value of R1 on entry
  4749.  *                size - value of R2 on entry
  4750.  *
  4751.  * Output:        end - value of R1 on exit
  4752.  *
  4753.  * Other notes:   Calls SWI 0xE2.
  4754.  */
  4755.  
  4756. extern os_error *xos_convert_spaced_cardinal2 (int value,
  4757.       char *buffer,
  4758.       int size,
  4759.       char **end);
  4760. extern void os_convert_spaced_cardinal2 (int value,
  4761.       char *buffer,
  4762.       int size,
  4763.       char **end);
  4764.  
  4765. /* ------------------------------------------------------------------------
  4766.  * Function:      os_convert_spaced_cardinal3()
  4767.  *
  4768.  * Description:   Converts a 3-byte number into a spaced unsigned decimal
  4769.  *                string
  4770.  *
  4771.  * Input:         value - value of R0 on entry
  4772.  *                buffer - value of R1 on entry
  4773.  *                size - value of R2 on entry
  4774.  *
  4775.  * Output:        end - value of R1 on exit
  4776.  *
  4777.  * Other notes:   Calls SWI 0xE3.
  4778.  */
  4779.  
  4780. extern os_error *xos_convert_spaced_cardinal3 (int value,
  4781.       char *buffer,
  4782.       int size,
  4783.       char **end);
  4784. extern void os_convert_spaced_cardinal3 (int value,
  4785.       char *buffer,
  4786.       int size,
  4787.       char **end);
  4788.  
  4789. /* ------------------------------------------------------------------------
  4790.  * Function:      os_convert_spaced_cardinal4()
  4791.  *
  4792.  * Description:   Converts a 4-byte number into a spaced unsigned decimal
  4793.  *                string
  4794.  *
  4795.  * Input:         value - value of R0 on entry
  4796.  *                buffer - value of R1 on entry
  4797.  *                size - value of R2 on entry
  4798.  *
  4799.  * Output:        end - value of R1 on exit
  4800.  *
  4801.  * Other notes:   Calls SWI 0xE4.
  4802.  */
  4803.  
  4804. extern os_error *xos_convert_spaced_cardinal4 (int value,
  4805.       char *buffer,
  4806.       int size,
  4807.       char **end);
  4808. extern void os_convert_spaced_cardinal4 (int value,
  4809.       char *buffer,
  4810.       int size,
  4811.       char **end);
  4812.  
  4813. /* ------------------------------------------------------------------------
  4814.  * Function:      os_convert_spaced_integer1()
  4815.  *
  4816.  * Description:   Converts a 1-byte number into a spaced signed decimal
  4817.  *                string
  4818.  *
  4819.  * Input:         value - value of R0 on entry
  4820.  *                buffer - value of R1 on entry
  4821.  *                size - value of R2 on entry
  4822.  *
  4823.  * Output:        end - value of R1 on exit
  4824.  *
  4825.  * Other notes:   Calls SWI 0xE5.
  4826.  */
  4827.  
  4828. extern os_error *xos_convert_spaced_integer1 (int value,
  4829.       char *buffer,
  4830.       int size,
  4831.       char **end);
  4832. extern void os_convert_spaced_integer1 (int value,
  4833.       char *buffer,
  4834.       int size,
  4835.       char **end);
  4836.  
  4837. /* ------------------------------------------------------------------------
  4838.  * Function:      os_convert_spaced_integer2()
  4839.  *
  4840.  * Description:   Converts a 2-byte number into a spaced signed decimal
  4841.  *                string
  4842.  *
  4843.  * Input:         value - value of R0 on entry
  4844.  *                buffer - value of R1 on entry
  4845.  *                size - value of R2 on entry
  4846.  *
  4847.  * Output:        end - value of R1 on exit
  4848.  *
  4849.  * Other notes:   Calls SWI 0xE6.
  4850.  */
  4851.  
  4852. extern os_error *xos_convert_spaced_integer2 (int value,
  4853.       char *buffer,
  4854.       int size,
  4855.       char **end);
  4856. extern void os_convert_spaced_integer2 (int value,
  4857.       char *buffer,
  4858.       int size,
  4859.       char **end);
  4860.  
  4861. /* ------------------------------------------------------------------------
  4862.  * Function:      os_convert_spaced_integer3()
  4863.  *
  4864.  * Description:   Converts a 3-byte number into a spaced signed decimal
  4865.  *                string
  4866.  *
  4867.  * Input:         value - value of R0 on entry
  4868.  *                buffer - value of R1 on entry
  4869.  *                size - value of R2 on entry
  4870.  *
  4871.  * Output:        end - value of R1 on exit
  4872.  *
  4873.  * Other notes:   Calls SWI 0xE7.
  4874.  */
  4875.  
  4876. extern os_error *xos_convert_spaced_integer3 (int value,
  4877.       char *buffer,
  4878.       int size,
  4879.       char **end);
  4880. extern void os_convert_spaced_integer3 (int value,
  4881.       char *buffer,
  4882.       int size,
  4883.       char **end);
  4884.  
  4885. /* ------------------------------------------------------------------------
  4886.  * Function:      os_convert_spaced_integer4()
  4887.  *
  4888.  * Description:   Converts a 4-byte number into a spaced signed decimal
  4889.  *                string
  4890.  *
  4891.  * Input:         value - value of R0 on entry
  4892.  *                buffer - value of R1 on entry
  4893.  *                size - value of R2 on entry
  4894.  *
  4895.  * Output:        end - value of R1 on exit
  4896.  *
  4897.  * Other notes:   Calls SWI 0xE8.
  4898.  */
  4899.  
  4900. extern os_error *xos_convert_spaced_integer4 (int value,
  4901.       char *buffer,
  4902.       int size,
  4903.       char **end);
  4904. extern void os_convert_spaced_integer4 (int value,
  4905.       char *buffer,
  4906.       int size,
  4907.       char **end);
  4908.  
  4909. /* ------------------------------------------------------------------------
  4910.  * Function:      os_convert_fixed_net_station()
  4911.  *
  4912.  * Description:   Converts from an Econet station/network number pair to a
  4913.  *                string of fixed length
  4914.  *
  4915.  * Input:         station_number - value of R0 on entry
  4916.  *                buffer - value of R1 on entry
  4917.  *                size - value of R2 on entry
  4918.  *
  4919.  * Output:        end - value of R1 on exit
  4920.  *
  4921.  * Other notes:   Calls SWI 0xE9.
  4922.  */
  4923.  
  4924. extern os_error *xos_convert_fixed_net_station (os_station_number *station_number,
  4925.       char *buffer,
  4926.       int size,
  4927.       char **end);
  4928. extern void os_convert_fixed_net_station (os_station_number *station_number,
  4929.       char *buffer,
  4930.       int size,
  4931.       char **end);
  4932.  
  4933. /* ------------------------------------------------------------------------
  4934.  * Function:      os_convert_net_station()
  4935.  *
  4936.  * Description:   Converts from an Econet station/network number pair to a
  4937.  *                string
  4938.  *
  4939.  * Input:         station_number - value of R0 on entry
  4940.  *                buffer - value of R1 on entry
  4941.  *                size - value of R2 on entry
  4942.  *
  4943.  * Output:        end - value of R1 on exit
  4944.  *
  4945.  * Other notes:   Calls SWI 0xEA.
  4946.  */
  4947.  
  4948. extern os_error *xos_convert_net_station (os_station_number *station_number,
  4949.       char *buffer,
  4950.       int size,
  4951.       char **end);
  4952. extern void os_convert_net_station (os_station_number *station_number,
  4953.       char *buffer,
  4954.       int size,
  4955.       char **end);
  4956.  
  4957. /* ------------------------------------------------------------------------
  4958.  * Function:      os_convert_fixed_file_size()
  4959.  *
  4960.  * Description:   Converts an integer into a filesize string of fixed
  4961.  *                length
  4962.  *
  4963.  * Input:         file_size - value of R0 on entry
  4964.  *                buffer - value of R1 on entry
  4965.  *                size - value of R2 on entry
  4966.  *
  4967.  * Output:        end - value of R1 on exit
  4968.  *
  4969.  * Other notes:   Calls SWI 0xEB.
  4970.  */
  4971.  
  4972. extern os_error *xos_convert_fixed_file_size (int file_size,
  4973.       char *buffer,
  4974.       int size,
  4975.       char **end);
  4976. extern void os_convert_fixed_file_size (int file_size,
  4977.       char *buffer,
  4978.       int size,
  4979.       char **end);
  4980.  
  4981. /* ------------------------------------------------------------------------
  4982.  * Function:      os_convert_file_size()
  4983.  *
  4984.  * Description:   Converts an integer into a filesize string
  4985.  *
  4986.  * Input:         file_size - value of R0 on entry
  4987.  *                buffer - value of R1 on entry
  4988.  *                size - value of R2 on entry
  4989.  *
  4990.  * Output:        end - value of R1 on exit
  4991.  *
  4992.  * Other notes:   Calls SWI 0xEC.
  4993.  */
  4994.  
  4995. extern os_error *xos_convert_file_size (int file_size,
  4996.       char *buffer,
  4997.       int size,
  4998.       char **end);
  4999. extern void os_convert_file_size (int file_size,
  5000.       char *buffer,
  5001.       int size,
  5002.       char **end);
  5003.  
  5004. /* ------------------------------------------------------------------------
  5005.  * Function:      os_null()
  5006.  *
  5007.  * Description:   VDU command for nul (no operation)
  5008.  *
  5009.  * Other notes:   Calls SWI 0x100.
  5010.  */
  5011.  
  5012. extern os_error *xos_null (void);
  5013. extern void os_null (void);
  5014.  
  5015. /* ------------------------------------------------------------------------
  5016.  * Function:      os_char_to_printer()
  5017.  *
  5018.  * Description:   VDU command to send the next character to the printer
  5019.  *                only - must be followed by 'char'
  5020.  *
  5021.  * Other notes:   Calls SWI 0x101.
  5022.  */
  5023.  
  5024. extern os_error *xos_char_to_printer (void);
  5025. extern void os_char_to_printer (void);
  5026.  
  5027. /* ------------------------------------------------------------------------
  5028.  * Function:      os_printer_on()
  5029.  *
  5030.  * Description:   VDU command to enable the printer stream
  5031.  *
  5032.  * Other notes:   Calls SWI 0x102.
  5033.  */
  5034.  
  5035. extern os_error *xos_printer_on (void);
  5036. extern void os_printer_on (void);
  5037.  
  5038. /* ------------------------------------------------------------------------
  5039.  * Function:      os_printer_off()
  5040.  *
  5041.  * Description:   VDU command to disable the printer stream
  5042.  *
  5043.  * Other notes:   Calls SWI 0x103.
  5044.  */
  5045.  
  5046. extern os_error *xos_printer_off (void);
  5047. extern void os_printer_off (void);
  5048.  
  5049. /* ------------------------------------------------------------------------
  5050.  * Function:      os_split_cursors()
  5051.  *
  5052.  * Description:   VDU command to split the text and graphics cursors
  5053.  *
  5054.  * Other notes:   Calls SWI 0x104.
  5055.  */
  5056.  
  5057. extern os_error *xos_split_cursors (void);
  5058. extern void os_split_cursors (void);
  5059.  
  5060. /* ------------------------------------------------------------------------
  5061.  * Function:      os_join_cursors()
  5062.  *
  5063.  * Description:   VDU command to join the text and graphics cursors
  5064.  *
  5065.  * Other notes:   Calls SWI 0x105.
  5066.  */
  5067.  
  5068. extern os_error *xos_join_cursors (void);
  5069. extern void os_join_cursors (void);
  5070.  
  5071. /* ------------------------------------------------------------------------
  5072.  * Function:      os_vdu_on()
  5073.  *
  5074.  * Description:   VDU command to enable screen output
  5075.  *
  5076.  * Other notes:   Calls SWI 0x106.
  5077.  */
  5078.  
  5079. extern os_error *xos_vdu_on (void);
  5080. extern void os_vdu_on (void);
  5081.  
  5082. /* ------------------------------------------------------------------------
  5083.  * Function:      os_bell()
  5084.  *
  5085.  * Description:   VDU command to ring the bell
  5086.  *
  5087.  * Other notes:   Calls SWI 0x107.
  5088.  */
  5089.  
  5090. extern os_error *xos_bell (void);
  5091. extern void os_bell (void);
  5092.  
  5093. /* ------------------------------------------------------------------------
  5094.  * Function:      os_backspace()
  5095.  *
  5096.  * Description:   VDU command to perform a backspace
  5097.  *
  5098.  * Other notes:   Calls SWI 0x108.
  5099.  */
  5100.  
  5101. extern os_error *xos_backspace (void);
  5102. extern void os_backspace (void);
  5103.  
  5104. /* ------------------------------------------------------------------------
  5105.  * Function:      os_tab()
  5106.  *
  5107.  * Description:   VDU command to perform a horizontal tab
  5108.  *
  5109.  * Other notes:   Calls SWI 0x109.
  5110.  */
  5111.  
  5112. extern os_error *xos_tab (void);
  5113. extern void os_tab (void);
  5114.  
  5115. /* ------------------------------------------------------------------------
  5116.  * Function:      os_line_feed()
  5117.  *
  5118.  * Description:   VDU command to perform a linefeed
  5119.  *
  5120.  * Other notes:   Calls SWI 0x10A.
  5121.  */
  5122.  
  5123. extern os_error *xos_line_feed (void);
  5124. extern void os_line_feed (void);
  5125.  
  5126. /* ------------------------------------------------------------------------
  5127.  * Function:      os_vertical_tab()
  5128.  *
  5129.  * Description:   VDU command to perform a vertical tab
  5130.  *
  5131.  * Other notes:   Calls SWI 0x10B.
  5132.  */
  5133.  
  5134. extern os_error *xos_vertical_tab (void);
  5135. extern void os_vertical_tab (void);
  5136.  
  5137. /* ------------------------------------------------------------------------
  5138.  * Function:      os_cls()
  5139.  *
  5140.  * Description:   VDU command to clear the text window
  5141.  *
  5142.  * Other notes:   Calls SWI 0x10C.
  5143.  */
  5144.  
  5145. extern os_error *xos_cls (void);
  5146. extern void os_cls (void);
  5147.  
  5148. /* ------------------------------------------------------------------------
  5149.  * Function:      os_return()
  5150.  *
  5151.  * Description:   VDU command to perform a return
  5152.  *
  5153.  * Other notes:   Calls SWI 0x10D.
  5154.  */
  5155.  
  5156. extern os_error *xos_return (void);
  5157. extern void os_return (void);
  5158.  
  5159. /* ------------------------------------------------------------------------
  5160.  * Function:      os_page_mode_on()
  5161.  *
  5162.  * Description:   VDU command to turn paged mode on
  5163.  *
  5164.  * Other notes:   Calls SWI 0x10E.
  5165.  */
  5166.  
  5167. extern os_error *xos_page_mode_on (void);
  5168. extern void os_page_mode_on (void);
  5169.  
  5170. /* ------------------------------------------------------------------------
  5171.  * Function:      os_page_mode_off()
  5172.  *
  5173.  * Description:   VDU command to turn paged mode off
  5174.  *
  5175.  * Other notes:   Calls SWI 0x10F.
  5176.  */
  5177.  
  5178. extern os_error *xos_page_mode_off (void);
  5179. extern void os_page_mode_off (void);
  5180.  
  5181. /* ------------------------------------------------------------------------
  5182.  * Function:      os_clg()
  5183.  *
  5184.  * Description:   VDU command to clear the graphics window
  5185.  *
  5186.  * Other notes:   Calls SWI 0x110.
  5187.  */
  5188.  
  5189. extern os_error *xos_clg (void);
  5190. extern void os_clg (void);
  5191.  
  5192. /* ------------------------------------------------------------------------
  5193.  * Function:      os_set_text_colour()
  5194.  *
  5195.  * Description:   VDU command to set the text colour - must be followed by
  5196.  *                'colour'
  5197.  *
  5198.  * Other notes:   Calls SWI 0x111.
  5199.  */
  5200.  
  5201. extern os_error *xos_set_text_colour (void);
  5202. extern void os_set_text_colour (void);
  5203.  
  5204. /* ------------------------------------------------------------------------
  5205.  * Function:      os_set_gcol()
  5206.  *
  5207.  * Description:   VDU command to set the graphics colour and action - must
  5208.  *                be followed by 'action,' 'colour'
  5209.  *
  5210.  * Other notes:   Calls SWI 0x112.
  5211.  */
  5212.  
  5213. extern os_error *xos_set_gcol (void);
  5214. extern void os_set_gcol (void);
  5215.  
  5216. /* ------------------------------------------------------------------------
  5217.  * Function:      os_set_palette()
  5218.  *
  5219.  * Description:   VDU command to set the palette - must be followed by
  5220.  *                'colour,' 'mode,' 'red,' 'green,' 'blue'
  5221.  *
  5222.  * Other notes:   Calls SWI 0x113.
  5223.  */
  5224.  
  5225. extern os_error *xos_set_palette (void);
  5226. extern void os_set_palette (void);
  5227.  
  5228. /* ------------------------------------------------------------------------
  5229.  * Function:      os_reset_colours()
  5230.  *
  5231.  * Description:   VDU command to restore default colours
  5232.  *
  5233.  * Other notes:   Calls SWI 0x114.
  5234.  */
  5235.  
  5236. extern os_error *xos_reset_colours (void);
  5237. extern void os_reset_colours (void);
  5238.  
  5239. /* ------------------------------------------------------------------------
  5240.  * Function:      os_vdu_off()
  5241.  *
  5242.  * Description:   VDU command to disable screen output
  5243.  *
  5244.  * Other notes:   Calls SWI 0x115.
  5245.  */
  5246.  
  5247. extern os_error *xos_vdu_off (void);
  5248. extern void os_vdu_off (void);
  5249.  
  5250. /* ------------------------------------------------------------------------
  5251.  * Function:      os_set_mode()
  5252.  *
  5253.  * Description:   VDU command to change display mode - must be followed by
  5254.  *                'mode'
  5255.  *
  5256.  * Other notes:   Calls SWI 0x116.
  5257.  */
  5258.  
  5259. extern os_error *xos_set_mode (void);
  5260. extern void os_set_mode (void);
  5261.  
  5262. /* ------------------------------------------------------------------------
  5263.  * Function:      os_misc()
  5264.  *
  5265.  * Description:   Miscellaneous VDU commands - must be followed by
  5266.  *                'command' and 8 more arguments)
  5267.  *
  5268.  * Other notes:   Calls SWI 0x117.
  5269.  */
  5270.  
  5271. extern os_error *xos_misc (void);
  5272. extern void os_misc (void);
  5273.  
  5274. /* ------------------------------------------------------------------------
  5275.  * Function:      os_set_graphics_window()
  5276.  *
  5277.  * Description:   VDU command to define the graphics window - must be
  5278.  *                followed by 'x0,' 'y0,' 'x1,' 'y1' (2 bytes each)
  5279.  *
  5280.  * Other notes:   Calls SWI 0x118.
  5281.  */
  5282.  
  5283. extern os_error *xos_set_graphics_window (void);
  5284. extern void os_set_graphics_window (void);
  5285.  
  5286. /* ------------------------------------------------------------------------
  5287.  * Function:      os_plot_vdu()
  5288.  *
  5289.  * Description:   General VDU plot commands - must be followed by
  5290.  *                'plot_type' and 'x,' 'y' (2 bytes each) (prefer OS_Plot)
  5291.  *
  5292.  * Other notes:   Calls SWI 0x119.
  5293.  */
  5294.  
  5295. extern os_error *xos_plot_vdu (void);
  5296. extern void os_plot_vdu (void);
  5297.  
  5298. /* ------------------------------------------------------------------------
  5299.  * Function:      os_reset_windows()
  5300.  *
  5301.  * Description:   VDU command to restore default windows
  5302.  *
  5303.  * Other notes:   Calls SWI 0x11A.
  5304.  */
  5305.  
  5306. extern os_error *xos_reset_windows (void);
  5307. extern void os_reset_windows (void);
  5308.  
  5309. /* ------------------------------------------------------------------------
  5310.  * Function:      os_escape()
  5311.  *
  5312.  * Description:   VDU command for escape (no operation)
  5313.  *
  5314.  * Other notes:   Calls SWI 0x11B.
  5315.  */
  5316.  
  5317. extern os_error *xos_escape (void);
  5318. extern void os_escape (void);
  5319.  
  5320. /* ------------------------------------------------------------------------
  5321.  * Function:      os_set_text_window()
  5322.  *
  5323.  * Description:   VDU command to define the text window - must be followed
  5324.  *                by 'x0,' 'y0,' 'x1,' 'y1'
  5325.  *
  5326.  * Other notes:   Calls SWI 0x11C.
  5327.  */
  5328.  
  5329. extern os_error *xos_set_text_window (void);
  5330. extern void os_set_text_window (void);
  5331.  
  5332. /* ------------------------------------------------------------------------
  5333.  * Function:      os_set_graphics_origin()
  5334.  *
  5335.  * Description:   VDU command to set the graphics origin - must be followed
  5336.  *                by 'x,' 'y' (2 bytes each)
  5337.  *
  5338.  * Other notes:   Calls SWI 0x11D.
  5339.  */
  5340.  
  5341. extern os_error *xos_set_graphics_origin (void);
  5342. extern void os_set_graphics_origin (void);
  5343.  
  5344. /* ------------------------------------------------------------------------
  5345.  * Function:      os_home_text_cursor()
  5346.  *
  5347.  * Description:   VDU command to home the text cursor
  5348.  *
  5349.  * Other notes:   Calls SWI 0x11E.
  5350.  */
  5351.  
  5352. extern os_error *xos_home_text_cursor (void);
  5353. extern void os_home_text_cursor (void);
  5354.  
  5355. /* ------------------------------------------------------------------------
  5356.  * Function:      os_set_text_cursor()
  5357.  *
  5358.  * Description:   VDU command to position the text cursor - must be
  5359.  *                followed by 'x,' 'y'
  5360.  *
  5361.  * Other notes:   Calls SWI 0x11F.
  5362.  */
  5363.  
  5364. extern os_error *xos_set_text_cursor (void);
  5365. extern void os_set_text_cursor (void);
  5366.  
  5367. /* ------------------------------------------------------------------------
  5368.  * Function:      os_space()
  5369.  *
  5370.  * Description:   VDU command to perform a space
  5371.  *
  5372.  * Other notes:   Calls SWI 0x120.
  5373.  */
  5374.  
  5375. extern os_error *xos_space (void);
  5376. extern void os_space (void);
  5377.  
  5378. /* ------------------------------------------------------------------------
  5379.  * Function:      os_delete()
  5380.  *
  5381.  * Description:   VDU command to perform a delete
  5382.  *
  5383.  * Other notes:   Calls SWI 0x17F.
  5384.  */
  5385.  
  5386. extern os_error *xos_delete (void);
  5387. extern void os_delete (void);
  5388.  
  5389. /* ------------------------------------------------------------------------
  5390.  * Function:      ukvdu23v()
  5391.  *
  5392.  * Description:   Called when an unrecognised VDU 23 command is issued
  5393.  *
  5394.  * Input:         n - value of R0 on entry
  5395.  *                queue - value of R1 on entry
  5396.  *
  5397.  * Other notes:   Calls SWI 0x34 with R9 = 0x17.
  5398.  */
  5399.  
  5400. extern os_error *xukvdu23v (int n,
  5401.       byte *queue);
  5402. extern void ukvdu23v (int n,
  5403.       byte *queue);
  5404.  
  5405. /* ------------------------------------------------------------------------
  5406.  * Function:      vduxv()
  5407.  *
  5408.  * Description:   Called when VDU output has been redirected
  5409.  *
  5410.  * Input:         b - value of R0 on entry
  5411.  *
  5412.  * Other notes:   Calls SWI 0x34 with R9 = 0x1B.
  5413.  */
  5414.  
  5415. extern os_error *xvduxv (byte b);
  5416. extern void vduxv (byte b);
  5417.  
  5418. /* ------------------------------------------------------------------------
  5419.  * Function:      service_release_fiq()
  5420.  *
  5421.  * Description:   FIQ released
  5422.  *
  5423.  * Other notes:   Calls SWI 0x30 with R1 = 0xB.
  5424.  */
  5425.  
  5426. extern os_error *xservice_release_fiq (void);
  5427. extern void service_release_fiq (void);
  5428.  
  5429. /* ------------------------------------------------------------------------
  5430.  * Function:      service_claim_fiq()
  5431.  *
  5432.  * Description:   FIQ claimed
  5433.  *
  5434.  * Other notes:   Calls SWI 0x30 with R1 = 0xC.
  5435.  */
  5436.  
  5437. extern os_error *xservice_claim_fiq (void);
  5438. extern void service_claim_fiq (void);
  5439.  
  5440. /* ------------------------------------------------------------------------
  5441.  * Function:      service_reset()
  5442.  *
  5443.  * Description:   Post-reset. Also, request to task modules and filing
  5444.  *                system-specific desktop filers to set task_handle
  5445.  *                variable to 0
  5446.  *
  5447.  * Other notes:   Calls SWI 0x30 with R1 = 0x27.
  5448.  */
  5449.  
  5450. extern os_error *xservice_reset (void);
  5451. extern void service_reset (void);
  5452.  
  5453. /* ------------------------------------------------------------------------
  5454.  * Function:      service_key_handler()
  5455.  *
  5456.  * Description:   Keyboard handler changed
  5457.  *
  5458.  * Input:         keyboard_id - value of R2 on entry
  5459.  *
  5460.  * Other notes:   Calls SWI 0x30 with R1 = 0x44.
  5461.  */
  5462.  
  5463. extern os_error *xservice_key_handler (int keyboard_id);
  5464. extern void service_key_handler (int keyboard_id);
  5465.  
  5466. /* ------------------------------------------------------------------------
  5467.  * Function:      service_mode_change()
  5468.  *
  5469.  * Description:   Mode changed
  5470.  *
  5471.  * Other notes:   Calls SWI 0x30 with R1 = 0x46.
  5472.  */
  5473.  
  5474. extern os_error *xservice_mode_change (void);
  5475. extern void service_mode_change (void);
  5476.  
  5477. /* ------------------------------------------------------------------------
  5478.  * Function:      service_claim_fiq_in_background()
  5479.  *
  5480.  * Description:   FIQ claimed in background
  5481.  *
  5482.  * Other notes:   Calls SWI 0x30 with R1 = 0x47.
  5483.  */
  5484.  
  5485. extern os_error *xservice_claim_fiq_in_background (void);
  5486. extern void service_claim_fiq_in_background (void);
  5487.  
  5488. /* ------------------------------------------------------------------------
  5489.  * Function:      service_memory_moved()
  5490.  *
  5491.  * Description:   Memory moved
  5492.  *
  5493.  * Other notes:   Calls SWI 0x30 with R1 = 0x4E.
  5494.  */
  5495.  
  5496. extern os_error *xservice_memory_moved (void);
  5497. extern void service_memory_moved (void);
  5498.  
  5499. /* ------------------------------------------------------------------------
  5500.  * Function:      service_pre_mode_change()
  5501.  *
  5502.  * Description:   Mode change
  5503.  *
  5504.  * Input:         mode - value of R2 on entry
  5505.  *
  5506.  * Other notes:   Calls SWI 0x30 with R1 = 0x4D.
  5507.  */
  5508.  
  5509. extern os_error *xservice_pre_mode_change (os_mode mode);
  5510. extern void service_pre_mode_change (os_mode mode);
  5511.  
  5512. /* ------------------------------------------------------------------------
  5513.  * Function:      service_mode_extension()
  5514.  *
  5515.  * Description:   Allow soft modes
  5516.  *
  5517.  * Input:         mode - value of R2 on entry
  5518.  *                monitor_type - value of R3 on entry
  5519.  *                bandwidth - value of R4 on entry
  5520.  *                vram_size - value of R5 on entry
  5521.  *
  5522.  * Output:        unclaimed - value of R1 on exit (X version only)
  5523.  *                vidc_list - value of R3 on exit
  5524.  *                workspace_list - value of R4 on exit
  5525.  *
  5526.  * Returns:       R1 (non-X version only)
  5527.  *
  5528.  * Other notes:   Calls SWI 0x30 with R1 = 0x50.
  5529.  */
  5530.  
  5531. extern os_error *xservice_mode_extension (os_mode mode,
  5532.       int monitor_type,
  5533.       int bandwidth,
  5534.       int vram_size,
  5535.       bool *unclaimed,
  5536.       int **vidc_list,
  5537.       int **workspace_list);
  5538. extern bool service_mode_extension (os_mode mode,
  5539.       int monitor_type,
  5540.       int bandwidth,
  5541.       int vram_size,
  5542.       int **vidc_list,
  5543.       int **workspace_list);
  5544.  
  5545. /* ------------------------------------------------------------------------
  5546.  * Function:      service_mode_translation()
  5547.  *
  5548.  * Description:   Translate modes for unknown monitor types
  5549.  *
  5550.  * Input:         mode - value of R2 on entry
  5551.  *                monitor_type - value of R3 on entry
  5552.  *
  5553.  * Other notes:   Calls SWI 0x30 with R1 = 0x51.
  5554.  */
  5555.  
  5556. extern os_error *xservice_mode_translation (os_mode mode,
  5557.       int monitor_type);
  5558. extern void service_mode_translation (os_mode mode,
  5559.       int monitor_type);
  5560.  
  5561. /* ------------------------------------------------------------------------
  5562.  * Function:      service_validate_address()
  5563.  *
  5564.  * Description:   OS_ValidateAddress has been called with an unknown area
  5565.  *
  5566.  * Other notes:   Calls SWI 0x30 with R1 = 0x6D.
  5567.  */
  5568.  
  5569. extern os_error *xservice_validate_address (void);
  5570. extern void service_validate_address (void);
  5571.  
  5572. /* ------------------------------------------------------------------------
  5573.  * Function:      service_monitor_lead_translation()
  5574.  *
  5575.  * Description:   Translate monitor lead ID
  5576.  *
  5577.  * Input:         lead_id - value of R2 on entry
  5578.  *
  5579.  * Other notes:   Calls SWI 0x30 with R1 = 0x76.
  5580.  */
  5581.  
  5582. extern os_error *xservice_monitor_lead_translation (int lead_id);
  5583. extern void service_monitor_lead_translation (int lead_id);
  5584.  
  5585. /* ------------------------------------------------------------------------
  5586.  * Function:      service_mode_changing()
  5587.  *
  5588.  * Description:   Mode change
  5589.  *
  5590.  * Input:         mode - value of R2 on entry
  5591.  *                monitor_type - value of R3 on entry
  5592.  *
  5593.  * Other notes:   Calls SWI 0x30 with R1 = 0x89.
  5594.  */
  5595.  
  5596. extern os_error *xservice_mode_changing (os_mode mode,
  5597.       int monitor_type);
  5598. extern void service_mode_changing (os_mode mode,
  5599.       int monitor_type);
  5600.  
  5601. /* ------------------------------------------------------------------------
  5602.  * Function:      service_enumerate_screen_modes()
  5603.  *
  5604.  * Description:   Enumerates the available screen modes
  5605.  *
  5606.  * Input:         context - value of R2 on entry
  5607.  *                monitor_type - value of R3 on entry
  5608.  *                bandwidth - value of R4 on entry
  5609.  *                vram_size - value of R5 on entry
  5610.  *                block - value of R6 on entry
  5611.  *                block_size - value of R7 on entry
  5612.  *
  5613.  * Output:        unclaimed - value of R1 on exit (X version only)
  5614.  *                context_out - value of R2 on exit
  5615.  *                end - value of R6 on exit
  5616.  *                free - value of R7 on exit
  5617.  *
  5618.  * Returns:       R1 (non-X version only)
  5619.  *
  5620.  * Other notes:   Calls SWI 0x30 with R1 = 0x8D.
  5621.  */
  5622.  
  5623. extern os_error *xservice_enumerate_screen_modes (int context,
  5624.       int monitor_type,
  5625.       int bandwidth,
  5626.       int vram_size,
  5627.       os_mode_block *block,
  5628.       int block_size,
  5629.       bool *unclaimed,
  5630.       int *context_out,
  5631.       byte **end,
  5632.       int *free);
  5633. extern bool service_enumerate_screen_modes (int context,
  5634.       int monitor_type,
  5635.       int bandwidth,
  5636.       int vram_size,
  5637.       os_mode_block *block,
  5638.       int block_size,
  5639.       int *context_out,
  5640.       byte **end,
  5641.       int *free);
  5642.  
  5643. /* ------------------------------------------------------------------------
  5644.  * Function:      service_pages_unsafe()
  5645.  *
  5646.  * Description:   Pages specified are about to be swapped for different
  5647.  *                pages
  5648.  *
  5649.  * Input:         page_block - value of R2 on entry
  5650.  *                request_count - value of R3 on entry
  5651.  *
  5652.  * Other notes:   Calls SWI 0x30 with R1 = 0x8E.
  5653.  */
  5654.  
  5655. extern os_error *xservice_pages_unsafe (os_page_block *page_block,
  5656.       int request_count);
  5657. extern void service_pages_unsafe (os_page_block *page_block,
  5658.       int request_count);
  5659.  
  5660. /* ------------------------------------------------------------------------
  5661.  * Function:      service_pages_safe()
  5662.  *
  5663.  * Description:   Pages specified have been swapped for different pages
  5664.  *
  5665.  * Input:         request_count - value of R2 on entry
  5666.  *                old_page_block - value of R3 on entry
  5667.  *                new_page_block - value of R4 on entry
  5668.  *
  5669.  * Other notes:   Calls SWI 0x30 with R1 = 0x8F.
  5670.  */
  5671.  
  5672. extern os_error *xservice_pages_safe (int request_count,
  5673.       os_page_block *old_page_block,
  5674.       os_page_block *new_page_block);
  5675. extern void service_pages_safe (int request_count,
  5676.       os_page_block *old_page_block,
  5677.       os_page_block *new_page_block);
  5678.  
  5679. /* ------------------------------------------------------------------------
  5680.  * Function:      service_dynamic_area_create()
  5681.  *
  5682.  * Description:   Dynamic area has just been successfully created
  5683.  *
  5684.  * Input:         area - value of R2 on entry
  5685.  *
  5686.  * Other notes:   Calls SWI 0x30 with R1 = 0x90.
  5687.  */
  5688.  
  5689. extern os_error *xservice_dynamic_area_create (int area);
  5690. extern void service_dynamic_area_create (int area);
  5691.  
  5692. /* ------------------------------------------------------------------------
  5693.  * Function:      service_dynamic_area_remove()
  5694.  *
  5695.  * Description:   Dynamic area is about to be removed
  5696.  *
  5697.  * Input:         area - value of R2 on entry
  5698.  *
  5699.  * Other notes:   Calls SWI 0x30 with R1 = 0x91.
  5700.  */
  5701.  
  5702. extern os_error *xservice_dynamic_area_remove (int area);
  5703. extern void service_dynamic_area_remove (int area);
  5704.  
  5705. /* ------------------------------------------------------------------------
  5706.  * Function:      service_dynamic_area_renumber()
  5707.  *
  5708.  * Description:   Dynamic area is being renumbered
  5709.  *
  5710.  * Input:         area - value of R2 on entry
  5711.  *
  5712.  * Other notes:   Calls SWI 0x30 with R1 = 0x92.
  5713.  */
  5714.  
  5715. extern os_error *xservice_dynamic_area_renumber (int area);
  5716. extern void service_dynamic_area_renumber (int area);
  5717.  
  5718. /* ------------------------------------------------------------------------
  5719.  * Function:      event_char_input()
  5720.  *
  5721.  * Description:   Character input
  5722.  *
  5723.  * Input:         buffer - value of R1 on entry
  5724.  *                b - value of R2 on entry
  5725.  *
  5726.  * Other notes:   Calls SWI 0x22 with R0 = 0x2.
  5727.  */
  5728.  
  5729. extern os_error *xevent_char_input (int buffer,
  5730.       byte b);
  5731. extern void event_char_input (int buffer,
  5732.       byte b);
  5733.  
  5734. /* ------------------------------------------------------------------------
  5735.  * Function:      event_vsync()
  5736.  *
  5737.  * Description:   Vertical sync
  5738.  *
  5739.  * Other notes:   Calls SWI 0x22 with R0 = 0x4.
  5740.  */
  5741.  
  5742. extern os_error *xevent_vsync (void);
  5743. extern void event_vsync (void);
  5744.  
  5745. /* ------------------------------------------------------------------------
  5746.  * Function:      event_interval_timer()
  5747.  *
  5748.  * Description:   Interval timer
  5749.  *
  5750.  * Other notes:   Calls SWI 0x22 with R0 = 0x5.
  5751.  */
  5752.  
  5753. extern os_error *xevent_interval_timer (void);
  5754. extern void event_interval_timer (void);
  5755.  
  5756. /* ------------------------------------------------------------------------
  5757.  * Function:      event_escape()
  5758.  *
  5759.  * Description:   Escape
  5760.  *
  5761.  * Other notes:   Calls SWI 0x22 with R0 = 0x6.
  5762.  */
  5763.  
  5764. extern os_error *xevent_escape (void);
  5765. extern void event_escape (void);
  5766.  
  5767. /* ------------------------------------------------------------------------
  5768.  * Function:      event_mouse_transition()
  5769.  *
  5770.  * Description:   Mouse button up/down
  5771.  *
  5772.  * Input:         x - value of R1 on entry
  5773.  *                y - value of R2 on entry
  5774.  *                state - value of R3 on entry
  5775.  *                t - value of R4 on entry
  5776.  *
  5777.  * Other notes:   Calls SWI 0x22 with R0 = 0xA.
  5778.  */
  5779.  
  5780. extern os_error *xevent_mouse_transition (int x,
  5781.       int y,
  5782.       bits state,
  5783.       os_t t);
  5784. extern void event_mouse_transition (int x,
  5785.       int y,
  5786.       bits state,
  5787.       os_t t);
  5788.  
  5789. /* ------------------------------------------------------------------------
  5790.  * Function:      event_key_transition()
  5791.  *
  5792.  * Description:   Key up/down
  5793.  *
  5794.  * Input:         down - value of R1 on entry
  5795.  *                key - value of R2 on entry
  5796.  *                keyboard_id - value of R3 on entry
  5797.  *
  5798.  * Other notes:   Calls SWI 0x22 with R0 = 0xB.
  5799.  */
  5800.  
  5801. extern os_error *xevent_key_transition (bool down,
  5802.       int key,
  5803.       int keyboard_id);
  5804. extern void event_key_transition (bool down,
  5805.       int key,
  5806.       int keyboard_id);
  5807.  
  5808. /* ------------------------------------------------------------------------
  5809.  * Function:      upcall_move_memory_request()
  5810.  *
  5811.  * Description:   Informs your program that RISC OS would like to move
  5812.  *                memory
  5813.  *
  5814.  * Input:         size_change - value of R1 on entry
  5815.  *
  5816.  * Output:        not_moved - value of R0 on exit (X version only)
  5817.  *
  5818.  * Returns:       R0 (non-X version only)
  5819.  *
  5820.  * Other notes:   Calls SWI 0x33 with R0 = 0x101.
  5821.  */
  5822.  
  5823. extern os_error *xupcall_move_memory_request (int size_change,
  5824.       bool *not_moved);
  5825. extern bool upcall_move_memory_request (int size_change);
  5826.  
  5827. #ifdef __cplusplus
  5828.    }
  5829. #endif
  5830.  
  5831. #endif
  5832.