@ -4,7 +4,7 @@
/* */
/* The FreeType services (specification only). */
/* */
/* Copyright 2003-2007, 2009, 2012 by */
/* Copyright 2003-2007, 2009, 2012, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -174,6 +174,7 @@ FT_BEGIN_HEADER
/* FT_DEFINE_SERVICEDESCREC4 */
/* FT_DEFINE_SERVICEDESCREC5 */
/* FT_DEFINE_SERVICEDESCREC6 */
/* FT_DEFINE_SERVICEDESCREC7 */
/* */
/* <Description> */
/* Used to initialize an array of FT_ServiceDescRec structures. */
@ -270,6 +271,26 @@ FT_BEGIN_HEADER
{ NULL , NULL } \
} ;
# define FT_DEFINE_SERVICEDESCREC7( class_, \
serv_id_1 , serv_data_1 , \
serv_id_2 , serv_data_2 , \
serv_id_3 , serv_data_3 , \
serv_id_4 , serv_data_4 , \
serv_id_5 , serv_data_5 , \
serv_id_6 , serv_data_6 , \
serv_id_7 , serv_data_7 ) \
static const FT_ServiceDescRec class_ [ ] = \
{ \
{ serv_id_1 , serv_data_1 } , \
{ serv_id_2 , serv_data_2 } , \
{ serv_id_3 , serv_data_3 } , \
{ serv_id_4 , serv_data_4 } , \
{ serv_id_5 , serv_data_5 } , \
{ serv_id_6 , serv_data_6 } , \
{ serv_id_7 , serv_data_7 } , \
{ NULL , NULL } \
} ;
# else /* FT_CONFIG_OPTION_PIC */
# define FT_DEFINE_SERVICEDESCREC1( class_, \
@ -527,6 +548,59 @@ FT_BEGIN_HEADER
return FT_Err_Ok ; \
}
# define FT_DEFINE_SERVICEDESCREC7( class_, \
serv_id_1 , serv_data_1 , \
serv_id_2 , serv_data_2 , \
serv_id_3 , serv_data_3 , \
serv_id_4 , serv_data_4 , \
serv_id_5 , serv_data_5 , \
serv_id_6 , serv_data_6 , \
serv_id_7 , serv_data_7 ) \
void \
FT_Destroy_Class_ # # class_ ( FT_Library library , \
FT_ServiceDescRec * clazz ) \
{ \
FT_Memory memory = library - > memory ; \
\
\
if ( clazz ) \
FT_FREE ( clazz ) ; \
} \
\
FT_Error \
FT_Create_Class_ # # class_ ( FT_Library library , \
FT_ServiceDescRec * * output_class ) \
{ \
FT_ServiceDescRec * clazz = NULL ; \
FT_Error error ; \
FT_Memory memory = library - > memory ; \
\
\
if ( FT_ALLOC ( clazz , sizeof ( * clazz ) * 8 ) ) \
return error ; \
\
clazz [ 0 ] . serv_id = serv_id_1 ; \
clazz [ 0 ] . serv_data = serv_data_1 ; \
clazz [ 1 ] . serv_id = serv_id_2 ; \
clazz [ 1 ] . serv_data = serv_data_2 ; \
clazz [ 2 ] . serv_id = serv_id_3 ; \
clazz [ 2 ] . serv_data = serv_data_3 ; \
clazz [ 3 ] . serv_id = serv_id_4 ; \
clazz [ 3 ] . serv_data = serv_data_4 ; \
clazz [ 4 ] . serv_id = serv_id_5 ; \
clazz [ 4 ] . serv_data = serv_data_5 ; \
clazz [ 5 ] . serv_id = serv_id_6 ; \
clazz [ 5 ] . serv_data = serv_data_6 ; \
clazz [ 6 ] . serv_id = serv_id_7 ; \
clazz [ 6 ] . serv_data = serv_data_7 ; \
clazz [ 7 ] . serv_id = NULL ; \
clazz [ 7 ] . serv_data = NULL ; \
\
* output_class = clazz ; \
\
return FT_Err_Ok ; \
}
# endif /* FT_CONFIG_OPTION_PIC */