LAL  7.5.0.1-08ee4f4
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 
33 struct tagLALList {
35 };
36 
37 /* LIST ITEM ROUTINES */
38 
39 LALListItem * 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 
49 LALListItem * 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 
60 LALListItem * 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 
67 LALListItem * XLALListItemSetValue(LALListItem *item, const LALValue *value)
68 {
69  if (XLALValueCopy(&item->value, value) == NULL)
71  return item;
72 }
73 
74 LALListItem * 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 
83 const LALValue * XLALListItemGetValue(const LALListItem *item)
84 {
85  return &item->value;
86 }
87 
88 LALTYPECODE XLALListItemGetValueType(const LALListItem *item)
89 {
90  const LALValue *value = XLALListItemGetValue(item);
91  if (value == NULL)
93  return XLALValueGetType(value);
94 }
95 
96 void * 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 
104 void * 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 */
113 const char * XLALListItemGetStringValue(const LALListItem *item)
114 {
115  const LALValue *value = XLALListItemGetValue(item);
116  if (value == NULL)
118  return XLALValueGetString(value);
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 
145 REAL8 XLALListItemGetValueAsREAL8(const LALListItem *item)
146 {
147  const LALValue *value = XLALListItemGetValue(item);
148  if (value == NULL)
150  return XLALValueGetAsREAL8(value);
151 }
152 
153 /* LIST ROUTINES */
154 
155 void 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 
169 LALList * XLALCreateList(void)
170 {
171  return XLALCalloc(1, sizeof(LALList));
172 }
173 
174 LALList * 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 
198 int 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 
214 static 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 
233 int 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 
268 size_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 
281 void 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 
293 LALListItem * 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 
303 LALListItem * 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 
314 LALListItem * 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 
328 static int XLALListFindValueFunc(const LALValue *value, void *thunk)
329 {
330  const LALValue *target = (const LALValue *)thunk;
331  return XLALValueEqual(value, target);
332 }
333 
334 LALListItem * 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 
340 int 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 
372 int 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 
405 int 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 
411 int XLALListReplaceValueAll(LALList *list, const LALValue *value, const LALValue *replace)
412 {
413  void *thunk = (void *)(uintptr_t)value; /* discard const qualifier */
414  return XLALListReplaceAll(list, XLALListFindValueFunc, thunk, replace);
415 }
416 
417 int 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 
438 int 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 
463 int 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 
469 int 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 
475 void XLALListIterInit(LALListIter *iter, LALList *list)
476 {
477  iter->next = list == NULL ? NULL : list->head;
478 }
479 
480 LALListItem * 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 
489 int 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 
509 int 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 
517 int XLALListAddBLOBValue(LALList *list, const void *blob, size_t size)
518 {
519  return XLALListAdd(list, blob, size, LAL_UCHAR_TYPE_CODE);
520 }
521 
522 int 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 
549 static 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 
560 char * XLALListAsStringAppend(char *s, LALList *list)
561 {
563  p.s = XLALStringAppend(p.s, "[");
565  p.s = XLALStringAppend(p.s, "]");
566  return p.s;
567 }
568 
569 void XLALListPrint(LALList *list, int fd)
570 {
571  char *s = NULL;
572  s = XLALListAsStringAppend(s, list);
574 #if HAVE_DPRINTF
575  dprintf(fd, "%s", s);
576 #else
577  /* hack... */
578  switch (fd) {
579  case 1:
580  fprintf(stdout, "%s", s);
581  break;
582  case 2:
583  fprintf(stderr, "%s", s);
584  break;
585  default:
586  LALFree(s);
587  XLAL_ERROR_VOID(XLAL_EIO, "Don't know what to do with file descriptor %d", fd);
588  }
589 #endif
590  LALFree(s);
591  return;
592 }
void XLALListPrint(LALList *list, int fd)
Definition: LALList.c:569
int XLALListAddValue(LALList *list, const LALValue *value)
Definition: LALList.c:509
#define DEFINE_GET_FUNC(TYPE, FAILVAL)
Definition: LALList.c:121
LALListItem * XLALListItemRealloc(LALListItem *item, size_t size)
Definition: LALList.c:49
LALList * XLALListDuplicate(const LALList *list)
Definition: LALList.c:174
int XLALListReverse(LALList *list)
Definition: LALList.c:198
static LALListItem * XLALListSortMerge(LALListItem *a, LALListItem *b, int(*cmp)(const LALValue *, const LALValue *, void *), void *thunk)
Definition: LALList.c:214
LALListItem * XLALListLast(LALList *list)
Definition: LALList.c:303
size_t XLALListSize(const LALList *list)
Definition: LALList.c:268
static int XLALListFindValueFunc(const LALValue *value, void *thunk)
Definition: LALList.c:328
void XLALListIterInit(LALListIter *iter, LALList *list)
Definition: LALList.c:475
const char * XLALListItemGetStringValue(const LALListItem *item)
Definition: LALList.c:113
REAL8 XLALListItemGetValueAsREAL8(const LALListItem *item)
Definition: LALList.c:145
void * XLALListItemGetValueData(void *data, size_t size, LALTYPECODE type, const LALListItem *item)
Definition: LALList.c:96
#define DEFINE_ADD_FUNC(TYPE, TCODE)
Definition: LALList.c:528
int XLALListRemoveValue(LALList *list, const LALValue *value)
Definition: LALList.c:463
void * XLALListItemGetBLOBValue(const LALListItem *item)
Definition: LALList.c:104
LALListItem * XLALListFind(LALList *list, int(*func)(const LALValue *, void *), void *thunk)
Definition: LALList.c:314
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
void XLALListForeach(LALList *list, void(*func)(LALValue *, void *), void *thunk)
Definition: LALList.c:281
int XLALListRemoveValueAll(LALList *list, const LALValue *value)
Definition: LALList.c:469
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
int XLALListReplaceAll(LALList *list, int(*func)(const LALValue *, void *), void *thunk, const LALValue *replace)
Definition: LALList.c:372
int XLALListAdd(LALList *list, const void *data, size_t size, LALTYPECODE type)
Definition: LALList.c:489
LALListItem * XLALListItemSet(LALListItem *item, const void *data, size_t size, LALTYPECODE type)
Definition: LALList.c:60
const LALValue * XLALListItemGetValue(const LALListItem *item)
Definition: LALList.c:83
int XLALListRemoveAll(LALList *list, int(*func)(const LALValue *, void *), void *thunk)
Definition: LALList.c:438
void XLALDestroyList(LALList *list)
Definition: LALList.c:155
int XLALListRemove(LALList *list, int(*func)(const LALValue *, void *), void *thunk)
Definition: LALList.c:417
LALListItem * XLALListItemDuplicate(const LALListItem *item)
Definition: LALList.c:74
LALListItem * XLALListPop(LALList *list)
Definition: LALList.c:293
LALListItem * XLALListIterNext(LALListIter *iter)
Definition: LALList.c:480
LALList * XLALCreateList(void)
Definition: LALList.c:169
LALListItem * XLALListItemSetValue(LALListItem *item, const LALValue *value)
Definition: LALList.c:67
int XLALListReplace(LALList *list, int(*func)(const LALValue *, void *), void *thunk, const LALValue *replace)
Definition: LALList.c:340
char * XLALListAsStringAppend(char *s, LALList *list)
Definition: LALList.c:560
LALListItem * XLALListFindValue(LALList *list, const LALValue *value)
Definition: LALList.c:334
LALListItem * XLALListItemAlloc(size_t size)
Definition: LALList.c:39
#define LALFree(p)
Definition: LALMalloc.h:96
static int replace(int c, void *param)
Definition: LALString.c:373
REAL8 XLALValueGetAsREAL8(const LALValue *value)
Definition: LALValue.c:256
char * XLALValueAsStringAppend(char *s, const LALValue *value)
Definition: LALValue.c:313
int XLALValueEqual(const LALValue *value1, const LALValue *value2)
Definition: LALValue.c:203
void * XLALValueGetBLOB(const LALValue *value)
Definition: LALValue.c:210
LALValue * XLALValueCopy(LALValue *copy, const LALValue *orig)
Definition: LALValue.c:60
size_t XLALValueGetSize(const LALValue *value)
Definition: LALValue.c:185
const void * XLALValueGetDataPtr(const LALValue *value)
Definition: LALValue.c:191
const char * XLALValueGetString(const LALValue *value)
Definition: LALValue.c:223
void * XLALValueGetData(void *data, size_t size, LALTYPECODE type, const LALValue *value)
Definition: LALValue.c:196
LALTYPECODE XLALValueGetType(const LALValue *value)
Definition: LALValue.c:180
LALValue * XLALValueSet(LALValue *value, const void *data, size_t size, LALTYPECODE type)
Definition: LALValue.c:68
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