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
27 /*******************************************************************
29 ** Additional FICL words designed for FreeBSD's loader
31 *******************************************************************/
34 #include <sys/types.h>
44 #include "bootstrap.h"
51 /* FreeBSD's loader interaction words and extras
53 * setenv ( value n name n' -- )
54 * setenv? ( value n name n' flag -- )
55 * getenv ( addr n -- addr' n' | -1 )
56 * unsetenv ( addr n -- )
57 * copyin ( addr addr' len -- )
58 * copyout ( addr addr' len -- )
59 * findfile ( name len type len' -- addr )
60 * pnpdevices ( -- addr )
61 * pnphandlers ( -- addr )
62 * ccall ( [[...[p10] p9] ... p1] n addr -- result )
63 * uuid-from-string ( addr n -- addr' )
64 * uuid-to-string ( addr' -- addr n )
69 /* ( flags x1 y1 x2 y2 -- flag ) */
71 ficl_term_putimage(FICL_VM *pVM)
75 unsigned long ret = FICL_FALSE;
76 uint32_t x1, y1, x2, y2, f;
81 vmCheckStack(pVM, 7, 1);
83 names = stackPopINT(pVM->pStack);
84 namep = (char *) stackPopPtr(pVM->pStack);
85 y2 = stackPopINT(pVM->pStack);
86 x2 = stackPopINT(pVM->pStack);
87 y1 = stackPopINT(pVM->pStack);
88 x1 = stackPopINT(pVM->pStack);
89 f = stackPopINT(pVM->pStack);
91 x1 = gfx_state.tg_origin.tp_col + x1 * gfx_state.tg_font.vf_width;
92 y1 = gfx_state.tg_origin.tp_row + y1 * gfx_state.tg_font.vf_height;
94 x2 = gfx_state.tg_origin.tp_col +
95 x2 * gfx_state.tg_font.vf_width;
98 y2 = gfx_state.tg_origin.tp_row +
99 y2 * gfx_state.tg_font.vf_height;
102 name = ficlMalloc(names + 1);
104 vmThrowErr(pVM, "Error: out of memory");
105 (void) strncpy(name, namep, names);
108 if ((error = png_open(&png, name)) != PNG_NO_ERROR) {
109 if (f & FL_PUTIMAGE_DEBUG)
110 printf("%s\n", png_error_string(error));
112 if (gfx_fb_putimage(&png, x1, y1, x2, y2, f) == 0)
113 ret = FICL_TRUE; /* success */
114 (void) png_close(&png);
117 stackPushUNS(pVM->pStack, ret);
120 /* ( flags x1 y1 x2 y2 -- flag ) */
122 ficl_fb_putimage(FICL_VM *pVM)
126 unsigned long ret = FICL_FALSE;
127 uint32_t x1, y1, x2, y2, f;
132 vmCheckStack(pVM, 7, 1);
134 names = stackPopINT(pVM->pStack);
135 namep = (char *) stackPopPtr(pVM->pStack);
136 y2 = stackPopINT(pVM->pStack);
137 x2 = stackPopINT(pVM->pStack);
138 y1 = stackPopINT(pVM->pStack);
139 x1 = stackPopINT(pVM->pStack);
140 f = stackPopINT(pVM->pStack);
142 name = ficlMalloc(names + 1);
144 vmThrowErr(pVM, "Error: out of memory");
145 (void) strncpy(name, namep, names);
148 if ((error = png_open(&png, name)) != PNG_NO_ERROR) {
149 if (f & FL_PUTIMAGE_DEBUG)
150 printf("%s\n", png_error_string(error));
152 if (gfx_fb_putimage(&png, x1, y1, x2, y2, f) == 0)
153 ret = FICL_TRUE; /* success */
154 (void) png_close(&png);
157 stackPushUNS(pVM->pStack, ret);
161 ficl_fb_setpixel(FICL_VM *pVM)
166 vmCheckStack(pVM, 2, 0);
169 y = stackPopUNS(pVM->pStack);
170 x = stackPopUNS(pVM->pStack);
171 gfx_fb_setpixel(x, y);
175 ficl_fb_line(FICL_VM *pVM)
177 FICL_UNS x0, y0, x1, y1, wd;
180 vmCheckStack(pVM, 5, 0);
183 wd = stackPopUNS(pVM->pStack);
184 y1 = stackPopUNS(pVM->pStack);
185 x1 = stackPopUNS(pVM->pStack);
186 y0 = stackPopUNS(pVM->pStack);
187 x0 = stackPopUNS(pVM->pStack);
188 gfx_fb_line(x0, y0, x1, y1, wd);
192 ficl_fb_bezier(FICL_VM *pVM)
194 FICL_UNS x0, y0, x1, y1, x2, y2, width;
197 vmCheckStack(pVM, 7, 0);
200 width = stackPopUNS(pVM->pStack);
201 y2 = stackPopUNS(pVM->pStack);
202 x2 = stackPopUNS(pVM->pStack);
203 y1 = stackPopUNS(pVM->pStack);
204 x1 = stackPopUNS(pVM->pStack);
205 y0 = stackPopUNS(pVM->pStack);
206 x0 = stackPopUNS(pVM->pStack);
207 gfx_fb_bezier(x0, y0, x1, y1, x2, y2, width);
211 ficl_fb_drawrect(FICL_VM *pVM)
213 FICL_UNS x1, x2, y1, y2, fill;
216 vmCheckStack(pVM, 5, 0);
219 fill = stackPopUNS(pVM->pStack);
220 y2 = stackPopUNS(pVM->pStack);
221 x2 = stackPopUNS(pVM->pStack);
222 y1 = stackPopUNS(pVM->pStack);
223 x1 = stackPopUNS(pVM->pStack);
224 gfx_fb_drawrect(x1, y1, x2, y2, fill);
228 ficl_term_drawrect(FICL_VM *pVM)
230 FICL_UNS x1, x2, y1, y2;
233 vmCheckStack(pVM, 4, 0);
236 y2 = stackPopUNS(pVM->pStack);
237 x2 = stackPopUNS(pVM->pStack);
238 y1 = stackPopUNS(pVM->pStack);
239 x1 = stackPopUNS(pVM->pStack);
240 gfx_term_drawrect(x1, y1, x2, y2);
242 #endif /* TESTMAIN */
245 ficlSetenv(FICL_VM *pVM)
250 char *namep, *valuep;
254 vmCheckStack(pVM, 4, 0);
256 names = stackPopINT(pVM->pStack);
257 namep = (char*) stackPopPtr(pVM->pStack);
258 values = stackPopINT(pVM->pStack);
259 valuep = (char*) stackPopPtr(pVM->pStack);
262 name = (char*) ficlMalloc(names+1);
264 vmThrowErr(pVM, "Error: out of memory");
265 strncpy(name, namep, names);
267 value = (char*) ficlMalloc(values+1);
269 vmThrowErr(pVM, "Error: out of memory");
270 strncpy(value, valuep, values);
271 value[values] = '\0';
273 setenv(name, value, 1);
282 ficlSetenvq(FICL_VM *pVM)
287 char *namep, *valuep;
288 int names, values, overwrite;
291 vmCheckStack(pVM, 5, 0);
293 overwrite = stackPopINT(pVM->pStack);
294 names = stackPopINT(pVM->pStack);
295 namep = (char*) stackPopPtr(pVM->pStack);
296 values = stackPopINT(pVM->pStack);
297 valuep = (char*) stackPopPtr(pVM->pStack);
300 name = (char*) ficlMalloc(names+1);
302 vmThrowErr(pVM, "Error: out of memory");
303 strncpy(name, namep, names);
305 value = (char*) ficlMalloc(values+1);
307 vmThrowErr(pVM, "Error: out of memory");
308 strncpy(value, valuep, values);
309 value[values] = '\0';
311 setenv(name, value, overwrite);
320 ficlGetenv(FICL_VM *pVM)
329 vmCheckStack(pVM, 2, 2);
331 names = stackPopINT(pVM->pStack);
332 namep = (char*) stackPopPtr(pVM->pStack);
335 name = (char*) ficlMalloc(names+1);
337 vmThrowErr(pVM, "Error: out of memory");
338 strncpy(name, namep, names);
341 value = getenv(name);
345 stackPushPtr(pVM->pStack, value);
346 stackPushINT(pVM->pStack, strlen(value));
349 stackPushINT(pVM->pStack, -1);
355 ficlUnsetenv(FICL_VM *pVM)
364 vmCheckStack(pVM, 2, 0);
366 names = stackPopINT(pVM->pStack);
367 namep = (char*) stackPopPtr(pVM->pStack);
370 name = (char*) ficlMalloc(names+1);
372 vmThrowErr(pVM, "Error: out of memory");
373 strncpy(name, namep, names);
384 ficlCopyin(FICL_VM *pVM)
391 vmCheckStack(pVM, 3, 0);
394 len = stackPopINT(pVM->pStack);
395 dest = stackPopINT(pVM->pStack);
396 src = stackPopPtr(pVM->pStack);
399 archsw.arch_copyin(src, dest, len);
406 ficlCopyout(FICL_VM *pVM)
413 vmCheckStack(pVM, 3, 0);
416 len = stackPopINT(pVM->pStack);
417 dest = stackPopPtr(pVM->pStack);
418 src = stackPopINT(pVM->pStack);
421 archsw.arch_copyout(src, dest, len);
428 ficlFindfile(FICL_VM *pVM)
434 struct preloaded_file* fp;
438 vmCheckStack(pVM, 4, 1);
441 types = stackPopINT(pVM->pStack);
442 typep = (char*) stackPopPtr(pVM->pStack);
443 names = stackPopINT(pVM->pStack);
444 namep = (char*) stackPopPtr(pVM->pStack);
446 name = (char*) ficlMalloc(names+1);
448 vmThrowErr(pVM, "Error: out of memory");
449 strncpy(name, namep, names);
451 type = (char*) ficlMalloc(types+1);
453 vmThrowErr(pVM, "Error: out of memory");
454 strncpy(type, typep, types);
457 fp = file_findfile(name, type);
461 stackPushPtr(pVM->pStack, fp);
468 /* isvirtualized? - Return whether the loader runs under a
471 * isvirtualized? ( -- flag )
474 ficlIsvirtualizedQ(FICL_VM *pVM)
480 vmCheckStack(pVM, 0, 1);
483 hv = (archsw.arch_hypervisor != NULL)
484 ? (*archsw.arch_hypervisor)()
486 flag = (hv != NULL) ? FICL_TRUE : FICL_FALSE;
487 stackPushINT(pVM->pStack, flag);
490 #endif /* ndef TESTMAIN */
493 ficlCcall(FICL_VM *pVM)
495 int (*func)(int, ...);
500 vmCheckStack(pVM, 2, 0);
503 func = stackPopPtr(pVM->pStack);
504 nparam = stackPopINT(pVM->pStack);
507 vmCheckStack(pVM, nparam, 1);
510 for (i = 0; i < nparam; i++)
511 p[i] = stackPopINT(pVM->pStack);
513 result = func(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8],
516 stackPushINT(pVM->pStack, result);
522 ficlUuidFromString(FICL_VM *pVM)
533 vmCheckStack(pVM, 2, 0);
536 uuids = stackPopINT(pVM->pStack);
537 uuidp = (char *) stackPopPtr(pVM->pStack);
540 uuid = (char *)ficlMalloc(uuids + 1);
542 vmThrowErr(pVM, "Error: out of memory");
543 strncpy(uuid, uuidp, uuids);
546 u = (uuid_t *)ficlMalloc(sizeof (*u));
548 uuid_from_string(uuid, u, &status);
550 if (status != uuid_s_ok) {
557 stackPushPtr(pVM->pStack, u);
564 ficlUuidToString(FICL_VM *pVM)
573 vmCheckStack(pVM, 1, 0);
576 u = (uuid_t *)stackPopPtr(pVM->pStack);
579 uuid_to_string(u, &uuid, &status);
580 if (status != uuid_s_ok) {
581 stackPushPtr(pVM->pStack, uuid);
582 stackPushINT(pVM->pStack, strlen(uuid));
585 stackPushINT(pVM->pStack, -1);
590 /**************************************************************************
592 ** reads in text from file fd and passes it to ficlExec()
593 * returns VM_OUTOFTEXT on success or the ficlExec() error code on
597 int ficlExecFD(FICL_VM *pVM, int fd)
600 int nLine = 0, rval = VM_OUTOFTEXT;
605 pVM->sourceID.i = fd;
607 /* feed each line to ficlExec */
612 while ((status = read(fd, &ch, 1)) > 0 && ch != '\n')
620 rval = ficlExecC(pVM, cp, i);
621 if(rval != VM_QUIT && rval != VM_USEREXIT && rval != VM_OUTOFTEXT)
628 ** Pass an empty line with SOURCE-ID == -1 to flush
629 ** any pending REFILLs (as required by FILE wordset)
631 pVM->sourceID.i = -1;
638 static void displayCellNoPad(FICL_VM *pVM)
642 vmCheckStack(pVM, 1, 0);
644 c = stackPop(pVM->pStack);
645 ltoa((c).i, pVM->pad, pVM->base);
646 vmTextOut(pVM, pVM->pad, 0);
650 /* isdir? - Return whether an fd corresponds to a directory.
652 * isdir? ( fd -- bool )
654 static void isdirQuestion(FICL_VM *pVM)
661 vmCheckStack(pVM, 1, 1);
664 fd = stackPopINT(pVM->pStack);
669 if (fstat(fd, &sb) < 0)
671 if (!S_ISDIR(sb.st_mode))
675 stackPushINT(pVM->pStack, flag);
678 /* fopen - open a file and return new fd on stack.
680 * fopen ( ptr count mode -- fd )
682 static void pfopen(FICL_VM *pVM)
688 vmCheckStack(pVM, 3, 1);
691 mode = stackPopINT(pVM->pStack); /* get mode */
692 count = stackPopINT(pVM->pStack); /* get count */
693 ptr = stackPopPtr(pVM->pStack); /* get ptr */
695 if ((count < 0) || (ptr == NULL)) {
696 stackPushINT(pVM->pStack, -1);
700 /* ensure that the string is null terminated */
701 name = (char *)malloc(count+1);
702 bcopy(ptr,name,count);
706 fd = open(name, mode);
707 #ifdef LOADER_VERIEXEC
709 if (verify_file(fd, name, 0, VE_GUESS, __func__) < 0) {
710 /* not verified writing ok but reading is not */
711 if ((mode & O_ACCMODE) != O_WRONLY) {
716 /* verified reading ok but writing is not */
717 if ((mode & O_ACCMODE) != O_RDONLY) {
725 stackPushINT(pVM->pStack, fd);
729 /* fclose - close a file who's fd is on stack.
733 static void pfclose(FICL_VM *pVM)
738 vmCheckStack(pVM, 1, 0);
740 fd = stackPopINT(pVM->pStack); /* get fd */
746 /* fread - read file contents
748 * fread ( fd buf nbytes -- nread )
750 static void pfread(FICL_VM *pVM)
756 vmCheckStack(pVM, 3, 1);
758 len = stackPopINT(pVM->pStack); /* get number of bytes to read */
759 buf = stackPopPtr(pVM->pStack); /* get buffer */
760 fd = stackPopINT(pVM->pStack); /* get fd */
761 if (len > 0 && buf && fd != -1)
762 stackPushINT(pVM->pStack, read(fd, buf, len));
764 stackPushINT(pVM->pStack, -1);
768 /* freaddir - read directory contents
770 * freaddir ( fd -- ptr len TRUE | FALSE )
772 static void pfreaddir(FICL_VM *pVM)
775 static struct dirent dirent;
786 vmCheckStack(pVM, 1, 3);
789 fd = stackPopINT(pVM->pStack);
792 * The readdirfd() function is specific to the loader environment.
793 * We do the best we can to make freaddir work, but it's not at
801 if (fstat(fd, &sb) == -1)
803 blksz = (sb.st_blksize) ? sb.st_blksize : getpagesize();
804 if ((blksz & (blksz - 1)) != 0)
809 off = lseek(fd, 0LL, SEEK_CUR);
813 if (lseek(fd, 0, SEEK_SET) == -1)
815 bufsz = getdents(fd, buf, blksz);
816 while (bufsz > 0 && bufsz <= ptr) {
818 bufsz = getdents(fd, buf, blksz);
822 d = (void *)(buf + ptr);
825 d = (lseek(fd, off, SEEK_SET) != off) ? NULL : &dirent;
833 stackPushPtr(pVM->pStack, d->d_name);
834 stackPushINT(pVM->pStack, strlen(d->d_name));
835 stackPushINT(pVM->pStack, FICL_TRUE);
837 stackPushINT(pVM->pStack, FICL_FALSE);
841 /* fload - interpret file contents
845 static void pfload(FICL_VM *pVM)
850 vmCheckStack(pVM, 1, 0);
852 fd = stackPopINT(pVM->pStack); /* get fd */
858 /* fwrite - write file contents
860 * fwrite ( fd buf nbytes -- nwritten )
862 static void pfwrite(FICL_VM *pVM)
868 vmCheckStack(pVM, 3, 1);
870 len = stackPopINT(pVM->pStack); /* get number of bytes to read */
871 buf = stackPopPtr(pVM->pStack); /* get buffer */
872 fd = stackPopINT(pVM->pStack); /* get fd */
873 if (len > 0 && buf && fd != -1)
874 stackPushINT(pVM->pStack, write(fd, buf, len));
876 stackPushINT(pVM->pStack, -1);
880 /* fseek - seek to a new position in a file
882 * fseek ( fd ofs whence -- pos )
884 static void pfseek(FICL_VM *pVM)
889 vmCheckStack(pVM, 3, 1);
891 whence = stackPopINT(pVM->pStack);
892 pos = stackPopINT(pVM->pStack);
893 fd = stackPopINT(pVM->pStack);
894 stackPushINT(pVM->pStack, lseek(fd, pos, whence));
898 /* key - get a character from stdin
902 static void key(FICL_VM *pVM)
905 vmCheckStack(pVM, 0, 1);
907 stackPushINT(pVM->pStack, getchar());
911 /* key? - check for a character from stdin (FACILITY)
915 static void keyQuestion(FICL_VM *pVM)
918 vmCheckStack(pVM, 0, 1);
921 /* XXX Since we don't fiddle with termios, let it always succeed... */
922 stackPushINT(pVM->pStack, FICL_TRUE);
924 /* But here do the right thing. */
925 stackPushINT(pVM->pStack, ischar()? FICL_TRUE : FICL_FALSE);
930 /* seconds - gives number of seconds since beginning of time
932 * beginning of time is defined as:
934 * BTX - number of seconds since midnight
935 * FreeBSD - number of seconds since Jan 1 1970
939 static void pseconds(FICL_VM *pVM)
942 vmCheckStack(pVM,0,1);
944 stackPushUNS(pVM->pStack, (FICL_UNS) time(NULL));
948 /* ms - wait at least that many milliseconds (FACILITY)
953 static void ms(FICL_VM *pVM)
956 vmCheckStack(pVM,1,0);
959 usleep(stackPopUNS(pVM->pStack)*1000);
961 delay(stackPopUNS(pVM->pStack)*1000);
966 /* fkey - get a character from a file
968 * fkey ( file -- char )
970 static void fkey(FICL_VM *pVM)
976 vmCheckStack(pVM, 1, 1);
978 fd = stackPopINT(pVM->pStack);
979 i = read(fd, &ch, 1);
980 stackPushINT(pVM->pStack, i > 0 ? ch : -1);
986 ** Retrieves free space remaining on the dictionary
989 static void freeHeap(FICL_VM *pVM)
991 stackPushINT(pVM->pStack, dictCellsAvail(ficlGetDict(pVM->pSys)));
995 /******************* Increase dictionary size on-demand ******************/
997 static void ficlDictThreshold(FICL_VM *pVM)
999 stackPushPtr(pVM->pStack, &dictThreshold);
1002 static void ficlDictIncrease(FICL_VM *pVM)
1004 stackPushPtr(pVM->pStack, &dictIncrease);
1007 /**************************************************************************
1008 f i c l C o m p i l e P l a t f o r m
1009 ** Build FreeBSD platform extensions into the system dictionary
1010 **************************************************************************/
1011 void ficlCompilePlatform(FICL_SYSTEM *pSys)
1013 ficlCompileFcn **fnpp;
1014 FICL_DICT *dp = pSys->dp;
1017 dictAppendWord(dp, ".#", displayCellNoPad, FW_DEFAULT);
1018 dictAppendWord(dp, "isdir?", isdirQuestion, FW_DEFAULT);
1019 dictAppendWord(dp, "fopen", pfopen, FW_DEFAULT);
1020 dictAppendWord(dp, "fclose", pfclose, FW_DEFAULT);
1021 dictAppendWord(dp, "fread", pfread, FW_DEFAULT);
1022 dictAppendWord(dp, "freaddir", pfreaddir, FW_DEFAULT);
1023 dictAppendWord(dp, "fload", pfload, FW_DEFAULT);
1024 dictAppendWord(dp, "fkey", fkey, FW_DEFAULT);
1025 dictAppendWord(dp, "fseek", pfseek, FW_DEFAULT);
1026 dictAppendWord(dp, "fwrite", pfwrite, FW_DEFAULT);
1027 dictAppendWord(dp, "key", key, FW_DEFAULT);
1028 dictAppendWord(dp, "key?", keyQuestion, FW_DEFAULT);
1029 dictAppendWord(dp, "ms", ms, FW_DEFAULT);
1030 dictAppendWord(dp, "seconds", pseconds, FW_DEFAULT);
1031 dictAppendWord(dp, "heap?", freeHeap, FW_DEFAULT);
1032 dictAppendWord(dp, "dictthreshold", ficlDictThreshold, FW_DEFAULT);
1033 dictAppendWord(dp, "dictincrease", ficlDictIncrease, FW_DEFAULT);
1035 dictAppendWord(dp, "setenv", ficlSetenv, FW_DEFAULT);
1036 dictAppendWord(dp, "setenv?", ficlSetenvq, FW_DEFAULT);
1037 dictAppendWord(dp, "getenv", ficlGetenv, FW_DEFAULT);
1038 dictAppendWord(dp, "unsetenv", ficlUnsetenv, FW_DEFAULT);
1039 dictAppendWord(dp, "copyin", ficlCopyin, FW_DEFAULT);
1040 dictAppendWord(dp, "copyout", ficlCopyout, FW_DEFAULT);
1041 dictAppendWord(dp, "findfile", ficlFindfile, FW_DEFAULT);
1042 dictAppendWord(dp, "ccall", ficlCcall, FW_DEFAULT);
1043 dictAppendWord(dp, "uuid-from-string", ficlUuidFromString, FW_DEFAULT);
1044 dictAppendWord(dp, "uuid-to-string", ficlUuidToString, FW_DEFAULT);
1046 dictAppendWord(dp, "fb-setpixel", ficl_fb_setpixel, FW_DEFAULT);
1047 dictAppendWord(dp, "fb-line", ficl_fb_line, FW_DEFAULT);
1048 dictAppendWord(dp, "fb-bezier", ficl_fb_bezier, FW_DEFAULT);
1049 dictAppendWord(dp, "fb-drawrect", ficl_fb_drawrect, FW_DEFAULT);
1050 dictAppendWord(dp, "fb-putimage", ficl_fb_putimage, FW_DEFAULT);
1051 dictAppendWord(dp, "term-drawrect", ficl_term_drawrect, FW_DEFAULT);
1052 dictAppendWord(dp, "term-putimage", ficl_term_putimage, FW_DEFAULT);
1053 dictAppendWord(dp, "isvirtualized?",ficlIsvirtualizedQ, FW_DEFAULT);
1056 SET_FOREACH(fnpp, Xficl_compile_set)
1059 #if defined(__i386__)
1060 ficlSetEnv(pSys, "arch-i386", FICL_TRUE);
1061 ficlSetEnv(pSys, "arch-powerpc", FICL_FALSE);
1062 #elif defined(__powerpc__)
1063 ficlSetEnv(pSys, "arch-i386", FICL_FALSE);
1064 ficlSetEnv(pSys, "arch-powerpc", FICL_TRUE);