#include "omConfig.h"
#include "omalloc.h"
#include "omDebug.h"
Go to the source code of this file.
|
int | _omListLength (void *list, int next) |
|
void * | _omListLast (void *list, int next) |
|
void * | _omListHasCycle (void *list, int next) |
|
void * | _omIsOnList (void *list, int next, void *addr) |
|
void * | _omRemoveFromList (void *list, int next, void *addr) |
|
void * | _omFindInList (void *list, int next, int long_field, unsigned long what) |
|
void * | _omFindInSortedList (void *list, int next, int long_field, unsigned long what) |
|
void * | _omRemoveFromSortedList (void *list, int next, int long_field, void *addr) |
|
void * | _omInsertInSortedList (void *list, int next, int long_field, void *addr) |
|
omError_t | _omCheckList (void *list, int next, int level, omError_t report, OM_FLR_DECL) |
|
omError_t | _omCheckSortedList (void *list, int next, int long_field, int level, omError_t report, OM_FLR_DECL) |
|
◆ _VALUE
#define _VALUE |
( |
|
list, |
|
|
|
offset |
|
) |
| *((void**) ((char *)list + offset)) |
◆ ITER
#define ITER |
( |
|
list | ) |
list = NEXT(list) |
◆ NEXT
◆ NULL
◆ VALUE
◆ _omCheckList()
omError_t _omCheckList |
( |
void * |
list, |
|
|
int |
next, |
|
|
int |
level, |
|
|
omError_t |
report, |
|
|
OM_FLR_DECL |
|
|
) |
| |
Definition at line 178 of file omList.c.
void report(const char *fmt, const char *name)
omError_t omCheckPtr(const void *ptr, omError_t report, OM_FLR_DECL)
#define omCheckReturn(cond)
omError_t omReportError(omError_t error, omError_t report_error, OM_FLR_DECL, const char *fmt,...)
◆ _omCheckSortedList()
omError_t _omCheckSortedList |
( |
void * |
list, |
|
|
int |
next, |
|
|
int |
long_field, |
|
|
int |
level, |
|
|
omError_t |
report, |
|
|
OM_FLR_DECL |
|
|
) |
| |
Definition at line 216 of file omList.c.
227 if (prev !=
NULL &&
VALUE(prev, long_field) >
VALUE(list, long_field))
229 "%d > %d",
VALUE(prev, long_field),
VALUE(list, long_field));
243 if (prev !=
NULL &&
VALUE(prev, long_field) >
VALUE(l1, long_field))
245 "%d > %d",
VALUE(prev, long_field),
VALUE(l1, long_field));
#define omCheckReturnError(cond, error)
@ omError_SortedListError
#define VALUE(list, offset)
◆ _omFindInList()
void * _omFindInList |
( |
void * |
list, |
|
|
int |
next, |
|
|
int |
long_field, |
|
|
unsigned long |
what |
|
) |
| |
Definition at line 100 of file omList.c.
104 if (
VALUE(list, long_field) == what)
return list;
◆ _omFindInSortedList()
void * _omFindInSortedList |
( |
void * |
list, |
|
|
int |
next, |
|
|
int |
long_field, |
|
|
unsigned long |
what |
|
) |
| |
Definition at line 110 of file omList.c.
115 if (
VALUE(list, long_field) >= what)
117 if (
VALUE(list, long_field) == what)
return list;
◆ _omInsertInSortedList()
void * _omInsertInSortedList |
( |
void * |
list, |
|
|
int |
next, |
|
|
int |
long_field, |
|
|
void * |
addr |
|
) |
| |
Definition at line 148 of file omList.c.
150 unsigned long what =
VALUE(addr, long_field);
152 if (list ==
NULL || what <=
VALUE(list, long_field))
160 void* curr =
NEXT(list);
162 while (curr !=
NULL &&
VALUE(curr, long_field) < what)
◆ _omIsOnList()
void * _omIsOnList |
( |
void * |
list, |
|
|
int |
next, |
|
|
void * |
addr |
|
) |
| |
Definition at line 66 of file omList.c.
73 if (addr == list)
return addr;
◆ _omListHasCycle()
void * _omListHasCycle |
( |
void * |
list, |
|
|
int |
next |
|
) |
| |
Definition at line 42 of file omList.c.
58 if (
i !=
l)
return l1;
◆ _omListLast()
void * _omListLast |
( |
void * |
list, |
|
|
int |
next |
|
) |
| |
◆ _omListLength()
int _omListLength |
( |
void * |
list, |
|
|
int |
next |
|
) |
| |
◆ _omRemoveFromList()
void * _omRemoveFromList |
( |
void * |
list, |
|
|
int |
next, |
|
|
void * |
addr |
|
) |
| |
Definition at line 79 of file omList.c.
87 if (list == addr)
return nlist;
90 while (nlist !=
NULL && nlist != addr)
◆ _omRemoveFromSortedList()
void * _omRemoveFromSortedList |
( |
void * |
list, |
|
|
int |
next, |
|
|
int |
long_field, |
|
|
void * |
addr |
|
) |
| |
Definition at line 125 of file omList.c.
129 unsigned long what =
VALUE(addr, long_field);
133 if (list == addr)
return nlist;
134 if (
VALUE(list, long_field) > what)
return list;
137 while (nlist !=
NULL && nlist != addr)
139 if (
VALUE(list, long_field) > what)
return olist;