File:  [gforth] / gforth / filedump.fs
Revision 1.6: download - view: text, annotated - select for diffs
Tue Dec 8 22:02:42 1998 UTC (25 years, 3 months ago) by anton
Branches: MAIN
CVS tags: v0-4-0, HEAD
updated dates in copyright messages
inserted copyright messages in most files that did not have them
removed outdated files engine/32bit.h engine/strsig.c

    1: #! /usr/local/lib/gforth/0.2.0/kernel.fi
    2: \ file hex dump
    3: 
    4: \ Copyright (C) 1997 Free Software Foundation, Inc.
    5: 
    6: \ This file is part of Gforth.
    7: 
    8: \ Gforth is free software; you can redistribute it and/or
    9: \ modify it under the terms of the GNU General Public License
   10: \ as published by the Free Software Foundation; either version 2
   11: \ of the License, or (at your option) any later version.
   12: 
   13: \ This program is distributed in the hope that it will be useful,
   14: \ but WITHOUT ANY WARRANTY; without even the implied warranty of
   15: \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   16: \ GNU General Public License for more details.
   17: 
   18: \ You should have received a copy of the GNU General Public License
   19: \ along with this program; if not, write to the Free Software
   20: \ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   21: 
   22: Create buffer $10 allot
   23: 
   24: : dumpline ( addr handle -- flag )
   25:   buffer $10 rot read-file throw
   26:   dup /dump !  $10 <> swap 6 u.r ." : "  buffer .line cr ;
   27: 
   28: : init  cr $10 base ! ;
   29: 
   30: : filedump  ( addr count -- )  init r/o bin open-file throw >r
   31:   0  BEGIN  $10 bounds  r@ dumpline  UNTIL  drop
   32:   r> close-file throw ;
   33: 
   34: script? [IF]
   35:    : alldump argc @ 2 ?DO I arg 2dup type ." :" filedump LOOP ;
   36:    alldump bye
   37: [THEN]

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>