--- gforth/oldlib.fs 2003/08/15 21:45:46 1.1 +++ gforth/oldlib.fs 2005/12/31 15:46:09 1.4 @@ -1,6 +1,6 @@ \ lib.fs shared library support package 11may97py -\ Copyright (C) 1995,1996,1997,1998,2000 Free Software Foundation, Inc. +\ Copyright (C) 1995,1996,1997,1998,2000,2003,2005 Free Software Foundation, Inc. \ This file is part of Gforth. @@ -30,6 +30,8 @@ Create fcall-table Variable libs 0 libs ! \G links between libraries +Variable legacy legacy off + : @lib ( lib -- ) \G obtains library handle cell+ dup 2 cells + count open-lib @@ -40,6 +42,14 @@ Variable libs 0 libs ! cell+ tuck 2 cells + count rot cell+ @ lib-sym dup 0= abort" Proc not found!" swap cell+ ! ; +-1 Constant (addr) + 0 Constant (int) + 1 Constant (float) + 2 Constant (void) + 4 Constant (int...) + 5 Constant (float...) + 6 Constant (void...) + : proc, ( pars type lib addr -- ) \G allocates and initializes proc stub \G stub format: @@ -47,18 +57,11 @@ Variable libs 0 libs ! \G address of proc \G offset in lcall1-table to call proc \G OS name of symbol as counted string + legacy @ IF (int) -rot THEN here 2dup swap 2 cells + dup @ A, ! 2swap 1 and IF fcall-table ELSE icall-table THEN swap cells 2* + , 0 , bl sword string, @proc ; --1 Constant (addr) - 0 Constant (int) - 1 Constant (float) - 2 Constant (void) - 4 Constant (int...) - 5 Constant (float...) - 6 Constant (void...) - : proc: ( pars type lib "name" "string" -- ) \G Creates a named proc stub Create proc,