( Title: Quick and Dirty Structures PFE Extensions File: qdstruct-pfe.fs Version: 1.0.3 Author: David N. Williams License: LGPL ) \ Copyright (C) 1999, 2001, 2002 by David N. Williams ( This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or at your option any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. Please see the file POLITENESS included with this distribution. Version 1.0.3: 10 March 2002 - Start. Moved nonstandard words from qdstruct.fs to here. ANS Forth compatible except for: - Case sensitivity. - REQUIRES loads Forth source if it's not already loaded. - Use of the terminology "word" for 2 address units, and W@, W! - Words containing that use $! and $@ from our Dynamic-Strings word set. - "LOADM dstrings" loads the dstrings shared library module in pfe, which implements the Dynamic-Strings word set. All "/" sizes are in bytes, and "struc" is the address of a structure instance. ) REQUIRES qdstruct.fs LOADM dstrings \ *** NONSTANDARD WORDS : word-members ( -- ) 2 to /member ; : w@member: ( "name" -- ) create-member DOES> ( struc -- n ) @ ( offset) + w@ ; : w!member: ( "name" -- ) create-member DOES> ( n struc -- ) @ ( offset) + w! ; : $@member: ( "name" -- ) create-member DOES> ( struc -- ) ($: -- $) @ ( offset) + $@ ; : $!member: ( "name" -- ) create-member DOES> ( struc -- ) ($: $ -- ) @ ( offset) + $! ;