LAL  7.5.0.1-08ee4f4
LALValue.h
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 #ifndef _LAL_VALUE_H
21 #define _LAL_VALUE_H
22 
23 #include <stdio.h>
24 #include <stddef.h>
25 #include <lal/LALDatatypes.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #elif 0
30 } /* so that editors will match preceding brace */
31 #endif
32 
33 struct tagLALValue;
34 typedef struct tagLALValue LALValue;
35 
36 LALValue *XLALValueAlloc(size_t size);
37 LALValue *XLALValueRealloc(LALValue *value, size_t size);
38 LALValue *XLALValueDuplicate(const LALValue *value);
39 LALValue *XLALValueCopy(LALValue *copy, const LALValue *orig);
40 LALValue *XLALValueSet(LALValue *value, const void *data, size_t size, LALTYPECODE type);
41 
42 void XLALDestroyValue(LALValue *value);
43 
44 LALValue *XLALCreateValue(const void * data, size_t size, LALTYPECODE type);
45 LALValue *XLALCreateBLOBValue(const void *blob, size_t size);
46 LALValue *XLALCreateStringValue(const char *string);
47 LALValue *XLALCreateCHARValue(CHAR value);
48 LALValue *XLALCreateINT2Value(INT2 value);
49 LALValue *XLALCreateINT4Value(INT4 value);
50 LALValue *XLALCreateINT8Value(INT8 value);
51 LALValue *XLALCreateUCHARValue(UCHAR value);
52 LALValue *XLALCreateUINT2Value(UINT2 value);
53 LALValue *XLALCreateUINT4Value(UINT4 value);
54 LALValue *XLALCreateUINT8Value(UINT8 value);
55 LALValue *XLALCreateREAL4Value(REAL4 value);
56 LALValue *XLALCreateREAL8Value(REAL8 value);
59 
60 LALTYPECODE XLALValueGetType(const LALValue *value);
61 size_t XLALValueGetSize(const LALValue *value);
62 /* warning: shallow pointer */
63 const void * XLALValueGetDataPtr(const LALValue *value);
64 void * XLALValueGetData(void *data, size_t size, LALTYPECODE type, const LALValue *value);
65 int XLALValueEqual(const LALValue *value1, const LALValue *value2);
66 
67 void * XLALValueGetBLOB(const LALValue *value);
68 /* warning: shallow pointer */
69 const char * XLALValueGetString(const LALValue *value);
70 CHAR XLALValueGetCHAR(const LALValue *value);
71 INT2 XLALValueGetINT2(const LALValue *value);
72 INT4 XLALValueGetINT4(const LALValue *value);
73 INT8 XLALValueGetINT8(const LALValue *value);
74 UCHAR XLALValueGetUCHAR(const LALValue *value);
75 UINT2 XLALValueGetUINT2(const LALValue *value);
76 UINT4 XLALValueGetUINT4(const LALValue *value);
77 UINT8 XLALValueGetUINT8(const LALValue *value);
78 REAL4 XLALValueGetREAL4(const LALValue *value);
79 REAL8 XLALValueGetREAL8(const LALValue *value);
80 COMPLEX8 XLALValueGetCOMPLEX8(const LALValue *value);
81 COMPLEX16 XLALValueGetCOMPLEX16(const LALValue *value);
82 
83 REAL8 XLALValueGetAsREAL8(const LALValue *value);
84 
85 char * XLALValueAsStringAppend(char *s, const LALValue *value);
86 void XLALValuePrint(const LALValue *value, int fd);
87 
88 #if 0
89 { /* so that editors will match succeeding brace */
90 #elif defined(__cplusplus)
91 }
92 #endif
93 #endif /* _LAL_VALUE_H */
REAL8 XLALValueGetREAL8(const LALValue *value)
LALValue * XLALCreateUCHARValue(UCHAR value)
REAL4 XLALValueGetREAL4(const LALValue *value)
LALValue * XLALValueRealloc(LALValue *value, size_t size)
Definition: LALValue.c:40
LALValue * XLALCreateUINT2Value(UINT2 value)
REAL8 XLALValueGetAsREAL8(const LALValue *value)
Definition: LALValue.c:256
LALValue * XLALCreateCHARValue(CHAR value)
LALValue * XLALCreateCOMPLEX16Value(COMPLEX16 value)
INT2 XLALValueGetINT2(const LALValue *value)
INT8 XLALValueGetINT8(const LALValue *value)
CHAR XLALValueGetCHAR(const LALValue *value)
LALValue * XLALCreateINT8Value(INT8 value)
UCHAR XLALValueGetUCHAR(const LALValue *value)
char * XLALValueAsStringAppend(char *s, const LALValue *value)
Definition: LALValue.c:313
LALValue * XLALValueDuplicate(const LALValue *value)
Definition: LALValue.c:51
int XLALValueEqual(const LALValue *value1, const LALValue *value2)
Definition: LALValue.c:203
COMPLEX8 XLALValueGetCOMPLEX8(const LALValue *value)
COMPLEX16 XLALValueGetCOMPLEX16(const LALValue *value)
void * XLALValueGetBLOB(const LALValue *value)
Definition: LALValue.c:210
void XLALDestroyValue(LALValue *value)
Definition: LALValue.c:122
LALValue * XLALCreateREAL4Value(REAL4 value)
LALValue * XLALCreateUINT8Value(UINT8 value)
LALValue * XLALCreateValue(const void *data, size_t size, LALTYPECODE type)
Definition: LALValue.c:128
void XLALValuePrint(const LALValue *value, int fd)
Definition: LALValue.c:392
LALValue * XLALValueCopy(LALValue *copy, const LALValue *orig)
Definition: LALValue.c:60
LALValue * XLALCreateStringValue(const char *string)
Definition: LALValue.c:147
LALValue * XLALCreateINT4Value(INT4 value)
UINT8 XLALValueGetUINT8(const LALValue *value)
LALValue * XLALCreateREAL8Value(REAL8 value)
LALValue * XLALCreateCOMPLEX8Value(COMPLEX8 value)
size_t XLALValueGetSize(const LALValue *value)
Definition: LALValue.c:185
LALValue * XLALCreateUINT4Value(UINT4 value)
const void * XLALValueGetDataPtr(const LALValue *value)
Definition: LALValue.c:191
INT4 XLALValueGetINT4(const LALValue *value)
const char * XLALValueGetString(const LALValue *value)
Definition: LALValue.c:223
LALValue * XLALCreateINT2Value(INT2 value)
LALValue * XLALCreateBLOBValue(const void *blob, size_t size)
Definition: LALValue.c:139
UINT4 XLALValueGetUINT4(const LALValue *value)
void * XLALValueGetData(void *data, size_t size, LALTYPECODE type, const LALValue *value)
Definition: LALValue.c:196
LALValue * XLALValueAlloc(size_t size)
Definition: LALValue.c:30
UINT2 XLALValueGetUINT2(const LALValue *value)
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
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).
union tagLALValue::@15 data[]
LALTYPECODE type