[1478] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next next in chain last in chain last

Re: Text Dump Structure

daemon@ATHENA.MIT.EDU (Wed Nov 17 17:30:38 1999 )

Date: Wed, 17 Nov 1999 15:10:21 -0700
From: Brandon Gillespie <brandon@roguetrader.com>
To: cold-announce@cold.org
In-Reply-To: <199911172149.NAA00535@taller.eng.sun.com>; from Jeff Kesselman on Wed, Nov 17, 1999 at 01:49:28PM -0800
Reply-To: cold-announce@cold.org


--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

This shouldn't be on cold-announce, lets do additional followups to
coldstuff@cold.org.

On Wed, Nov 17, 1999 at 01:49:28PM -0800, Jeff Kesselman wrote:
> Textdump is human readable and IMO very simple to grok. Why dont you
> just dump and look at the output?
>=20
>> I've been going through the ColdC reference material lately and it
>> appears that the Text Dump Structure information is missing.  I was
>> wondering if this information is available somewhere?

It should be documented, and I never did.  But Jeff is right, it is
easy to figure out.  You can dig into the spagetti of textdb.c if you
want the full gritty details.  Basically you have one 'statement'
which ends with a semicolon (always).  The statement format is
abstractly:

    [new|old] <directive> <directive args>;

My long term goals when I redid the textdump parsing was to have
textdb.c be an interim phase until I wroteup a yacc parser for the
textdump.  My goals with the rewrite of textdump parsing was to make=20
it more parseable by external scripts (specifically in dealing with=20
broken lines--for programs that might choke on a single string 10MB in
length).  But yacc hasn't been done yet, so you do have some limits=20
which shouldn't exist.  Basically, you can break a line with a=20
backslash followed by a newline (but this is the only valid way--it=20
does not process backslashes in other contexts--such as a method). =20
You can also break the line with a block in curly braces -- only for
methods.  As for the format of each directive, just read the textdump.
for the most part dont expect it to be forgiving about its format.  It
wasn't intended to be used as an end-user programming format, but=20
simply as a machine readable and parsable format which can be read and
tweaked by humans.  The new/old prefix to a directive WILL change its=20
behaviour--for many directives you have three conditions: new(add),
old(delete) and neither.  If you are doing a new, it will expect=20
whatever you are doing to not exist currently.  Doing an old WILL=20
DELETE IT.  So doing 'old object #124124;' will delete the object. =20
This is so you can 'patch' databases from coldcc. =20

Basically, follow Jeff's advice--read the textdump.  Also look at the=20
source, and finally ask me if you need clarification.

-Brandon Gillespie

--xHFwDpU9dbj6ez1V
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: 7kggo3gVcr0ioEvcJT+aq0cK1ZJkR0rE

iQA/AwUBODMny0v5XoQiMgn6EQLo3ACgm8FPrZOA4ktOpGGOakgK6fpAjVkAn2Aw
dHax6tcC+LBvlW7OpEhfFHkL
=Jwqn
-----END PGP SIGNATURE-----

--xHFwDpU9dbj6ez1V--