2 * Copyright (c) 2000 Daniel Capo Sobral
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 /*******************************************************************
31 ** Additional FICL words designed for FreeBSD's loader
33 *******************************************************************/
36 #include <sys/types.h>
46 #include "bootstrap.h"
53 /* FreeBSD's loader interaction words and extras
55 * setenv ( value n name n' -- )
56 * setenv? ( value n name n' flag -- )
57 * getenv ( addr n -- addr' n' | -1 )
58 * unsetenv ( addr n -- )
59 * copyin ( addr addr' len -- )
60 * copyout ( addr addr' len -- )
61 * findfile ( name len type len' -- addr )
62 * pnpdevices ( -- addr )
63 * pnphandlers ( -- addr )
64 * ccall ( [[...[p10] p9] ... p1] n addr -- result )
65 * uuid-from-string ( addr n -- addr' )
66 * uuid-to-string ( addr' -- addr n )
71 /* ( flags x1 y1 x2 y2 -- flag ) */
73 ficl_term_putimage(FICL_VM *pVM)
77 unsigned long ret = FICL_FALSE;
78 uint32_t x1, y1, x2, y2, f;
83 vmCheckStack(pVM, 7, 1);
85 names = stackPopINT(pVM->pStack);
86 namep = (char *) stackPopPtr(pVM->pStack);
87 y2 = stackPopINT(pVM->pStack);
88 x2 = stackPopINT(pVM->pStack);
89 y1 = stackPopINT(pVM->pStack);
90 x1 = stackPopINT(pVM->pStack);
91 f = stackPopINT(pVM->pStack);
93 x1 = gfx_state.tg_origin.tp_col + x1 * gfx_state.tg_font.vf_width;
94 y1 = gfx_state.tg_origin.tp_row + y1 * gfx_state.tg_font.vf_height;
96 x2 = gfx_state.tg_origin.tp_col +
97 x2 * gfx_state.tg_font.vf_width;
100 y2 = gfx_state.tg_origin.tp_row +
101 y2 * gfx_state.tg_font.vf_height;
104 name = ficlMalloc(names + 1);
106 vmThrowErr(pVM, "Error: out of memory");
107 (void) strncpy(name, namep, names);
110 if ((error = png_open(&png, name)) != PNG_NO_ERROR) {
111 if (f & FL_PUTIMAGE_DEBUG)
112 printf("%s\n", png_error_string(error));
114 if (gfx_fb_putimage(&png, x1, y1, x2, y2, f) == 0)
115 ret = FICL_TRUE; /* success */
116 (void) png_close(&png);
119 stackPushUNS(pVM->pStack, ret);
122 /* ( flags x1 y1 x2 y2 -- flag ) */
124 ficl_fb_putimage(FICL_VM *pVM)
128 unsigned long ret = FICL_FALSE;
129 uint32_t x1, y1, x2, y2, f;
134 vmCheckStack(pVM, 7, 1);
136 names = stackPopINT(pVM->pStack);
137 namep = (char *) stackPopPtr(pVM->pStack);
138 y2 = stackPopINT(pVM->pStack);
139 x2 = stackPopINT(pVM->pStack);
140 y1 = stackPopINT(pVM->pStack);
141 x1 = stackPopINT(pVM->pStack);
142 f = stackPopINT(pVM->pStack);
144 name = ficlMalloc(names + 1);
146 vmThrowErr(pVM, "Error: out of memory");
147 (void) strncpy(name, namep, names);
150 if ((error = png_open(&png, name)) != PNG_NO_ERROR) {
151 if (f & FL_PUTIMAGE_DEBUG)
152 printf("%s\n", png_error_string(error));
154 if (gfx_fb_putimage(&png, x1, y1, x2, y2, f) == 0)
155 ret = FICL_TRUE; /* success */
156 (void) png_close(&png);
159 stackPushUNS(pVM->pStack, ret);
163 ficl_fb_setpixel(FICL_VM *pVM)
168 vmCheckStack(pVM, 2, 0);
171 y = stackPopUNS(pVM->pStack);
172 x = stackPopUNS(pVM->pStack);
173 gfx_fb_setpixel(x, y);
177 ficl_fb_line(FICL_VM *pVM)
179 FICL_UNS x0, y0, x1, y1, wd;
182 vmCheckStack(pVM, 5, 0);
185 wd = stackPopUNS(pVM->pStack);
186 y1 = stackPopUNS(pVM->pStack);
187 x1 = stackPopUNS(pVM->pStack);
188 y0 = stackPopUNS(pVM->pStack);
189 x0 = stackPopUNS(pVM->pStack);
190 gfx_fb_line(x0, y0, x1, y1, wd);
194 ficl_fb_bezier(FICL_VM *pVM)
196 FICL_UNS x0, y0, x1, y1, x2, y2, width;
199 vmCheckStack(pVM, 7, 0);
202 width = stackPopUNS(pVM->pStack);
203 y2 = stackPopUNS(pVM->pStack);
204 x2 = stackPopUNS(pVM->pStack);
205 y1 = stackPopUNS(pVM->pStack);
206 x1 = stackPopUNS(pVM->pStack);
207 y0 = stackPopUNS(pVM->pStack);
208 x0 = stackPopUNS(pVM->pStack);
209 gfx_fb_bezier(x0, y0, x1, y1, x2, y2, width);
213 ficl_fb_drawrect(FICL_VM *pVM)
215 FICL_UNS x1, x2, y1, y2, fill;
218 vmCheckStack(pVM, 5, 0);
221 fill = stackPopUNS(pVM->pStack);
222 y2 = stackPopUNS(pVM->pStack);
223 x2 = stackPopUNS(pVM->pStack);
224 y1 = stackPopUNS(pVM->pStack);
225 x1 = stackPopUNS(pVM->pStack);
226 gfx_fb_drawrect(x1, y1, x2, y2, fill);
230 ficl_term_drawrect(FICL_VM *pVM)
232 FICL_UNS x1, x2, y1, y2;
235 vmCheckStack(pVM, 4, 0);
238 y2 = stackPopUNS(pVM->pStack);
239 x2 = stackPopUNS(pVM->pStack);
240 y1 = stackPopUNS(pVM->pStack);
241 x1 = stackPopUNS(pVM->pStack);
242 gfx_term_drawrect(x1, y1, x2, y2);
244 #endif /* TESTMAIN */
247 ficlSetenv(FICL_VM *pVM)
252 char *namep, *valuep;
256 vmCheckStack(pVM, 4, 0);
258 names = stackPopINT(pVM->pStack);
259 namep = (char*) stackPopPtr(pVM->pStack);
260 values = stackPopINT(pVM->pStack);
261 valuep = (char*) stackPopPtr(pVM->pStack);
264 name = (char*) ficlMalloc(names+1);
266 vmThrowErr(pVM, "Error: out of memory");
267 strncpy(name, namep, names);
269 value = (char*) ficlMalloc(values+1);
271 vmThrowErr(pVM, "Error: out of memory");
272 strncpy(value, valuep, values);
273 value[values] = '\0';
275 setenv(name, value, 1);
284 ficlSetenvq(FICL_VM *pVM)
289 char *namep, *valuep;
290 int names, values, overwrite;
293 vmCheckStack(pVM, 5, 0);
295 overwrite = stackPopINT(pVM->pStack);
296 names = stackPopINT(pVM->pStack);
297 namep = (char*) stackPopPtr(pVM->pStack);
298 values = stackPopINT(pVM->pStack);
299 valuep = (char*) stackPopPtr(pVM->pStack);
302 name = (char*) ficlMalloc(names+1);
304 vmThrowErr(pVM, "Error: out of memory");
305 strncpy(name, namep, names);
307 value = (char*) ficlMalloc(values+1);
309 vmThrowErr(pVM, "Error: out of memory");
310 strncpy(value, valuep, values);
311 value[values] = '\0';
313 setenv(name, value, overwrite);
322 ficlGetenv(FICL_VM *pVM)
331 vmCheckStack(pVM, 2, 2);
333 names = stackPopINT(pVM->pStack);
334 namep = (char*) stackPopPtr(pVM->pStack);
337 name = (char*) ficlMalloc(names+1);
339 vmThrowErr(pVM, "Error: out of memory");
340 strncpy(name, namep, names);
343 value = getenv(name);
347 stackPushPtr(pVM->pStack, value);
348 stackPushINT(pVM->pStack, strlen(value));
351 stackPushINT(pVM->pStack, -1);
357 ficlUnsetenv(FICL_VM *pVM)
366 vmCheckStack(pVM, 2, 0);
368 names = stackPopINT(pVM->pStack);
369 namep = (char*) stackPopPtr(pVM->pStack);
372 name = (char*) ficlMalloc(names+1);
374 vmThrowErr(pVM, "Error: out of memory");
375 strncpy(name, namep, names);
386 ficlCopyin(FICL_VM *pVM)
393 vmCheckStack(pVM, 3, 0);
396 len = stackPopINT(pVM->pStack);
397 dest = stackPopINT(pVM->pStack);
398 src = stackPopPtr(pVM->pStack);
401 archsw.arch_copyin(src, dest, len);
408 ficlCopyout(FICL_VM *pVM)
415 vmCheckStack(pVM, 3, 0);
418 len = stackPopINT(pVM->pStack);
419 dest = stackPopPtr(pVM->pStack);
420 src = stackPopINT(pVM->pStack);
423 archsw.arch_copyout(src, dest, len);
430 ficlFindfile(FICL_VM *pVM)
436 struct preloaded_file* fp;
440 vmCheckStack(pVM, 4, 1);
443 types = stackPopINT(pVM->pStack);
444 typep = (char*) stackPopPtr(pVM->pStack);
445 names = stackPopINT(pVM->pStack);
446 namep = (char*) stackPopPtr(pVM->pStack);
448 name = (char*) ficlMalloc(names+1);
450 vmThrowErr(pVM, "Error: out of memory");
451 strncpy(name, namep, names);
453 type = (char*) ficlMalloc(types+1);
455 vmThrowErr(pVM, "Error: out of memory");
456 strncpy(type, typep, types);
459 fp = file_findfile(name, type);
463 stackPushPtr(pVM->pStack, fp);
470 /* isvirtualized? - Return whether the loader runs under a
473 * isvirtualized? ( -- flag )
476 ficlIsvirtualizedQ(FICL_VM *pVM)
482 vmCheckStack(pVM, 0, 1);
485 hv = (archsw.arch_hypervisor != NULL)
486 ? (*archsw.arch_hypervisor)()
488 flag = (hv != NULL) ? FICL_TRUE : FICL_FALSE;
489 stackPushINT(pVM->pStack, flag);
492 #endif /* ndef TESTMAIN */
495 ficlCcall(FICL_VM *pVM)
497 int (*func)(int, ...);
502 vmCheckStack(pVM, 2, 0);
505 func = stackPopPtr(pVM->pStack);
506 nparam = stackPopINT(pVM->pStack);
509 vmCheckStack(pVM, nparam, 1);
512 for (i = 0; i < nparam; i++)
513 p[i] = stackPopINT(pVM->pStack);
515 result = func(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8],
518 stackPushINT(pVM->pStack, result);
524 ficlUuidFromString(FICL_VM *pVM)
535 vmCheckStack(pVM, 2, 0);
538 uuids = stackPopINT(pVM->pStack);
539 uuidp = (char *) stackPopPtr(pVM->pStack);
542 uuid = (char *)ficlMalloc(uuids + 1);
544 vmThrowErr(pVM, "Error: out of memory");
545 strncpy(uuid, uuidp, uuids);
548 u = (uuid_t *)ficlMalloc(sizeof (*u));
550 uuid_from_string(uuid, u, &status);
552 if (status != uuid_s_ok) {
559 stackPushPtr(pVM->pStack, u);
566 ficlUuidToString(FICL_VM *pVM)
575 vmCheckStack(pVM, 1, 0);
578 u = (uuid_t *)stackPopPtr(pVM->pStack);
581 uuid_to_string(u, &uuid, &status);
582 if (status != uuid_s_ok) {
583 stackPushPtr(pVM->pStack, uuid);
584 stackPushINT(pVM->pStack, strlen(uuid));
587 stackPushINT(pVM->pStack, -1);
592 /**************************************************************************
594 ** reads in text from file fd and passes it to ficlExec()
595 * returns VM_OUTOFTEXT on success or the ficlExec() error code on
599 int ficlExecFD(FICL_VM *pVM, int fd)
602 int nLine = 0, rval = VM_OUTOFTEXT;
607 pVM->sourceID.i = fd;
609 /* feed each line to ficlExec */
614 while ((status = read(fd, &ch, 1)) > 0 && ch != '\n')
622 rval = ficlExecC(pVM, cp, i);
623 if(rval != VM_QUIT && rval != VM_USEREXIT && rval != VM_OUTOFTEXT)
630 ** Pass an empty line with SOURCE-ID == -1 to flush
631 ** any pending REFILLs (as required by FILE wordset)
633 pVM->sourceID.i = -1;
640 static void displayCellNoPad(FICL_VM *pVM)
644 vmCheckStack(pVM, 1, 0);
646 c = stackPop(pVM->pStack);
647 ltoa((c).i, pVM->pad, pVM->base);
648 vmTextOut(pVM, pVM->pad, 0);
652 /* isdir? - Return whether an fd corresponds to a directory.
654 * isdir? ( fd -- bool )
656 static void isdirQuestion(FICL_VM *pVM)
663 vmCheckStack(pVM, 1, 1);
666 fd = stackPopINT(pVM->pStack);
671 if (fstat(fd, &sb) < 0)
673 if (!S_ISDIR(sb.st_mode))
677 stackPushINT(pVM->pStack, flag);
680 /* fopen - open a file and return new fd on stack.
682 * fopen ( ptr count mode -- fd )
684 static void pfopen(FICL_VM *pVM)
690 vmCheckStack(pVM, 3, 1);
693 mode = stackPopINT(pVM->pStack); /* get mode */
694 count = stackPopINT(pVM->pStack); /* get count */
695 ptr = stackPopPtr(pVM->pStack); /* get ptr */
697 if ((count < 0) || (ptr == NULL)) {
698 stackPushINT(pVM->pStack, -1);
702 /* ensure that the string is null terminated */
703 name = (char *)malloc(count+1);
704 bcopy(ptr,name,count);
708 fd = open(name, mode);
709 #ifdef LOADER_VERIEXEC
711 if (verify_file(fd, name, 0, VE_GUESS, __func__) < 0) {
712 /* not verified writing ok but reading is not */
713 if ((mode & O_ACCMODE) != O_WRONLY) {
718 /* verified reading ok but writing is not */
719 if ((mode & O_ACCMODE) != O_RDONLY) {
727 stackPushINT(pVM->pStack, fd);
731 /* fclose - close a file who's fd is on stack.
735 static void pfclose(FICL_VM *pVM)
740 vmCheckStack(pVM, 1, 0);
742 fd = stackPopINT(pVM->pStack); /* get fd */
748 /* fread - read file contents
750 * fread ( fd buf nbytes -- nread )
752 static void pfread(FICL_VM *pVM)
758 vmCheckStack(pVM, 3, 1);
760 len = stackPopINT(pVM->pStack); /* get number of bytes to read */
761 buf = stackPopPtr(pVM->pStack); /* get buffer */
762 fd = stackPopINT(pVM->pStack); /* get fd */
763 if (len > 0 && buf && fd != -1)
764 stackPushINT(pVM->pStack, read(fd, buf, len));
766 stackPushINT(pVM->pStack, -1);
770 /* freaddir - read directory contents
772 * freaddir ( fd -- ptr len TRUE | FALSE )
774 static void pfreaddir(FICL_VM *pVM)
777 static struct dirent dirent;
788 vmCheckStack(pVM, 1, 3);
791 fd = stackPopINT(pVM->pStack);
794 * The readdirfd() function is specific to the loader environment.
795 * We do the best we can to make freaddir work, but it's not at
803 if (fstat(fd, &sb) == -1)
805 blksz = (sb.st_blksize) ? sb.st_blksize : getpagesize();
806 if ((blksz & (blksz - 1)) != 0)
811 off = lseek(fd, 0LL, SEEK_CUR);
815 if (lseek(fd, 0, SEEK_SET) == -1)
817 bufsz = getdents(fd, buf, blksz);
818 while (bufsz > 0 && bufsz <= ptr) {
820 bufsz = getdents(fd, buf, blksz);
824 d = (void *)(buf + ptr);
827 d = (lseek(fd, off, SEEK_SET) != off) ? NULL : &dirent;
835 stackPushPtr(pVM->pStack, d->d_name);
836 stackPushINT(pVM->pStack, strlen(d->d_name));
837 stackPushINT(pVM->pStack, FICL_TRUE);
839 stackPushINT(pVM->pStack, FICL_FALSE);
843 /* fload - interpret file contents
847 static void pfload(FICL_VM *pVM)
852 vmCheckStack(pVM, 1, 0);
854 fd = stackPopINT(pVM->pStack); /* get fd */
860 /* fwrite - write file contents
862 * fwrite ( fd buf nbytes -- nwritten )
864 static void pfwrite(FICL_VM *pVM)
870 vmCheckStack(pVM, 3, 1);
872 len = stackPopINT(pVM->pStack); /* get number of bytes to read */
873 buf = stackPopPtr(pVM->pStack); /* get buffer */
874 fd = stackPopINT(pVM->pStack); /* get fd */
875 if (len > 0 && buf && fd != -1)
876 stackPushINT(pVM->pStack, write(fd, buf, len));
878 stackPushINT(pVM->pStack, -1);
882 /* fseek - seek to a new position in a file
884 * fseek ( fd ofs whence -- pos )
886 static void pfseek(FICL_VM *pVM)
891 vmCheckStack(pVM, 3, 1);
893 whence = stackPopINT(pVM->pStack);
894 pos = stackPopINT(pVM->pStack);
895 fd = stackPopINT(pVM->pStack);
896 stackPushINT(pVM->pStack, lseek(fd, pos, whence));
900 /* key - get a character from stdin
904 static void key(FICL_VM *pVM)
907 vmCheckStack(pVM, 0, 1);
909 stackPushINT(pVM->pStack, getchar());
913 /* key? - check for a character from stdin (FACILITY)
917 static void keyQuestion(FICL_VM *pVM)
920 vmCheckStack(pVM, 0, 1);
923 /* XXX Since we don't fiddle with termios, let it always succeed... */
924 stackPushINT(pVM->pStack, FICL_TRUE);
926 /* But here do the right thing. */
927 stackPushINT(pVM->pStack, ischar()? FICL_TRUE : FICL_FALSE);
932 /* seconds - gives number of seconds since beginning of time
934 * beginning of time is defined as:
936 * BTX - number of seconds since midnight
937 * FreeBSD - number of seconds since Jan 1 1970
941 static void pseconds(FICL_VM *pVM)
944 vmCheckStack(pVM,0,1);
946 stackPushUNS(pVM->pStack, (FICL_UNS) time(NULL));
950 /* ms - wait at least that many milliseconds (FACILITY)
955 static void ms(FICL_VM *pVM)
958 vmCheckStack(pVM,1,0);
961 usleep(stackPopUNS(pVM->pStack)*1000);
963 delay(stackPopUNS(pVM->pStack)*1000);
968 /* fkey - get a character from a file
970 * fkey ( file -- char )
972 static void fkey(FICL_VM *pVM)
978 vmCheckStack(pVM, 1, 1);
980 fd = stackPopINT(pVM->pStack);
981 i = read(fd, &ch, 1);
982 stackPushINT(pVM->pStack, i > 0 ? ch : -1);
988 ** Retrieves free space remaining on the dictionary
991 static void freeHeap(FICL_VM *pVM)
993 stackPushINT(pVM->pStack, dictCellsAvail(ficlGetDict(pVM->pSys)));
997 /******************* Increase dictionary size on-demand ******************/
999 static void ficlDictThreshold(FICL_VM *pVM)
1001 stackPushPtr(pVM->pStack, &dictThreshold);
1004 static void ficlDictIncrease(FICL_VM *pVM)
1006 stackPushPtr(pVM->pStack, &dictIncrease);
1009 /**************************************************************************
1010 f i c l C o m p i l e P l a t f o r m
1011 ** Build FreeBSD platform extensions into the system dictionary
1012 **************************************************************************/
1013 void ficlCompilePlatform(FICL_SYSTEM *pSys)
1015 ficlCompileFcn **fnpp;
1016 FICL_DICT *dp = pSys->dp;
1019 dictAppendWord(dp, ".#", displayCellNoPad, FW_DEFAULT);
1020 dictAppendWord(dp, "isdir?", isdirQuestion, FW_DEFAULT);
1021 dictAppendWord(dp, "fopen", pfopen, FW_DEFAULT);
1022 dictAppendWord(dp, "fclose", pfclose, FW_DEFAULT);
1023 dictAppendWord(dp, "fread", pfread, FW_DEFAULT);
1024 dictAppendWord(dp, "freaddir", pfreaddir, FW_DEFAULT);
1025 dictAppendWord(dp, "fload", pfload, FW_DEFAULT);
1026 dictAppendWord(dp, "fkey", fkey, FW_DEFAULT);
1027 dictAppendWord(dp, "fseek", pfseek, FW_DEFAULT);
1028 dictAppendWord(dp, "fwrite", pfwrite, FW_DEFAULT);
1029 dictAppendWord(dp, "key", key, FW_DEFAULT);
1030 dictAppendWord(dp, "key?", keyQuestion, FW_DEFAULT);
1031 dictAppendWord(dp, "ms", ms, FW_DEFAULT);
1032 dictAppendWord(dp, "seconds", pseconds, FW_DEFAULT);
1033 dictAppendWord(dp, "heap?", freeHeap, FW_DEFAULT);
1034 dictAppendWord(dp, "dictthreshold", ficlDictThreshold, FW_DEFAULT);
1035 dictAppendWord(dp, "dictincrease", ficlDictIncrease, FW_DEFAULT);
1037 dictAppendWord(dp, "setenv", ficlSetenv, FW_DEFAULT);
1038 dictAppendWord(dp, "setenv?", ficlSetenvq, FW_DEFAULT);
1039 dictAppendWord(dp, "getenv", ficlGetenv, FW_DEFAULT);
1040 dictAppendWord(dp, "unsetenv", ficlUnsetenv, FW_DEFAULT);
1041 dictAppendWord(dp, "copyin", ficlCopyin, FW_DEFAULT);
1042 dictAppendWord(dp, "copyout", ficlCopyout, FW_DEFAULT);
1043 dictAppendWord(dp, "findfile", ficlFindfile, FW_DEFAULT);
1044 dictAppendWord(dp, "ccall", ficlCcall, FW_DEFAULT);
1045 dictAppendWord(dp, "uuid-from-string", ficlUuidFromString, FW_DEFAULT);
1046 dictAppendWord(dp, "uuid-to-string", ficlUuidToString, FW_DEFAULT);
1048 dictAppendWord(dp, "fb-setpixel", ficl_fb_setpixel, FW_DEFAULT);
1049 dictAppendWord(dp, "fb-line", ficl_fb_line, FW_DEFAULT);
1050 dictAppendWord(dp, "fb-bezier", ficl_fb_bezier, FW_DEFAULT);
1051 dictAppendWord(dp, "fb-drawrect", ficl_fb_drawrect, FW_DEFAULT);
1052 dictAppendWord(dp, "fb-putimage", ficl_fb_putimage, FW_DEFAULT);
1053 dictAppendWord(dp, "term-drawrect", ficl_term_drawrect, FW_DEFAULT);
1054 dictAppendWord(dp, "term-putimage", ficl_term_putimage, FW_DEFAULT);
1055 dictAppendWord(dp, "isvirtualized?",ficlIsvirtualizedQ, FW_DEFAULT);
1058 SET_FOREACH(fnpp, Xficl_compile_set)
1061 #if defined(__i386__)
1062 ficlSetEnv(pSys, "arch-i386", FICL_TRUE);
1063 ficlSetEnv(pSys, "arch-powerpc", FICL_FALSE);
1064 #elif defined(__powerpc__)
1065 ficlSetEnv(pSys, "arch-i386", FICL_FALSE);
1066 ficlSetEnv(pSys, "arch-powerpc", FICL_TRUE);