Loading [MathJax]/extensions/TeX/AMSsymbols.js
LAL 7.7.0.1-3a66518
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALList.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2016 Jolien Creighton
3*
4* This program is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License as published by
6* the Free Software Foundation; either version 2 of the License, or
7* (at your option) any later version.
8*
9* This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with with program; see the file COPYING. If not, write to the
16* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17* MA 02110-1301 USA
18*/
19
20#include <stdint.h>
21#include <unistd.h>
22#include <lal/LALStdio.h>
23#include <lal/LALStdlib.h>
24#include <lal/LALList.h>
25#include "LALValue_private.h"
26#include "config.h"
27
30 LALValue value;
31};
32
33struct tagLALList {
35};
36
37/* LIST ITEM ROUTINES */
38
39LALListItem * XLALListItemAlloc(size_t size)
40{
41 LALListItem *item;
42 item = XLALMalloc(sizeof(*item) + size);
43 if (!item)
45 item->value.size = size;
46 return item;
47}
48
49LALListItem * XLALListItemRealloc(LALListItem *item, size_t size)
50{
51 if (item == NULL)
52 return XLALListItemAlloc(size);
53 item = XLALRealloc(item, sizeof(*item) + size);
54 if (!item)
56 item->value.size = size;
57 return item;
58}
59
60LALListItem * XLALListItemSet(LALListItem *item, const void *data, size_t size, LALTYPECODE type)
61{
62 if (XLALValueSet(&item->value, data, size, type) == NULL)
64 return item;
65}
66
67LALListItem * XLALListItemSetValue(LALListItem *item, const LALValue *value)
68{
69 if (XLALValueCopy(&item->value, value) == NULL)
71 return item;
72}
73
74LALListItem * XLALListItemDuplicate(const LALListItem *item)
75{
76 size_t size = sizeof(LALListItem) + item->value.size;
77 LALListItem *copy = XLALMalloc(size);
78 if (!copy)
80 return memcpy(copy, item, size);
81}
82
83const LALValue * XLALListItemGetValue(const LALListItem *item)
84{
85 return &item->value;
86}
87
88LALTYPECODE XLALListItemGetValueType(const LALListItem *item)
89{
90 const LALValue *value = XLALListItemGetValue(item);
91 if (value == NULL)
93 return XLALValueGetType(value);
94}
95
96void * XLALListItemGetValueData(void * data, size_t size, LALTYPECODE type, const LALListItem *item)
97{
98 const LALValue *value = XLALListItemGetValue(item);
99 if (value == NULL)
101 return XLALValueGetData(data, size, type, value);
102}
103
104void * XLALListItemGetBLOBValue(const LALListItem *item)
105{
106 const LALValue *value = XLALListItemGetValue(item);
107 if (value == NULL)
109 return XLALValueGetBLOB(value);
110}
111
112/* warning: shallow pointer */
113const char * XLALListItemGetStringValue(const LALListItem *item)
114{
115 const LALValue *value = XLALListItemGetValue(item);
116 if (value == NULL)
119}
120
121#define DEFINE_GET_FUNC(TYPE, FAILVAL) \
122 TYPE XLALListItemGet ## TYPE ## Value(const LALListItem *item) \
123 { \
124 const LALValue *value = XLALListItemGetValue(item); \
125 if (value == NULL) \
126 XLAL_ERROR_VAL(FAILVAL, XLAL_EFUNC); \
127 return XLALValueGet ## TYPE (value); \
128 }
129
142
143#undef DEFINE_GET_FUNC
144
145REAL8 XLALListItemGetValueAsREAL8(const LALListItem *item)
146{
147 const LALValue *value = XLALListItemGetValue(item);
148 if (value == NULL)
151}
152
153/* LIST ROUTINES */
154
155void XLALDestroyList(LALList *list)
156{
157 if (list != NULL) {
158 LALListItem *item = list->head;
159 while (item) {
160 LALListItem *next = item->next;
161 LALFree(item);
162 item = next;
163 }
164 LALFree(list);
165 }
166 return;
167}
168
169LALList * XLALCreateList(void)
170{
171 return XLALCalloc(1, sizeof(LALList));
172}
173
174LALList * XLALListDuplicate(const LALList *list)
175{
176 LALList *newlist;
177 const LALListItem *item = list->head;
178 LALListItem *head = NULL;
179 LALListItem *prev = NULL;
180
181 while (item) {
182 LALListItem *copy = NULL;
183 copy = XLALListItemDuplicate(item);
184 copy->next = NULL;
185 if (prev == NULL)
186 head = copy;
187 else
188 prev->next = copy;
189 prev = copy;
190 item = item->next;
191 }
192
193 newlist = XLALCreateList();
194 newlist->head = head;
195 return newlist;
196}
197
198int XLALListReverse(LALList *list)
199{
200 if (list != NULL) {
201 LALListItem *item = list->head;
202 LALListItem *tsil = NULL; // reversed list
203 while (item) {
204 LALListItem *next = item->next;
205 item->next = tsil;
206 tsil = item;
207 item = next;
208 }
209 list->head = tsil;
210 }
211 return 0;
212}
213
214static LALListItem *XLALListSortMerge(LALListItem *a, LALListItem *b, int (*cmp)(const LALValue *, const LALValue *, void *), void *thunk)
215{
216 LALListItem *result = NULL;
217 if (a == NULL)
218 return b;
219 if (b == NULL)
220 return a;
221
222 if (cmp(&a->value, &b->value, thunk) <= 0) {
223 result = a;
224 result->next = XLALListSortMerge(a->next, b, cmp, thunk);
225 } else {
226 result = b;
227 result->next = XLALListSortMerge(a, b->next, cmp, thunk);
228 }
229
230 return result;
231}
232
233int XLALListSort(LALList *list, int (*cmp)(const LALValue *, const LALValue *, void *), void *thunk)
234{
235 LALListItem *slow;
236 LALListItem *fast;
237 LALList head;
238 LALList tail;
239
240 if (list->head == NULL || list->head->next == NULL)
241 return 0;
242
243 /* find midpoint */
244 slow = list->head;
245 fast = slow->next;
246 while (fast != NULL) {
247 fast = fast->next;
248 if (fast != NULL) {
249 slow = slow->next;
250 fast = fast->next;
251 }
252 }
253
254 /* split at midpoint to get back half */
255 head.head = list->head;
256 tail.head = slow->next;
257 slow->next = NULL;
258
259 /* recursively sort front and back */
260 XLALListSort(&head, cmp, thunk);
261 XLALListSort(&tail, cmp, thunk);
262
263 /* merge sort front and back */
264 list->head = XLALListSortMerge(head.head, tail.head, cmp, thunk);
265 return 0;
266}
267
268size_t XLALListSize(const LALList *list)
269{
270 size_t size = 0;
271 if (list != NULL) {
272 const LALListItem *item = list->head;
273 while (item) {
274 item = item->next;
275 ++size;
276 }
277 }
278 return size;
279}
280
281void XLALListForeach(LALList *list, void (*func)(LALValue *, void *), void *thunk)
282{
283 if (list != NULL) {
284 LALListItem *item = list->head;
285 while (item) {
286 func(&item->value, thunk);
287 item = item->next;
288 }
289 }
290 return;
291}
292
293LALListItem * XLALListPop(LALList *list)
294{
295 LALListItem *item = NULL;
296 if (list != NULL && list->head != NULL) {
297 item = list->head;
298 list->head = item->next;
299 }
300 return item;
301}
302
303LALListItem * XLALListLast(LALList *list)
304{
305 LALListItem *item = NULL;
306 if (list != NULL && list->head != NULL) {
307 item = list->head;
308 while (item->next != NULL)
309 item = item->next;
310 }
311 return item;
312}
313
314LALListItem * XLALListFind(LALList *list, int (*func)(const LALValue *, void *), void *thunk)
315{
316 LALListItem *item = NULL;
317 if (list != NULL) {
318 item = list->head;
319 while (item) {
320 if (func(&item->value, thunk))
321 break;
322 item = item->next;
323 }
324 }
325 return item;
326}
327
328static int XLALListFindValueFunc(const LALValue *value, void *thunk)
329{
330 const LALValue *target = (const LALValue *)thunk;
331 return XLALValueEqual(value, target);
332}
333
334LALListItem * XLALListFindValue(LALList *list, const LALValue *value)
335{
336 void *thunk = (void *)(uintptr_t)value; /* discard const qualifier */
337 return XLALListFind(list, XLALListFindValueFunc, thunk);
338}
339
340int XLALListReplace(LALList *list, int (*func)(const LALValue *, void *), void *thunk, const LALValue *replace)
341{
342 size_t size = XLALValueGetSize(replace);
343 if (list != NULL) {
344 LALListItem *item = list->head;
345 LALListItem *prev = NULL;
346 while (item) {
347 if (func(&item->value, thunk)) { /* found it! */
348 LALListItem *orig = item;
349
350 if (XLALValueGetSize(&item->value) != size)
351 item = XLALListItemRealloc(orig, size);
352
354
355 /* repair links if necessary */
356 if (orig != item) {
357 if (prev == NULL) /* head is changed */
358 list->head = item;
359 else
360 prev->next = item;
361 }
362
363 return 0;
364 }
365 prev = item;
366 item = item->next;
367 }
368 }
369 return -1; /* not found */
370}
371
372int XLALListReplaceAll(LALList *list, int (*func)(const LALValue *, void *), void *thunk, const LALValue *replace)
373{
374 int replaced = 0;
375 size_t size = XLALValueGetSize(replace);
376 if (list != NULL) {
377 LALListItem *item = list->head;
378 LALListItem *prev = NULL;
379 while (item) {
380 if (func(&item->value, thunk)) { /* found it! */
381 LALListItem *orig = item;
382
383 if (XLALValueGetSize(&item->value) != size)
384 item = XLALListItemRealloc(orig, size);
385
387
388 /* repair links if necessary */
389 if (orig != item) {
390 if (prev == NULL) /* head is changed */
391 list->head = item;
392 else
393 prev->next = item;
394 }
395
396 ++replaced;
397 }
398 prev = item;
399 item = item->next;
400 }
401 }
402 return replaced;
403}
404
405int XLALListReplaceValue(LALList *list, const LALValue *value, const LALValue *replace)
406{
407 void *thunk = (void *)(uintptr_t)value; /* discard const qualifier */
408 return XLALListReplace(list, XLALListFindValueFunc, thunk, replace);
409}
410
411int XLALListReplaceValueAll(LALList *list, const LALValue *value, const LALValue *replace)
412{
413 void *thunk = (void *)(uintptr_t)value; /* discard const qualifier */
415}
416
417int XLALListRemove(LALList *list, int (*func)(const LALValue *, void *), void *thunk)
418{
419 if (list != NULL) {
420 LALListItem *item = list->head;
421 LALListItem *prev = NULL;
422 while (item) {
423 if (func(&item->value, thunk)) { /* found it! */
424 if (prev == NULL) /* head is removed */
425 list->head = item->next;
426 else
427 prev->next = item->next;
428 LALFree(item);
429 return 0;
430 }
431 prev = item;
432 item = item->next;
433 }
434 }
435 return -1; /* not found */
436}
437
438int XLALListRemoveAll(LALList *list, int (*func)(const LALValue *, void *), void *thunk)
439{
440 int removed = 0;
441 if (list != NULL) {
442 LALListItem *item = list->head;
443 LALListItem *prev = NULL;
444 while (item) {
445 if (func(&item->value, thunk)) { /* found it! */
446 LALListItem *next = item->next;
447 if (prev == NULL) /* head is removed */
448 list->head = next;
449 else
450 prev->next = next;
451 LALFree(item);
452 item = next;
453 ++removed;
454 } else {
455 prev = item;
456 item = item->next;
457 }
458 }
459 }
460 return removed;
461}
462
463int XLALListRemoveValue(LALList *list, const LALValue *value)
464{
465 void *thunk = (void *)(uintptr_t)value; /* discard const qualifier */
466 return XLALListRemove(list, XLALListFindValueFunc, thunk);
467}
468
469int XLALListRemoveValueAll(LALList *list, const LALValue *value)
470{
471 void *thunk = (void *)(uintptr_t)value; /* discard const qualifier */
472 return XLALListRemoveAll(list, XLALListFindValueFunc, thunk);
473}
474
475void XLALListIterInit(LALListIter *iter, LALList *list)
476{
477 iter->next = list == NULL ? NULL : list->head;
478}
479
480LALListItem * XLALListIterNext(LALListIter *iter)
481{
482 if (iter->next == NULL) /* iteration terminated */
483 return NULL;
484 LALListItem *next = iter->next;
485 iter->next = next->next;
486 return next;
487}
488
489int XLALListAdd(LALList *list, const void *data, size_t size, LALTYPECODE type)
490{
491 LALListItem *item;
492
493 XLAL_CHECK(list != NULL, XLAL_EFAULT);
494
495 item = XLALListItemAlloc(size);
496 if (item == NULL)
498
499 if (XLALListItemSet(item, data, size, type) == NULL) {
500 LALFree(item);
502 }
503
504 item->next = list->head;
505 list->head = item;
506 return 0;
507}
508
509int XLALListAddValue(LALList *list, const LALValue *value)
510{
512 size_t size = XLALValueGetSize(value);
513 const void * data = XLALValueGetDataPtr(value);
514 return XLALListAdd(list, data, size, type);
515}
516
517int XLALListAddBLOBValue(LALList *list, const void *blob, size_t size)
518{
519 return XLALListAdd(list, blob, size, LAL_UCHAR_TYPE_CODE);
520}
521
522int XLALListAddStringValue(LALList *list, const char *string)
523{
524 size_t size = strlen(string) + 1;
525 return XLALListAdd(list, string, size, LAL_CHAR_TYPE_CODE);
526}
527
528#define DEFINE_ADD_FUNC(TYPE, TCODE) \
529 int XLALListAdd ## TYPE ## Value (LALList *list, TYPE value) \
530 { return XLALListAdd(list, &value, sizeof(value), TCODE); } \
531
544
545#undef DEFINE_ADD_FUNC
546
548
549static void XLALListAsStringAppendValueFunc(LALValue *value, void *thunk)
550{
552 if (p->first)
553 p->first = 0;
554 else
555 p->s = XLALStringAppend(p->s, ", ");
556 p->s = XLALValueAsStringAppend(p->s, value);
557 return;
558}
559
560char * XLALListAsStringAppend(char *s, const LALList *list)
561{
562 LALList *l = (LALList *)(uintptr_t)list; // discarding const qual is harmless
563
565 p.s = XLALStringAppend(p.s, "[");
567 p.s = XLALStringAppend(p.s, "]");
568 return p.s;
569}
570
571void XLALListPrint(const LALList *list, int fd)
572{
573 char *s = NULL;
574 s = XLALListAsStringAppend(s, list);
576#if HAVE_DPRINTF
577 dprintf(fd, "%s", s);
578#else
579 /* hack... */
580 switch (fd) {
581 case 1:
582 fprintf(stdout, "%s", s);
583 break;
584 case 2:
585 fprintf(stderr, "%s", s);
586 break;
587 default:
588 LALFree(s);
589 XLAL_ERROR_VOID(XLAL_EIO, "Don't know what to do with file descriptor %d", fd);
590 }
591#endif
592 LALFree(s);
593 return;
594}
int XLALListAddValue(LALList *list, const LALValue *value)
Definition: LALList.c:509
#define DEFINE_GET_FUNC(TYPE, FAILVAL)
Definition: LALList.c:121
LALListItem * XLALListLast(LALList *list)
Definition: LALList.c:303
int XLALListReverse(LALList *list)
Definition: LALList.c:198
size_t XLALListSize(const LALList *list)
Definition: LALList.c:268
LALList * XLALCreateList(void)
Definition: LALList.c:169
LALListItem * XLALListPop(LALList *list)
Definition: LALList.c:293
static int XLALListFindValueFunc(const LALValue *value, void *thunk)
Definition: LALList.c:328
void XLALListIterInit(LALListIter *iter, LALList *list)
Definition: LALList.c:475
REAL8 XLALListItemGetValueAsREAL8(const LALListItem *item)
Definition: LALList.c:145
LALListItem * XLALListItemDuplicate(const LALListItem *item)
Definition: LALList.c:74
#define DEFINE_ADD_FUNC(TYPE, TCODE)
Definition: LALList.c:528
LALListItem * XLALListItemAlloc(size_t size)
Definition: LALList.c:39
int XLALListRemoveValue(LALList *list, const LALValue *value)
Definition: LALList.c:463
int XLALListReplaceValue(LALList *list, const LALValue *value, const LALValue *replace)
Definition: LALList.c:405
int XLALListReplaceValueAll(LALList *list, const LALValue *value, const LALValue *replace)
Definition: LALList.c:411
int XLALListSort(LALList *list, int(*cmp)(const LALValue *, const LALValue *, void *), void *thunk)
Definition: LALList.c:233
int XLALListAddStringValue(LALList *list, const char *string)
Definition: LALList.c:522
LALList * XLALListDuplicate(const LALList *list)
Definition: LALList.c:174
const LALValue * XLALListItemGetValue(const LALListItem *item)
Definition: LALList.c:83
LALListItem * XLALListItemSetValue(LALListItem *item, const LALValue *value)
Definition: LALList.c:67
LALListItem * XLALListIterNext(LALListIter *iter)
Definition: LALList.c:480
void XLALListForeach(LALList *list, void(*func)(LALValue *, void *), void *thunk)
Definition: LALList.c:281
const char * XLALListItemGetStringValue(const LALListItem *item)
Definition: LALList.c:113
void XLALListPrint(const LALList *list, int fd)
Definition: LALList.c:571
int XLALListRemoveValueAll(LALList *list, const LALValue *value)
Definition: LALList.c:469
LALListItem * XLALListFind(LALList *list, int(*func)(const LALValue *, void *), void *thunk)
Definition: LALList.c:314
LALListItem * XLALListItemRealloc(LALListItem *item, size_t size)
Definition: LALList.c:49
int XLALListAddBLOBValue(LALList *list, const void *blob, size_t size)
Definition: LALList.c:517
static void XLALListAsStringAppendValueFunc(LALValue *value, void *thunk)
Definition: LALList.c:549
LALTYPECODE XLALListItemGetValueType(const LALListItem *item)
Definition: LALList.c:88
static LALListItem * XLALListSortMerge(LALListItem *a, LALListItem *b, int(*cmp)(const LALValue *, const LALValue *, void *), void *thunk)
Definition: LALList.c:214
int XLALListReplaceAll(LALList *list, int(*func)(const LALValue *, void *), void *thunk, const LALValue *replace)
Definition: LALList.c:372
void * XLALListItemGetValueData(void *data, size_t size, LALTYPECODE type, const LALListItem *item)
Definition: LALList.c:96
int XLALListAdd(LALList *list, const void *data, size_t size, LALTYPECODE type)
Definition: LALList.c:489
int XLALListRemoveAll(LALList *list, int(*func)(const LALValue *, void *), void *thunk)
Definition: LALList.c:438
void XLALDestroyList(LALList *list)
Definition: LALList.c:155
void * XLALListItemGetBLOBValue(const LALListItem *item)
Definition: LALList.c:104
int XLALListRemove(LALList *list, int(*func)(const LALValue *, void *), void *thunk)
Definition: LALList.c:417
LALListItem * XLALListItemSet(LALListItem *item, const void *data, size_t size, LALTYPECODE type)
Definition: LALList.c:60
int XLALListReplace(LALList *list, int(*func)(const LALValue *, void *), void *thunk, const LALValue *replace)
Definition: LALList.c:340
char * XLALListAsStringAppend(char *s, const LALList *list)
Definition: LALList.c:560
LALListItem * XLALListFindValue(LALList *list, const LALValue *value)
Definition: LALList.c:334
#define LALFree(p)
Definition: LALMalloc.h:96
static int replace(int c, void *param)
Definition: LALString.c:373
char * XLALValueAsStringAppend(char *s, const LALValue *value)
Definition: LALValue.c:313
const void * XLALValueGetDataPtr(const LALValue *value)
Definition: LALValue.c:191
REAL8 XLALValueGetAsREAL8(const LALValue *value)
Definition: LALValue.c:256
LALValue * XLALValueCopy(LALValue *copy, const LALValue *orig)
Definition: LALValue.c:60
int XLALValueEqual(const LALValue *value1, const LALValue *value2)
Definition: LALValue.c:203
void * XLALValueGetData(void *data, size_t size, LALTYPECODE type, const LALValue *value)
Definition: LALValue.c:196
LALValue * XLALValueSet(LALValue *value, const void *data, size_t size, LALTYPECODE type)
Definition: LALValue.c:68
const char * XLALValueGetString(const LALValue *value)
Definition: LALValue.c:223
size_t XLALValueGetSize(const LALValue *value)
Definition: LALValue.c:185
void * XLALValueGetBLOB(const LALValue *value)
Definition: LALValue.c:210
LALTYPECODE XLALValueGetType(const LALValue *value)
Definition: LALValue.c:180
static int cmp(REAL4Sequence *a, REAL4Sequence *b)
Definition: SequenceTest.c:62
#define fprintf
LALTYPECODE
Type codes: use these type codes to identify a LAL atomic data type, see Headers LAL(Atomic)Datatypes...
Definition: LALDatatypes.h:49
unsigned char UCHAR
One-byte unsigned integer, see Headers LAL(Atomic)Datatypes.h for more details.
uint64_t UINT8
Eight-byte unsigned integer; on some platforms this is equivalent to unsigned long int instead.
double complex COMPLEX16
Double-precision floating-point complex number (16 bytes total)
double REAL8
Double precision real floating-point number (8 bytes).
int16_t INT2
Two-byte signed integer.
int64_t INT8
Eight-byte signed integer; on some platforms this is equivalent to long int instead.
uint16_t UINT2
Two-byte unsigned integer.
char CHAR
One-byte signed integer, see Headers LAL(Atomic)Datatypes.h for more details.
uint32_t UINT4
Four-byte unsigned integer.
float complex COMPLEX8
Single-precision floating-point complex number (8 bytes total)
int32_t INT4
Four-byte signed integer.
float REAL4
Single precision real floating-point number (4 bytes).
@ LAL_C_TYPE_CODE
COMPLEX8 type code (27)
Definition: LALDatatypes.h:60
@ LAL_CHAR_TYPE_CODE
CHAR type code (0)
Definition: LALDatatypes.h:50
@ LAL_U2_TYPE_CODE
UINT2 type code (33)
Definition: LALDatatypes.h:55
@ LAL_Z_TYPE_CODE
COMPLEX16 type code (28)
Definition: LALDatatypes.h:61
@ LAL_S_TYPE_CODE
REAL4 type code (18)
Definition: LALDatatypes.h:58
@ LAL_I2_TYPE_CODE
INT2 type code (1)
Definition: LALDatatypes.h:51
@ LAL_I8_TYPE_CODE
INT8 type code (3)
Definition: LALDatatypes.h:53
@ LAL_D_TYPE_CODE
REAL8 type code (19)
Definition: LALDatatypes.h:59
@ LAL_I4_TYPE_CODE
INT4 type code (2)
Definition: LALDatatypes.h:52
@ LAL_UCHAR_TYPE_CODE
UCHAR type code (32)
Definition: LALDatatypes.h:54
@ LAL_U8_TYPE_CODE
UINT8 type code (35)
Definition: LALDatatypes.h:57
@ LAL_U4_TYPE_CODE
UINT4 type code (34)
Definition: LALDatatypes.h:56
#define XLALMalloc(n)
Definition: LALMalloc.h:44
#define XLALCalloc(m, n)
Definition: LALMalloc.h:45
#define XLALRealloc(p, n)
Definition: LALMalloc.h:46
char * XLALStringAppend(char *s, const char *append)
Like strcat but dynamically reallocates string with LALRealloc.
Definition: LALString.c:50
static const INT4 a
Definition: Random.c:79
#define XLAL_ERROR_VOID(...)
Macro to invoke a failure from a XLAL routine returning void.
Definition: XLALError.h:726
#define XLAL_ERROR_REAL8(...)
Macro to invoke a failure from a XLAL routine returning a REAL8.
Definition: XLALError.h:752
#define XLAL_ERROR_NULL(...)
Macro to invoke a failure from a XLAL routine returning a pointer.
Definition: XLALError.h:713
#define XLAL_ERROR(...)
Macro to invoke a failure from a XLAL routine returning an integer.
Definition: XLALError.h:700
#define XLAL_CHECK(assertion,...)
Macro to test an assertion and invoke a failure if it is not true in a function that returns an integ...
Definition: XLALError.h:810
#define XLAL_CHECK_VOID(assertion,...)
Macro to test an assertion and invoke a failure if it is not true in a function that returns void.
Definition: XLALError.h:840
#define XLAL_REAL4_FAIL_NAN
Floating-point value of the XLAL REAL4 failure NaN.
Definition: XLALError.h:388
#define XLAL_REAL8_FAIL_NAN
Floating-point value of the XLAL REAL8 failure NaN.
Definition: XLALError.h:389
@ XLAL_ENOMEM
Memory allocation error.
Definition: XLALError.h:407
@ XLAL_EFAULT
Invalid pointer.
Definition: XLALError.h:408
@ XLAL_EFUNC
Internal function call failed bit: "or" this with existing error number.
Definition: XLALError.h:462
@ XLAL_EIO
I/O error.
Definition: XLALError.h:406
@ XLAL_FAILURE
Failure return value (not an error number)
Definition: XLALError.h:402
struct tagLALListItem * head
Definition: LALList.c:34
LALValue value
Definition: LALList.c:30
struct tagLALListItem * next
Definition: LALList.c:29