This commit was manufactured by cvs2svn to create branch 'captive'.
[reactos.git] / include / freetype / ftsystem.h
1 /***************************************************************************/
2 /*                                                                         */
3 /*  ftsystem.h                                                             */
4 /*                                                                         */
5 /*    FreeType low-level system interface definition (specification).      */
6 /*                                                                         */
7 /*  Copyright 1996-2000 by                                                 */
8 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
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
19 #ifndef FTSYSTEM_H
20 #define FTSYSTEM_H
21
22
23   /*************************************************************************/
24   /*                                                                       */
25   /*                  M E M O R Y   M A N A G E M E N T                    */
26   /*                                                                       */
27   /*************************************************************************/
28
29
30   typedef struct FT_MemoryRec_*  FT_Memory;
31
32
33   typedef void*  (*FT_Alloc_Func)( FT_Memory  memory,
34                                    long       size );
35
36   typedef void  (*FT_Free_Func)( FT_Memory  memory,
37                                  void*      block );
38
39   typedef void*  (*FT_Realloc_Func)( FT_Memory  memory,
40                                      long       cur_size,
41                                      long       new_size,
42                                      void*      block );
43
44
45   struct FT_MemoryRec_
46   {
47     void*            user;
48     FT_Alloc_Func    alloc;
49     FT_Free_Func     free;
50     FT_Realloc_Func  realloc;
51   };
52
53
54   /*************************************************************************/
55   /*                                                                       */
56   /*                       I / O   M A N A G E M E N T                     */
57   /*                                                                       */
58   /*************************************************************************/
59
60
61   typedef union  FT_StreamDesc_
62   {
63     long   value;
64     void*  pointer;
65
66   } FT_StreamDesc;
67
68
69   typedef struct FT_StreamRec_*  FT_Stream;
70
71
72   typedef unsigned long  (*FT_Stream_IO)( FT_Stream       stream,
73                                           unsigned long   offset,
74                                           unsigned char*  buffer,
75                                           unsigned long   count );
76
77   typedef void  (*FT_Stream_Close)( FT_Stream  stream );
78
79
80   struct  FT_StreamRec_
81   {
82     unsigned char*   base;
83     unsigned long    size;
84     unsigned long    pos;
85
86     FT_StreamDesc    descriptor;
87     FT_StreamDesc    pathname;    /* ignored by FreeType -- */
88                                   /* useful for debugging   */
89     FT_Stream_IO     read;
90     FT_Stream_Close  close;
91
92     FT_Memory        memory;
93     unsigned char*   cursor;
94     unsigned char*   limit;
95   };
96
97
98 #endif /* FTSYSTEM_H */
99
100
101 /* END */