src/java.desktop/share/native/libfreetype/src/base/ftrfork.c
changeset 54876 da3834261f0c
parent 49234 3375a8039fde
equal deleted inserted replaced
54875:bcfedddcf4ce 54876:da3834261f0c
     1 /***************************************************************************/
     1 /****************************************************************************
     2 /*                                                                         */
     2  *
     3 /*  ftrfork.c                                                              */
     3  * ftrfork.c
     4 /*                                                                         */
     4  *
     5 /*    Embedded resource forks accessor (body).                             */
     5  *   Embedded resource forks accessor (body).
     6 /*                                                                         */
     6  *
     7 /*  Copyright 2004-2018 by                                                 */
     7  * Copyright (C) 2004-2019 by
     8 /*  Masatake YAMATO and Redhat K.K.                                        */
     8  * Masatake YAMATO and Redhat K.K.
     9 /*                                                                         */
     9  *
    10 /*  FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are     */
    10  * FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are
    11 /*  derived from ftobjs.c.                                                 */
    11  * derived from ftobjs.c.
    12 /*                                                                         */
    12  *
    13 /*  This file is part of the FreeType project, and may only be used,       */
    13  * This file is part of the FreeType project, and may only be used,
    14 /*  modified, and distributed under the terms of the FreeType project      */
    14  * modified, and distributed under the terms of the FreeType project
    15 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
    15  * license, LICENSE.TXT.  By continuing to use, modify, or distribute
    16 /*  this file you indicate that you have read the license and              */
    16  * this file you indicate that you have read the license and
    17 /*  understand and accept it fully.                                        */
    17  * understand and accept it fully.
    18 /*                                                                         */
    18  *
    19 /***************************************************************************/
    19  */
    20 
    20 
    21 /***************************************************************************/
    21 /****************************************************************************
    22 /* Development of the code in this file is support of                      */
    22  * Development of the code in this file is support of
    23 /* Information-technology Promotion Agency, Japan.                         */
    23  * Information-technology Promotion Agency, Japan.
    24 /***************************************************************************/
    24  */
    25 
    25 
    26 
    26 
    27 #include <ft2build.h>
    27 #include <ft2build.h>
    28 #include FT_INTERNAL_DEBUG_H
    28 #include FT_INTERNAL_DEBUG_H
    29 #include FT_INTERNAL_STREAM_H
    29 #include FT_INTERNAL_STREAM_H
    30 #include FT_INTERNAL_RFORK_H
    30 #include FT_INTERNAL_RFORK_H
    31 #include "basepic.h"
    31 
    32 #include "ftbase.h"
    32 #include "ftbase.h"
    33 
    33 
    34 #undef  FT_COMPONENT
    34 #undef  FT_COMPONENT
    35 #define FT_COMPONENT  trace_raccess
    35 #define FT_COMPONENT  raccess
    36 
    36 
    37 
    37 
    38   /*************************************************************************/
    38   /*************************************************************************/
    39   /*************************************************************************/
    39   /*************************************************************************/
    40   /*************************************************************************/
    40   /*************************************************************************/
   436                                FT_Int32    magic,
   436                                FT_Int32    magic,
   437                                FT_Long    *result_offset );
   437                                FT_Long    *result_offset );
   438 
   438 
   439   static FT_Error
   439   static FT_Error
   440   raccess_guess_linux_double_from_file_name( FT_Library  library,
   440   raccess_guess_linux_double_from_file_name( FT_Library  library,
   441                                              char *      file_name,
   441                                              char*       file_name,
   442                                              FT_Long    *result_offset );
   442                                              FT_Long    *result_offset );
   443 
   443 
   444   static char *
   444   static char *
   445   raccess_make_file_name( FT_Memory    memory,
   445   raccess_make_file_name( FT_Memory    memory,
   446                           const char  *original_name,
   446                           const char  *original_name,
   466         errors[i] = FT_Err_Ok;
   466         errors[i] = FT_Err_Ok;
   467 
   467 
   468       if ( errors[i] )
   468       if ( errors[i] )
   469         continue;
   469         continue;
   470 
   470 
   471       errors[i] = (FT_RACCESS_GUESS_TABLE_GET[i].func)( library,
   471       errors[i] = ft_raccess_guess_table[i].func( library,
   472                                                  stream, base_name,
   472                                                   stream, base_name,
   473                                                  &(new_names[i]),
   473                                                   &(new_names[i]),
   474                                                  &(offsets[i]) );
   474                                                   &(offsets[i]) );
   475     }
   475     }
   476 
   476 
   477     return;
   477     return;
   478   }
   478   }
   479 
   479 
   486     FT_UNUSED( library );
   486     FT_UNUSED( library );
   487 
   487 
   488     if ( rule_index >= FT_RACCESS_N_RULES )
   488     if ( rule_index >= FT_RACCESS_N_RULES )
   489       return FT_RFork_Rule_invalid;
   489       return FT_RFork_Rule_invalid;
   490 
   490 
   491     return FT_RACCESS_GUESS_TABLE_GET[rule_index].type;
   491     return ft_raccess_guess_table[rule_index].type;
   492   }
   492   }
   493 
   493 
   494 
   494 
   495   /*
   495   /*
   496    * For this function, refer ftbase.h.
   496    * For this function, refer ftbase.h.
   845                                              char       *file_name,
   845                                              char       *file_name,
   846                                              FT_Long    *result_offset )
   846                                              FT_Long    *result_offset )
   847   {
   847   {
   848     FT_Open_Args  args2;
   848     FT_Open_Args  args2;
   849     FT_Stream     stream2;
   849     FT_Stream     stream2;
   850     char *        nouse = NULL;
   850     char*         nouse = NULL;
   851     FT_Error      error;
   851     FT_Error      error;
   852 
   852 
   853 
   853 
   854     args2.flags    = FT_OPEN_PATHNAME;
   854     args2.flags    = FT_OPEN_PATHNAME;
   855     args2.pathname = file_name;
   855     args2.pathname = file_name;
   907 
   907 
   908 
   908 
   909 #else   /* !FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
   909 #else   /* !FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
   910 
   910 
   911 
   911 
   912   /*************************************************************************/
   912   /**************************************************************************
   913   /*                  Dummy function; just sets errors                     */
   913    *                 Dummy function; just sets errors
   914   /*************************************************************************/
   914    */
   915 
   915 
   916   FT_BASE_DEF( void )
   916   FT_BASE_DEF( void )
   917   FT_Raccess_Guess( FT_Library  library,
   917   FT_Raccess_Guess( FT_Library  library,
   918                     FT_Stream   stream,
   918                     FT_Stream   stream,
   919                     char       *base_name,
   919                     char       *base_name,