gwenhywfar  5.11.1beta
Macros
misc.h File Reference
#include <gwenhywfar/gwenhywfarapi.h>
#include <gwenhywfar/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <gwenhywfar/memory.h>
#include <gwenhywfar/list1.h>

Go to the source code of this file.

Macros

#define GWEN_LIST_ADD(typ, sr, head)
 
#define GWEN_LIST_DEL(typ, sr, head)
 
#define GWEN_LIST_INSERT(typ, sr, head)
 

Macro Definition Documentation

◆ GWEN_LIST_ADD

#define GWEN_LIST_ADD (   typ,
  sr,
  head 
)
Value:
{\
typ *curr; \
\
assert(sr); \
\
curr=*head; \
if (!curr) { \
*head=sr; \
} \
else { \
while(curr->next) { \
curr=curr->next; \
} \
curr->next=sr; \
}\
}

Definition at line 82 of file misc.h.

◆ GWEN_LIST_DEL

#define GWEN_LIST_DEL (   typ,
  sr,
  head 
)
Value:
{\
typ *curr; \
\
assert(sr); \
curr=*head; \
if (curr) { \
if (curr==sr) { \
*head=curr->next; \
} \
else { \
while(curr->next!=sr) { \
curr=curr->next; \
} \
if (curr) \
curr->next=sr->next; \
} \
} \
sr->next=0;\
}

Definition at line 116 of file misc.h.

◆ GWEN_LIST_INSERT

#define GWEN_LIST_INSERT (   typ,
  sr,
  head 
)
Value:
{\
typ *curr; \
\
assert(sr); \
\
curr=*head; \
if (!curr) { \
*head=sr; \
} \
else { \
sr->next=curr;\
*head=sr;\
}\
}

Definition at line 100 of file misc.h.