sj4/include/sj3core/Struct.h

167 lines
3.5 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: Struct.h,v $
* $SonyRevision: 1.3 $
2008-01-11 11:57:08 +00:00
* $SonyDate: 1994/10/21 05:13:34 $
*/
#ifndef STRUCT_H
#define STRUCT_H
typedef struct global {
2026-06-19 01:49:53 +09:00
JREC* Jmaxjptr;
CLREC* Jmaxclptr;
JREC* Jjrt1st;
CLREC* Jclt1st;
JREC* Jjrt2nd;
CLREC* Jclt2nd;
CLREC* Jselcl;
short Jselectid;
short Jtrank;
short Jnrank;
u_char* Jinputyomi;
u_char* Jcnvstart;
2008-01-11 11:57:08 +00:00
short Jcnvlen;
2026-06-19 01:49:53 +09:00
u_char* Jystart;
2008-01-11 11:57:08 +00:00
u_char Jhyomi[MAXPHINPUTLEN + 1];
2026-06-19 01:49:53 +09:00
u_char Jorgyomi[MAXCLINPUTLEN * 2 + 1];
2008-01-11 11:57:08 +00:00
u_char Jkanjibuf[MINPHOUTPUTLEN];
2026-06-19 01:49:53 +09:00
u_char* Jkanjipos;
u_char* Jkanjitmp;
2008-01-11 11:57:08 +00:00
short Jkanjilen;
2026-06-19 01:49:53 +09:00
u_char Jdicinl;
u_char Jdicsaml;
TypeDicSeg Jprevseg;
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
u_char Jfzkcount;
u_char Jfzk_ka_flg;
FREC Jfzktbl[MAXFREC];
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
u_char Jheadcode;
u_char Jheadlen;
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
u_char Jgobilen;
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
TypeGram Jprevclgrm;
TypeCnct Jprevclrow;
u_char Jnextcllen;
2008-01-11 11:57:08 +00:00
short Jkhcount;
short Jnkhcount;
KHREC Jkouhotbl[MAXKOUHONUMBER];
2026-06-19 01:49:53 +09:00
STDYIN* Jstdytop;
DICT* Jcurdict;
DICTL* Jdictlist;
u_char* Jdicbuf;
u_char* Jidxbuf;
TypeIdxOfs* Jidxofs;
u_char* Jaskknj[MAXKNJASKNUMBER];
u_char* Jaskknj_k[MAXKNJASKNUMBER];
STDY* Jcurstdy;
u_short Jsuuji_wbuf[NUMWORDBUF];
u_char Jsuuji_ubuf[NUMKETALENGTH];
TypeClass Jsuuji_class;
u_char Jsuuji_comma;
u_char Jsuuji_keta;
u_char* Jsuuji_yptr;
u_char Jsuuji_len;
u_char Jsuuji_exit;
u_short* Jsuuji_wkeep;
u_char* Jsuuji_ukeep;
u_char Jpeepyomi[MAXWDYOMILEN * 2 + 1];
u_char Jpeepknj[MAXWDKANJILEN + 1];
TypeGram Jpeepgrm;
u_char* Jpeepdptr;
u_char* Jpeephptr;
u_char* Jpeepkptr;
TypeDicSeg Jpeepidx;
2008-01-11 11:57:08 +00:00
} Global;
2026-06-19 01:49:53 +09:00
typedef struct dictfile {
DICT dict;
int refcnt;
2026-06-19 01:31:17 +09:00
#ifdef SJ3_LOCK
2026-06-19 01:49:53 +09:00
fd_set lock;
2026-06-19 01:31:17 +09:00
#endif
2026-06-19 01:49:53 +09:00
FILE* fp;
int fd;
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
u_char* buffer;
long bufsiz;
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
long idxstrt;
long segstrt;
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
TypeIdxOfs* ofsptr;
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
struct dictfile* link;
2008-01-11 11:57:08 +00:00
} DictFile;
2026-06-19 01:49:53 +09:00
typedef struct stdyfile {
STDY stdy;
int refcnt;
ino_t inode;
FILE* fp;
int fd;
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
u_char* header;
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
struct stdyfile* link;
2008-01-11 11:57:08 +00:00
} StdyFile;
2026-06-19 01:49:53 +09:00
typedef struct workarea {
int refcnt;
int lock;
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
struct workarea* link;
2008-01-11 11:57:08 +00:00
2026-06-19 01:49:53 +09:00
Global global;
2008-01-11 11:57:08 +00:00
} WorkArea;
2026-06-19 21:48:44 +09:00
typedef struct sj3context {
Global* work;
STDY* stdy;
2026-06-20 01:21:01 +09:00
JREC* jrec_free;
JREC* jrec_pool;
CLREC* clrec_free;
CLREC* clrec_pool;
2026-06-19 21:48:44 +09:00
} Sj3Context;
2008-01-11 11:57:08 +00:00
#endif