| 1 |
/* ===EmacsMode: -*- Mode: C; tab-width:4; c-basic-offset: 4; -*- === */ |
| 2 |
/* ===FileName: === |
| 3 |
Copyright (c) 1998 Takuya SHIOZAKI, All Rights reserved. |
| 4 |
Copyright (c) 1998 X-TrueType Server Project, All rights reserved. |
| 5 |
Copyright (c) 2003 After X-TT Project, All rights reserved. |
| 6 |
|
| 7 |
===Notice |
| 8 |
Redistribution and use in source and binary forms, with or without |
| 9 |
modification, are permitted provided that the following conditions |
| 10 |
are met: |
| 11 |
1. Redistributions of source code must retain the above copyright |
| 12 |
notice, this list of conditions and the following disclaimer. |
| 13 |
2. Redistributions in binary form must reproduce the above copyright |
| 14 |
notice, this list of conditions and the following disclaimer in the |
| 15 |
documentation and/or other materials provided with the distribution. |
| 16 |
|
| 17 |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
| 18 |
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 19 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 20 |
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
| 21 |
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 22 |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 23 |
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 24 |
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 25 |
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 26 |
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 27 |
SUCH DAMAGE. |
| 28 |
|
| 29 |
Major Release ID: X-TrueType Server Version 1.3 [Aoi MATSUBARA Release 3] |
| 30 |
|
| 31 |
Notice=== |
| 32 |
*/ |
| 33 |
|
| 34 |
#ifndef _XTTCAP_H_ |
| 35 |
#define _XTTCAP_H_ (1) |
| 36 |
|
| 37 |
#include <X11/Xdefs.h> |
| 38 |
|
| 39 |
/******************************************************************* |
| 40 |
Data Types |
| 41 |
*/ |
| 42 |
|
| 43 |
/* Record Type */ |
| 44 |
typedef enum |
| 45 |
{ |
| 46 |
eRecTypeInteger, |
| 47 |
eRecTypeDouble, |
| 48 |
eRecTypeBool, |
| 49 |
eRecTypeString, |
| 50 |
eRecTypeVoid=-1 |
| 51 |
} ERecType; |
| 52 |
|
| 53 |
/* Record Name vs Record Type */ |
| 54 |
typedef struct |
| 55 |
{ |
| 56 |
char const *strRecordName; |
| 57 |
ERecType const recordType; |
| 58 |
} SPropertyRecord; |
| 59 |
|
| 60 |
/* Record Value Container */ |
| 61 |
typedef struct |
| 62 |
{ |
| 63 |
SPropertyRecord const *refRecordType; |
| 64 |
union { |
| 65 |
int integerValue; |
| 66 |
double doubleValue; |
| 67 |
Bool boolValue; |
| 68 |
char *dynStringValue; |
| 69 |
} uValue; |
| 70 |
} SPropRecValContainerEntityP, *SPropRecValContainer; |
| 71 |
|
| 72 |
/* Record Value List */ |
| 73 |
typedef struct TagSPropRecValListNodeP SPropRecValListNode; |
| 74 |
typedef struct |
| 75 |
{ |
| 76 |
SPropRecValListNode *headNode; |
| 77 |
} SDynPropRecValList; |
| 78 |
typedef SDynPropRecValList const SRefPropRecValList; |
| 79 |
|
| 80 |
|
| 81 |
/******************************************************************* |
| 82 |
Functions |
| 83 |
*/ |
| 84 |
|
| 85 |
/* Constructor for Rec Val List */ |
| 86 |
extern Bool /* True == Error, False == Success */ |
| 87 |
SPropRecValList_new(SDynPropRecValList *pThisList); |
| 88 |
/* Destructor for Rec Val List */ |
| 89 |
extern Bool /* True == Error, False == Success */ |
| 90 |
SPropRecValList_delete(SDynPropRecValList *pThisList); |
| 91 |
/* Read Property File */ |
| 92 |
extern Bool /* True == Error, False == Success */ |
| 93 |
SPropRecValList_read_prop_file(SDynPropRecValList *pThisList, |
| 94 |
char const * const strFileName); |
| 95 |
/* Search Property Record */ |
| 96 |
extern Bool /* True == Hit, False == Miss */ |
| 97 |
SPropRecValList_search_record(SRefPropRecValList *pThisList, |
| 98 |
SPropRecValContainer *refContRecVal, |
| 99 |
char const * const recordName); |
| 100 |
/* Add by Font Cap */ |
| 101 |
extern Bool /* True == Error, False == Success */ |
| 102 |
SPropRecValList_add_by_font_cap(SDynPropRecValList *pThisList, |
| 103 |
char const *strCapHead); |
| 104 |
|
| 105 |
#ifdef DUMP |
| 106 |
void |
| 107 |
SPropRecValList_dump(SRefPropRecValList *refList); |
| 108 |
#endif |
| 109 |
|
| 110 |
#define SPropContainer_value_int(contRecVal)\ |
| 111 |
((contRecVal)->uValue.integerValue) |
| 112 |
#define SPropContainer_value_dbl(contRecVal)\ |
| 113 |
((contRecVal)->uValue.doubleValue) |
| 114 |
#define SPropContainer_value_bool(contRecVal)\ |
| 115 |
((contRecVal)->uValue.boolValue) |
| 116 |
#define SPropContainer_value_str(contRecVal)\ |
| 117 |
((contRecVal)->uValue.dynStringValue) |
| 118 |
|
| 119 |
#endif /* !def _XTTCAP_H_ */ |
| 120 |
|
| 121 |
/* end of file */ |