| 1 |
(* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. *) |
| 2 |
(* This file is part of GNU Modula-2. |
| 3 |
|
| 4 |
GNU Modula-2 is free software; you can redistribute it and/or modify it under |
| 5 |
the terms of the GNU General Public License as published by the Free |
| 6 |
Software Foundation; either version 2, or (at your option) any later |
| 7 |
version. |
| 8 |
|
| 9 |
GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY |
| 10 |
WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 |
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 12 |
for more details. |
| 13 |
|
| 14 |
You should have received a copy of the GNU General Public License along |
| 15 |
with gm2; see the file COPYING. If not, write to the Free Software |
| 16 |
Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *) |
| 17 |
|
| 18 |
IMPLEMENTATION MODULE opaque ; |
| 19 |
|
| 20 |
CONST |
| 21 |
MaxBuf = 127 ; |
| 22 |
|
| 23 |
TYPE |
| 24 |
Contents = RECORD |
| 25 |
buf : ARRAY [0..MaxBuf-1] OF CHAR ; |
| 26 |
len : CARDINAL ; |
| 27 |
next: String ; |
| 28 |
END ; |
| 29 |
|
| 30 |
Descriptor = POINTER TO descriptor ; (* forward declaration necessary for p2c *) |
| 31 |
|
| 32 |
String = POINTER TO RECORD |
| 33 |
contents: Contents ; |
| 34 |
head : Descriptor ; |
| 35 |
END ; |
| 36 |
|
| 37 |
descriptor = RECORD |
| 38 |
charStarUsed : BOOLEAN ; (* can we garbage collect this? *) |
| 39 |
charStarSize : CARDINAL ; |
| 40 |
charStarValid: BOOLEAN ; |
| 41 |
state : (inuse, marked, onlist, poisoned) ; |
| 42 |
garbage : String ; (* temporary strings to be destroyed |
| 43 |
once this string is killed *) |
| 44 |
END ; |
| 45 |
|
| 46 |
|
| 47 |
END opaque. |