home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / rxjis096.zip / pctojis.hpp < prev    next >
C/C++ Source or Header  |  1997-08-07  |  2KB  |  38 lines

  1. /* product name: RXJIS                                                */
  2. /* Version:      0.90                                                 */
  3. /* author:       YANO Takashi                                         */
  4. /* target:       OS/2 Warp J3.0+ (J2.1 is possible)                   */
  5. /* source name:  PCTOJIS.HPP                                          */
  6. /* address:      tyano@ca2.so-net.or.jp or tyano@yamato.ibm.co.jp     */
  7. /* comment:      RXJIS is a utility functions for REXX.               */
  8. /*               This header file is a interface to be called from    */
  9. /*               C/C++.                                               */
  10. /* history: 1997-08-05 0.90                                           */
  11. /*                                                                    */
  12. extern BOOL InJis90;
  13. extern wchar_t _Export PccodeToJiscode(wchar_t pccode);
  14. extern wchar_t _Export OldJisToNewJis(wchar_t pccode);
  15. extern wchar_t _Export NewJisToOldJis(wchar_t pccode);
  16. extern int IbmcodeStringToJiscodeString(PCHAR ibmstr, int ibmstrsize, PCHAR jisstr, int jisstrsize);
  17. extern const int maxIbm2JisSize;
  18. extern BOOL DbcsVec[UCHAR_MAX+1];
  19. #define IsDbcs1st(c) DbcsVec[c]
  20. #define FillInPc 0x81ac  // ü¼
  21. #define FillInJis 0x222e // ü¼
  22. #define ByteMask 0x000000ff
  23. #define ByteBitWidth 8
  24. #define RxJisError -1                     
  25.  
  26. #define RxJisArgCheck(source, target, targetsize, sourcesize) \
  27.    if (NULL == source || NULL == target || targetsize <= 0) { \
  28.       return (RxJisError); \
  29.    } /* endif */ \
  30.    if (sourcesize <= 0) { \
  31.       sourcesize = strlen(source); \
  32.    } /* endif */
  33.  
  34. #define RxJisCountCheck(count, targetsize) \
  35.    if (count >= targetsize) { \
  36.       return (RxJisError); \
  37.    } /* endif */
  38.