CWB
Data Structures | Typedefs | Functions | Variables
builtins.h File Reference
#include "../cl/cdaccess.h"
#include "eval.h"

Data Structures

struct  _builtinf
 The BuiltinF object represents a built-in function. More...
 

Typedefs

typedef struct _builtinf BuiltinF
 The BuiltinF object represents a built-in function. More...
 

Functions

int find_predefined (char *name)
 Gets the identifier of a specified predefined function (index into the global array of info about the "builtins"). More...
 
int is_predefined_function (char *name)
 Checks whether a string is the name of a predefined function. More...
 
int call_predefined_function (int bf_id, DynCallResult *apl, int nr_args, Constrainttree ctptr, DynCallResult *result)
 Calls a predefined function from the builtin_function array. More...
 

Variables

BuiltinF builtin_function []
 Global array of built-in functions. More...
 

Typedef Documentation

typedef struct _builtinf BuiltinF

The BuiltinF object represents a built-in function.

Function Documentation

int call_predefined_function ( int  bf_id,
DynCallResult apl,
int  nr_args,
Constrainttree  ctptr,
DynCallResult result 
)

Calls a predefined function from the builtin_function array.

See also
builtin_function
Parameters
bf_idThe function to call, identified as an index to the builtin_function array.
aplContains the arguments to this function.
nr_argsThe number of arguments the function takes.
ctptrA constraint tree used in some (but not all) of the builtin functions.
resultWhere to put the result of calling the function.
Returns
boolean: true on success, otherwise false.

References c_tree::args, ATTAT_INT, attat_name(), ATTAT_NONE, ATTAT_PAREF, ATTAT_POS, ATTAT_STRING, c_tree::attr, CDA_OK, cderrno, _DCR::charres, CL_DYN_STRING_SIZE, cl_set_intersection(), cl_set_size(), common_prefix_length(), cqpmessage(), _DCR::dynamic_string_buffer, Error, False, c_tree::func, get_id_frequency, get_id_of_string, get_string_of_id, _DCR::intres, pa_ref, c_tree::pa_ref, _ActualParamList::param, _DCR::parefres, sa_ref, c_tree::sa_ref, True, c_tree::type, _DCR::type, and _DCR::value.

Referenced by get_leaf_value().

int find_predefined ( char *  name)

Gets the identifier of a specified predefined function (index into the global array of info about the "builtins").

Returns -1 if the function is not found.

See also
builtin_function
Parameters
nameThe name of the function to search for.
Returns
An index into the builtin_function array (or -1 for not found)

References _builtinf::name.

Referenced by FunctionCall(), and is_predefined_function().

int is_predefined_function ( char *  name)

Checks whether a string is the name of a predefined function.

Parameters
nameThe name of the function to search for.
Returns
Boolean.

References find_predefined().

Variable Documentation

BuiltinF builtin_function[]

Global array of built-in functions.

Referenced by FunctionCall(), and print_booltree().