libamxo  4.3.4
Object Definition Language (ODL) parsing
amxo_parser_hooks_priv.h File Reference

Go to the source code of this file.

Functions

PRIVATE void amxo_hooks_comment (amxo_parser_t *parser, char *comment, uint32_t len)
 
PRIVATE void amxo_hooks_start (amxo_parser_t *parser)
 
PRIVATE void amxo_hooks_end (amxo_parser_t *parser)
 
PRIVATE void amxo_hooks_start_include (amxo_parser_t *parser, const char *file)
 
PRIVATE void amxo_hooks_end_include (amxo_parser_t *parser, const char *file)
 
PRIVATE void amxo_hooks_start_section (amxo_parser_t *parser, int section_id)
 
PRIVATE void amxo_hooks_end_section (amxo_parser_t *parser, int section_id)
 
PRIVATE void amxo_hooks_set_config (amxo_parser_t *parser, const char *name, amxc_var_t *value)
 
PRIVATE void amxo_hooks_create_object (amxo_parser_t *parser, const char *name, int64_t attr_bitmask, amxd_object_type_t type)
 
PRIVATE void amxo_hooks_add_instance (amxo_parser_t *parser, uint32_t index, const char *name)
 
PRIVATE void amxo_hooks_select_object (amxo_parser_t *parser, const char *path)
 
PRIVATE void amxo_hooks_end_object (amxo_parser_t *parser)
 
PRIVATE void amxo_hooks_add_param (amxo_parser_t *parser, const char *name, int64_t attr_bitmask, uint32_t type)
 
PRIVATE void amxo_hooks_set_param (amxo_parser_t *parser, amxc_var_t *value)
 
PRIVATE void amxo_hooks_end_param (amxo_parser_t *parser)
 
PRIVATE void amxo_hooks_add_func (amxo_parser_t *parser, const char *name, int64_t attr_bitmask, uint32_t type)
 
PRIVATE void amxo_hooks_end_func (amxo_parser_t *parser)
 
PRIVATE void amxo_hooks_add_func_arg (amxo_parser_t *parser, const char *name, int64_t attr_bitmask, uint32_t type, amxc_var_t *def_value)
 
PRIVATE void amxo_hooks_add_mib (amxo_parser_t *parser, const char *mib)
 
PRIVATE void amxo_hooks_set_counter (amxo_parser_t *parser, const char *param_name)
 
PRIVATE void amxo_hooks_set_action_cb (amxo_parser_t *parser, amxd_object_t *object, amxd_param_t *param, amxd_action_t action_id, const char *action_name, const amxc_var_t *data)
 

Function Documentation

◆ amxo_hooks_add_func()

PRIVATE void amxo_hooks_add_func ( amxo_parser_t parser,
const char *  name,
int64_t  attr_bitmask,
uint32_t  type 
)

Definition at line 230 of file amxo_parser_hooks.c.

233  {
234  amxc_llist_for_each(it, parser->hooks) {
235  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
236  if(hook->add_func != NULL) {
237  hook->add_func(parser,
238  parser->object,
239  name,
240  attr_bitmask,
241  type);
242  }
243  }
244 }
amxo_add_param_func_t add_func
Definition: amxo_types.h:198
amxc_llist_t * hooks
Definition: amxo_types.h:274
amxd_object_t * object
Definition: amxo_types.h:262

◆ amxo_hooks_add_func_arg()

PRIVATE void amxo_hooks_add_func_arg ( amxo_parser_t parser,
const char *  name,
int64_t  attr_bitmask,
uint32_t  type,
amxc_var_t *  def_value 
)

Definition at line 270 of file amxo_parser_hooks.c.

274  {
275  amxc_llist_for_each(it, parser->hooks) {
276  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
277  if(hook->add_func_arg != NULL) {
278  hook->add_func_arg(parser,
279  parser->object,
280  parser->func,
281  name,
282  attr_bitmask,
283  type,
284  def_value);
285  }
286  }
287 }
amxo_add_func_arg_t add_func_arg
Definition: amxo_types.h:199
amxd_function_t * func
Definition: amxo_types.h:264

◆ amxo_hooks_add_instance()

PRIVATE void amxo_hooks_add_instance ( amxo_parser_t parser,
uint32_t  index,
const char *  name 
)

Definition at line 154 of file amxo_parser_hooks.c.

156  {
157  amxc_llist_for_each(it, parser->hooks) {
158  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
159  if(hook->add_instance != NULL) {
160  hook->add_instance(parser,
161  parser->object,
162  index,
163  name);
164  }
165  }
166 }
amxo_add_instance_t add_instance
Definition: amxo_types.h:192

