Files
jailbasic/function.h

29 lines
1.1 KiB
C++

#pragma once
#include <stdint.h>
#include <string>
// Register a new function. Returns false if a function with the same name already exists
const bool function_register(const std::string name, const uint32_t address);
// Set the return type of the last searched function
void function_set_type(const uint32_t type);
// Get the return type of the last searched function or -1 if none
const int function_get_type();
// Add a parameter to the last registered function, returns false if there's a parameter already named like that
const bool function_parameter_add(const std::string name, const uint32_t type);
// Check if there's a function with that name
const bool function_exists(const std::string name);
// Retrieve the address of the specified function, or zero if there's no such function
const uint32_t function_get_address(const std::string name);
// Retrieve the number of parameters of the last searched function
const int function_get_num_parameters();
// Retrieve the type of the nth parameter of the last searched function
const int function_get_parameter_type(const int index);