;ELC   
;;; compiled by ckclark@major.MIT.EDU on Tue Aug  3 03:12:40 1993
;;; from file /afs/sipb.mit.edu/contrib/emacs/elisp19/edb/db-tagged.el
;;; emacs version 19.16.1.
;;; bytecomp version FSF 2.10
;;; optimization is on.
;;; this file uses opcodes which do not exist in Emacs 18.

(if (and (boundp 'emacs-version)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19")))
    (error "This file was compiled for Emacs 19"))

(byte-code "ÀÁ!ˆÀÂ!ˆÃÄ!‡" [require database db-util provide db-tagged] 2)
(defvar db-tagged-tag-chars "-_A-Za-z" "\
The characters that are allowed in field tags, in a form suitable for
placing inside [] in a regular expression.")
(defvar db-tagged-pre-tag "" "\
The string that precedes each tag.
Used only if  db-tagged-pre-tag-regexp  or  db-tagged-pre-tag-output
nil (depending on whether the record is being read or written).")
(defvar db-tagged-pre-tag-regexp nil "\
A regexp for what precedes each tag on its line when parsing.
It must NOT contain any grouping constructs.")
(defvar db-tagged-pre-tag-output nil "\
The fixed string to place before each tag on output.")
(defvar db-tagged-separator ":" "\
The string that separates field names from values.
Used only if  db-tagged-separator-regexp  or  db-tagged-separator-output  is
nil (depending on whether the record is being read or written).")
(defvar db-tagged-separator-regexp nil "\
A regexp for the separator between field names and values when parsing.")
(defvar db-tagged-separator-output nil "\
The separator between field names and values on output.")
(defvar db-tagged-continuation "	" "\
The string that marks (the beginning of) a continuation line.
Used only if  db-tagged-continuation-regexp  or  db-tagged-continuation-output
is nil (depending on whether the record is being read or written).")
(defvar db-tagged-continuation-regexp "[ 	]+" "\
A regexp for a continuation line in a value when parsing.")
(defvar db-tagged-continuation-output nil "\
The fixed string to use (before) continuing values on output.")
(defvar db-tagged-rrfr-hooks nil "\
Hooks run on each database record before tagged parse.")
(defvar db-tagged-wrfr-before-hooks nil "\
Hooks run before each tagged write of a database record.
The record is bound to the dynamic variable  record, and point is where the
record will be inserted in the buffer.")
(defvar db-tagged-wrfr-after-hooks nil "\
Hooks run after each tagged write of a database record.
The record is bound to the dynamic variable  record, and point is immediately
after the file representation of the record.")
(defvar db-tagged-converted-p nil "\
Non-nil if `database-stored->actual' has already been run.")
(defvar db-tagged-default-field nil "\
A fieldname (symbol) for the field indicated by an illegal or empty tag.
(For instance, you might set it to 'comments.)
Nil if those values should be discarded.")
(byte-code "ÀÁÂ\"ˆÀÃÄ\"ˆÀÅÆ\"‡" [defalias tagged-field-spec-name #[(tfs) "@‡" [tfs] 1] tagged-field-spec-tag #[(tfs) "A@‡" [tfs] 1] tagged-field-spec-help #[(tfs) "AA@‡" [tfs] 1]] 3)
(defalias 'db-tagged-setup #[(tagged-field-specs) "À	!ƒ ÂÃ	Ä#?… ÅÃ	Ä#‡Æ!‡" [db-tagged-p database database-get-local db-tagged-converted-p t database-set-local db-tagged-setup-internal tagged-field-specs] 4 "\
Ready the database to read files in tagged format.
Creates database local variables and sets database slots.
Argument TAGGED-FIELD-SPECS is a list of tagged-field specifications, one
for each field in a database record.  Each tagged-field specification is a
three-element list of the field name (a symbol), the tag used to identify
it in the file (a string), and a brief help string.
Instead of a symbol, the tagged-field name may be a cons of the
field name and its type.
To indicate that a field is never found in the input file (typically
because it is computed on the fly), use nil for its tag.

This function should be called first in an auxiliary or format file, so
that the defaults it chooses can be overridden.
`database-set-fieldnames-to-list' should not be called if this function is."])
(defalias 'db-tagged-setup-internal #[(tagged-field-specs) "ÀÁ\n#ˆÄÅÆ\"ˆÇÉ\nÄÊ\"\"ˆÄË\"ˆ\nÌÍIˆ\nÎÏIˆ\nÐHÑÒIˆ\nÐHÓÔIˆÕÖ×\"ˆÕØÙ\"‡" [database-make-local db-tagged-field-spec database tagged-field-specs mapcar #[(fld) "À	\n	J#‡" [database-make-local fld database] 4] (db-tagged-rrfr-hooks db-tagged-wrfr-before-hooks db-tagged-wrfr-after-hooks db-tagged-tag-chars db-tagged-pre-tag db-tagged-pre-tag-regexp db-tagged-pre-tag-output db-tagged-separator db-tagged-separator-regexp db-tagged-separator-output db-tagged-continuation db-tagged-continuation-regexp db-tagged-continuation-output db-tagged-converted-p) nil-or-string db-default-field-type database-set-fieldnames-to-list tagged-field-spec-name #[(fspec) "À	!Â	!Ã‰‰‰:ƒ @É\n\"ËÌ\n\"!‰ÍHÍƒ> ÎQ‚@ IˆÏ\n#-‡" [tagged-field-spec-name fspec tagged-field-spec-help nil ohelp rs fnum help fn fieldname->fieldnumber database copy-sequence database-recordfieldspec 8 "\n" database-set-recordfieldspec] 6] 20 db-tagged-rrfr 21 db-tagged-wrfr 17 4 "\n\n" 8 "\n" db-add-to-hook db-before-read-hooks db-tagged-before-read db-after-read-hooks db-tagged-database-stored->actual] 5 "\
Do the real work of `db-tagged-setup'.
This function should only be called once per database."])
(defalias 'db-tagged-p #[(database) "ÀÁ\nÃ#‡" [database-get-local db-tagged-field-spec database t] 4 "\
Non-nil if DATABASE is in tagged file layout."])
(defalias 'db-tagged-database-stored->actual #[(&optional db) "À	† \n!… ÃÄ\nÅ#?… Æ	!ˆÇÄ\nÅ#‡" [db-tagged-p db database database-get-local db-tagged-converted-p t database-stored->actual database-set-local] 4 "\
Like `database-stored->actual', but only in tagged file layout."])
(byte-code "ÀÁÂ\"ˆÀÃÄ\"ˆÀÅÆ\"ˆÀÇÈ\"‡" [defalias db-tagged-before-read #[nil "À	!…q ÂÃ	\"„ ÄÃ	ÅÂÆ	\"!#ˆÂÇ	\"„( ÄÇ	ÂÆ	\"#ˆÂÈ	\"„= ÄÈ	ÉÅÂÊ	\"!ÉQ#ˆÂË	\"„O ÄË	ÂÊ	\"ÌP#ˆÂÍ	\"„a ÄÍ	ÅÂÎ	\"!#ˆÂÏ	\"?…q ÄÏ	ÂÎ	\"#‡" [db-tagged-p database database-get-local db-tagged-pre-tag-regexp database-set-local regexp-quote db-tagged-pre-tag db-tagged-pre-tag-output db-tagged-separator-regexp "[ 	]*" db-tagged-separator db-tagged-separator-output "	" db-tagged-continuation-regexp db-tagged-continuation db-tagged-continuation-output] 8] db-tagged-rrfr #[nil "À	!ÃÄ	\"ÆÃÇ	\"ÈÃÉ	\"ÊÃË	\"°ÍÍÍÃÑ	\"ÓÒ!ˆ)ebˆm„´ Ô!ƒ¬ ÕÖ!×!ÍˆØ•`{ÖyˆÔ!ƒn ÍˆÚØ•`{QÖyˆ‚U „} ÛÜ\"ˆÞ\n	#ƒ¨ „› ß\n	$ˆ‚¨ ß\nÚQ	$ˆ)‚3 àá`\"ˆ‚3 \n.‡" [make-record database result-record database-get-local db-tagged-continuation-regexp cnt-re "^" db-tagged-pre-tag-regexp "\\([" db-tagged-tag-chars "]*\\)" db-tagged-separator-regexp tag-re nil fld-nam fld prev-value db-tagged-rrfr-hooks hooks run-hooks looking-at db-match-string 1 lookup-field 0 fld-val "\n" db-message "Invalid field name %s." db-tagged-default-field record-field record-set-field error "At char %d, didn't find either a tag or the end of the record."] 8] db-tagged-wrfr #[(record) "ÀÁ\n\"ÄÃ!ˆ)ÀÅ\n\"ÀÆ\n\"ÉÊÀË\n\"\"ˆ*ÌÍ!ˆÀÎ\n\"ÄÃ!)‡" [database-get-local db-tagged-wrfr-before-hooks database hooks run-hooks db-tagged-separator-output db-tagged-continuation-output contin sep mapcar #[(fld-def) "À	!Â	!‰:ƒ @??…ˆ Å\"È\"ÉH\nË\nH\"‰?†; Îš?…‡ ÏÐÎšƒL ‚N ±ˆÖ×#‰ƒ} O×±ˆØ\\‚Z ÐO×±++*‡" [tagged-field-spec-name fld-def tagged-field-spec-tag fld-tag fld-nam fieldname->fieldnumber database fld-nbr database-recordfieldspec 9 a->s db-funcall-maybe record fld-val "" 0 nil sep contin cnt j i string-match "\n" 1] 5] db-tagged-field-spec delete-char -1 db-tagged-wrfr-after-hooks] 5] lookup-field #[(key) "ÀÁ\n\"Ã‰ƒ  @A@šƒ @@A‰„ :ƒ* @‚+ *‡" [database-get-local db-tagged-field-spec database nil r l key] 4]] 3)
