SolarCapture C Bindings
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
args.h
Go to the documentation of this file.
1 
8 #ifndef __SOLAR_CAPTURE_ARGS_H__
9 #define __SOLAR_CAPTURE_ARGS_H__
10 
20 };
21 
22 
27 struct sc_arg {
28  const char* name;
30  union {
31  const char* str;
32  int64_t i;
33  struct sc_object* obj;
34  double dbl;
35  } val;
36 };
37 
43 #define SC_ARG_INT(_name, _val) \
44  { .name = _name, .type = SC_PARAM_INT, .val.i = _val }
45 
51 #define SC_ARG_STR(_name, _val) \
52  { .name = _name, .type = SC_PARAM_STR, .val.str = _val }
53 
59 #define SC_ARG_OBJ(_name, _val) \
60  { .name = _name, .type = SC_PARAM_OBJ, .val.obj = _val }
61 
67 #define SC_ARG_DBL(_name, _val) \
68  { .name = _name, .type = SC_PARAM_DBL, .val.dbl = _val }
69 
70 
71 #endif /* __SOLAR_CAPTURE_ARGS_H__ */
72 
Definition: args.h:19
sc_param_type
Possible parameter types that can be used for arguments in a node's init function.
Definition: args.h:15
Definition: args.h:17
An opaque object. Use this to pass all types of data that are not ints, doubles or char arrays (see S...
union sc_arg::@0 val
Definition: args.h:18
const char * name
Definition: args.h:28
enum sc_param_type type
Definition: args.h:29
Definition: args.h:16
Representation of an argument. Used by node init functions.
Definition: args.h:27