R3BROOT
R3B analysis software
Toggle main menu visibility
Loading...
Searching...
No Matches
R3BUcesbDecl.h
Go to the documentation of this file.
1
#pragma once
2
/******************************************************************************
3
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
4
* Copyright (C) 2019-2025 Members of R3B Collaboration *
5
* *
6
* This software is distributed under the terms of the *
7
* GNU General Public Licence (GPL) version 3, *
8
* copied verbatim in the file "LICENSE". *
9
* *
10
* In applying this license GSI does not waive the privileges and immunities *
11
* granted to it by virtue of its status as an Intergovernmental Organization *
12
* or submit itself to any jurisdiction. *
13
******************************************************************************/
14
15
// This header file can totally be avoided if, for some reasons, Ucesb client code base didn't hide these declarations
16
// in SOURCE file.
17
18
#include <cstddef>
19
#include <cstdint>
20
21
constexpr
auto
EXT_DATA_STATE_INIT
= 0;
22
constexpr
auto
EXT_DATA_STATE_OPEN
= 1;
23
constexpr
auto
EXT_DATA_STATE_OPEN_OUT
= 2;
24
constexpr
auto
EXT_DATA_STATE_PARSED_HEADERS
= 3;
25
constexpr
auto
EXT_DATA_STATE_SETUP_READ
= 4;
26
constexpr
auto
EXT_DATA_STATE_SETUP_WRITE
= 5;
27
28
struct
ext_data_structure_item
29
{
30
uint32_t
_offset
;
/* Not used within STRUCT_WRITER itself. */
31
uint32_t
_length
;
/* not needed, info only */
32
const
char
*
_block
;
/* not needed, info only */
33
34
const
char
*
_var_name
;
35
uint32_t
_var_array_len
;
36
const
char
*
_var_ctrl_name
;
37
uint32_t
_var_type
;
38
uint32_t
_limit_min
;
39
uint32_t
_limit_max
;
40
41
uint32_t
_map_success
;
42
43
#if STRUCT_WRITER
44
uint32_t _ctrl_offset;
45
#endif
46
/* Used for remapping. */
47
struct
ext_data_structure_item
*
_ctrl_item
;
48
struct
ext_data_structure_item
*
_next_off_item
;
49
/* Temporary used while creating remap list. */
50
struct
ext_data_structure_item
*
_match_item
;
51
struct
ext_data_structure_item
*
_child_item
;
52
};
53
54
struct
ext_data_structure_info
55
{
56
struct
ext_data_structure_item
*
_items
;
57
58
/* Used while returning items for ext_data_struct_info_map_success(). */
59
struct
ext_data_structure_item
*
_ret_item
;
60
int
_ret_for_server
;
61
62
struct
ext_data_structure_info
*
_server_struct_info
;
63
64
uint32_t
_map_success
;
65
66
const
char
*
_last_error
;
67
};
68
69
struct
ext_data_client_struct
70
{
71
const
char
*
_id
;
72
73
/* Todo: the following controls _raw_ptr in ext_data_client. With
74
* several structures...?
75
*/
76
uint32_t
_max_raw_words
;
77
78
uint32_t
_orig_xor_sum_msg
;
79
size_t
_orig_struct_size
;
80
void
*
_orig_array
;
/* for mapping */
81
82
uint32_t
_orig_max_pack_items
;
83
uint32_t
_orig_static_pack_items
;
84
85
uint32_t*
_orig_pack_list
;
86
uint32_t*
_orig_pack_list_end
;
87
88
size_t
_dest_struct_size
;
89
90
uint32_t
_dest_max_pack_items
;
91
uint32_t
_dest_static_pack_items
;
92
93
uint32_t*
_dest_pack_list
;
94
uint32_t*
_dest_pack_list_end
;
95
96
uint32_t*
_dest_reverse_pack
;
97
98
uint32_t*
_map_list
;
99
uint32_t*
_map_list_end
;
100
101
struct
ext_data_structure_info
*
_struct_info_msg
;
102
};
103
104
struct
ext_data_client
105
{
106
int
_fd
;
107
int
_fd_close
;
/* If using STDIN, we are not to close it, so -1. */
108
109
char
*
_buf
;
110
size_t
_buf_alloc
;
111
size_t
_buf_used
;
112
size_t
_buf_filled
;
113
114
uint32_t*
_raw_ptr
;
/* This is not allocated; just used. */
115
uint32_t
_raw_words
;
116
uint32_t*
_raw_swapped
;
117
118
struct
ext_data_client_struct
*
_structures
;
119
int
_num_structures
;
120
121
uint32_t
_sort_u32_words
;
122
123
const
char
*
_last_error
;
124
125
int
_state
;
126
127
int
_fetched_event
;
128
};
129
130
/* Layout of the structure information generated.
131
*/
132
133
struct
ext_data_structure_layout_item
134
{
135
uint32_t
_offset
;
136
uint32_t
_size
;
137
uint32_t
_xor
;
138
const
char
*
_name
;
139
};
140
141
struct
ext_data_structure_layout
142
{
143
uint32_t
_magic
;
144
uint32_t
_size_info
;
145
uint32_t
_size_struct
;
146
uint32_t
_size_struct_onion
;
147
uint32_t
_pack_list_items
;
148
149
uint32_t
_num_items
;
150
// NOLINTNEXTLINE
151
struct
ext_data_structure_layout_item
_items
[1];
/* more than 1 for parts */
152
};
EXT_DATA_STATE_INIT
constexpr auto EXT_DATA_STATE_INIT
Definition
R3BUcesbDecl.h:21
EXT_DATA_STATE_OPEN
constexpr auto EXT_DATA_STATE_OPEN
Definition
R3BUcesbDecl.h:22
EXT_DATA_STATE_SETUP_WRITE
constexpr auto EXT_DATA_STATE_SETUP_WRITE
Definition
R3BUcesbDecl.h:26
EXT_DATA_STATE_SETUP_READ
constexpr auto EXT_DATA_STATE_SETUP_READ
Definition
R3BUcesbDecl.h:25
EXT_DATA_STATE_PARSED_HEADERS
constexpr auto EXT_DATA_STATE_PARSED_HEADERS
Definition
R3BUcesbDecl.h:24
EXT_DATA_STATE_OPEN_OUT
constexpr auto EXT_DATA_STATE_OPEN_OUT
Definition
R3BUcesbDecl.h:23
ext_data_client_struct
Definition
R3BUcesbDecl.h:70
ext_data_client_struct::_max_raw_words
uint32_t _max_raw_words
Definition
R3BUcesbDecl.h:76
ext_data_client_struct::_dest_max_pack_items
uint32_t _dest_max_pack_items
Definition
R3BUcesbDecl.h:90
ext_data_client_struct::_dest_pack_list_end
uint32_t * _dest_pack_list_end
Definition
R3BUcesbDecl.h:94
ext_data_client_struct::_orig_pack_list_end
uint32_t * _orig_pack_list_end
Definition
R3BUcesbDecl.h:86
ext_data_client_struct::_orig_max_pack_items
uint32_t _orig_max_pack_items
Definition
R3BUcesbDecl.h:82
ext_data_client_struct::_orig_array
void * _orig_array
Definition
R3BUcesbDecl.h:80
ext_data_client_struct::_id
const char * _id
Definition
R3BUcesbDecl.h:71
ext_data_client_struct::_orig_pack_list
uint32_t * _orig_pack_list
Definition
R3BUcesbDecl.h:85
ext_data_client_struct::_map_list_end
uint32_t * _map_list_end
Definition
R3BUcesbDecl.h:99
ext_data_client_struct::_orig_struct_size
size_t _orig_struct_size
Definition
R3BUcesbDecl.h:79
ext_data_client_struct::_dest_static_pack_items
uint32_t _dest_static_pack_items
Definition
R3BUcesbDecl.h:91
ext_data_client_struct::_dest_reverse_pack
uint32_t * _dest_reverse_pack
Definition
R3BUcesbDecl.h:96
ext_data_client_struct::_map_list
uint32_t * _map_list
Definition
R3BUcesbDecl.h:98
ext_data_client_struct::_dest_struct_size
size_t _dest_struct_size
Definition
R3BUcesbDecl.h:88
ext_data_client_struct::_dest_pack_list
uint32_t * _dest_pack_list
Definition
R3BUcesbDecl.h:93
ext_data_client_struct::_orig_xor_sum_msg
uint32_t _orig_xor_sum_msg
Definition
R3BUcesbDecl.h:78
ext_data_client_struct::_orig_static_pack_items
uint32_t _orig_static_pack_items
Definition
R3BUcesbDecl.h:83
ext_data_client_struct::_struct_info_msg
struct ext_data_structure_info * _struct_info_msg
Definition
R3BUcesbDecl.h:101
ext_data_client
Definition
R3BUcesbDecl.h:105
ext_data_client::_last_error
const char * _last_error
Definition
R3BUcesbDecl.h:123
ext_data_client::_num_structures
int _num_structures
Definition
R3BUcesbDecl.h:119
ext_data_client::_buf_used
size_t _buf_used
Definition
R3BUcesbDecl.h:111
ext_data_client::_sort_u32_words
uint32_t _sort_u32_words
Definition
R3BUcesbDecl.h:121
ext_data_client::_fd
int _fd
Definition
R3BUcesbDecl.h:106
ext_data_client::_fetched_event
int _fetched_event
Definition
R3BUcesbDecl.h:127
ext_data_client::_buf
char * _buf
Definition
R3BUcesbDecl.h:109
ext_data_client::_raw_words
uint32_t _raw_words
Definition
R3BUcesbDecl.h:115
ext_data_client::_state
int _state
Definition
R3BUcesbDecl.h:125
ext_data_client::_raw_swapped
uint32_t * _raw_swapped
Definition
R3BUcesbDecl.h:116
ext_data_client::_fd_close
int _fd_close
Definition
R3BUcesbDecl.h:107
ext_data_client::_buf_filled
size_t _buf_filled
Definition
R3BUcesbDecl.h:112
ext_data_client::_raw_ptr
uint32_t * _raw_ptr
Definition
R3BUcesbDecl.h:114
ext_data_client::_buf_alloc
size_t _buf_alloc
Definition
R3BUcesbDecl.h:110
ext_data_client::_structures
struct ext_data_client_struct * _structures
Definition
R3BUcesbDecl.h:118
ext_data_structure_info
Definition
R3BUcesbDecl.h:55
ext_data_structure_info::_ret_item
struct ext_data_structure_item * _ret_item
Definition
R3BUcesbDecl.h:59
ext_data_structure_info::_ret_for_server
int _ret_for_server
Definition
R3BUcesbDecl.h:60
ext_data_structure_info::_server_struct_info
struct ext_data_structure_info * _server_struct_info
Definition
R3BUcesbDecl.h:62
ext_data_structure_info::_map_success
uint32_t _map_success
Definition
R3BUcesbDecl.h:64
ext_data_structure_info::_items
struct ext_data_structure_item * _items
Definition
R3BUcesbDecl.h:56
ext_data_structure_info::_last_error
const char * _last_error
Definition
R3BUcesbDecl.h:66
ext_data_structure_item
Definition
R3BUcesbDecl.h:29
ext_data_structure_item::_var_array_len
uint32_t _var_array_len
Definition
R3BUcesbDecl.h:35
ext_data_structure_item::_block
const char * _block
Definition
R3BUcesbDecl.h:32
ext_data_structure_item::_var_ctrl_name
const char * _var_ctrl_name
Definition
R3BUcesbDecl.h:36
ext_data_structure_item::_limit_max
uint32_t _limit_max
Definition
R3BUcesbDecl.h:39
ext_data_structure_item::_child_item
struct ext_data_structure_item * _child_item
Definition
R3BUcesbDecl.h:51
ext_data_structure_item::_map_success
uint32_t _map_success
Definition
R3BUcesbDecl.h:41
ext_data_structure_item::_length
uint32_t _length
Definition
R3BUcesbDecl.h:31
ext_data_structure_item::_match_item
struct ext_data_structure_item * _match_item
Definition
R3BUcesbDecl.h:50
ext_data_structure_item::_var_type
uint32_t _var_type
Definition
R3BUcesbDecl.h:37
ext_data_structure_item::_limit_min
uint32_t _limit_min
Definition
R3BUcesbDecl.h:38
ext_data_structure_item::_next_off_item
struct ext_data_structure_item * _next_off_item
Definition
R3BUcesbDecl.h:48
ext_data_structure_item::_var_name
const char * _var_name
Definition
R3BUcesbDecl.h:34
ext_data_structure_item::_ctrl_item
struct ext_data_structure_item * _ctrl_item
Definition
R3BUcesbDecl.h:47
ext_data_structure_item::_offset
uint32_t _offset
Definition
R3BUcesbDecl.h:30
ext_data_structure_layout_item
Definition
R3BUcesbDecl.h:134
ext_data_structure_layout_item::_size
uint32_t _size
Definition
R3BUcesbDecl.h:136
ext_data_structure_layout_item::_offset
uint32_t _offset
Definition
R3BUcesbDecl.h:135
ext_data_structure_layout_item::_xor
uint32_t _xor
Definition
R3BUcesbDecl.h:137
ext_data_structure_layout_item::_name
const char * _name
Definition
R3BUcesbDecl.h:138
ext_data_structure_layout
Definition
R3BUcesbDecl.h:142
ext_data_structure_layout::_magic
uint32_t _magic
Definition
R3BUcesbDecl.h:143
ext_data_structure_layout::_pack_list_items
uint32_t _pack_list_items
Definition
R3BUcesbDecl.h:147
ext_data_structure_layout::_size_info
uint32_t _size_info
Definition
R3BUcesbDecl.h:144
ext_data_structure_layout::_size_struct_onion
uint32_t _size_struct_onion
Definition
R3BUcesbDecl.h:146
ext_data_structure_layout::_num_items
uint32_t _num_items
Definition
R3BUcesbDecl.h:149
ext_data_structure_layout::_items
struct ext_data_structure_layout_item _items[1]
Definition
R3BUcesbDecl.h:151
ext_data_structure_layout::_size_struct
uint32_t _size_struct
Definition
R3BUcesbDecl.h:145
r3bsource
base
utils
R3BUcesbDecl.h
Generated by
1.18.0