vrshoot

diff libs/ft2static/freetype/internal/ftrfork.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libs/ft2static/freetype/internal/ftrfork.h	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,196 @@
     1.4 +/***************************************************************************/
     1.5 +/*                                                                         */
     1.6 +/*  ftrfork.h                                                              */
     1.7 +/*                                                                         */
     1.8 +/*    Embedded resource forks accessor (specification).                    */
     1.9 +/*                                                                         */
    1.10 +/*  Copyright 2004, 2006, 2007 by                                          */
    1.11 +/*  Masatake YAMATO and Redhat K.K.                                        */
    1.12 +/*                                                                         */
    1.13 +/*  This file is part of the FreeType project, and may only be used,       */
    1.14 +/*  modified, and distributed under the terms of the FreeType project      */
    1.15 +/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
    1.16 +/*  this file you indicate that you have read the license and              */
    1.17 +/*  understand and accept it fully.                                        */
    1.18 +/*                                                                         */
    1.19 +/***************************************************************************/
    1.20 +
    1.21 +/***************************************************************************/
    1.22 +/* Development of the code in this file is support of                      */
    1.23 +/* Information-technology Promotion Agency, Japan.                         */
    1.24 +/***************************************************************************/
    1.25 +
    1.26 +
    1.27 +#ifndef __FTRFORK_H__
    1.28 +#define __FTRFORK_H__
    1.29 +
    1.30 +
    1.31 +#include <ft2build.h>
    1.32 +#include FT_INTERNAL_OBJECTS_H
    1.33 +
    1.34 +
    1.35 +FT_BEGIN_HEADER
    1.36 +
    1.37 +
    1.38 +  /* Number of guessing rules supported in `FT_Raccess_Guess'.            */
    1.39 +  /* Don't forget to increment the number if you add a new guessing rule. */
    1.40 +#define FT_RACCESS_N_RULES  9
    1.41 +
    1.42 +
    1.43 +  /* A structure to describe a reference in a resource by its resource ID */
    1.44 +  /* and internal offset.  The `POST' resource expects to be concatenated */
    1.45 +  /* by the order of resource IDs instead of its appearance in the file.  */
    1.46 +
    1.47 +  typedef struct  FT_RFork_Ref_
    1.48 +  {
    1.49 +    FT_UShort  res_id;
    1.50 +    FT_ULong   offset;
    1.51 +
    1.52 +  } FT_RFork_Ref;
    1.53 +
    1.54 +
    1.55 +  /*************************************************************************/
    1.56 +  /*                                                                       */
    1.57 +  /* <Function>                                                            */
    1.58 +  /*    FT_Raccess_Guess                                                   */
    1.59 +  /*                                                                       */
    1.60 +  /* <Description>                                                         */
    1.61 +  /*    Guess a file name and offset where the actual resource fork is     */
    1.62 +  /*    stored.  The macro FT_RACCESS_N_RULES holds the number of          */
    1.63 +  /*    guessing rules;  the guessed result for the Nth rule is            */
    1.64 +  /*    represented as a triplet: a new file name (new_names[N]), a file   */
    1.65 +  /*    offset (offsets[N]), and an error code (errors[N]).                */
    1.66 +  /*                                                                       */
    1.67 +  /* <Input>                                                               */
    1.68 +  /*    library ::                                                         */
    1.69 +  /*      A FreeType library instance.                                     */
    1.70 +  /*                                                                       */
    1.71 +  /*    stream ::                                                          */
    1.72 +  /*      A file stream containing the resource fork.                      */
    1.73 +  /*                                                                       */
    1.74 +  /*    base_name ::                                                       */
    1.75 +  /*      The (base) file name of the resource fork used for some          */
    1.76 +  /*      guessing rules.                                                  */
    1.77 +  /*                                                                       */
    1.78 +  /* <Output>                                                              */
    1.79 +  /*    new_names ::                                                       */
    1.80 +  /*      An array of guessed file names in which the resource forks may   */
    1.81 +  /*      exist.  If `new_names[N]' is NULL, the guessed file name is      */
    1.82 +  /*      equal to `base_name'.                                            */
    1.83 +  /*                                                                       */
    1.84 +  /*    offsets ::                                                         */
    1.85 +  /*      An array of guessed file offsets.  `offsets[N]' holds the file   */
    1.86 +  /*      offset of the possible start of the resource fork in file        */
    1.87 +  /*      `new_names[N]'.                                                  */
    1.88 +  /*                                                                       */
    1.89 +  /*    errors ::                                                          */
    1.90 +  /*      An array of FreeType error codes.  `errors[N]' is the error      */
    1.91 +  /*      code of Nth guessing rule function.  If `errors[N]' is not       */
    1.92 +  /*      FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless.      */
    1.93 +  /*                                                                       */
    1.94 +  FT_BASE( void )
    1.95 +  FT_Raccess_Guess( FT_Library  library,
    1.96 +                    FT_Stream   stream,
    1.97 +                    char*       base_name,
    1.98 +                    char**      new_names,
    1.99 +                    FT_Long*    offsets,
   1.100 +                    FT_Error*   errors );
   1.101 +
   1.102 +
   1.103 +  /*************************************************************************/
   1.104 +  /*                                                                       */
   1.105 +  /* <Function>                                                            */
   1.106 +  /*    FT_Raccess_Get_HeaderInfo                                          */
   1.107 +  /*                                                                       */
   1.108 +  /* <Description>                                                         */
   1.109 +  /*    Get the information from the header of resource fork.  The         */
   1.110 +  /*    information includes the file offset where the resource map        */
   1.111 +  /*    starts, and the file offset where the resource data starts.        */
   1.112 +  /*    `FT_Raccess_Get_DataOffsets' requires these two data.              */
   1.113 +  /*                                                                       */
   1.114 +  /* <Input>                                                               */
   1.115 +  /*    library ::                                                         */
   1.116 +  /*      A FreeType library instance.                                     */
   1.117 +  /*                                                                       */
   1.118 +  /*    stream ::                                                          */
   1.119 +  /*      A file stream containing the resource fork.                      */
   1.120 +  /*                                                                       */
   1.121 +  /*    rfork_offset ::                                                    */
   1.122 +  /*      The file offset where the resource fork starts.                  */
   1.123 +  /*                                                                       */
   1.124 +  /* <Output>                                                              */
   1.125 +  /*    map_offset ::                                                      */
   1.126 +  /*      The file offset where the resource map starts.                   */
   1.127 +  /*                                                                       */
   1.128 +  /*    rdata_pos ::                                                       */
   1.129 +  /*      The file offset where the resource data starts.                  */
   1.130 +  /*                                                                       */
   1.131 +  /* <Return>                                                              */
   1.132 +  /*    FreeType error code.  FT_Err_Ok means success.                     */
   1.133 +  /*                                                                       */
   1.134 +  FT_BASE( FT_Error )
   1.135 +  FT_Raccess_Get_HeaderInfo( FT_Library  library,
   1.136 +                             FT_Stream   stream,
   1.137 +                             FT_Long     rfork_offset,
   1.138 +                             FT_Long    *map_offset,
   1.139 +                             FT_Long    *rdata_pos );
   1.140 +
   1.141 +
   1.142 +  /*************************************************************************/
   1.143 +  /*                                                                       */
   1.144 +  /* <Function>                                                            */
   1.145 +  /*    FT_Raccess_Get_DataOffsets                                         */
   1.146 +  /*                                                                       */
   1.147 +  /* <Description>                                                         */
   1.148 +  /*    Get the data offsets for a tag in a resource fork.  Offsets are    */
   1.149 +  /*    stored in an array because, in some cases, resources in a resource */
   1.150 +  /*    fork have the same tag.                                            */
   1.151 +  /*                                                                       */
   1.152 +  /* <Input>                                                               */
   1.153 +  /*    library ::                                                         */
   1.154 +  /*      A FreeType library instance.                                     */
   1.155 +  /*                                                                       */
   1.156 +  /*    stream ::                                                          */
   1.157 +  /*      A file stream containing the resource fork.                      */
   1.158 +  /*                                                                       */
   1.159 +  /*    map_offset ::                                                      */
   1.160 +  /*      The file offset where the resource map starts.                   */
   1.161 +  /*                                                                       */
   1.162 +  /*    rdata_pos ::                                                       */
   1.163 +  /*      The file offset where the resource data starts.                  */
   1.164 +  /*                                                                       */
   1.165 +  /*    tag ::                                                             */
   1.166 +  /*      The resource tag.                                                */
   1.167 +  /*                                                                       */
   1.168 +  /* <Output>                                                              */
   1.169 +  /*    offsets ::                                                         */
   1.170 +  /*      The stream offsets for the resource data specified by `tag'.     */
   1.171 +  /*      This array is allocated by the function, so you have to call     */
   1.172 +  /*      @ft_mem_free after use.                                          */
   1.173 +  /*                                                                       */
   1.174 +  /*    count ::                                                           */
   1.175 +  /*      The length of offsets array.                                     */
   1.176 +  /*                                                                       */
   1.177 +  /* <Return>                                                              */
   1.178 +  /*    FreeType error code.  FT_Err_Ok means success.                     */
   1.179 +  /*                                                                       */
   1.180 +  /* <Note>                                                                */
   1.181 +  /*    Normally you should use `FT_Raccess_Get_HeaderInfo' to get the     */
   1.182 +  /*    value for `map_offset' and `rdata_pos'.                            */
   1.183 +  /*                                                                       */
   1.184 +  FT_BASE( FT_Error )
   1.185 +  FT_Raccess_Get_DataOffsets( FT_Library  library,
   1.186 +                              FT_Stream   stream,
   1.187 +                              FT_Long     map_offset,
   1.188 +                              FT_Long     rdata_pos,
   1.189 +                              FT_Long     tag,
   1.190 +                              FT_Long   **offsets,
   1.191 +                              FT_Long    *count );
   1.192 +
   1.193 +
   1.194 +FT_END_HEADER
   1.195 +
   1.196 +#endif /* __FTRFORK_H__ */
   1.197 +
   1.198 +
   1.199 +/* END */