Serialbox  2.2.0
Data serialization library and tools for C/C++, Python and Fortran
Array.h
1 /*===-- serialbox-c/Array.h ---------------------------------------------------------*- C++ -*-===*\
2  *
3  * S E R I A L B O X
4  *
5  * This file is distributed under terms of BSD license.
6  * See LICENSE.txt for more information
7  *
8  *===------------------------------------------------------------------------------------------===//
9  *
10  *! \file
11  *! This file contains the array type definitions of the C Interface of Serialbox.
12  *
13 \*===------------------------------------------------------------------------------------------===*/
14 
15 #include "serialbox-c/Api.h"
16 #include "serialbox-c/Type.h"
17 
18 #ifndef SERIALBOX_C_ARRAY_H
19 #define SERIALBOX_C_ARRAY_H
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
33 /*===------------------------------------------------------------------------------------------===*\
34  * Array Types
35 \*===------------------------------------------------------------------------------------------===*/
36 
40 SERIALBOX_API typedef struct {
41  serialboxBoolean_t* data;
42  int len;
44 
48 SERIALBOX_API typedef struct {
49  serialboxInt32_t* data;
50  int len;
52 
56 SERIALBOX_API typedef struct {
57  serialboxInt64_t* data;
58  int len;
60 
64 SERIALBOX_API typedef struct {
65  serialboxFloat32_t* data;
66  int len;
68 
72 SERIALBOX_API typedef struct {
73  serialboxFloat64_t* data;
74  int len;
76 
80 SERIALBOX_API typedef struct {
81  serialboxString_t* data;
82  int len;
84 
93 SERIALBOX_API serialboxArrayOfInt32_t* serialboxArrayOfInt32Create(int len);
94 SERIALBOX_API serialboxArrayOfInt64_t* serialboxArrayOfInt64Create(int len);
95 SERIALBOX_API serialboxArrayOfFloat32_t* serialboxArrayOfFloat32Create(int len);
96 SERIALBOX_API serialboxArrayOfFloat64_t* serialboxArrayOfFloat64Create(int len);
97 SERIALBOX_API serialboxArrayOfString_t* serialboxArrayOfStringCreate(int len);
107 SERIALBOX_API void serialboxArrayOfInt32Destroy(serialboxArrayOfInt32_t* array);
108 SERIALBOX_API void serialboxArrayOfInt64Destroy(serialboxArrayOfInt64_t* array);
109 SERIALBOX_API void serialboxArrayOfFloat32Destroy(serialboxArrayOfFloat32_t* array);
110 SERIALBOX_API void serialboxArrayOfFloat64Destroy(serialboxArrayOfFloat64_t* array);
111 SERIALBOX_API void serialboxArrayOfStringDestroy(serialboxArrayOfString_t* array);
116 #ifdef __cplusplus
117 }
118 #endif
119 
120 #endif
Array of booleans.
Definition: Array.h:40
SERIALBOX_API typedef int serialboxBoolean_t
Boolean type of serialbox.
Definition: Type.h:41
SERIALBOX_API typedef int64_t serialboxInt64_t
64-bit integral type of serialbox
Definition: Type.h:51
SERIALBOX_API serialboxArrayOfBoolean_t * serialboxArrayOfBooleanCreate(int len)
Allocate array of type T of size len
SERIALBOX_API typedef int32_t serialboxInt32_t
32-bit integral type of serialbox
Definition: Type.h:46
Array of strings.
Definition: Array.h:80
SERIALBOX_API typedef char * serialboxString_t
String type of serialbox.
Definition: Type.h:66
SERIALBOX_API typedef float serialboxFloat32_t
32-bit floating point type of serialbox (float)
Definition: Type.h:56
SERIALBOX_API void serialboxArrayOfBooleanDestroy(serialboxArrayOfBoolean_t *array)
Deallocate array.
SERIALBOX_API typedef double serialboxFloat64_t
64-bit floating point type of serialbox (double)
Definition: Type.h:61
Array of 32-bit integers.
Definition: Array.h:48
Array of 32-bit floating point numbers (float)
Definition: Array.h:64
Array of 64-bit floating point numbers (double)
Definition: Array.h:72
Array of 64-bit integers.
Definition: Array.h:56