bfx
An interpreter, compiler, and REPL for brainfuck-like languages
Loading...
Searching...
No Matches
weave.c File Reference
#include "weave.h"
#include "brainfuck.h"
#include "util.h"
#include <pthread.h>
#include <string.h>

Data Structures

struct  BFX_WeaveData
 Weave language data structure. More...
 
struct  BFX_WeaveWrapper
 Weave thread wrapper structure. More...
 

Functions

BFX_Error bfx_weave_init (BFX *bfx)
 Initialize the Weave interpreter.
 
BFX_Error bfx_weave_run (BFX *bfx)
 Run the Weave interpreter.
 
BFX_Error bfx_op_weave_exit (BFX *bfx, BFX_FileIndex *index)
 Terminate current thread (weave).
 
BFX_Error bfx_op_weave_toggle (BFX *bfx, BFX_FileIndex *index)
 Toggle between thread and global tape (weave).
 

Detailed Description

This file contains functions related to interpreting the Weave language.

Function Documentation

◆ bfx_op_weave_exit()

BFX_Error bfx_op_weave_exit ( BFX bfx,
BFX_FileIndex index 
)

Terminate current thread (weave).

◆ bfx_op_weave_toggle()

BFX_Error bfx_op_weave_toggle ( BFX bfx,
BFX_FileIndex index 
)

Toggle between thread and global tape (weave).

◆ bfx_weave_init()

BFX_Error bfx_weave_init ( BFX bfx)

Initialize the Weave interpreter.

Parameters
bfxPointer to the already-allocated interpreter struct

◆ bfx_weave_run()

BFX_Error bfx_weave_run ( BFX bfx)

Run the Weave interpreter.

This function initializes and runs the Weave interpreter threads. It creates and joins the threads, and frees the language-specific data.

Parameters
bfxPointer to the interpreter struct