Paula Script
Loading...
Searching...
No Matches
paula.h
Go to the documentation of this file.
1#pragma once
2
3#include "defs.h"
4#include "args.h"
5
6namespace paula
7{
8 class IInputStream;
9
10 // user interface
11
12 constexpr const char * PAULA_VERSION = "0.1";
13
15
19 [[nodiscard]] const Error* run(const char* code, const char** args, int numArgs);
20
24 [[nodiscard]] const Error * run(const char*);
25
29 [[nodiscard]] const Error * run(IInputStream&);
30
34 void runSafe(const char*);
35
40
44 Var get(const char * varName);
45
49 const Error * addCallback(const char* name, const Error* (*_action)(Args&));
50}
Access callback arguments (e.g. value of "a" in "f(a)"). Set return value of the callback function,...
Definition args.h:88
Base class for input streams.
Definition stream.h:113
Access Paula script variable data.
Definition args.h:19
Definition paula.h:7
constexpr const char * PAULA_VERSION
Definition paula.h:12
void runSafe(const char *)
Run a script. If an error occurs, print the error.
const Error * run(const char *code, const char **args, int numArgs)
Run a script with arguments and return error, or NO_ERROR, if everything went well.
const Error * addCallback(const char *name, const Error *(*_action)(Args &))
Add a callback to call from a Paula script.
void printVersion()
Var get(const char *varName)
Get a variable by name. Return 'empty' if the variable is not found.