moo/lib/moo-std.h

153 lines
2.1 KiB
C
Raw Normal View History

2018-11-07 15:26:30 +00:00
#ifndef _MOO_STD_H_
#define _MOO_STD_H_
#include <moo.h>
enum moo_cfgstd_type_t
2018-11-11 16:53:21 +00:00
{
MOO_CFGSTD_OPT,
MOO_CFGSTD_OPTB,
MOO_CFGSTD_OPTU
2018-11-11 16:53:21 +00:00
};
typedef enum moo_cfgstd_type_t moo_cfgstd_type_t;
2018-11-11 16:53:21 +00:00
struct moo_cfgstd_t
2018-11-11 16:53:21 +00:00
{
moo_cfgstd_type_t type;
2018-11-11 16:53:21 +00:00
moo_gc_type_t gc_type;
2019-10-16 09:04:09 +00:00
moo_oow_t proc_stk_size;
2018-11-11 16:53:21 +00:00
int large_pages;
moo_cmgr_t* cmgr;
moo_cmgr_t* input_cmgr;
moo_cmgr_t* log_cmgr;
2019-05-22 08:49:27 +00:00
moo_log_write_t log_write;
2018-11-11 16:53:21 +00:00
union
{
struct
{
const moo_ooch_t* log;
const moo_ooch_t* dbg;
} opt;
struct
{
const moo_bch_t* log;
const moo_bch_t* dbg;
} optb;
struct
{
const moo_uch_t* log;
const moo_uch_t* dbg;
} optu;
} u;
2018-11-11 16:53:21 +00:00
};
typedef struct moo_cfgstd_t moo_cfgstd_t;
2018-11-11 16:53:21 +00:00
enum moo_iostd_type_t
{
MOO_IOSTD_FILE,
MOO_IOSTD_FILEB,
MOO_IOSTD_FILEU
};
typedef enum moo_iostd_type_t moo_iostd_type_t;
struct moo_iostd_t
{
moo_iostd_type_t type;
union
{
struct
{
const moo_ooch_t* path;
} file;
struct
{
const moo_bch_t* path;
} fileb;
struct
{
const moo_uch_t* path;
} fileu;
} u;
moo_cmgr_t* cmgr;
};
typedef struct moo_iostd_t moo_iostd_t;
2018-11-07 15:26:30 +00:00
#if defined(__cplusplus)
extern "C" {
#endif
MOO_EXPORT void moo_start_ticker (
void
);
MOO_EXPORT void moo_stop_ticker (
void
);
MOO_EXPORT void moo_catch_termreq (
void
);
MOO_EXPORT void moo_uncatch_termreq (
void
);
/* ----------------------------------------------------------------------- */
2018-11-07 15:26:30 +00:00
MOO_EXPORT moo_t* moo_openstd (
moo_oow_t xtnsize,
const moo_cfgstd_t* cfg,
moo_errinf_t* errinfo
2018-11-07 15:26:30 +00:00
);
2018-11-15 08:40:22 +00:00
MOO_EXPORT void moo_abortstd (
moo_t* moo
);
#if defined(MOO_INCLUDE_COMPILER)
MOO_EXPORT int moo_compilestd(
moo_t* moo,
const moo_iostd_t* in,
moo_oow_t count
);
2019-11-02 06:34:18 +00:00
MOO_EXPORT int moo_compilefileb (
moo_t* moo,
const moo_bch_t* path
);
MOO_EXPORT int moo_compilefileu (
moo_t* moo,
const moo_uch_t* path
);
#endif
MOO_EXPORT int moo_invokebynameb (
2019-11-02 06:34:18 +00:00
moo_t* moo,
const moo_bch_t* objname,
const moo_bch_t* mthname
);
MOO_EXPORT void moo_rcvtickstd (
moo_t* moo,
int v
);
2018-11-07 15:26:30 +00:00
#if defined(__cplusplus)
}
#endif
#endif