sj4/include/sj3core/sj_dict.h

88 lines
2.6 KiB
C
Raw Normal View History

2008-01-11 11:57:08 +00:00
/*
* Copyright (c) 1991-1994 Sony Corporation
2026-06-19 01:49:53 +09:00
*
2008-01-11 11:57:08 +00:00
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
2026-06-19 01:49:53 +09:00
*
2008-01-11 11:57:08 +00:00
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
2026-06-19 01:49:53 +09:00
*
2008-01-11 11:57:08 +00:00
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL SONY CORPORATION BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2026-06-19 01:49:53 +09:00
*
2008-01-11 11:57:08 +00:00
* Except as contained in this notice, the name of Sony Corporation
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* from Sony Corporation.
*
*/
/*
2026-06-19 01:49:53 +09:00
* $SonyRCSfile: sj_dict.h,v $
* $SonyRevision: 1.1 $
2008-01-11 11:57:08 +00:00
* $SonyDate: 1994/06/03 08:01:03 $
*/
2026-06-19 01:49:53 +09:00
#ifndef _SJ_DICT
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
#define _SJ_DICT
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
#define DIC_MAIN 0
#define DIC_USER 1
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
#define DICSEGBASE 0
#define MAXDOUONBLK 0xfff
#define DOUONBLKSIZENUMBER 3
#define DICSEGTERM 0xff
#define DOUONBLKTERM 0xff
#define HINSIBLKTERM 0xff
#define MAXSEGMENTNUMBER 0xffff
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
#define NORMALKANJIMASK 0x7f
#define SS3KANJI 0x0080
#define ZENHIRAASSYUKU 0x80
#define OFFSETASSYUKU 0x90
#define ZENKATAASSYUKU 0xa0
#define AIATTRIBUTE 0xb0
#define KANJIASSYUKU 0xc0
#define LEADINGHANKAKU 0xd0
#define KANJISTREND 0x00
#define ISASSYUKU 0x80
#define ASSUKUUSE2BYTE 0x90
#define KNJASSYUKUMASK 0x0f
#define KANJICODEMASK 0x0f
#define KANJIMODEMASK 0xf0
#define ATRMSKANJIOFS 0xc0c0
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
#define MAXKNJASKNUMBER 16
#define MAXYOMIASKNUMBER 16
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
#define MAXWDYOMILEN 31
#define MAXWDKANJILEN 64
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
#define ASSYUKUYOMITOP 0x80
#define NOKORIYOMITOP 0x40
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
#define getsize(p) (((int)(*(p) & 0x0f) * 0x100) + *((p) + 1))
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
#define getntag(p) ((*(p) == DICSEGTERM) ? (p) : (p) + getsize(p))
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
#define getplen(p) (((*(p) & ASSYUKUYOMITOP) ? 0x10 : 0) + (*((p) + 2) >> 4))
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
#define getnlen(p) (((*(p) & NOKORIYOMITOP) ? 0x10 : 0) + (*((p) + 2) & 0x0f))
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
#define segtop() (dicbuf + *dicbuf + 1)
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
#define segend(p) (*(p) == DICSEGTERM || (p) >= dicbuf + curdict->seglen)
2008-01-11 11:57:08 +00:00
#endif