◆ amxo_hooks_add_mib()

PRIVATE void amxo_hooks_add_mib ( amxo_parser_t parser,
const char *  mib 
)

Definition at line 257 of file amxo_parser_hooks.c.

258  {
259  amxc_llist_for_each(it, parser->hooks) {
260  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
261  if(hook->add_mib != NULL) {
262  hook->add_mib(parser,
263  parser->object,
264  mib);
265  }
266  }
267 }
amxo_add_mib_t add_mib
Definition: amxo_types.h:201

◆ amxo_hooks_add_param()

PRIVATE void amxo_hooks_add_param ( amxo_parser_t parser,
const char *  name,
int64_t  attr_bitmask,
uint32_t  type 
)

Definition at line 190 of file amxo_parser_hooks.c.

193  {
194  amxc_llist_for_each(it, parser->hooks) {
195  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
196  if(hook->add_param != NULL) {
197  hook->add_param(parser,
198  parser->object,
199  name,
200  attr_bitmask,
201  type);
202  }
203  }
204 }
amxo_add_param_func_t add_param
Definition: amxo_types.h:195

◆ amxo_hooks_comment()

PRIVATE void amxo_hooks_comment ( amxo_parser_t parser,
char *  comment,
uint32_t  len 
)

Definition at line 63 of file amxo_parser_hooks.c.

63  {
64  comment[len] = 0;
65  amxc_llist_for_each(it, parser->hooks) {
66  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
67  if(hook->comment != NULL) {
68  hook->comment(parser, comment);
69  }
70  }
71 }
amxo_comment_t comment
Definition: amxo_types.h:183

◆ amxo_hooks_create_object()

PRIVATE void amxo_hooks_create_object ( amxo_parser_t parser,
const char *  name,
int64_t  attr_bitmask,
amxd_object_type_t  type 
)

Definition at line 138 of file amxo_parser_hooks.c.

141  {
142  amxc_llist_for_each(it, parser->hooks) {
143  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
144  if(hook->create_object != NULL) {
145  hook->create_object(parser,
146  parser->object,
147  name,
148  attr_bitmask,
149  type);
150  }
151  }
152 }
amxo_create_object_t create_object
Definition: amxo_types.h:191

◆ amxo_hooks_end()

PRIVATE void amxo_hooks_end ( amxo_parser_t parser)

Definition at line 82 of file amxo_parser_hooks.c.

82  {
83  amxc_llist_for_each(it, parser->hooks) {
84  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
85  if(hook->end != NULL) {
86  hook->end(parser);
87  }
88  }
89 }
amxo_start_end_t end
Definition: amxo_types.h:185

◆ amxo_hooks_end_func()

PRIVATE void amxo_hooks_end_func ( amxo_parser_t parser)

Definition at line 246 of file amxo_parser_hooks.c.

246  {
247  amxc_llist_for_each(it, parser->hooks) {
248  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
249  if(hook->end_func != NULL) {
250  hook->end_func(parser,
251  parser->object,
252  parser->func);
253  }
254  }
255 }
amxo_end_func_t end_func
Definition: amxo_types.h:200

◆ amxo_hooks_end_include()

PRIVATE void amxo_hooks_end_include ( amxo_parser_t parser,
const char *  file 
)

Definition at line 100 of file amxo_parser_hooks.c.

100  {
101  amxc_llist_for_each(it, parser->hooks) {
102  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
103  if(hook->end_include != NULL) {
104  hook->end_include(parser, file);
105  }
106  }
107 }
amxo_include_t end_include
Definition: amxo_types.h:187

◆ amxo_hooks_end_object()

PRIVATE void amxo_hooks_end_object ( amxo_parser_t parser)

Definition at line 180 of file amxo_parser_hooks.c.

180  {
181  amxc_llist_for_each(it, parser->hooks) {
182  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
183  if(hook->end_object != NULL) {
184  hook->end_object(parser,
185  parser->object);
186  }
187  }
188 }
amxo_end_object_t end_object
Definition: amxo_types.h:194

◆ amxo_hooks_end_param()

PRIVATE void amxo_hooks_end_param ( amxo_parser_t parser)

Definition at line 219 of file amxo_parser_hooks.c.

219  {
220  amxc_llist_for_each(it, parser->hooks) {
221  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
222  if(hook->end_param != NULL) {
223  hook->end_param(parser,
224  parser->object,
225  parser->param);
226  }
227  }
228 }
amxo_end_param_t end_param
Definition: amxo_types.h:197
amxd_param_t * param
Definition: amxo_types.h:263

◆ amxo_hooks_end_section()

PRIVATE void amxo_hooks_end_section ( amxo_parser_t parser,
int  section_id 
)

Definition at line 118 of file amxo_parser_hooks.c.

118  {
119  amxc_llist_for_each(it, parser->hooks) {
120  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
121  if(hook->end_section != NULL) {
122  hook->end_section(parser, section_id);
123  }
124  }
125 }
amxo_section_t end_section
Definition: amxo_types.h:190

◆ amxo_hooks_select_object()

PRIVATE void amxo_hooks_select_object ( amxo_parser_t parser,
const char *  path 
)

Definition at line 168 of file amxo_parser_hooks.c.

169  {
170  amxc_llist_for_each(it, parser->hooks) {
171  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
172  if(hook->select_object != NULL) {
173  hook->select_object(parser,
174  parser->object,
175  path);
176  }
177  }
178 }
amxo_select_object_t select_object
Definition: amxo_types.h:193

◆ amxo_hooks_set_action_cb()

PRIVATE void amxo_hooks_set_action_cb ( amxo_parser_t parser,
amxd_object_t *  object,
amxd_param_t *  param,
amxd_action_t  action_id,
const char *  action_name,
const amxc_var_t *  data 
)

Definition at line 301 of file amxo_parser_hooks.c.

306  {
307  amxc_llist_for_each(it, parser->hooks) {
308  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
309  if(hook->set_action_cb != NULL) {
310  hook->set_action_cb(parser,
311  object,
312  param,
313  action_id,
314  action_name,
315  data);
316  }
317  }
318 }
amxo_set_action_cb_t set_action_cb
Definition: amxo_types.h:203

◆ amxo_hooks_set_config()

PRIVATE void amxo_hooks_set_config ( amxo_parser_t parser,
const char *  name,
amxc_var_t *  value 
)

Definition at line 127 of file amxo_parser_hooks.c.

129  {
130  amxc_llist_for_each(it, parser->hooks) {
131  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
132  if(hook->set_config != NULL) {
133  hook->set_config(parser, name, value);
134  }
135  }
136 }
amxo_set_config_t set_config
Definition: amxo_types.h:188

◆ amxo_hooks_set_counter()

PRIVATE void amxo_hooks_set_counter ( amxo_parser_t parser,
const char *  param_name 
)

Definition at line 289 of file amxo_parser_hooks.c.

290  {
291  amxc_llist_for_each(it, parser->hooks) {
292  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
293  if(hook->set_counter != NULL) {
294  hook->set_counter(parser,
295  parser->object,
296  param_name);
297  }
298  }
299 }
amxo_set_counter_t set_counter
Definition: amxo_types.h:202

◆ amxo_hooks_set_param()

PRIVATE void amxo_hooks_set_param ( amxo_parser_t parser,
amxc_var_t *  value 
)

Definition at line 206 of file amxo_parser_hooks.c.

207  {
208  amxc_llist_for_each(it, parser->hooks) {
209  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
210  if(hook->set_param != NULL) {
211  hook->set_param(parser,
212  parser->object,
213  parser->param,
214  value);
215  }
216  }
217 }
amxo_set_param_t set_param
Definition: amxo_types.h:196

◆ amxo_hooks_start()

PRIVATE void amxo_hooks_start ( amxo_parser_t parser)

Definition at line 73 of file amxo_parser_hooks.c.

73  {
74  amxc_llist_for_each(it, parser->hooks) {
75  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
76  if(hook->start != NULL) {
77  hook->start(parser);
78  }
79  }
80 }
amxo_start_end_t start
Definition: amxo_types.h:184

◆ amxo_hooks_start_include()

PRIVATE void amxo_hooks_start_include ( amxo_parser_t parser,
const char *  file 
)

Definition at line 91 of file amxo_parser_hooks.c.

91  {
92  amxc_llist_for_each(it, parser->hooks) {
93  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
94  if(hook->start_include != NULL) {
95  hook->start_include(parser, file);
96  }
97  }
98 }
amxo_include_t start_include
Definition: amxo_types.h:186

◆ amxo_hooks_start_section()

PRIVATE void amxo_hooks_start_section ( amxo_parser_t parser,
int  section_id 
)

Definition at line 109 of file amxo_parser_hooks.c.

109  {
110  amxc_llist_for_each(it, parser->hooks) {
111  amxo_hooks_t* hook = amxc_container_of(it, amxo_hooks_t, it);
112  if(hook->start_section != NULL) {
113  hook->start_section(parser, section_id);
114  }
115  }
116 }
amxo_section_t start_section
Definition: amxo_types.h:189