/*
 *  jstring.h   Japanese DBCS functions
 *
 * =========================================================================
 *
 *                          Open Watcom Project
 *
 * Copyright (c) 2004-2026 The Open Watcom Contributors. All Rights Reserved.
 * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
 *
 *    This file is automatically generated. Do not edit directly.
 *
 * =========================================================================
 */
#ifndef _JSTRING_H_INCLUDED
#define _JSTRING_H_INCLUDED

#ifndef _ENABLE_AUTODEPEND
 #pragma read_only_file
#endif

#ifndef __COMDEF_H_INCLUDED
 #include <_comdef.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __cplusplus
 #ifndef _STDSIZE_T_DEFINED
 #define _STDSIZE_T_DEFINED
  namespace std {
    typedef unsigned size_t;
  }
  typedef std::size_t __w_size_t;
 #endif
 #ifndef _SIZE_T_DEFINED
 #define _SIZE_T_DEFINED
  #define _SIZE_T_DEFINED_
  using std::size_t;
 #endif
#else  /* __cplusplus not defined */
 #ifndef _SIZE_T_DEFINED
 #define _SIZE_T_DEFINED
  #define _SIZE_T_DEFINED_
  typedef unsigned size_t;
  typedef size_t   __w_size_t;
 #endif
#endif /* __cplusplus not defined */

#ifndef NULL
#ifdef __cplusplus
  #define NULL 0
#else
 #ifdef __RDOSDEV__
  #define NULL 0
 #else
  #define NULL ((void *)0)
 #endif
#endif
#endif

/*
 * definitions for chkctype(), nthctype()
 */

#define CT_ANK  0       /* ANK */
#define CT_KJ1  1       /* 漢字第１バイト */
#define CT_KJ2  2       /* 漢字第２バイト */
#define CT_ILGL -1      /* イリーガル */

typedef unsigned char JCHAR;    /* 漢字カナ用ｃｈａｒ(char for Japan) */
typedef JCHAR        *JSTRING;  /* 漢字文字列(string for Japan) */
typedef JCHAR _WCFAR *FJSTRING; /* 漢字 far 文字列(far string for Japan) */
typedef unsigned short JMOJI;   /* 漢字コード(2byte code) */

/*
 *
 *       漢字処理関数用プロトタイプ宣言
 *
 */

_WCRTLINK extern size_t btom( const JCHAR *__s, size_t __nb );
_WCRTLINK extern size_t mtob( const JCHAR *__s, size_t __nm );

_WCRTLINK extern JMOJI hantozen( JMOJI __c );
_WCRTLINK extern JMOJI zentohan( JMOJI __c );

_WCRTLINK extern int chkctype( JCHAR __c, int __n );
_WCRTLINK extern int nthctype( const JCHAR *__s, size_t __n );

_WCRTLINK extern JMOJI jtolower( JMOJI __c );
_WCRTLINK extern JMOJI jtoupper( JMOJI __c );
_WCRTLINK extern JMOJI jtohira( JMOJI __c );
_WCRTLINK extern JMOJI jtokata( JMOJI __c );

_WCRTLINK extern int jisalpha( JMOJI __c );
_WCRTLINK extern int jisdigit( JMOJI __c );
_WCRTLINK extern int jishira( JMOJI __c );
_WCRTLINK extern int jiskana( JMOJI __c );
_WCRTLINK extern int jiskigou( JMOJI __c );
_WCRTLINK extern int jisl0( JMOJI __c );
_WCRTLINK extern int jisl1( JMOJI __c );
_WCRTLINK extern int jisl2( JMOJI __c );
_WCRTLINK extern int jislower( JMOJI __c );
_WCRTLINK extern int jisprint( JMOJI __c );
_WCRTLINK extern int jisspace( JMOJI __c );
_WCRTLINK extern int jisupper( JMOJI __c );
_WCRTLINK extern int jiszen( JMOJI __c );

_WCRTLINK extern JSTRING  jgetmoji( const JCHAR *__s, JMOJI *__c );
_WCRTLINK extern unsigned short jistojms( unsigned short __c );
_WCRTLINK extern unsigned short jmstojis( unsigned short __msc );
_WCRTLINK extern void     jperror( const char *__msg );
_WCRTLINK extern JSTRING  jputmoji( JCHAR *__s, JMOJI __c );
_WCRTLINK extern JSTRING  jstradv( const JCHAR *__s, size_t __n );
_WCRTLINK extern JSTRING  jstrcat( JCHAR *__to, const JCHAR *__from );
_WCRTLINK extern JSTRING  jstrchr( const JCHAR *__s, JMOJI __c );
_WCRTLINK extern int      jstrcmp( const JCHAR *__s1, const JCHAR *__s2 );
_WCRTLINK extern size_t   jstrcspn( const JCHAR *__s1, const JCHAR *__s2 );
_WCRTLINK extern unsigned char *jstrerror( int __errnum );
_WCRTLINK extern int      jstricmp( const JCHAR *__s1, const JCHAR *__s2 );
_WCRTLINK extern size_t   jstrlen( const JCHAR *__s );
_WCRTLINK extern JSTRING  jstrlwr( JCHAR *__s );
_WCRTLINK extern JSTRING  jstrmatch( const JCHAR *__s1, const JCHAR *__s2 );
_WCRTLINK extern JSTRING  jstrncat( JCHAR *__to, const JCHAR *__from, size_t __n );
_WCRTLINK extern int      jstrncmp( const JCHAR *__s1, const JCHAR *__s2, size_t __n );
_WCRTLINK extern JSTRING  jstrncpy( JCHAR *__to, const JCHAR *__from, size_t __n );
_WCRTLINK extern int      jstrnicmp( const JCHAR *__s1, const JCHAR *__s2, size_t __n );
_WCRTLINK extern JSTRING  jstrnset( JCHAR *__s, JMOJI __c, size_t __n );
_WCRTLINK extern JSTRING  jstrrchr( const JCHAR *__s, JMOJI __c );
_WCRTLINK extern JSTRING  jstrrev( JCHAR *__s );
_WCRTLINK extern JSTRING  jstrset( JCHAR *__s, JMOJI __c );
_WCRTLINK extern JSTRING  jstrskip( const JCHAR *__s1, const JCHAR *__s2 );
_WCRTLINK extern size_t   jstrspn( const JCHAR *__s1, const JCHAR *__s2 );
_WCRTLINK extern JSTRING  jstrstr( const JCHAR *__s1, const JCHAR *__s2 );
_WCRTLINK extern JSTRING  jstrtok( JCHAR *__targ, const JCHAR *__brk );
_WCRTLINK extern JSTRING  jstrupr( JCHAR *__s );

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif
