zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ftmisc.h
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* ftmisc.h */
4 /* */
5 /* Miscellaneous macros for stand-alone rasterizer (specification */
6 /* only). */
7 /* */
8 /* Copyright 2005, 2009, 2010 by */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* */
11 /* This file is part of the FreeType project, and may only be used */
12 /* modified and distributed under the terms of the FreeType project */
13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 /* this file you indicate that you have read the license and */
15 /* understand and accept it fully. */
16 /* */
17 /***************************************************************************/
18 
19 
20  /***************************************************/
21  /* */
22  /* This file is *not* portable! You have to adapt */
23  /* its definitions to your platform. */
24  /* */
25  /***************************************************/
26 
27 #ifndef __FTMISC_H__
28 #define __FTMISC_H__
29 
30 
31  /* memset */
32 #include FT_CONFIG_STANDARD_LIBRARY_H
33 
34 #define FT_BEGIN_HEADER
35 #define FT_END_HEADER
36 
37 #define FT_LOCAL_DEF( x ) static x
38 
39 
40  /* from include/freetype2/fttypes.h */
41 
42  typedef unsigned char FT_Byte;
43  typedef signed int FT_Int;
44  typedef unsigned int FT_UInt;
45  typedef signed long FT_Long;
46  typedef unsigned long FT_ULong;
47  typedef signed long FT_F26Dot6;
48  typedef int FT_Error;
49 
50 #define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
51  ( ( (FT_ULong)_x1 << 24 ) | \
52  ( (FT_ULong)_x2 << 16 ) | \
53  ( (FT_ULong)_x3 << 8 ) | \
54  (FT_ULong)_x4 )
55 
56 
57  /* from include/freetype2/ftsystem.h */
58 
59  typedef struct FT_MemoryRec_* FT_Memory;
60 
61  typedef void* (*FT_Alloc_Func)( FT_Memory memory,
62  long size );
63 
64  typedef void (*FT_Free_Func)( FT_Memory memory,
65  void* block );
66 
67  typedef void* (*FT_Realloc_Func)( FT_Memory memory,
68  long cur_size,
69  long new_size,
70  void* block );
71 
72  typedef struct FT_MemoryRec_
73  {
74  void* user;
75 
79 
80  } FT_MemoryRec;
81 
82 
83  /* from src/ftcalc.c */
84 
85 #if ( defined _WIN32 || defined _WIN64 )
86 
87  typedef __int64 FT_Int64;
88 
89 #else
90 
91 #include "inttypes.h"
92 
93  typedef int64_t FT_Int64;
94 
95 #endif
96 
97 
98  static FT_Long
100  FT_Long b,
101  FT_Long c )
102  {
103  FT_Int s;
104  FT_Long d;
105 
106 
107  s = 1;
108  if ( a < 0 ) { a = -a; s = -1; }
109  if ( b < 0 ) { b = -b; s = -s; }
110  if ( c < 0 ) { c = -c; s = -s; }
111 
112  d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c
113  : 0x7FFFFFFFL );
114 
115  return ( s > 0 ) ? d : -d;
116  }
117 
118 #endif /* __FTMISC_H__ */
119 
120 
121 /* END */
FT_Free_Func free
Definition: ftsystem.h:175
int FT_Error
Definition: fttypes.h:296
signed long FT_Long
Definition: fttypes.h:238
GLdouble s
Definition: glew.h:1376
unsigned long FT_ULong
Definition: fttypes.h:249
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
Definition: glew.h:1824
long long int64_t
Definition: types.h:10
signed int FT_Int
Definition: fttypes.h:216
void(* FT_Free_Func)(FT_Memory memory, void *block)
Definition: ftsystem.h:110
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:8736
return Display return Display Bool Bool int d
Definition: SDL_x11sym.h:30
void *(* FT_Realloc_Func)(FT_Memory memory, long cur_size, long new_size, void *block)
Definition: ftsystem.h:143
void *(* FT_Alloc_Func)(FT_Memory memory, long size)
Definition: ftsystem.h:89
FT_Alloc_Func alloc
Definition: ftsystem.h:174
unsigned char FT_Byte
Definition: fttypes.h:150
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
Definition: ftcalc.c:358
const GLfloat * c
Definition: glew.h:14913
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
signed long FT_F26Dot6
Definition: fttypes.h:272
unsigned int FT_UInt
Definition: fttypes.h:227
struct FT_MemoryRec_ FT_MemoryRec
GLdouble GLdouble GLdouble b
Definition: glew.h:8383
FT_Realloc_Func realloc
Definition: ftsystem.h:176
struct FT_Int64_ FT_Int64
void * user
Definition: ftsystem.h:173
GLsizei size
Definition: gl2ext.h:1467