OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* ftrfork.h */ | 3 /* ftrfork.h */ |
4 /* */ | 4 /* */ |
5 /* Embedded resource forks accessor (specification). */ | 5 /* Embedded resource forks accessor (specification). */ |
6 /* */ | 6 /* */ |
7 /* Copyright 2004, 2006, 2007 by */ | 7 /* Copyright 2004, 2006, 2007 by */ |
8 /* Masatake YAMATO and Redhat K.K. */ | 8 /* Masatake YAMATO and Redhat K.K. */ |
9 /* */ | 9 /* */ |
10 /* This file is part of the FreeType project, and may only be used, */ | 10 /* This file is part of the FreeType project, and may only be used, */ |
(...skipping 30 matching lines...) Expand all Loading... |
41 /* and internal offset. The `POST' resource expects to be concatenated */ | 41 /* and internal offset. The `POST' resource expects to be concatenated */ |
42 /* by the order of resource IDs instead of its appearance in the file. */ | 42 /* by the order of resource IDs instead of its appearance in the file. */ |
43 | 43 |
44 typedef struct FT_RFork_Ref_ | 44 typedef struct FT_RFork_Ref_ |
45 { | 45 { |
46 FT_UShort res_id; | 46 FT_UShort res_id; |
47 FT_ULong offset; | 47 FT_ULong offset; |
48 | 48 |
49 } FT_RFork_Ref; | 49 } FT_RFork_Ref; |
50 | 50 |
| 51 #ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK |
| 52 typedef FT_Error |
| 53 (*ft_raccess_guess_func)( FT_Library library, |
| 54 FT_Stream stream, |
| 55 char *base_file_name, |
| 56 char **result_file_name, |
| 57 FT_Long *result_offset ); |
| 58 |
| 59 typedef enum FT_RFork_Rule_ { |
| 60 FT_RFork_Rule_invalid = -2, |
| 61 FT_RFork_Rule_uknown, /* -1 */ |
| 62 FT_RFork_Rule_apple_double, |
| 63 FT_RFork_Rule_apple_single, |
| 64 FT_RFork_Rule_darwin_ufs_export, |
| 65 FT_RFork_Rule_darwin_newvfs, |
| 66 FT_RFork_Rule_darwin_hfsplus, |
| 67 FT_RFork_Rule_vfat, |
| 68 FT_RFork_Rule_linux_cap, |
| 69 FT_RFork_Rule_linux_double, |
| 70 FT_RFork_Rule_linux_netatalk |
| 71 } FT_RFork_Rule; |
| 72 |
| 73 /* For fast translation between rule index and rule type, |
| 74 * the macros FT_RFORK_xxx should be kept consistent with |
| 75 * the raccess_guess_funcs table |
| 76 */ |
| 77 typedef struct ft_raccess_guess_rec_ { |
| 78 ft_raccess_guess_func func; |
| 79 FT_RFork_Rule type; |
| 80 } ft_raccess_guess_rec; |
| 81 |
| 82 #ifndef FT_CONFIG_OPTION_PIC |
| 83 /* this array is a storage in non-PIC mode, so ; is needed in END */ |
| 84 #define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \ |
| 85 const type name[] = { |
| 86 #define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \ |
| 87 { raccess_guess_##func_suffix, FT_RFork_Rule_##type_suffix }, |
| 88 #define CONST_FT_RFORK_RULE_ARRAY_END }; |
| 89 #else /* FT_CONFIG_OPTION_PIC */ |
| 90 /* this array is a function in PIC mode, so no ; is needed in END */ |
| 91 #define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \ |
| 92 void FT_Init_##name ( type* storage ) { \ |
| 93 type *local = storage; \ |
| 94 int i = 0; |
| 95 #define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \ |
| 96 local[i].func = raccess_guess_##func_suffix; \ |
| 97 local[i].type = FT_RFork_Rule_##type_suffix; \ |
| 98 i++; |
| 99 #define CONST_FT_RFORK_RULE_ARRAY_END } |
| 100 #endif /* FT_CONFIG_OPTION_PIC */ |
| 101 #endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */ |
51 | 102 |
52 /*************************************************************************/ | 103 /*************************************************************************/ |
53 /* */ | 104 /* */ |
54 /* <Function> */ | 105 /* <Function> */ |
55 /* FT_Raccess_Guess */ | 106 /* FT_Raccess_Guess */ |
56 /* */ | 107 /* */ |
57 /* <Description> */ | 108 /* <Description> */ |
58 /* Guess a file name and offset where the actual resource fork is */ | 109 /* Guess a file name and offset where the actual resource fork is */ |
59 /* stored. The macro FT_RACCESS_N_RULES holds the number of */ | 110 /* stored. The macro FT_RACCESS_N_RULES holds the number of */ |
60 /* guessing rules; the guessed result for the Nth rule is */ | 111 /* guessing rules; the guessed result for the Nth rule is */ |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 FT_Long **offsets, | 238 FT_Long **offsets, |
188 FT_Long *count ); | 239 FT_Long *count ); |
189 | 240 |
190 | 241 |
191 FT_END_HEADER | 242 FT_END_HEADER |
192 | 243 |
193 #endif /* __FTRFORK_H__ */ | 244 #endif /* __FTRFORK_H__ */ |
194 | 245 |
195 | 246 |
196 /* END */ | 247 /* END */ |
OLD | NEW |