8 #define _RPMFICL_INTERNAL
19 #if defined(WITH_FICL)
21 static void rpmficlTextOut(ficlCallback *callback,
char *text)
26 if (ficl->iob == NULL)
38 #if defined(WITH_FICL)
39 ficlSystem * sys = ficl->sys;
40 ficlSystemDestroy(sys);
57 if (_rpmficlPool == NULL) {
81 #if defined(WITH_FICL)
82 static const char * _av[] = {
"rpmficl", NULL };
83 ficlSystemInformation fsi;
89 if (av == NULL) av = _av;
92 ficlSystemInformationInitialize(&fsi);
93 fsi.context = (
void *)ficl;
94 fsi.textOut = rpmficlTextOut;
96 sys = ficlSystemCreate(&fsi);
98 ficlSystemCompileExtras(sys);
99 vm = ficlSystemCreateVm(sys);
102 xx = ficlVmEvaluate(vm,
".ver .( " __DATE__
" ) cr quit");
107 sprintf(b,
".( loading %s ) cr load %s\n cr", av[1], av[1]);
108 xx = ficlVmEvaluate(vm, b);
115 fprintf(stderr,
"%s", s);
128 fprintf(stderr,
"==> %s(%p,%s)\n", __FUNCTION__, ficl, fn);
130 if (ficl == NULL) ficl =
rpmficlI();
133 #if defined(WITH_FICL)
145 fprintf(stderr,
"==> %s(%p,%s)\n", __FUNCTION__, ficl, str);
147 if (ficl == NULL) ficl =
rpmficlI();
150 #if defined(WITH_FICL)
151 ficlVm *vm = ficl->vm;
152 switch (ficlVmEvaluate(vm, (
char *)str)) {
155 case FICL_VM_STATUS_OUT_OF_TEXT:
157 if (resultp && ficl->iob)
static rpmficl rpmficlGetPool(rpmioPool pool)
static void rpmficlFini(void *_ficl)
rpmficl rpmficlNew(char **av, uint32_t flags)
Create and load a ficl interpreter.
rpmiob rpmiobFree(rpmiob iob)
Destroy a I/O buffer instance.
rpmiob rpmiobAppend(rpmiob iob, const char *s, size_t nl)
Append string to I/O buffer.
rpmioItem rpmioGetPool(rpmioPool pool, size_t size)
Get unused item from pool, or alloc a new item.
int argvCount(const ARGV_t argv)
Return no.
static rpmficl rpmficlI(void)
rpmRC rpmficlRun(rpmficl ficl, const char *str, const char **resultp)
Execute ficl string.
rpmficl rpmficlLink(rpmficl ficl)
Reference a ficl interpreter instance.
rpmiob rpmiobNew(size_t len)
Create an I/O buffer.
const char const bson int mongo_write_concern int flags
enum rpmRC_e rpmRC
RPM return codes.
char * rpmiobStr(rpmiob iob)
Return I/O buffer (as string).
rpmioPool rpmioNewPool(const char *name, size_t size, int limit, int flags, char *(*dbg)(void *item), void(*init)(void *item), void(*fini)(void *item))
Create a memory pool.
rpmiob rpmiobEmpty(rpmiob iob)
Empty an I/O buffer.
struct rpmficl_s * rpmficl
rpmRC rpmficlRunFile(rpmficl ficl, const char *fn, const char **resultp)
Execute ficl from a file.