home *** CD-ROM | disk | FTP | other *** search
- #ifndef messagetrans_H
- #define messagetrans_H
-
- /* C header file for MessageTrans
- * written by DefMod (Sep 7 1994) on Wed Sep 7 21:23:23 1994
- * Copyright © Acorn Computers Ltd, 1994
- */
-
- /*************************************************************************
- * This source file was written by Acorn Computers Limited. It is part *
- * of the OSLib library for writing applications for RISC OS. It may be *
- * used freely in the creation of programs for RISC OS. *
- *************************************************************************/
-
- #ifndef types_H
- #include "types.h"
- #endif
-
- #ifndef os_H
- #include "os.h"
- #endif
-
- /**********************************
- * SWI names and SWI reason codes *
- **********************************/
- #undef MessageTrans_FileInfo
- #define MessageTrans_FileInfo 0x41500
- #undef XMessageTrans_FileInfo
- #define XMessageTrans_FileInfo 0x61500
- #undef MessageTrans_OpenFile
- #define MessageTrans_OpenFile 0x41501
- #undef XMessageTrans_OpenFile
- #define XMessageTrans_OpenFile 0x61501
- #undef MessageTrans_Lookup
- #define MessageTrans_Lookup 0x41502
- #undef XMessageTrans_Lookup
- #define XMessageTrans_Lookup 0x61502
- #undef MessageTrans_MakeMenus
- #define MessageTrans_MakeMenus 0x41503
- #undef XMessageTrans_MakeMenus
- #define XMessageTrans_MakeMenus 0x61503
- #undef MessageTrans_CloseFile
- #define MessageTrans_CloseFile 0x41504
- #undef XMessageTrans_CloseFile
- #define XMessageTrans_CloseFile 0x61504
- #undef MessageTrans_EnumerateTokens
- #define MessageTrans_EnumerateTokens 0x41505
- #undef XMessageTrans_EnumerateTokens
- #define XMessageTrans_EnumerateTokens 0x61505
- #undef MessageTrans_ErrorLookup
- #define MessageTrans_ErrorLookup 0x41506
- #undef XMessageTrans_ErrorLookup
- #define XMessageTrans_ErrorLookup 0x61506
- #undef MessageTrans_GSLookup
- #define MessageTrans_GSLookup 0x41507
- #undef XMessageTrans_GSLookup
- #define XMessageTrans_GSLookup 0x61507
- #undef MessageTrans_CopyError
- #define MessageTrans_CopyError 0x41508
- #undef XMessageTrans_CopyError
- #define XMessageTrans_CopyError 0x61508
- #undef Service_MessageFileClosed
- #define Service_MessageFileClosed 0x5E
-
- /************************************
- * Structure and union declarations *
- ************************************/
- typedef struct messagetrans_control_block messagetrans_control_block;
-
- /********************
- * Type definitions *
- ********************/
- struct messagetrans_control_block
- { int cb [4];
- };
-
- /************************
- * Constant definitions *
- ************************/
- #define messagetrans_DIRECT_ACCESS 0x1u
- #define error_MESSAGE_TRANS_SYNTAX 0xAC0u
- #define error_MESSAGE_TRANS_FILE_OPEN 0xAC1u
- #define error_MESSAGE_TRANS_TOKEN_NOT_FOUND 0xAC2u
- #define error_MESSAGE_TRANS_RECURSE 0xAC3u
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*************************************************************
- * NOTE: The following functions provide direct access to *
- * the SWI's noted in the function description. *
- * Please read the relevant PRM section for more *
- * information on their input/output parameters. *
- *************************************************************/
-
- /* ------------------------------------------------------------------------
- * Function: messagetrans_file_info()
- *
- * Description: Gives information about a message file
- *
- * Input: file_name - value of R1 on entry
- *
- * Output: flags - value of R0 on exit
- * size - value of R2 on exit
- *
- * Other notes: Calls SWI 0x41500.
- */
-
- extern os_error *xmessagetrans_file_info (char *file_name,
- bits *flags,
- int *size);
- extern void messagetrans_file_info (char *file_name,
- bits *flags,
- int *size);
-
- /* ------------------------------------------------------------------------
- * Function: messagetrans_open_file()
- *
- * Description: Opens a message file
- *
- * Input: cb - value of R0 on entry
- * file_name - value of R1 on entry
- * buffer - value of R2 on entry
- *
- * Other notes: Calls SWI 0x41501.
- */
-
- extern os_error *xmessagetrans_open_file (messagetrans_control_block *cb,
- char *file_name,
- char *buffer);
- extern void messagetrans_open_file (messagetrans_control_block *cb,
- char *file_name,
- char *buffer);
-
- /* ------------------------------------------------------------------------
- * Function: messagetrans_lookup()
- *
- * Description: Translates a message token into a string
- *
- * Input: cb - value of R0 on entry
- * token - value of R1 on entry
- * buffer - value of R2 on entry
- * size - value of R3 on entry
- * arg0 - value of R4 on entry
- * arg1 - value of R5 on entry
- * arg2 - value of R6 on entry
- * arg3 - value of R7 on entry
- *
- * Output: result - value of R2 on exit (X version only)
- * used - value of R3 on exit
- *
- * Returns: R2 (non-X version only)
- *
- * Other notes: Calls SWI 0x41502.
- */
-
- extern os_error *xmessagetrans_lookup (messagetrans_control_block *cb,
- char *token,
- char *buffer,
- int size,
- char *arg0,
- char *arg1,
- char *arg2,
- char *arg3,
- char **result,
- int *used);
- extern char *messagetrans_lookup (messagetrans_control_block *cb,
- char *token,
- char *buffer,
- int size,
- char *arg0,
- char *arg1,
- char *arg2,
- char *arg3,
- int *used);
-
- /* ------------------------------------------------------------------------
- * Function: messagetrans_make_menus()
- *
- * Description: Sets up a menu structure from a definition containing
- * references to tokens
- *
- * Input: cb - value of R0 on entry
- * menus - value of R1 on entry
- * buffer - value of R2 on entry
- * size - value of R3 on entry
- *
- * Output: used - value of R3 on exit
- *
- * Other notes: Calls SWI 0x41503.
- */
-
- extern os_error *xmessagetrans_make_menus (messagetrans_control_block *cb,
- byte *menus,
- char *buffer,
- int size,
- int *used);
- extern void messagetrans_make_menus (messagetrans_control_block *cb,
- byte *menus,
- char *buffer,
- int size,
- int *used);
-
- /* ------------------------------------------------------------------------
- * Function: messagetrans_close_file()
- *
- * Description: Closes a message file
- *
- * Input: cb - value of R0 on entry
- *
- * Other notes: Calls SWI 0x41504.
- */
-
- extern os_error *xmessagetrans_close_file (messagetrans_control_block *cb);
- extern void messagetrans_close_file (messagetrans_control_block *cb);
-
- /* ------------------------------------------------------------------------
- * Function: messagetrans_enumerate_tokens()
- *
- * Description: Enumerates tokens that match a wildcarded token
- *
- * Input: cb - value of R0 on entry
- * token - value of R1 on entry
- * buffer - value of R2 on entry
- * size - value of R3 on entry
- * context - value of R4 on entry
- *
- * Output: more - value of R2 on exit (X version only)
- * used - value of R3 on exit
- * context_out - value of R4 on exit
- *
- * Returns: R2 (non-X version only)
- *
- * Other notes: Calls SWI 0x41505.
- */
-
- extern os_error *xmessagetrans_enumerate_tokens (messagetrans_control_block *cb,
- char *token,
- char *buffer,
- int size,
- int context,
- bool *more,
- int *used,
- int *context_out);
- extern bool messagetrans_enumerate_tokens (messagetrans_control_block *cb,
- char *token,
- char *buffer,
- int size,
- int context,
- int *used,
- int *context_out);
-
- /* ------------------------------------------------------------------------
- * Function: messagetrans_error_lookup()
- *
- * Description: Translates a message token within an error block
- *
- * Input: error - value of R0 on entry
- * cb - value of R1 on entry
- * buffer - value of R2 on entry
- * size - value of R3 on entry
- * arg0 - value of R4 on entry
- * arg1 - value of R5 on entry
- * arg2 - value of R6 on entry
- * arg3 - value of R7 on entry
- *
- * Other notes: Calls SWI 0x41506.
- */
-
- extern os_error *xmessagetrans_error_lookup (os_error *error,
- messagetrans_control_block *cb,
- char *buffer,
- int size,
- char *arg0,
- char *arg1,
- char *arg2,
- char *arg3);
- extern void messagetrans_error_lookup (os_error *error,
- messagetrans_control_block *cb,
- char *buffer,
- int size,
- char *arg0,
- char *arg1,
- char *arg2,
- char *arg3);
-
- /* ------------------------------------------------------------------------
- * Function: messagetrans_gs_lookup()
- *
- * Description: Translates a message token into a string and calls
- * OS_GSTrans
- *
- * Input: cb - value of R0 on entry
- * token - value of R1 on entry
- * buffer - value of R2 on entry
- * size - value of R3 on entry
- * arg0 - value of R4 on entry
- * arg1 - value of R5 on entry
- * arg2 - value of R6 on entry
- * arg3 - value of R7 on entry
- *
- * Output: used - value of R3 on exit
- *
- * Other notes: Calls SWI 0x41507.
- */
-
- extern os_error *xmessagetrans_gs_lookup (messagetrans_control_block *cb,
- char *token,
- char *buffer,
- int size,
- char *arg0,
- char *arg1,
- char *arg2,
- char *arg3,
- int *used);
- extern void messagetrans_gs_lookup (messagetrans_control_block *cb,
- char *token,
- char *buffer,
- int size,
- char *arg0,
- char *arg1,
- char *arg2,
- char *arg3,
- int *used);
-
- /* ------------------------------------------------------------------------
- * Function: messagetrans_copy_error()
- *
- * Description: Copies an error into one of the MessageTrans internal
- * buffers
- *
- * Input: error - value of R0 on entry
- *
- * Output: copy - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x41508.
- */
-
- extern os_error *xmessagetrans_copy_error (os_error *error,
- os_error **copy);
- extern os_error *messagetrans_copy_error (os_error *error);
-
- /* ------------------------------------------------------------------------
- * Function: service_message_file_closed()
- *
- * Description: Message files have been closed
- *
- * Input: cb - value of R0 on entry
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x5E.
- */
-
- extern os_error *xservice_message_file_closed (messagetrans_control_block *cb);
- extern void service_message_file_closed (messagetrans_control_block *cb);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-