Loading [MathJax]/extensions/TeX/AMSsymbols.js
LAL 7.7.0.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
28extern "C" {
29#elif 0
30} /* so that editors will match preceding brace */
31#endif
32
33struct tagLALValue;
34typedef struct tagLALValue LALValue;
35
36LALValue *XLALValueAlloc(size_t size);
37LALValue *XLALValueRealloc(LALValue *value, size_t size);
38LALValue *XLALValueDuplicate(const LALValue *value);
39LALValue *XLALValueCopy(LALValue *copy, const LALValue *orig);
40LALValue *XLALValueSet(LALValue *value, const void *data, size_t size, LALTYPECODE type);
41
42void XLALDestroyValue(LALValue *value);
43
44LALValue *XLALCreateValue(const void * data, size_t size, LALTYPECODE type);
45LALValue *XLALCreateBLOBValue(const void *blob, size_t size);
46LALValue *XLALCreateStringValue(const char *string);
47LALValue *XLALCreateCHARValue(CHAR value);
48LALValue *XLALCreateINT2Value(INT2 value);
49LALValue *XLALCreateINT4Value(INT4 value);
50LALValue *XLALCreateINT8Value(INT8 value);
51LALValue *XLALCreateUCHARValue(UCHAR value);
52LALValue *XLALCreateUINT2Value(UINT2 value);
53LALValue *XLALCreateUINT4Value(UINT4 value);
54LALValue *XLALCreateUINT8Value(UINT8 value);
55LALValue *XLALCreateREAL4Value(REAL4 value);
56LALValue *XLALCreateREAL8Value(REAL8 value);
59
60LALTYPECODE XLALValueGetType(const LALValue *value);
61size_t XLALValueGetSize(const LALValue *value);
62/* warning: shallow pointer */
63const void * XLALValueGetDataPtr(const LALValue *value);
64void * XLALValueGetData(void *data, size_t size, LALTYPECODE type, const LALValue *value);
65int XLALValueEqual(const LALValue *value1, const LALValue *value2);
66
67void * XLALValueGetBLOB(const LALValue *value);
68/* warning: shallow pointer */
69const char * XLALValueGetString(const LALValue *value);
70CHAR XLALValueGetCHAR(const LALValue *value);
71INT2 XLALValueGetINT2(const LALValue *value);
72INT4 XLALValueGetINT4(const LALValue *value);
73INT8 XLALValueGetINT8(const LALValue *value);
74UCHAR XLALValueGetUCHAR(const LALValue *value);
75UINT2 XLALValueGetUINT2(const LALValue *value);
76UINT4 XLALValueGetUINT4(const LALValue *value);
77UINT8 XLALValueGetUINT8(const LALValue *value);
78REAL4 XLALValueGetREAL4(const LALValue *value);
79REAL8 XLALValueGetREAL8(const LALValue *value);
80COMPLEX8 XLALValueGetCOMPLEX8(const LALValue *value);
81COMPLEX16 XLALValueGetCOMPLEX16(const LALValue *value);
82
83REAL8 XLALValueGetAsREAL8(const LALValue *value);
84
85char * XLALValueAsStringAppend(char *s, const LALValue *value);
86void 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 */
LALValue * XLALCreateUINT2Value(UINT2 value)
LALValue * XLALValueRealloc(LALValue *value, size_t size)
Definition: LALValue.c:40
char * XLALValueAsStringAppend(char *s, const LALValue *value)
Definition: LALValue.c:313
LALValue * XLALCreateCHARValue(CHAR value)
REAL8 XLALValueGetREAL8(const LALValue *value)
REAL4 XLALValueGetREAL4(const LALValue *value)
LALValue * XLALCreateValue(const void *data, size_t size, LALTYPECODE type)
Definition: LALValue.c:128
const void * XLALValueGetDataPtr(const LALValue *value)
Definition: LALValue.c:191
REAL8 XLALValueGetAsREAL8(const LALValue *value)
Definition: LALValue.c:256
LALValue * XLALValueAlloc(size_t size)
Definition: LALValue.c:30
LALValue * XLALCreateUCHARValue(UCHAR value)
LALValue * XLALValueCopy(LALValue *copy, const LALValue *orig)
Definition: LALValue.c:60
INT2 XLALValueGetINT2(const LALValue *value)
INT8 XLALValueGetINT8(const LALValue *value)
LALValue * XLALCreateINT8Value(INT8 value)
CHAR XLALValueGetCHAR(const LALValue *value)
UCHAR XLALValueGetUCHAR(const LALValue *value)
LALValue * XLALCreateREAL4Value(REAL4 value)
int XLALValueEqual(const LALValue *value1, const LALValue *value2)
Definition: LALValue.c:203
COMPLEX8 XLALValueGetCOMPLEX8(const LALValue *value)
LALValue * XLALCreateBLOBValue(const void *blob, size_t size)
Definition: LALValue.c:139
void * XLALValueGetData(void *data, size_t size, LALTYPECODE type, const LALValue *value)
Definition: LALValue.c:196
COMPLEX16 XLALValueGetCOMPLEX16(const LALValue *value)
LALValue * XLALCreateCOMPLEX16Value(COMPLEX16 value)
void XLALDestroyValue(LALValue *value)
Definition: LALValue.c:122
LALValue * XLALCreateCOMPLEX8Value(COMPLEX8 value)
void XLALValuePrint(const LALValue *value, int fd)
Definition: LALValue.c:392
LALValue * XLALValueSet(LALValue *value, const void *data, size_t size, LALTYPECODE type)
Definition: LALValue.c:68
LALValue * XLALCreateUINT8Value(UINT8 value)
LALValue * XLALValueDuplicate(const LALValue *value)
Definition: LALValue.c:51
LALValue * XLALCreateREAL8Value(REAL8 value)
UINT8 XLALValueGetUINT8(const LALValue *value)
LALValue * XLALCreateStringValue(const char *string)
Definition: LALValue.c:147
const char * XLALValueGetString(const LALValue *value)
Definition: LALValue.c:223
size_t XLALValueGetSize(const LALValue *value)
Definition: LALValue.c:185
INT4 XLALValueGetINT4(const LALValue *value)
LALValue * XLALCreateINT4Value(INT4 value)
LALValue * XLALCreateINT2Value(INT2 value)
void * XLALValueGetBLOB(const LALValue *value)
Definition: LALValue.c:210
UINT4 XLALValueGetUINT4(const LALValue *value)
LALValue * XLALCreateUINT4Value(UINT4 value)
UINT2 XLALValueGetUINT2(const LALValue *value)
LALTYPECODE XLALValueGetType(const LALValue *value)
Definition: LALValue.c:180
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).
LALTYPECODE type
union tagLALValue::@14 data[]