ftrfork.h
上传用户:yisoukefu
上传日期:2020-08-09
资源大小:39506k
文件大小:11k
源码类别:

其他游戏

开发平台:

Visual C++

  1. /***************************************************************************/
  2. /*                                                                         */
  3. /*  ftrfork.h                                                              */
  4. /*                                                                         */
  5. /*    Embedded resource forks accessor (specification).                    */
  6. /*                                                                         */
  7. /*  Copyright 2004, 2006 by                                                */
  8. /*  Masatake YAMATO and Redhat K.K.                                        */
  9. /*                                                                         */
  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.                                        */
  15. /*                                                                         */
  16. /***************************************************************************/
  17. /***************************************************************************/
  18. /* Development of the code in this file is support of                      */
  19. /* Information-technology Promotion Agency, Japan.                         */
  20. /***************************************************************************/
  21. #ifndef __FTRFORK_H__
  22. #define __FTRFORK_H__
  23. #include <ft2build.h>
  24. #include FT_INTERNAL_OBJECTS_H
  25. FT_BEGIN_HEADER
  26.   /* Number of guessing rules supported in `FT_Raccess_Guess'.            */
  27.   /* Don't forget to increment the number if you add a new guessing rule. */
  28. #define FT_RACCESS_N_RULES  8
  29.   /*************************************************************************/
  30.   /*                                                                       */
  31.   /* <Function>                                                            */
  32.   /*    FT_Raccess_Guess                                                   */
  33.   /*                                                                       */
  34.   /* <Description>                                                         */
  35.   /*    Guess a file name and offset where the actual resource fork is     */
  36.   /*    stored.  The macro FT_RACCESS_N_RULES holds the number of          */
  37.   /*    guessing rules;  the guessed result for the Nth rule is            */
  38.   /*    represented as a triplet: a new file name (new_names[N]), a file   */
  39.   /*    offset (offsets[N]), and an error code (errors[N]).                */
  40.   /*                                                                       */
  41.   /* <Input>                                                               */
  42.   /*    library ::                                                         */
  43.   /*      A FreeType library instance.                                     */
  44.   /*                                                                       */
  45.   /*    stream ::                                                          */
  46.   /*      A file stream containing the resource fork.                      */
  47.   /*                                                                       */
  48.   /*    base_name ::                                                       */
  49.   /*      The (base) file name of the resource fork used for some          */
  50.   /*      guessing rules.                                                  */
  51.   /*                                                                       */
  52.   /* <Output>                                                              */
  53.   /*    new_names ::                                                       */
  54.   /*      An array of guessed file names in which the resource forks may   */
  55.   /*      exist.  If `new_names[N]' is NULL, the guessed file name is      */
  56.   /*      equal to `base_name'.                                            */
  57.   /*                                                                       */
  58.   /*    offsets ::                                                         */
  59.   /*      An array of guessed file offsets.  `offsets[N]' holds the file   */
  60.   /*      offset of the possible start of the resource fork in file        */
  61.   /*      `new_names[N]'.                                                  */
  62.   /*                                                                       */
  63.   /*    errors ::                                                          */
  64.   /*      An array of FreeType error codes.  `errors[N]' is the error      */
  65.   /*      code of Nth guessing rule function.  If `errors[N]' is not       */
  66.   /*      FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless.      */
  67.   /*                                                                       */
  68.   FT_BASE( void )
  69.   FT_Raccess_Guess( FT_Library  library,
  70.                     FT_Stream   stream,
  71.                     char*       base_name,
  72.                     char**      new_names,
  73.                     FT_Long*    offsets,
  74.                     FT_Error*   errors );
  75.   /*************************************************************************/
  76.   /*                                                                       */
  77.   /* <Function>                                                            */
  78.   /*    FT_Raccess_Get_HeaderInfo                                          */
  79.   /*                                                                       */
  80.   /* <Description>                                                         */
  81.   /*    Get the information from the header of resource fork.  The         */
  82.   /*    information includes the file offset where the resource map        */
  83.   /*    starts, and the file offset where the resource data starts.        */
  84.   /*    `FT_Raccess_Get_DataOffsets' requires these two data.              */
  85.   /*                                                                       */
  86.   /* <Input>                                                               */
  87.   /*    library ::                                                         */
  88.   /*      A FreeType library instance.                                     */
  89.   /*                                                                       */
  90.   /*    stream ::                                                          */
  91.   /*      A file stream containing the resource fork.                      */
  92.   /*                                                                       */
  93.   /*    rfork_offset ::                                                    */
  94.   /*      The file offset where the resource fork starts.                  */
  95.   /*                                                                       */
  96.   /* <Output>                                                              */
  97.   /*    map_offset ::                                                      */
  98.   /*      The file offset where the resource map starts.                   */
  99.   /*                                                                       */
  100.   /*    rdata_pos ::                                                       */
  101.   /*      The file offset where the resource data starts.                  */
  102.   /*                                                                       */
  103.   /* <Return>                                                              */
  104.   /*    FreeType error code.  FT_Err_Ok means success.                     */
  105.   /*                                                                       */
  106.   FT_BASE( FT_Error )
  107.   FT_Raccess_Get_HeaderInfo( FT_Library  library,
  108.                              FT_Stream   stream,
  109.                              FT_Long     rfork_offset,
  110.                              FT_Long    *map_offset,
  111.                              FT_Long    *rdata_pos );
  112.   /*************************************************************************/
  113.   /*                                                                       */
  114.   /* <Function>                                                            */
  115.   /*    FT_Raccess_Get_DataOffsets                                         */
  116.   /*                                                                       */
  117.   /* <Description>                                                         */
  118.   /*    Get the data offsets for a tag in a resource fork.  Offsets are    */
  119.   /*    stored in an array because, in some cases, resources in a resource */
  120.   /*    fork have the same tag.                                            */
  121.   /*                                                                       */
  122.   /* <Input>                                                               */
  123.   /*    library ::                                                         */
  124.   /*      A FreeType library instance.                                     */
  125.   /*                                                                       */
  126.   /*    stream ::                                                          */
  127.   /*      A file stream containing the resource fork.                      */
  128.   /*                                                                       */
  129.   /*    map_offset ::                                                      */
  130.   /*      The file offset where the resource map starts.                   */
  131.   /*                                                                       */
  132.   /*    rdata_pos ::                                                       */
  133.   /*      The file offset where the resource data starts.                  */
  134.   /*                                                                       */
  135.   /*    tag ::                                                             */
  136.   /*      The resource tag.                                                */
  137.   /*                                                                       */
  138.   /* <Output>                                                              */
  139.   /*    offsets ::                                                         */
  140.   /*      The stream offsets for the resource data specified by `tag'.     */
  141.   /*      This array is allocated by the function, so you have to call     */
  142.   /*      @ft_mem_free after use.                                          */
  143.   /*                                                                       */
  144.   /*    count ::                                                           */
  145.   /*      The length of offsets array.                                     */
  146.   /*                                                                       */
  147.   /* <Return>                                                              */
  148.   /*    FreeType error code.  FT_Err_Ok means success.                     */
  149.   /*                                                                       */
  150.   /* <Note>                                                                */
  151.   /*    Normally you should use `FT_Raccess_Get_HeaderInfo' to get the     */
  152.   /*    value for `map_offset' and `rdata_pos'.                            */
  153.   /*                                                                       */
  154.   FT_BASE( FT_Error )
  155.   FT_Raccess_Get_DataOffsets( FT_Library  library,
  156.                               FT_Stream   stream,
  157.                               FT_Long     map_offset,
  158.                               FT_Long     rdata_pos,
  159.                               FT_Long     tag,
  160.                               FT_Long   **offsets,
  161.                               FT_Long    *count );
  162. FT_END_HEADER
  163. #endif /* __FTRFORK_H__ */
  164. /* END */