ReactOS 0.4.16-dev-2332-g4cba65d
ftlist.h File Reference
Include dependency graph for ftlist.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef FT_Error(* FT_List_Iterator) (FT_ListNode node, void *user)
 
typedef void(* FT_List_Destructor) (FT_Memory memory, void *data, void *user)
 

Functions

FT_BEGIN_HEADER FT_List_Find (FT_List list, void *data)
 
 FT_List_Add (FT_List list, FT_ListNode node)
 
 FT_List_Insert (FT_List list, FT_ListNode node)
 
 FT_List_Remove (FT_List list, FT_ListNode node)
 
 FT_List_Up (FT_List list, FT_ListNode node)
 
 FT_List_Iterate (FT_List list, FT_List_Iterator iterator, void *user)
 
 FT_List_Finalize (FT_List list, FT_List_Destructor destroy, FT_Memory memory, void *user)
 

Typedef Documentation

◆ FT_List_Destructor

typedef void(* FT_List_Destructor) (FT_Memory memory, void *data, void *user)

Definition at line 249 of file ftlist.h.

◆ FT_List_Iterator

typedef FT_Error(* FT_List_Iterator) (FT_ListNode node, void *user)

Definition at line 195 of file ftlist.h.

Function Documentation

◆ FT_List_Add()

FT_List_Add ( FT_List  list,
FT_ListNode  node 
)

Definition at line 268 of file ftutil.c.

270 {
272
273
274 if ( !list || !node )
275 return;
276
277 before = list->tail;
278
279 node->next = NULL;
280 node->prev = before;
281
282 if ( before )
283 before->next = node;
284 else
285 list->head = node;
286
287 list->tail = node;
288 }
Definition: list.h:37
#define NULL
Definition: types.h:112
__inline int before(__u32 seq1, __u32 seq2)
Definition: tcpcore.h:2390
Definition: dlist.c:348
void * next
Definition: dlist.c:360

Referenced by cff_parser_run(), ft_add_renderer(), FT_New_Size(), ft_open_face_internal(), and load_truetype_glyph().

◆ FT_List_Finalize()

FT_List_Finalize ( FT_List  list,
FT_List_Destructor  destroy,
FT_Memory  memory,
void user 
)

Definition at line 412 of file ftutil.c.

416 {
418
419
420 if ( !list || !memory )
421 return;
422
423 cur = list->head;
424 while ( cur )
425 {
426 FT_ListNode next = cur->next;
427 void* data = cur->data;
428
429
430 if ( destroy )
431 destroy( memory, data, user );
432
433 FT_FREE( cur );
434 cur = next;
435 }
436
437 list->head = NULL;
438 list->tail = NULL;
439 }
void destroy(_Tp *__pointer)
Definition: _construct.h:278
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define FT_FREE(ptr)
Definition: ftmemory.h:337
FxCollectionEntry * cur
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static char memory[1024 *256]
Definition: process.c:122
static unsigned __int64 next
Definition: rand_nt.c:6

Referenced by cff_parser_done(), Destroy_Driver(), destroy_face(), and tt_loader_done().

◆ FT_List_Find()

FT_BEGIN_HEADER FT_List_Find ( FT_List  list,
void data 
)

Definition at line 243 of file ftutil.c.

245 {
247
248
249 if ( !list )
250 return NULL;
251
252 cur = list->head;
253 while ( cur )
254 {
255 if ( cur->data == data )
256 return cur;
257
258 cur = cur->next;
259 }
260
261 return NULL;
262 }

Referenced by FT_Done_Face(), FT_Done_Size(), ft_remove_renderer(), FT_Set_Renderer(), load_truetype_glyph(), and T42_Size_Done().

◆ FT_List_Insert()

FT_List_Insert ( FT_List  list,
FT_ListNode  node 
)

Definition at line 294 of file ftutil.c.

296 {
298
299
300 if ( !list || !node )
301 return;
302
303 after = list->head;
304
305 node->next = after;
306 node->prev = NULL;
307
308 if ( !after )
309 list->tail = node;
310 else
311 after->prev = node;
312
313 list->head = node;
314 }
__inline int after(__u32 seq1, __u32 seq2)
Definition: tcpcore.h:2395

◆ FT_List_Iterate()

FT_List_Iterate ( FT_List  list,
FT_List_Iterator  iterator,
void user 
)

Definition at line 380 of file ftutil.c.

383 {
386
387
388 if ( !list || !iterator )
389 return FT_THROW( Invalid_Argument );
390
391 cur = list->head;
392
393 while ( cur )
394 {
395 FT_ListNode next = cur->next;
396
397
398 error = iterator( cur, user );
399 if ( error )
400 break;
401
402 cur = next;
403 }
404
405 return error;
406 }
return FT_Err_Ok
Definition: ftbbox.c:526
#define FT_THROW(e)
Definition: ftdebug.h:243
int FT_Error
Definition: fttypes.h:299
#define error(str)
Definition: mkdosfs.c:1605

◆ FT_List_Remove()

FT_List_Remove ( FT_List  list,
FT_ListNode  node 
)

Definition at line 320 of file ftutil.c.

322 {
324
325
326 if ( !list || !node )
327 return;
328
329 before = node->prev;
330 after = node->next;
331
332 if ( before )
333 before->next = after;
334 else
335 list->head = after;
336
337 if ( after )
338 after->prev = before;
339 else
340 list->tail = before;
341 }

Referenced by FT_Done_Face(), FT_Done_Size(), and ft_remove_renderer().

◆ FT_List_Up()

FT_List_Up ( FT_List  list,
FT_ListNode  node 
)

Definition at line 347 of file ftutil.c.

349 {
351
352
353 if ( !list || !node )
354 return;
355
356 before = node->prev;
357 after = node->next;
358
359 /* check whether we are already on top of the list */
360 if ( !before )
361 return;
362
363 before->next = after;
364
365 if ( after )
366 after->prev = before;
367 else
368 list->tail = before;
369
370 node->prev = NULL;
371 node->next = list->head;
372 list->head->prev = node;
373 list->head = node;
374 }
struct list * prev
Definition: list.h:39

Referenced by FT_Set_Renderer().