QPMS
Electromagnetic multiple scattering library and toolkit.
Loading...
Searching...
No Matches
Data Fields
qpms_specexpr_dyn_t Struct Reference

Dynamic resolution callbacks of an environment (all optional). More...

#include <specexpr.h>

Data Fields

int(* dyn_const )(void *userdata, const char *name, _Complex double *out, char *errbuf, size_t errlen)
 Resolves a bare identifier (after functions, constants and vars).
 
int(* dyn_call )(void *userdata, const char *name, const _Complex double *args, size_t nargs, _Complex double *out, char *errbuf, size_t errlen)
 Resolves a call of a name that is not a built-in function.
 
void * userdata
 Opaque context passed back to the callbacks.
 

Detailed Description

Dynamic resolution callbacks of an environment (all optional).

Installed with qpms_specexpr_env_set_dyn(); consulted for identifiers that are neither built-in nor user variables.

Field Documentation

◆ dyn_call

int(* qpms_specexpr_dyn_t::dyn_call) (void *userdata, const char *name, const _Complex double *args, size_t nargs, _Complex double *out, char *errbuf, size_t errlen)

Resolves a call of a name that is not a built-in function.

args points to the nargs evaluated arguments (nargs may be 0 for an empty argument list). Return convention as for dyn_const (0 means "not a function").

◆ dyn_const

int(* qpms_specexpr_dyn_t::dyn_const) (void *userdata, const char *name, _Complex double *out, char *errbuf, size_t errlen)

Resolves a bare identifier (after functions, constants and vars).

Returns 1 and stores the value in out when resolved, 0 when the name is not recognised (the evaluator then reports an unknown identifier), or -1 on a resolution error with a human readable message written to errbuf.


The documentation for this struct was generated from the following file: