ReactOS  0.4.14-dev-991-g696cdc6
psarrst.h File Reference
#include "pserror.h"
Include dependency graph for psarrst.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CF2_ArrStackRec_
 

Typedefs

typedef FT_BEGIN_HEADER struct CF2_ArrStackRec_ CF2_ArrStackRec
 
typedef FT_BEGIN_HEADER struct CF2_ArrStackRec_CF2_ArrStack
 

Functions

 cf2_arrstack_init (CF2_ArrStack arrstack, FT_Memory memory, FT_Error *error, size_t sizeItem)
 
 cf2_arrstack_finalize (CF2_ArrStack arrstack)
 
 cf2_arrstack_setCount (CF2_ArrStack arrstack, size_t numElements)
 
 cf2_arrstack_clear (CF2_ArrStack arrstack)
 
 cf2_arrstack_size (const CF2_ArrStack arrstack)
 
 cf2_arrstack_getBuffer (const CF2_ArrStack arrstack)
 
 cf2_arrstack_getPointer (const CF2_ArrStack arrstack, size_t idx)
 
 cf2_arrstack_push (CF2_ArrStack arrstack, const void *ptr)
 

Typedef Documentation

◆ CF2_ArrStack

◆ CF2_ArrStackRec

Function Documentation

◆ cf2_arrstack_clear()

cf2_arrstack_clear ( CF2_ArrStack  arrstack)

Definition at line 158 of file psarrst.c.

159  {
160  FT_ASSERT( arrstack );
161 
162  arrstack->count = 0;
163  }
#define FT_ASSERT(condition)
Definition: ftdebug.h:211

Referenced by cf2_hintmap_adjustHints(), and cf2_interpT2CharString().

◆ cf2_arrstack_finalize()

cf2_arrstack_finalize ( CF2_ArrStack  arrstack)

Definition at line 76 of file psarrst.c.

77  {
78  FT_Memory memory = arrstack->memory; /* for FT_FREE */
79 
80 
81  FT_ASSERT( arrstack );
82 
83  arrstack->allocated = 0;
84  arrstack->count = 0;
85  arrstack->totalSize = 0;
86 
87  /* free the data buffer */
88  FT_FREE( arrstack->ptr );
89  }
static char memory[1024 *256]
Definition: process.c:116
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
#define FT_FREE(ptr)
Definition: ftmemory.h:329
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66

Referenced by cf2_glyphpath_finalize(), and cf2_interpT2CharString().

◆ cf2_arrstack_getBuffer()

cf2_arrstack_getBuffer ( const CF2_ArrStack  arrstack)

Definition at line 177 of file psarrst.c.

178  {
179  FT_ASSERT( arrstack );
180 
181  return arrstack->ptr;
182  }
#define FT_ASSERT(condition)
Definition: ftdebug.h:211

Referenced by cf2_interpT2CharString().

◆ cf2_arrstack_getPointer()

cf2_arrstack_getPointer ( const CF2_ArrStack  arrstack,
size_t  idx 
)

Definition at line 187 of file psarrst.c.

189  {
190  void* newPtr;
191 
192 
193  FT_ASSERT( arrstack );
194 
195  if ( idx >= arrstack->count )
196  {
197  /* overflow */
198  CF2_SET_ERROR( arrstack->error, Stack_Overflow );
199  idx = 0; /* choose safe default */
200  }
201 
202  newPtr = (FT_Byte*)arrstack->ptr + idx * arrstack->sizeItem;
203 
204  return newPtr;
205  }
unsigned char FT_Byte
Definition: fttypes.h:154
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
unsigned int idx
Definition: utils.c:41
#define CF2_SET_ERROR(error, e)
Definition: pserror.h:109

Referenced by cf2_hint_init(), cf2_hintmap_adjustHints(), cf2_hintmap_build(), and cf2_interpT2CharString().

◆ cf2_arrstack_init()

cf2_arrstack_init ( CF2_ArrStack  arrstack,
FT_Memory  memory,
FT_Error error,
size_t  sizeItem 
)

Definition at line 56 of file psarrst.c.

60  {
61  FT_ASSERT( arrstack );
62 
63  /* initialize the structure */
64  arrstack->memory = memory;
65  arrstack->error = error;
66  arrstack->sizeItem = sizeItem;
67  arrstack->allocated = 0;
68  arrstack->chunk = 10; /* chunks of 10 items */
69  arrstack->count = 0;
70  arrstack->totalSize = 0;
71  arrstack->ptr = NULL;
72  }
#define error(str)
Definition: mkdosfs.c:1605
static char memory[1024 *256]
Definition: process.c:116
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
smooth NULL
Definition: ftsmooth.c:416

Referenced by cf2_glyphpath_init(), and cf2_interpT2CharString().

◆ cf2_arrstack_push()

cf2_arrstack_push ( CF2_ArrStack  arrstack,
const void ptr 
)

Definition at line 212 of file psarrst.c.

214  {
215  FT_ASSERT( arrstack );
216 
217  if ( arrstack->count == arrstack->allocated )
218  {
219  /* grow the buffer by one chunk */
221  arrstack, arrstack->allocated + arrstack->chunk ) )
222  {
223  /* on error, ignore the push */
224  return;
225  }
226  }
227 
228  FT_ASSERT( ptr );
229 
230  {
231  size_t offset = arrstack->count * arrstack->sizeItem;
232  void* newPtr = (FT_Byte*)arrstack->ptr + offset;
233 
234 
235  FT_MEM_COPY( newPtr, ptr, arrstack->sizeItem );
236  arrstack->count += 1;
237  }
238  }
GLintptr offset
Definition: glext.h:5920
unsigned char FT_Byte
Definition: fttypes.h:154
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
static PVOID ptr
Definition: dispmode.c:27
static FT_Bool cf2_arrstack_setNumElements(CF2_ArrStack arrstack, size_t numElements)
Definition: psarrst.c:95
#define FT_MEM_COPY(dest, source, count)
Definition: ftmemory.h:228

Referenced by cf2_doStems(), and cf2_hintmap_adjustHints().

◆ cf2_arrstack_setCount()

cf2_arrstack_setCount ( CF2_ArrStack  arrstack,
size_t  numElements 
)

Definition at line 140 of file psarrst.c.

142  {
143  FT_ASSERT( arrstack );
144 
145  if ( numElements > arrstack->allocated )
146  {
147  /* expand the allocation first */
148  if ( !cf2_arrstack_setNumElements( arrstack, numElements ) )
149  return;
150  }
151 
152  arrstack->count = numElements;
153  }
#define FT_ASSERT(condition)
Definition: ftdebug.h:211
static FT_Bool cf2_arrstack_setNumElements(CF2_ArrStack arrstack, size_t numElements)
Definition: psarrst.c:95

Referenced by cf2_interpT2CharString().

◆ cf2_arrstack_size()

cf2_arrstack_size ( const CF2_ArrStack  arrstack)

Definition at line 168 of file psarrst.c.

169  {
170  FT_ASSERT( arrstack );
171 
172  return arrstack->count;
173  }
#define FT_ASSERT(condition)
Definition: ftdebug.h:211

Referenced by cf2_hintmap_adjustHints(), cf2_hintmap_build(), and cf2_interpT2CharString().