home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / snanls.h < prev    next >
C/C++ Source or Header  |  2000-02-01  |  5KB  |  145 lines

  1. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  2. #ifdef __cplusplus
  3. extern "C"
  4. {
  5. #endif
  6.  
  7. #if !defined __SNANLS_INC__
  8.  
  9. #define __SNANLS_INC__
  10.  
  11. /* ********************* Constants ******************** */
  12.  
  13. #define    CP_37        37        /* EBCDIC Lower English    */
  14.  
  15. #define    CP_273        273        
  16. #define    CP_277        277        
  17. #define    CP_278        278    
  18. #define    CP_280        280    
  19. #define    CP_284        284    
  20. #define    CP_285        285    
  21.  
  22.  
  23. #define    CP_290        290        /* EBCDIC Katakana    */
  24.  
  25. #define    CP_297        297
  26. #define CP_423        423
  27. #define CP_500        500
  28. #define CP_875        875    
  29.  
  30. #define    CP_930        930        /* EBCDIC Katakana + Kanji    */
  31. #define    CP_931        931        /* EBCDIC Lower English + Kanji    */
  32. #define    CP_932        932     /* Japanese    */
  33.  
  34. #define    CP_933        933        /* EBCDIC Korean    */
  35.  
  36. #define CP_935        935        /* EBCDIC Simplified Chinese */
  37. #define CP_936        936        /* Chinese */
  38. #define    CP_937        937        /* EBCDIC Traditional Chinese    */
  39.  
  40. #define    CP_939        939        /* EBCDIC Extended Lower English + Kanji    */
  41. #define    CP_949        949        /* Korean    */
  42. #define    CP_950        950        /* Taiwanese    */
  43. #define    CP_1027        1027    /* EBCDIC Extended Lower English    */
  44.  
  45.  
  46. #define SNA_UNICODE   1  /* Result of Conversion is Unicode */
  47. #define SNA_MULTIBYTE 2  /* Result of Conversion is MultiByte */
  48.  
  49. /* ********************* Functions ******************** */
  50.  
  51. /* ***************************************************************** */
  52. /*        Initialization Routine : Local Machine                         */
  53. /*            CodePage : The CodePage which we need to support         */
  54. /*            return   : 1 if CodePage Translations are Supported      */
  55. /*                     0 otherwise                                     */
  56. /* ***************************************************************** */
  57.  
  58. int WINAPI SnaNlsInit(UINT CodePage);
  59.  
  60. /* ***************************************************************** */
  61. /*                                                                     */
  62. /* Translation Routine                                                 */
  63. /*                                                                     */
  64. /*        Input                                                         */
  65. /*                                                                     */
  66. /*            lpSrcStr   : Input, Source String                         */
  67. /*                                                                     */
  68. /*            lpDestStr  : Output, Translated String                     */
  69. /*                            maybe NULL if out_length is 0             */
  70. /*                                                                     */
  71. /*            inCodePage : CodePage of incoming string                 */
  72. /*                            ignored if input is in unicode             */
  73. /*                                                                     */
  74. /*            outCodePage: CodePage of translated string.                 */
  75. /*                            ignored if output is in unicode             */
  76. /*                                                                     */
  77. /*            in_length  : Length of input string                         */
  78. /*                            in characters if input is multibyte      */
  79. /*                            in wide chars if input is unicode        */
  80. /*                                                                     */
  81. /*          out_length : Length of output string                     */
  82. /*                            in characters if output is multibyte     */
  83. /*                            in wide chars if output is unicode       */
  84. /*                                                                     */
  85. /*            in_type    : SNA_UNICODE - Unicode Input                 */
  86. /*                         SNA_MULTIBYTE - MultiByte Input             */
  87. /*                                                                     */
  88. /*            out_type   : SNA_UNICODE - Unicode Output                 */
  89. /*                         SNA_MULTIBYTE - MultiByte Output             */
  90. /*                                                                     */
  91. /*            Options    : Multiple usage                                 */
  92. /*                            Trnsdt Options                             */
  93. /*                            Default Character for Translation (NLS)  */
  94. /*                                                                     */
  95. /*        Output                                                         */
  96. /*                                                                     */
  97. /*            return val : 0 - Failure                                 */
  98. /*                            Use GetLastError to retrieve error         */
  99. /*                         Else                                         */
  100. /*                            Num of chars(wide) written to lpDestStr  */
  101. /*                                                                     */
  102. /*            lpDestStr  : Translated String                             */
  103. /*                                                                     */
  104. /*             Options    : Required buffer length if call failed         */
  105. /*                                                                     */
  106. /*            Errors       : (Retrieved by using GetLastError)           */
  107. /*                                                                     */
  108. /*                          ERROR_NOT_SUPPORTED                         */
  109. /*                            Possible Reasons:                           */
  110. /*                                NLS is not available                  */
  111. /*                                Input & Output are not of same type     */
  112. /*                                                                     */
  113. /*                         ERROR_BUFFER_OVERFLOW                         */
  114. /*                            Possible Reasons:                         */
  115. /*                                Output buffer is too small           */
  116. /*                                                                     */
  117. /*                         ERROR_INVALID_PARAMETER                     */
  118. /*                            Possible Reasons:                         */
  119. /*                                in_type or out_type is faulty        */
  120. /*                                                                     */
  121. /*                         ERROR_INVALID_DATA                             */
  122. /*                            Possible Reasons:                         */
  123. /*                                input data has a lead byte at end    */
  124. /*                                                                     */
  125. /*                         ERROR_OUTOFMEMORY                             */
  126. /*                            Possible Reasons:                         */
  127. /*                                malloc failed                         */
  128. /*                                                                     */
  129. /*                                                                     */
  130. /* ***************************************************************** */
  131.  
  132. int WINAPI SnaNlsMapString (LPCTSTR lpSrcStr, LPTSTR lpDestStr,
  133.                      UINT inCodePage, UINT outCodePage,
  134.                      int in_length,   int out_length, 
  135.                      UINT in_type, UINT out_type,  WORD * Options);
  136.  
  137.  
  138.  
  139. #endif
  140.  
  141. #ifdef __cplusplus
  142. }
  143. #endif
  144. #pragma option pop /*P_O_Pop*/
  145.