ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

ftmisc.h
Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  ftmisc.h                                                               */
00004 /*                                                                         */
00005 /*    Miscellaneous macros for stand-alone rasterizer (specification       */
00006 /*    only).                                                               */
00007 /*                                                                         */
00008 /*  Copyright 2005, 2009, 2010 by                                          */
00009 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
00010 /*                                                                         */
00011 /*  This file is part of the FreeType project, and may only be used        */
00012 /*  modified and distributed under the terms of the FreeType project       */
00013 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
00014 /*  this file you indicate that you have read the license and              */
00015 /*  understand and accept it fully.                                        */
00016 /*                                                                         */
00017 /***************************************************************************/
00018 
00019 
00020   /***************************************************/
00021   /*                                                 */
00022   /* This file is *not* portable!  You have to adapt */
00023   /* its definitions to your platform.               */
00024   /*                                                 */
00025   /***************************************************/
00026 
00027 #ifndef __FTMISC_H__
00028 #define __FTMISC_H__
00029 
00030 
00031   /* memset */
00032 #include FT_CONFIG_STANDARD_LIBRARY_H
00033 
00034 #define FT_BEGIN_HEADER
00035 #define FT_END_HEADER
00036 
00037 #define FT_LOCAL_DEF( x )   static x
00038 
00039 
00040   /* from include/freetype2/fttypes.h */
00041 
00042   typedef unsigned char  FT_Byte;
00043   typedef signed int     FT_Int;
00044   typedef unsigned int   FT_UInt;
00045   typedef signed long    FT_Long;
00046   typedef unsigned long  FT_ULong;
00047   typedef signed long    FT_F26Dot6;
00048   typedef int            FT_Error;
00049 
00050 #define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
00051           ( ( (FT_ULong)_x1 << 24 ) |     \
00052             ( (FT_ULong)_x2 << 16 ) |     \
00053             ( (FT_ULong)_x3 <<  8 ) |     \
00054               (FT_ULong)_x4         )
00055 
00056 
00057   /* from include/freetype2/ftsystem.h */
00058 
00059   typedef struct FT_MemoryRec_*  FT_Memory;
00060 
00061   typedef void* (*FT_Alloc_Func)( FT_Memory  memory,
00062                                   long       size );
00063 
00064   typedef void (*FT_Free_Func)( FT_Memory  memory,
00065                                 void*      block );
00066 
00067   typedef void* (*FT_Realloc_Func)( FT_Memory  memory,
00068                                     long       cur_size,
00069                                     long       new_size,
00070                                     void*      block );
00071 
00072   typedef struct FT_MemoryRec_
00073   {
00074     void*            user;
00075 
00076     FT_Alloc_Func    alloc;
00077     FT_Free_Func     free;
00078     FT_Realloc_Func  realloc;
00079 
00080   } FT_MemoryRec;
00081 
00082 
00083   /* from src/ftcalc.c */
00084 
00085 #if ( defined _WIN32 || defined _WIN64 )
00086 
00087   typedef __int64  FT_Int64;
00088 
00089 #else
00090 
00091 #include "inttypes.h"
00092 
00093   typedef int64_t  FT_Int64;
00094 
00095 #endif
00096 
00097 
00098   static FT_Long
00099   FT_MulDiv( FT_Long  a,
00100              FT_Long  b,
00101              FT_Long  c )
00102   {
00103     FT_Int   s;
00104     FT_Long  d;
00105 
00106 
00107     s = 1;
00108     if ( a < 0 ) { a = -a; s = -1; }
00109     if ( b < 0 ) { b = -b; s = -s; }
00110     if ( c < 0 ) { c = -c; s = -s; }
00111 
00112     d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c
00113                          : 0x7FFFFFFFL );
00114 
00115     return ( s > 0 ) ? d : -d;
00116   }
00117 
00118 #endif /* __FTMISC_H__ */
00119 
00120 
00121 /* END */

Generated on Sun May 27 2012 04:34:00 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.