quakeforge/ruamoko/include/cbuf.h
Bill Currie 6f04c555a4 [ruamoko] Add support for cbuf handling
I'm not sure how this will turn out, but the idea is ruamoko code will
be able to create its own scripting "language".
2024-02-01 18:58:41 +09:00

24 lines
821 B
C

#ifndef __ruamoko_cbuf_h
#define __ruamoko_cbuf_h
typedef @handle cbuf_h cbuf_t;
typedef struct cbuf_interpreter_s {
void (*construct) (cbuf_t cbuf);
void (*destruct) (cbuf_t cbuf);
void (*reset) (cbuf_t cbuf);
void (*add) (cbuf_t cbuf, string str);
void (*insert) (cbuf_t cbuf, string str);
void (*execute) (cbuf_t cbuf);
string *(*complete) (cbuf_t cbuf, string str);
} cbuf_interpreter_t;
@extern cbuf_t Cbuf_New (cbuf_interpreter_t *interpreter, void *obj);
@extern void Cbuf_Delete (cbuf_t cbuf);
@extern void Cbuf_Reset (cbuf_t cbuf);
@extern void Cbuf_AddText (cbuf_t cbuf, string text);
@extern void Cbuf_InsertText (cbuf_t cbuf, string text);
@extern void Cbuf_Execute (cbuf_t cbuf);
@extern void Cbuf_Execute_Stack (cbuf_t cbuf);
@extern void Cbuf_Execute_Sets (cbuf_t cbuf);
#endif//__ruamoko_cbuf_h