| 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, 2012 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, */ |
| 11 /* modified, and distributed under the terms of the FreeType project */ | 11 /* modified, and distributed under the terms of the FreeType project */ |
| 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
| 13 /* this file you indicate that you have read the license and */ | 13 /* this file you indicate that you have read the license and */ |
| 14 /* understand and accept it fully. */ | 14 /* understand and accept it fully. */ |
| 15 /* */ | 15 /* */ |
| 16 /***************************************************************************/ | 16 /***************************************************************************/ |
| 17 | 17 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 /* For fast translation between rule index and rule type, | 73 /* For fast translation between rule index and rule type, |
| 74 * the macros FT_RFORK_xxx should be kept consistent with | 74 * the macros FT_RFORK_xxx should be kept consistent with |
| 75 * the raccess_guess_funcs table | 75 * the raccess_guess_funcs table |
| 76 */ | 76 */ |
| 77 typedef struct ft_raccess_guess_rec_ { | 77 typedef struct ft_raccess_guess_rec_ { |
| 78 ft_raccess_guess_func func; | 78 ft_raccess_guess_func func; |
| 79 FT_RFork_Rule type; | 79 FT_RFork_Rule type; |
| 80 } ft_raccess_guess_rec; | 80 } ft_raccess_guess_rec; |
| 81 | 81 |
| 82 #ifndef FT_CONFIG_OPTION_PIC | 82 #ifndef FT_CONFIG_OPTION_PIC |
| 83 |
| 83 /* this array is a storage in non-PIC mode, so ; is needed in END */ | 84 /* 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 #define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \ |
| 85 const type name[] = { | 86 const type name[] = { |
| 86 #define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \ | 87 #define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \ |
| 87 { raccess_guess_##func_suffix, FT_RFork_Rule_##type_suffix }, | 88 { raccess_guess_ ## func_suffix, \ |
| 88 #define CONST_FT_RFORK_RULE_ARRAY_END }; | 89 FT_RFork_Rule_ ## type_suffix }, |
| 90 #define CONST_FT_RFORK_RULE_ARRAY_END }; |
| 91 |
| 89 #else /* FT_CONFIG_OPTION_PIC */ | 92 #else /* FT_CONFIG_OPTION_PIC */ |
| 93 |
| 90 /* this array is a function in PIC mode, so no ; is needed in END */ | 94 /* this array is a function in PIC mode, so no ; is needed in END */ |
| 91 #define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \ | 95 #define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \ |
| 92 void FT_Init_##name ( type* storage ) { \ | 96 void \ |
| 93 type *local = storage; \ | 97 FT_Init_ ## name( type* storage ) \ |
| 94 int i = 0; | 98 { \ |
| 95 #define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \ | 99 type* local = storage; \ |
| 96 local[i].func = raccess_guess_##func_suffix; \ | 100 \ |
| 97 local[i].type = FT_RFork_Rule_##type_suffix; \ | 101 \ |
| 98 i++; | 102 int i = 0; |
| 99 #define CONST_FT_RFORK_RULE_ARRAY_END } | 103 #define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \ |
| 104 local[i].func = raccess_guess_ ## func_suffix; \ |
| 105 local[i].type = FT_RFork_Rule_ ## type_suffix; \ |
| 106 i++; |
| 107 #define CONST_FT_RFORK_RULE_ARRAY_END } |
| 108 |
| 100 #endif /* FT_CONFIG_OPTION_PIC */ | 109 #endif /* FT_CONFIG_OPTION_PIC */ |
| 110 |
| 101 #endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */ | 111 #endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */ |
| 102 | 112 |
| 113 |
| 103 /*************************************************************************/ | 114 /*************************************************************************/ |
| 104 /* */ | 115 /* */ |
| 105 /* <Function> */ | 116 /* <Function> */ |
| 106 /* FT_Raccess_Guess */ | 117 /* FT_Raccess_Guess */ |
| 107 /* */ | 118 /* */ |
| 108 /* <Description> */ | 119 /* <Description> */ |
| 109 /* Guess a file name and offset where the actual resource fork is */ | 120 /* Guess a file name and offset where the actual resource fork is */ |
| 110 /* stored. The macro FT_RACCESS_N_RULES holds the number of */ | 121 /* stored. The macro FT_RACCESS_N_RULES holds the number of */ |
| 111 /* guessing rules; the guessed result for the Nth rule is */ | 122 /* guessing rules; the guessed result for the Nth rule is */ |
| 112 /* represented as a triplet: a new file name (new_names[N]), a file */ | 123 /* represented as a triplet: a new file name (new_names[N]), a file */ |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 FT_Long **offsets, | 249 FT_Long **offsets, |
| 239 FT_Long *count ); | 250 FT_Long *count ); |
| 240 | 251 |
| 241 | 252 |
| 242 FT_END_HEADER | 253 FT_END_HEADER |
| 243 | 254 |
| 244 #endif /* __FTRFORK_H__ */ | 255 #endif /* __FTRFORK_H__ */ |
| 245 | 256 |
| 246 | 257 |
| 247 /* END */ | 258 /* END */ |
| OLD | NEW |