xref: /inferno-os/include/freetype/internal/ftexcept.h (revision 37da2899f40661e3e9631e497da8dc59b971cbd0)
1 #ifndef __FT_EXCEPT_H__
2 #define __FT_EXCEPT_H__
3 
4 #include <ft2build.h>
5 #include FT_INTERNAL_OBJECTS_H
6 
7 FT_BEGIN_HEADER
8 
9 
10 
11  /* I can't find a better place for this for now */
12 
13 <<<<<<< ftexcept.h
14 =======
15 
16 /* the size of a cleanup chunk in bytes is FT_CLEANUP_CHUNK_SIZE*12 + 4 */
17 /* this must be a small power of 2 whenever possible..                  */
18 /*                                                                      */
19 /* with a value of 5, we have a byte size of 64 bytes per chunk..       */
20 /*                                                                      */
21 #define  FT_CLEANUP_CHUNK_SIZE   5
22 
23 
24 
25   typedef struct FT_CleanupItemRec_
26   {
27     FT_Pointer      item;
28     FT_CleanupFunc  item_func;
29     FT_Pointer      item_data;
30 
31   } FT_CleanupItemRec;
32 
33   typedef struct FT_CleanupChunkRec_*   FT_CleanupChunk;
34 
35   typedef struct FT_CleanupChunkRec_
36   {
37     FT_CleanupChunk    link;
38     FT_CleanupItemRec  items[ FT_CLEANUP_CHUNK_SIZE ];
39 
40   } FT_CleanupChunkRec;
41 
42 
43   typedef struct FT_CleanupStackRec_
44   {
45     FT_CleanupItem     top;
46     FT_CleanupItem     limit;
47     FT_CleanupChunk    chunk;
48     FT_CleanupChunkRec chunk_0;  /* avoids stupid dynamic allocation */
49     FT_Memory          memory;
50 
51   } FT_CleanupStackRec, *FT_CleanupStack;
52 
53 
54   FT_BASE( void )
55   ft_cleanup_stack_push( FT_CleanupStack  stack,
56                          FT_Pointer       item,
57                          FT_CleanupFunc   item_func,
58                          FT_Pointer       item_data );
59 
60   FT_BASE( void )
61   ft_cleanup_stack_pop( FT_CleanupStack   stack,
62                         FT_Int            destroy );
63 
64   FT_BASE( FT_CleanupItem )
65   ft_cleanup_stack_peek( FT_CleanupStack  stack );
66 
67   FT_BASE( void )
68   ft_xhandler_enter( FT_XHandler  xhandler,
69                      FT_Memory    memory );
70 
71   FT_BASE( void )
72   ft_xhandler_exit( FT_XHandler  xhandler );
73 
74 
75   FT_BASE( void )
76   ft_cleanup_throw( FT_CleanupStack  stack,
77                     FT_Error         error );
78 
79 >>>>>>> 1.2
80 FT_END_HEADER
81 
82 #endif /* __FT_EXCEPT_H__ */
83