46 perror(
"sclist_new OOM");
73 perror(
"sclist_addrecord OOM");
76 record->
value = value;
84 sclist->
first = record;
85 sclist->
last = record;
89 sclist->
last = record;
101 for (cur=sclist->
first, prev=
NULL; (cur)&&(cur!=record); prev=cur,cur=cur->
next);
106 if (sclist->
first==cur)
111 if (sclist->
last==cur)
114 fprintf(stderr,
"sclist_remrecord record not found.\n");
122 return sclist->
first;
134 return record->
value;
void * sclist_getvalue(sclistrecord_t *record)
Returns the value pointer stored in the record.
sclist_t * sclist_new()
Allocate and initialize the internal list structure.
sclistrecord_t * sclist_nextrecord(const sclistrecord_t *record)
Returns the pointer on the record following the specified one.
void sclist_del(sclist_t *sclist)
Free all the list structure but not the values.
struct sclistrecord_s sclistrecord_t
Private list record structure.
sclistrecord_t * sclist_addrecord(sclist_t *sclist, void *value)
Add a value at the end of the list.
struct sclist_s sclist_t
Opaque sclist structure.
sclistrecord_t * sclist_firstrecord(const sclist_t *sclist)
Returns the pointer on the first list record.
void sclist_remrecord(sclist_t *sclist, sclistrecord_t *record)
Remove a record in a list.
Basic single chained generic list.
sclistrecord_t * last
Pointer to the last record.
sclistrecord_t * first
Pointer to the first record.
Private list record structure.
void * value
Pointer to value.
struct sclistrecord_s * next
Next record in the list.