home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / a / armedit / Code / h / armeditswi
Text File  |  1997-02-21  |  12KB  |  277 lines

  1. /*
  2.     File        : armeditswi.h
  3.     Date        : 21-Feb-97
  4.     Author      : © A.Thoukydides, 1996, 1997
  5.     Description : Interface to the ARMEdit module.
  6. */
  7.  
  8. #ifndef armeditswi_h
  9. #define armeditswi_h
  10.  
  11. // Include oslib header files
  12. #include "OS:os.h"
  13.  
  14. // SWI names and numbers
  15. #define ARMEdit_ControlPC 0x4BC40
  16. #define ARMEdit_TalkStart 0x4BC41
  17. #define ARMEdit_TalkEnd 0x4BC42
  18. #define ARMEdit_TalkTX 0x4BC43
  19. #define ARMEdit_TalkRX 0x4BC44
  20. #define ARMEdit_TalkAck 0x4BC45
  21. #define ARMEdit_HPC 0x4BC46
  22. #define ARMEdit_Polling 0x4BC47
  23. #define ARMEdit_TalkReply 0x4BC48
  24.  
  25. // Operations to perform using ARMEdit_ControlPC
  26. #define ARMEditControlPC_FreezeFullScreen 0x0
  27. #define ARMEditControlPC_FreezeWindow 0x1
  28. #define ARMEditControlPC_Reset 0x2
  29. #define ARMEditControlPC_Quit 0x3
  30.  
  31. // Flags defined for ARMEdit_TalkStart
  32. #define ARMEditTalkStart_FlagsARMEditMessages 0x1
  33.  
  34. // Message buffers
  35. #define ARMEditTalk_BufferSize 1024
  36. typedef char armedit_talk_buffer[ARMEditTalk_BufferSize];
  37.  
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41.  
  42. /*
  43.     Parameters  : operation - The operation to perform.
  44.     Returns     : os_error  - Pointer to a standard error block.
  45.     Description : Control the PC front-end.
  46.                   This calls XARMEdit_ControlPC.
  47. */
  48. os_error *xarmedit_control_pc(int operation);
  49.  
  50. /*
  51.     Parameters  : operation - The operation to perform.
  52.     Returns     : void
  53.     Description : Control the PC front-end.
  54.                   This calls ARMEdit_ControlPC.
  55. */
  56. void armedit_control_pc(int operation);
  57.  
  58. /*
  59.     Parameters  : id        - Pre-allocated ID for this task.
  60.                   flags     - The flags.
  61.                   func      - Pointer to a function to be called when a
  62.                               message is available, or 0 for none.
  63.                   r12       - Value for r12 to contain when the function is
  64.                               called.
  65.                   rhandle   - Optional variable to receive the unique client
  66.                               handle for this task.
  67.                   rpoll     - Optional variable to receive the pointer to a
  68.                               poll word for this task.
  69.     Returns     : os_error  - Pointer to a standard error block.
  70.     Description : Register a new client task.
  71.                   This calls XARMEdit_TalkStart.
  72. */
  73. os_error *xarmedit_talk_start(int id, int flags, void *func, int r12,
  74.                               int *rhandle, int **rpoll);
  75.  
  76. /*
  77.     Parameters  : id        - Pre-allocated ID for this task.
  78.                   flags     - The flags.
  79.                   func      - Pointer to a function to be called when a
  80.                               message is available, or 0 for none.
  81.                   r12       - Value for r12 to contain when the function is
  82.                               called.
  83.                   rhandle   - Optional variable to receive the unique client
  84.                               handle for this task.
  85.                   rpoll     - Optional variable to receive the pointer to a
  86.                               poll word for this task.
  87.     Returns     : int       - The unique client handle for this task.
  88.     Description : Register a new client task.
  89.                   This calls ARMEdit_TalkStart.
  90. */
  91. int armedit_talk_start(int id, int flags, void *func, int r12, int *rhandle,
  92.                        int **rpoll);
  93.  
  94. /*
  95.     Parameters  : handle    - The previously assigned handle for this client
  96.                               task.
  97.     Returns     : os_error  - Pointer to a standard error block.
  98.     Description : Deregister a client task.
  99.                   This calls XARMEdit_TalkEnd.
  100. */
  101. os_error *xarmedit_talk_end(int handle);
  102.  
  103. /*
  104.     Parameters  : handle    - The previously assigned handle for this client
  105.                               task.
  106.     Returns     : void
  107.     Description : Deregister a client task.
  108.                   This calls ARMEdit_TalkEnd.
  109. */
  110. void armedit_talk_end(int handle);
  111.  
  112. /*
  113.     Parameters  : handle    - Client handle for this task.
  114.                   dest      - Either the ID or client handle for the recipient
  115.                               (if msg is a valid pointer).
  116.                   msg       - Pointer to block containing the message to send,
  117.                               or NULL to check if the buffer already contains a
  118.                               message.
  119.                   rmsg      - Optional variable to receive a pointer to the
  120.                               message buffer, or NULL if no message is waiting
  121.                               to be delivered.
  122.     Returns     : os_error  - Pointer to a standard error block.
  123.     Description : Send a message to another client task.
  124.                   This calls XARMEdit_TalkTx.
  125. */
  126. os_error *xarmedit_talk_tx(int handle, int dest, void *msg, void **rmsg);
  127.  
  128. /*
  129.     Parameters  : handle    - Client handle for this task.
  130.                   dest      - Either the ID or client handle for the recipient
  131.                               (if msg is a valid pointer).
  132.                   msg       - Pointer to block containing the message to send,
  133.                               or NULL to check if the buffer already contains a
  134.                               message.
  135.                   rmsg      - Optional variable to receive a pointer to the
  136.                               message buffer, or NULL if no message is waiting
  137.                               to be delivered.
  138.     Returns     : void *    - Pointer to the message buffer, or NULL if no
  139.                               message is waiting to be delivered.
  140.     Description : Send a message to another client task.
  141.                   This calls ARMEdit_TalkTx.
  142. */
  143. void *armedit_talk_tx(int handle, int dest, void *msg, void **rmsg);
  144.  
  145. /*
  146.     Parameters  : handle    - Client handle for this task.
  147.                   rmsg      - Optional variable to receive a pointer to the
  148.                               block containing the waiting message, or NULL if
  149.                               no messages are waiting.
  150.                   rid       - Optional variable to receive the source ID.
  151.                   rhandle   - Optional variable to receive the source handle.
  152.     Returns     : os_error  - Pointer to a standard error block.
  153.     Description : Check for any waiting messages for this client task.
  154.                   This calls XARMEdit_TalkRx.
  155. */
  156. os_error *xarmedit_talk_rx(int handle, void **rmsg, int *rid, int *rhandle);
  157.  
  158. /*
  159.     Parameters  : handle    - Client handle for this task.
  160.                   rmsg      - Optional variable to receive a pointer to the
  161.                               block containing the waiting message, or NULL if
  162.                               no messages are waiting.
  163.                   rid       - Optional variable to receive the source ID.
  164.                   rhandle   - Optional variable to receive the source handle.
  165.     Returns     : void *    - Pointer to the block containing the waiting
  166.                               message, or NULL if no messages are waiting.
  167.     Description : Check for any waiting messages for this client task.
  168.                   This calls ARMEdit_TalkRx.
  169. */
  170. void *armedit_talk_rx(int handle, void **rmsg, int *rid, int *rhandle);
  171.  
  172. /*
  173.     Parameters  : handle    - Client handle for this task.
  174.     Returns     : os_error  - Pointer to a standard error block.
  175.     Description : Claim the most recently read message.
  176.                   This calls XARMEdit_TalkAck.
  177. */
  178. os_error *xarmedit_talk_ack(int handle);
  179.  
  180. /*
  181.     Parameters  : handle    - Client handle for this task.
  182.     Returns     : void
  183.     Description : Claim the most recently read message.
  184.                   This calls ARMEdit_TalkAck.
  185. */
  186. void armedit_talk_ack(int handle);
  187.  
  188. /*
  189.     Parameters  : tx1_size  - Length of first input block.
  190.                   tx1_buf   - Pointer to first input block.
  191.                   tx2_size  - Length of second input block.
  192.                   tx2_buf   - Pointer to second input block.
  193.                   rx1_size  - Length of first output block.
  194.                   rx1_buf   - Pointer to first output block.
  195.                   rx2_size  - Length of second output block.
  196.                   rx2_buf   - Pointer to second output block.
  197.     Returns     : os_error  - Pointer to a standard error block.
  198.     Description : Call