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

  1. #ifndef serviceinternational_H
  2. #define serviceinternational_H
  3.  
  4. /* C header file for ServiceInternational
  5.  * written by DefMod (Sep  7 1994) on Wed Sep  7 21:19:27 1994
  6.  * Copyright © Acorn Computers Ltd, 1994
  7.  */
  8.  
  9. /*************************************************************************
  10.  * This source file was written by Acorn Computers Limited. It is part   *
  11.  * of the OSLib library for writing applications for RISC OS. It may be  *
  12.  * used freely in the creation of programs for RISC OS.                  *
  13.  *************************************************************************/
  14.  
  15. #ifndef types_H
  16.    #include "types.h"
  17. #endif
  18.  
  19. #ifndef os_H
  20.    #include "os.h"
  21. #endif
  22.  
  23. /**********************************
  24.  * SWI names and SWI reason codes *
  25.  **********************************/
  26. #undef  Service_International
  27. #define Service_International                   0x43
  28. #undef  ServiceInternational_CountryNameToCountryNumber
  29. #define ServiceInternational_CountryNameToCountryNumber 0x0
  30. #undef  ServiceInternational_AlphabetNameToAlphabetNumber
  31. #define ServiceInternational_AlphabetNameToAlphabetNumber 0x1
  32. #undef  ServiceInternational_CountryNumberToCountryName
  33. #define ServiceInternational_CountryNumberToCountryName 0x2
  34. #undef  ServiceInternational_AlphabetNumberToAlphabetName
  35. #define ServiceInternational_AlphabetNumberToAlphabetName 0x3
  36. #undef  ServiceInternational_CountryNumberToAlphabetNumber
  37. #define ServiceInternational_CountryNumberToAlphabetNumber 0x4
  38. #undef  ServiceInternational_DefineChars
  39. #define ServiceInternational_DefineChars        0x5
  40. #undef  ServiceInternational_NewKeyboard
  41. #define ServiceInternational_NewKeyboard        0x6
  42.  
  43. /************************
  44.  * Constant definitions *
  45.  ************************/
  46. #define error_UNKNOWN_ALPHABET                  0x640u
  47. #define error_UNKNOWN_COUNTRY                   0x641u
  48. #define error_UNKNOWN_KEYBOARD                  0x642u
  49.  
  50. /*************************
  51.  * Function declarations *
  52.  *************************/
  53.  
  54. #ifdef __cplusplus
  55.    extern "C" {
  56. #endif
  57.  
  58. /*************************************************************
  59.  * NOTE: The following functions provide direct access to    *
  60.  *       the SWI's noted in the function description.        *
  61.  *       Please read the relevant PRM section for more       *
  62.  *       information on their input/output parameters.       *
  63.  *************************************************************/
  64.  
  65. /* ------------------------------------------------------------------------
  66.  * Function:      serviceinternational_country_name_to_country_number()
  67.  *
  68.  * Description:   Converts country name to country number
  69.  *
  70.  * Input:         country_name - value of R3 on entry
  71.  *
  72.  * Output:        unclaimed - value of R1 on exit (X version only)
  73.  *                country_no - value of R4 on exit
  74.  *
  75.  * Returns:       R1 (non-X version only)
  76.  *
  77.  * Other notes:   Calls SWI 0x30 with R1 = 0x43, R2 = 0x0.
  78.  */
  79.  
  80. extern os_error *xserviceinternational_country_name_to_country_number (char *country_name,
  81.       bool *unclaimed,
  82.       int *country_no);
  83. extern bool serviceinternational_country_name_to_country_number (char *country_name,
  84.       int *country_no);
  85.  
  86. /* ------------------------------------------------------------------------
  87.  * Function:      serviceinternational_alphabet_name_to_alphabet_number()
  88.  *
  89.  * Description:   Converts alphabet name to alphabet number
  90.  *
  91.  * Input:         alphabet_name - value of R3 on entry
  92.  *
  93.  * Output:        unclaimed - value of R1 on exit (X version only)
  94.  *                alphabet_no - value of R4 on exit
  95.  *
  96.  * Returns:       R1 (non-X version only)
  97.  *
  98.  * Other notes:   Calls SWI 0x30 with R1 = 0x43, R2 = 0x1.
  99.  */
  100.  
  101. extern os_error *xserviceinternational_alphabet_name_to_alphabet_number (char *alphabet_name,
  102.       bool *unclaimed,
  103.       int *alphabet_no);
  104. extern bool serviceinternational_alphabet_name_to_alphabet_number (char *alphabet_name,
  105.       int *alphabet_no);
  106.  
  107. /* ------------------------------------------------------------------------
  108.  * Function:      serviceinternational_country_number_to_country_name()
  109.  *
  110.  * Description:   Converts country number to country name
  111.  *
  112.  * Input:         country_no - value of R3 on entry
  113.  *                buffer - value of R4 on entry
  114.  *                size - value of R5 on entry
  115.  *
  116.  * Output:        unclaimed - value of R1 on exit (X version only)
  117.  *                used - value of R5 on exit
  118.  *
  119.  * Returns:       R1 (non-X version only)
  120.  *
  121.  * Other notes:   Calls SWI 0x30 with R1 = 0x43, R2 = 0x2.
  122.  */
  123.  
  124. extern os_error *xserviceinternational_country_number_to_country_name (int country_no,
  125.       char *buffer,
  126.       int size,
  127.       bool *unclaimed,
  128.       int *used);
  129. extern bool serviceinternational_country_number_to_country_name (int country_no,
  130.       char *buffer,
  131.       int size,
  132.       int *used);
  133.  
  134. /* ------------------------------------------------------------------------
  135.  * Function:      serviceinternational_alphabet_number_to_alphabet_name()
  136.  *
  137.  * Description:   Converts alphabet number to alphabet name
  138.  *
  139.  * Input:         alphabet_no - value of R3 on entry
  140.  *                buffer - value of R4 on entry
  141.  *                size - value of R5 on entry
  142.  *
  143.  * Output:        unclaimed - value of R1 on exit (X version only)
  144.  *                used - value of R5 on exit
  145.  *
  146.  * Returns:       R1 (non-X version only)
  147.  *
  148.  * Other notes:   Calls SWI 0x30 with R1 = 0x43, R2 = 0x3.
  149.  */
  150.  
  151. extern os_error *xserviceinternational_alphabet_number_to_alphabet_name (int alphabet_no,
  152.       char *buffer,
  153.       int size,
  154.       bool *unclaimed,
  155.       int *used);
  156. extern bool serviceinternational_alphabet_number_to_alphabet_name (int alphabet_no,
  157.       char *buffer,
  158.       int size,
  159.       int *used);
  160.  
  161. /* ------------------------------------------------------------------------
  162.  * Function:      serviceinternational_country_number_to_alphabet_number()
  163.  *
  164.  * Description:   Converts country number to alphabet number
  165.  *
  166.  * Input:         country_no - value of R3 on entry
  167.  *
  168.  * Output:        unclaimed - value of R1 on exit (X version only)
  169.  *                alphabet_no - value of R4 on exit
  170.  *
  171.  * Returns:       R1 (non-X version only)
  172.  *
  173.  * Other notes:   Calls SWI 0x30 with R1 = 0x43, R2 = 0x4.
  174.  */
  175.  
  176. extern os_error *xserviceinternational_country_number_to_alphabet_number (int country_no,
  177.       bool *unclaimed,
  178.       int *alphabet_no);
  179. extern bool serviceinternational_country_number_to_alphabet_number (int country_no,
  180.       int *alphabet_no);
  181.  
  182. /* ------------------------------------------------------------------------
  183.  * Function:      serviceinternational_define_chars()
  184.  *
  185.  * Description:   Defines a range of characters from a given alphabet
  186.  *                number
  187.  *
  188.  * Input:         alphabet_no - value of R3 on entry
  189.  *                first - value of R4 on entry
  190.  *                last - value of R5 on entry
  191.  *
  192.  * Output:        unclaimed - value of R1 on exit (X version only)
  193.  *
  194.  * Returns:       R1 (non-X version only)
  195.  *
  196.  * Other notes:   Calls SWI 0x30 with R1 = 0x43, R2 = 0x5.
  197.  */
  198.  
  199. extern os_error *xserviceinternational_define_chars (int alphabet_no,
  200.       byte first,
  201.       byte last,
  202.       bool *unclaimed);
  203. extern bool serviceinternational_define_chars (int alphabet_no,
  204.       byte first,
  205.       byte last);
  206.  
  207. /* ------------------------------------------------------------------------
  208.  * Function:      serviceinternational_new_keyboard()
  209.  *
  210.  * Description:   Notification of a new keyboard selection
  211.  *
  212.  * Input:         keyboard_no - value of R3 on entry
  213.  *                alphabet_no - value of R4 on entry
  214.  *
  215.  * Other notes:   Calls SWI 0x30 with R1 = 0x43, R2 = 0x6.
  216.  */
  217.  
  218. extern os_error *xserviceinternational_new_keyboard (int keyboard_no,
  219.       int alphabet_no);
  220. extern void serviceinternational_new_keyboard (int keyboard_no,
  221.       int alphabet_no);
  222.  
  223. #ifdef __cplusplus
  224.    }
  225. #endif
  226.  
  227. #endif
  228.