--- gforth/kernel/require.fs 2006/02/04 22:09:12 1.31 +++ gforth/kernel/require.fs 2012/12/31 15:25:19 1.39 @@ -1,12 +1,12 @@ \ require.fs -\ Copyright (C) 1995,1996,1997,1998,2000,2003 Free Software Foundation, Inc. +\ Copyright (C) 1995,1996,1997,1998,2000,2003,2006,2007,2010,2012 Free Software Foundation, Inc. \ This file is part of Gforth. \ Gforth is free software; you can redistribute it and/or \ modify it under the terms of the GNU General Public License -\ as published by the Free Software Foundation; either version 2 +\ as published by the Free Software Foundation, either version 3 \ of the License, or (at your option) any later version. \ This program is distributed in the hope that it will be useful, @@ -15,16 +15,15 @@ \ GNU General Public License for more details. \ You should have received a copy of the GNU General Public License -\ along with this program; if not, write to the Free Software -\ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. +\ along with this program. If not, see http://www.gnu.org/licenses/. \ Now: Kernel Module, Reloadable create included-files 0 , 0 , ( pointer to and count of included files ) \ note: these names must not contain a "/" or "\"; otherwise a part of \ that name might be used when expanding "./" (see expandtopic). -here ," *somewhere*" dup c@ swap 1 + swap -, A, here 2 cells - +here ," string.fs" dup c@ swap 1 + swap , A, +here 2 cells - create image-included-files 1 , A, ( pointer to and count of included files ) \ included-files points to ALLOCATEd space, while image-included-files \ points to ALLOTed objects, so it survives a save-system @@ -34,7 +33,7 @@ create image-included-files 1 , A, ( poi \G source. The result is valid only while the file is being \G loaded. If the current input source is no (stream) file, the \G result is undefined. In Gforth, the result is valid during the - \G whole seesion (but not across @code{savesystem} etc.). + \G whole session (but not across @code{savesystem} etc.). loadfilename 2@ ; : sourceline# ( -- u ) \ gforth sourceline-number @@ -69,7 +68,7 @@ create image-included-files 1 , A, ( poi : add-included-file ( c-addr u -- ) \ gforth \G add name c-addr u to included-files included-files 2@ 2* cells 2 cells extend-mem - 2/ cell / included-files 2! + 2/ cell/ included-files 2! 2! ; : included1 ( i*x file-id c-addr u -- j*x ) \ gforth @@ -138,4 +137,4 @@ create image-included-files 1 , A, ( poi : .included ( -- ) \ gforth \G list the names of the files that have been @code{included} - included-files 2@ 2 cells under+ 1- .strings ; + included-files 2@ .strings ;