![]() |
Phasor 3.1.1
Stack VM based Programming Language
|
#include <stdint.h>#include <stddef.h>#include <stdbool.h>Go to the source code of this file.
Classes | |
| struct | PhasorValue |
| Represents a value in the Phasor VM. More... | |
| struct | PhasorAPI |
| The collection of API functions that the Phasor host provides to the plugin. More... | |
Macros | |
| #define | PHASOR_FFI_EXPORT |
Typedefs | |
| typedef struct PhasorVM | PhasorVM |
| Phasor Virtual Machine pointer. | |
| typedef struct PhasorValue | PhasorValue |
| Forward declare for self-reference in the union. | |
| typedef PhasorValue(* | PhasorNativeFunction) (PhasorVM *vm, int argc, const PhasorValue *argv) |
| Signature for a native C function that can be registered with the Phasor VM. | |
| typedef void(* | PhasorRegisterFunction) (PhasorVM *vm, const char *name, PhasorNativeFunction func) |
| Function pointer type for the function that registers a native function with the VM. | |
Enumerations | |
| enum | PhasorValueType { PHASOR_TYPE_NULL , PHASOR_TYPE_BOOL , PHASOR_TYPE_INT , PHASOR_TYPE_FLOAT , PHASOR_TYPE_STRING , PHASOR_TYPE_ARRAY } |
| PhasorValue types. More... | |
Functions | |
| static PhasorValue | phasor_make_null () |
| static PhasorValue | phasor_make_bool (bool b) |
| static PhasorValue | phasor_make_int (int64_t i) |
| static PhasorValue | phasor_make_float (double f) |
| static PhasorValue | phasor_make_string (const char *s) |
| static PhasorValue | phasor_make_array (const PhasorValue *elements, size_t count) |
| static bool | phasor_is_null (PhasorValue val) |
| static bool | phasor_is_bool (PhasorValue val) |
| static bool | phasor_is_int (PhasorValue val) |
| static bool | phasor_is_float (PhasorValue val) |
| static bool | phasor_is_string (PhasorValue val) |
| static bool | phasor_is_array (PhasorValue val) |
| static bool | phasor_is_number (PhasorValue val) |
| static bool | phasor_to_bool (PhasorValue val) |
| static int64_t | phasor_to_int (PhasorValue val) |
| static double | phasor_to_float (PhasorValue val) |
| static const char * | phasor_to_string (PhasorValue val) |
| PHASOR_FFI_EXPORT void | phasor_plugin_entry (const PhasorAPI *api, PhasorVM *vm) |
| The one and only entry point for a Phasor plugin. | |
| #define PHASOR_FFI_EXPORT |
Definition at line 35 of file PhasorFFI.h.
| typedef PhasorValue(* PhasorNativeFunction) (PhasorVM *vm, int argc, const PhasorValue *argv) |
Signature for a native C function that can be registered with the Phasor VM.
Definition at line 189 of file PhasorFFI.h.
| typedef void(* PhasorRegisterFunction) (PhasorVM *vm, const char *name, PhasorNativeFunction func) |
Function pointer type for the function that registers a native function with the VM.
Definition at line 192 of file PhasorFFI.h.
| typedef struct PhasorValue PhasorValue |
Forward declare for self-reference in the union.
Definition at line 60 of file PhasorFFI.h.
Phasor Virtual Machine pointer.
Definition at line 44 of file PhasorFFI.h.
| enum PhasorValueType |
PhasorValue types.
| Enumerator | |
|---|---|
| PHASOR_TYPE_NULL | |
| PHASOR_TYPE_BOOL | |
| PHASOR_TYPE_INT | |
| PHASOR_TYPE_FLOAT | |
| PHASOR_TYPE_STRING | |
| PHASOR_TYPE_ARRAY | |
Definition at line 47 of file PhasorFFI.h.
|
inlinestatic |
|
inlinestatic |
Definition at line 138 of file PhasorFFI.h.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Definition at line 134 of file PhasorFFI.h.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
| PHASOR_FFI_EXPORT void phasor_plugin_entry | ( | const PhasorAPI * | api, |
| PhasorVM * | vm ) |
The one and only entry point for a Phasor plugin.
A Phasor-compatible shared library MUST export a C function with this exact signature. The Phasor host will call this function when the plugin is loaded, providing the plugin with a pointer to the host's API functions and the current VM instance.
| api | A pointer to a struct containing function pointers that the plugin can use to interact with the host (e.g., register functions). |
| vm | An opaque pointer to the VM instance. This should be passed back to any API functions that require it. |
Definition at line 182 of file main.c.
|
inlinestatic |
Definition at line 165 of file PhasorFFI.h.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |