libamxo  4.3.4
Object Definition Language (ODL) parsing
test_plugin.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <amxc/amxc.h>
#include <amxp/amxp_signal.h>
#include <amxp/amxp_slot.h>
#include <amxd/amxd_dm.h>
#include <amxd/amxd_object.h>
#include <amxd/amxd_action.h>
#include <amxd/amxd_transaction.h>
#include <amxo/amxo.h>
#include <amxc/amxc_macros.h>

Go to the source code of this file.

Functions

int _test_entry_point (int reason, amxd_dm_t *dm, amxo_parser_t *parser)
 
int _test_failing_entry_point (UNUSED int reason, UNUSED amxd_dm_t *dm, UNUSED amxo_parser_t *parser)
 
amxd_status_t _test_func (amxd_object_t *object, amxd_function_t *func, amxc_var_t *args, amxc_var_t *ret)
 
amxd_status_t _TestObject_TestFunc1 (amxd_object_t *object, amxd_function_t *func, amxc_var_t *args, amxc_var_t *ret)
 
amxd_status_t _TestObject_TestFunc2 (amxd_object_t *object, amxd_function_t *func, amxc_var_t *args, amxc_var_t *ret)
 
amxd_status_t _TestObject_TestFunc4 (amxd_object_t *object, amxd_function_t *func, amxc_var_t *args, amxc_var_t *ret)
 
amxd_status_t __TestObject_TestFunc1 (amxd_object_t *object, amxd_function_t *func, amxc_var_t *args, amxc_var_t *ret)
 
amxd_status_t TestObject_TestFunc2 (amxd_object_t *object, amxd_function_t *func, amxc_var_t *args, amxc_var_t *ret)
 
amxd_status_t __TestFunc3 (amxd_object_t *object, amxd_function_t *func, amxc_var_t *args, amxc_var_t *ret)
 
amxd_status_t TestFunc4 (amxd_object_t *object, amxd_function_t *func, amxc_var_t *args, amxc_var_t *ret)
 
amxd_status_t _test_dummy_action (amxd_object_t *const object, amxd_param_t *const param, amxd_action_t reason, const amxc_var_t *const args, amxc_var_t *const retval, void *priv)
 
int _test_entry_point (UNUSED int reason, UNUSED amxd_dm_t *dm, UNUSED amxo_parser_t *parser)
 

Variables

static amxo_parser_tlocal_parser = NULL
 

Function Documentation

◆ __TestFunc3()

amxd_status_t __TestFunc3 ( amxd_object_t *  object,
amxd_function_t *  func,
amxc_var_t *  args,
amxc_var_t *  ret 
)

Definition at line 175 of file test_plugin.c.

178  {
179  return _test_func(object, func, args, ret);
180 }
amxd_status_t _test_func(amxd_object_t *object, amxd_function_t *func, amxc_var_t *args, amxc_var_t *ret)
Definition: test_plugin.c:120

◆ __TestObject_TestFunc1()

amxd_status_t __TestObject_TestFunc1 ( amxd_object_t *  object,
amxd_function_t *  func,
amxc_var_t *  args,
amxc_var_t *  ret 
)

Definition at line 161 of file test_plugin.c.

164  {
165  return _test_func(object, func, args, ret);
166 }

◆ _test_dummy_action()

amxd_status_t _test_dummy_action ( amxd_object_t *const  object,
amxd_param_t *const  param,
amxd_action_t  reason,
const amxc_var_t *const  args,
amxc_var_t *const  retval,
void *  priv 
)

◆ _test_entry_point() [1/2]

int _test_entry_point ( int  reason,
amxd_dm_t *  dm,
amxo_parser_t parser 
)

◆ _test_entry_point() [2/2]

int _test_entry_point ( UNUSED int  reason,
UNUSED amxd_dm_t *  dm,
UNUSED amxo_parser_t parser 
)

Definition at line 190 of file test_plugin.c.

192  {
193 
194  amxc_var_t* counter = amxo_parser_get_config(parser, "counter");
195  amxc_var_set(uint32_t, counter, amxc_var_constcast(uint32_t, counter) + 1);
196 
197  if(reason == 0) {
198  local_parser = parser;
199  } else {
200  local_parser = NULL;
201  }
202  return 0;
203 }
amxc_var_t * amxo_parser_get_config(amxo_parser_t *parser, const char *path)
Gets a configuration option.
static amxo_parser_t * local_parser
Definition: test_plugin.c:69

◆ _test_failing_entry_point()

int _test_failing_entry_point ( UNUSED int  reason,
UNUSED amxd_dm_t *  dm,
UNUSED amxo_parser_t parser 
)

Definition at line 205 of file test_plugin.c.

207  {
208 
209  amxc_var_t* counter = amxo_parser_get_config(parser, "counter");
210  amxc_var_set(uint32_t, counter, amxc_var_constcast(uint32_t, counter) + 1);
211 
212  return -1;
213 }

◆ _test_func()

amxd_status_t _test_func ( amxd_object_t *  object,
amxd_function_t *  func,
amxc_var_t *  args,
amxc_var_t *  ret 
)

Definition at line 120 of file test_plugin.c.

123  {
124  char* path = amxd_object_get_path(object, AMXD_OBJECT_NAMED);
125  printf("Function call: \n");
126  printf("Object - %s\n", path);
127  printf("Function - %s\n", amxd_function_get_name(func));
128  amxc_var_copy(ret, args);
129  if(args != NULL) {
130  fflush(stdout);
131  amxc_var_dump(args, STDOUT_FILENO);
132  }
133  free(path);
134  return 0;
135 }

◆ _TestObject_TestFunc1()

amxd_status_t _TestObject_TestFunc1 ( amxd_object_t *  object,
amxd_function_t *  func,
amxc_var_t *  args,
amxc_var_t *  ret 
)

Definition at line 137 of file test_plugin.c.

140  {
141  return _test_func(object, func, args, ret);
142 }

◆ _TestObject_TestFunc2()

amxd_status_t _TestObject_TestFunc2 ( amxd_object_t *  object,
amxd_function_t *  func,
amxc_var_t *  args,
amxc_var_t *  ret 
)

Definition at line 144 of file test_plugin.c.

147  {
148  return _test_func(object, func, args, ret);
149 }

◆ _TestObject_TestFunc4()

amxd_status_t _TestObject_TestFunc4 ( amxd_object_t *  object,
amxd_function_t *  func,
amxc_var_t *  args,
amxc_var_t *  ret 
)

Definition at line 151 of file test_plugin.c.

154  {
155  return _test_func(object, func, args, ret);
156 }

◆ TestFunc4()

amxd_status_t TestFunc4 ( amxd_object_t *  object,
amxd_function_t *  func,
amxc_var_t *  args,
amxc_var_t *  ret 
)

Definition at line 182 of file test_plugin.c.

185  {
186  return _test_func(object, func, args, ret);
187 }

◆ TestObject_TestFunc2()

amxd_status_t TestObject_TestFunc2 ( amxd_object_t *  object,
amxd_function_t *  func,
amxc_var_t *  args,
amxc_var_t *  ret 
)

Definition at line 168 of file test_plugin.c.

171  {
172  return _test_func(object, func, args, ret);
173 }

Variable Documentation

◆ local_parser

amxo_parser_t* local_parser = NULL
static

Definition at line 69 of file test_plugin.c.