windows-nt/Source/XPSP1/NT/drivers/tpg/hwx/bear/inc/triads.h

204 lines
11 KiB
C
Raw Permalink Normal View History

2020-09-26 03:20:57 -05:00
/* ************************************************************************ */
/* * DTI header file Created by AVP 3-94. Modified 9-94 * */
/* ************************************************************************ */
#ifndef TRIADS_H_INCLUDED
#define TRIADS_H_INCLUDED
#include "ams_mg.h"
/* -------------------------- Defines for Triads ----------------------------- */
#define TR_NUMSYMBOLS 40
#define TR_OBJTYPE "Tr#3" /* Object type of current TR */
#define TR_LANG "Eng." /* Object type of current TR */
#define TR_VER "1.00" /* Object type of current TR */
#define TR_ID_LEN 4 /* Length of ID string in TR */
#define TR_FNAME_LEN 128 /* Pathname of dti len */
#define TR_NUMINBYTE 4 /* Number of triad values in one byte */
#define TR_GETVALUE(ptrd, a, b, c) (((*(ptrd))[(a)][(b)][(c)/4] >> (((c)%4)*2)) & 0x03) /* Get freq value from triads */
#ifdef FOR_GERMAN
#define DEF_TRIADS_MAPPING \
{ \
/* 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 2 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 3 */ 0, 0, 1, 0, 0, 0, 0, 0, 0, 40, \
/* 4 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 5 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 6 */ 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, \
/* 7 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
/* 8 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, \
/* 9 */ 27, 0, 0, 0, 0, 0, 0, 2, 3, 4, \
/* 10 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, \
/* 11 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, \
/* 12 */ 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, \
/* 13 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 14 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 15 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 16 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 17 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 18 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 19 */ 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, \
/* 20 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 21 */ 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, \
/* 22 */ 31, 0, 0, 32, 0, 0, 0, 0, 29, 0, \
/* 23 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 24 */ 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, \
/* 25 */ 0, 0, 31, 0, 0, 0 \
}
#elif defined(FOR_SWED)
#error Check coding -- it is MAC now!
#define DEF_TRIADS_MAPPING \
{ \
/* 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 2 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 3 */ 0, 0, 1, 0, 0, 0, 0, 0, 0, 40, \
/* 4 */ 0, 0, 0, 0, 0, 0, 99, 99, 0, 0, \
/* 5 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 6 */ 0, 0, 0, 0, 99, 2, 3, 4, 5, 6, \
/* 7 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
/* 8 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, \
/* 9 */ 27, 0, 99, 0, 0, 0, 0, 2, 3, 4, \
/* 10 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, \
/* 11 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, \
/* 12 */ 25, 26, 27, 0, 0, 0, 0, 0, 29, 28, \
/* 13 */ 30, 31, 15, 33, 34, 2, 29, 35, 29, 2, \
/* 14 */ 28, 30, 31, 36, 37, 6, 10, 10, 38, 32, \
/* 15 */ 15, 16, 16, 33, 33, 16, 22, 34, 39, 34, \
/* 16 */ 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, \
/* 17 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 18 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 19 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 20 */ 0, 0, 0, 29, 2, 16, 0, 0, 0, 0, \
/* 21 */ 0, 0, 0, 0, 0, 0, 26, 26, 0, 0, \
/* 22 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, \
/* 23 */ 37, 2, 6, 36, 9, 38, 32, 9, 16, 33, \
/* 24 */ 0, 16, 22, 39, 34, 0, 0, 0, 0, 0, \
/* 25 */ 0, 0, 0, 0, 0, 0 \
}
#elif defined(FOR_FRENCH)
#define DEF_TRIADS_MAPPING \
{ \
/* 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 2 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 3 */ 0, 0, 1, 0, 0, 0, 0, 0, 0, 40, \
/* 4 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 5 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 6 */ 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, \
/* 7 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
/* 8 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, \
/* 9 */ 27, 0, 0, 0, 0, 0, 0, 2, 3, 4, \
/* 10 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, \
/* 11 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, \
/* 12 */ 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, \
/* 13 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 14 */ 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 15 */ 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, \
/* 16 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 17 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 18 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 19 */ 0, 0, 29, 0, 35, 0, 0, 0, 0, 30, \
/* 20 */ 36, 31, 37, 28, 0, 0, 38, 32, 0, 0, \
/* 21 */ 0, 0, 33, 0, 0, 0, 0, 34, 0, 39, \
/* 22 */ 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, \
/* 23 */ 0, 30, 36, 31, 37, 28, 0, 0, 38, 32, \
/* 24 */ 0, 0, 0, 29, 33, 0, 0, 0, 0, 34, \
/* 25 */ 0, 39, 0, 0, 0, 0 \
}
#else /* !FOR_GERMAN && !FOR_SWED && !FOR_FRENCH */
#define DEF_TRIADS_MAPPING \
{ \
/* 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 2 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 3 */ 0, 0, 1, 0, 0, 0, 0, 0, 0, 40, \
/* 4 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 5 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 6 */ 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, \
/* 7 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
/* 8 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, \
/* 9 */ 27, 0, 0, 0, 0, 0, 0, 2, 3, 4, \
/* 10 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, \
/* 11 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, \
/* 12 */ 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, \
/* 13 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 14 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 15 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 16 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 17 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 18 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 19 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 20 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 21 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 22 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 23 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 24 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* 25 */ 0, 0, 0, 0, 0, 0 \
}
#endif /* FOR_GERMAN etc. */
/* -------------------------- Types definitions ------------------------------ */
typedef _UCHAR triad_el_type[TR_NUMSYMBOLS/TR_NUMINBYTE]; /* There are *some* tr in byte ! */
typedef triad_el_type triad_type[TR_NUMSYMBOLS][TR_NUMSYMBOLS];
typedef triad_type _PTR p_triad_type;
typedef struct { /* Header of Triads file */
_CHAR object_type[TR_ID_LEN]; /* Type file (now Tr#2) */
_CHAR type[TR_ID_LEN]; /* Type of TR (Eng., ) */
_CHAR version[TR_ID_LEN]; /* Version number */
_ULONG tr_offset; /* File offset of TR part */
_ULONG tr_len; /* Length of TR part of data */
_ULONG tr_chsum; /* Checksum of TR part */
} tr_header_type, _PTR p_tr_header_type;
typedef struct { /* TR memory descriptor */
_CHAR tr_fname[TR_FNAME_LEN]; /* File name of loaded TR */
_CHAR object_type[TR_ID_LEN]; /* Type file (now Tr#1) */
_CHAR type[TR_ID_LEN]; /* Type of TR (Eng., ..) */
_CHAR version[TR_ID_LEN]; /* Version number */
_ULONG h_tr; /* Handle of tr memory */
p_UCHAR p_tr; /* Pointer to locked tr mem */
_ULONG tr_chsum; /* CheckSum of tr memory */
} tr_descr_type, _PTR p_tr_descr_type;
/* -------------------------- Prototypes ------------------------------------- */
_INT triads_load(p_CHAR tradsname, _INT what_to_load, p_VOID _PTR tp);
_INT triads_unload(p_VOID _PTR tp);
_INT triads_save(p_CHAR fname, _INT what_to_save, p_VOID tp);
_INT triads_lock(p_VOID tp);
_INT triads_unlock(p_VOID tp);
/* ---------- Global constants definitions ----------------------------------- */
#ifndef ParaLibs_j_c
ROM_DATA_EXTERNAL _UCHAR triads_mapping[256];
#endif
/* --------------------------------------------------------------------------- */
#endif //TRIADS_H_INCLUDED
/* ************************************************************************ */
/* * End Of All ... * */
/* ************************************************************************ */