Reduct  v1.0.4-3-gdaf0d70
A functional and immutable language.
Loading...
Searching...
No Matches
Core

Detailed Description

Data Structures

struct  reduct_input_t
 Input structure. More...
 
struct  reduct_constant_t
 Constant structure. More...
 
struct  reduct_t
 State structure. More...
 

Macros

#define REDUCT_BUCKETS_MAX   128
 Amount of buckets used for intering atoms.
 
#define REDUCT_CONSTANTS_MAX   8
 Maximum amount of predefined constants.
 
#define REDUCT_GC_THRESHOLD_INITIAL   128
 Initial blocks allocated threshold for garbage collection.
 

Enumerations

enum  reduct_input_flags_t { REDUCT_INPUT_FLAG_NONE = 0 , REDUCT_INPUT_FLAG_OWNED = 1 }
 Input flags. More...
 

Functions

REDUCT_API reduct_treduct_new (reduct_error_t *error)
 Create a new Reduct structure.
 
REDUCT_API void reduct_free (reduct_t *reduct)
 Free the Reduct structure.
 
REDUCT_API void reduct_args_set (reduct_t *reduct, int argc, char **argv)
 Set the command line arguments for the Reduct structure.
 
REDUCT_API void reduct_constant_register (reduct_t *reduct, const char *name, struct reduct_item *item)
 Register a constant in a Reduct structure.
 
REDUCT_API reduct_input_treduct_input_new (reduct_t *reduct, const char *buffer, reduct_size_t length, const char *path, reduct_input_flags_t flags)
 Create a new input structure and push it onto the input stack.
 

Macro Definition Documentation

◆ REDUCT_BUCKETS_MAX

#define REDUCT_BUCKETS_MAX   128

Amount of buckets used for intering atoms.

Definition at line 19 of file core.h.

◆ REDUCT_CONSTANTS_MAX

#define REDUCT_CONSTANTS_MAX   8

Maximum amount of predefined constants.

Definition at line 20 of file core.h.

◆ REDUCT_GC_THRESHOLD_INITIAL

#define REDUCT_GC_THRESHOLD_INITIAL   128

Initial blocks allocated threshold for garbage collection.

Definition at line 22 of file core.h.

Enumeration Type Documentation

◆ reduct_input_flags_t

Input flags.

Enumerator
REDUCT_INPUT_FLAG_NONE 
REDUCT_INPUT_FLAG_OWNED 

The input buffer is owned by the input structure and should be freed.

Definition at line 27 of file core.h.

Function Documentation

◆ reduct_new()

REDUCT_API reduct_t * reduct_new ( reduct_error_t error)

Create a new Reduct structure.

Parameters
errorPointer to the error structure to be used for error reporting.
Returns
A pointer to the newly allocated Reduct structure.

Definition at line 11 of file core_impl.h.

Here is the call graph for this function:

◆ reduct_free()

REDUCT_API void reduct_free ( reduct_t reduct)

Free the Reduct structure.

Parameters
reductPointer to the Reduct structure to free.

Definition at line 47 of file core_impl.h.

Here is the call graph for this function:

◆ reduct_args_set()

REDUCT_API void reduct_args_set ( reduct_t reduct,
int  argc,
char **  argv 
)

Set the command line arguments for the Reduct structure.

Will be utilized by the (args!) native.

Parameters
reductPointer to the Reduct structure.
argcThe number of arguments.
argvThe argument strings.

Definition at line 95 of file core_impl.h.

◆ reduct_constant_register()

REDUCT_API void reduct_constant_register ( reduct_t reduct,
const char *  name,
struct reduct_item *  item 
)

Register a constant in a Reduct structure.

Parameters
reductPointer to the Reduct structure.
nameThe name of the constant.
itemThe item associated with the constant.

◆ reduct_input_new()

REDUCT_API reduct_input_t * reduct_input_new ( reduct_t reduct,
const char *  buffer,
reduct_size_t  length,
const char *  path,
reduct_input_flags_t  flags 
)

Create a new input structure and push it onto the input stack.

Parameters
reductThe Reduct structure.
bufferThe input buffer.
lengthThe length of the input buffer.
pathThe path to the input file.
flagsInput flags.
Returns
A pointer to the newly created input structure.

Definition at line 123 of file core_impl.h.

Here is the caller graph for this function: