ReactOS 0.4.16-dev-329-g9223134
ftlist.h File Reference
#include <ft2build.h>
Include dependency graph for ftlist.h:

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 233 of file ftlist.h.

◆ FT_List_Iterator

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

Definition at line 185 of file ftlist.h.

Function Documentation

◆ FT_List_Add()

FT_List_Add ( FT_List  list,
FT_ListNode  node 
)

Definition at line 269 of file ftutil.c.

271 {
273
274
275 if ( !list || !node )
276 return;
277
278 before = list->tail;
279
280 node->next = NULL;
281 node->prev = before;
282
283 if ( before )
284 before->next = node;
285 else
286 list->head = node;
287
288 list->tail = node;
289 }
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 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 413 of file ftutil.c.

417 {
419
420
421 if ( !list || !memory )
422 return;
423
424 cur = list->head;
425 while ( cur )
426 {
427 FT_ListNode next = cur->next;
428 void* data = cur->data;
429
430
431 if ( destroy )
432 destroy( memory, data, user );
433
434 FT_FREE( cur );
435 cur = next;
436 }
437
438 list->head = NULL;
439 list->tail = NULL;
440 }
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:329
FxCollectionEntry * cur
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static char memory[1024 *256]
Definition: process.c:116
static unsigned __int64 next
Definition: rand_nt.c:6

Referenced by 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 244 of file ftutil.c.

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

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 295 of file ftutil.c.

297 {
299
300
301 if ( !list || !node )
302 return;
303
304 after = list->head;
305
306 node->next = after;
307 node->prev = NULL;
308
309 if ( !after )
310 list->tail = node;
311 else
312 after->prev = node;
313
314 list->head = node;
315 }
__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 381 of file ftutil.c.

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

◆ FT_List_Remove()

FT_List_Remove ( FT_List  list,
FT_ListNode  node 
)

Definition at line 321 of file ftutil.c.

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

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 348 of file ftutil.c.

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

Referenced by FT_Set_Renderer().