1
/***************************************************************************/
5
/* Embedded resource forks accessor (specification). */
7
/* Copyright 2004 by */
8
/* Masatake YAMATO and Redhat K.K. */
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 */
12
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13
/* this file you indicate that you have read the license and */
14
/* understand and accept it fully. */
16
/***************************************************************************/
18
/***************************************************************************/
19
/* Development of the code in this file is support of */
20
/* Information-technology Promotion Agency, Japan. */
21
/***************************************************************************/
29
#include FT_INTERNAL_OBJECTS_H
35
/* Number of guessing rules supported in `FT_Raccess_Guess'. */
36
/* Don't forget to increment the number if you add a new guessing rule. */
37
#define FT_RACCESS_N_RULES 8
40
/*************************************************************************/
43
/* FT_Raccess_Guess */
46
/* Guess a file name and offset where the actual resource fork is */
47
/* stored. The macro FT_RACCESS_N_RULES holds the number of */
48
/* guessing rules; the guessed result for the Nth rule is */
49
/* represented as a triplet: a new file name (new_names[N]), a file */
50
/* offset (offsets[N]), and an error code (errors[N]). */
54
/* A FreeType library instance. */
57
/* A file stream containing the resource fork. */
60
/* The (base) file name of the resource fork used for some */
65
/* An array of guessed file names in which the resource forks may */
66
/* exist. If `new_names[N]' is NULL, the guessed file name is */
67
/* equal to `base_name'. */
70
/* An array of guessed file offsets. `offsets[N]' holds the file */
71
/* offset of the possible start of the resource fork in file */
75
/* An array of FreeType error codes. `errors[N]' is the error */
76
/* code of Nth guessing rule function. If `errors[N]' is not */
77
/* FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless. */
80
FT_Raccess_Guess( FT_Library library,
88
/*************************************************************************/
91
/* FT_Raccess_Get_HeaderInfo */
94
/* Get the information from the header of resource fork. The */
95
/* information includes the file offset where the resource map */
96
/* starts, and the file offset where the resource data starts. */
97
/* `FT_Raccess_Get_DataOffsets' requires these two data. */
101
/* A FreeType library instance. */
104
/* A file stream containing the resource fork. */
106
/* rfork_offset :: */
107
/* The file offset where the resource fork starts. */
111
/* The file offset where the resource map starts. */
114
/* The file offset where the resource data starts. */
117
/* FreeType error code. FT_Err_Ok means success. */
120
FT_Raccess_Get_HeaderInfo( FT_Library library,
122
FT_Long rfork_offset,
124
FT_Long *rdata_pos );
127
/*************************************************************************/
130
/* FT_Raccess_Get_DataOffsets */
133
/* Get the data offsets for a tag in a resource fork. Offsets are */
134
/* stored in an array because, in some cases, resources in a resource */
135
/* fork have the same tag. */
139
/* A FreeType library instance. */
142
/* A file stream containing the resource fork. */
145
/* The file offset where the resource map starts. */
148
/* The file offset where the resource data starts. */
151
/* The resource tag. */
155
/* The stream offsets for the resource data specified by `tag'. */
156
/* This array is allocated by the function, so you have to call */
157
/* @FT_Free after use. */
160
/* The length of offsets array. */
163
/* FreeType error code. FT_Err_Ok means success. */
166
/* Normally you should use `FT_Raccess_Get_HeaderInfo' to get the */
167
/* value for `map_offset' and `rdata_pos'. */
170
FT_Raccess_Get_DataOffsets( FT_Library library,
181
#endif /* __FTRFORK_H__ */