;
; msgs.sh
;
; Message file handling
;
;  1994-1998 Straylight
;

;----- Licensing note -------------------------------------------------------
;
; This file is part of Straylight's Sapphire library.
;
; Sapphire is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2, or (at your option)
; any later version.
;
; Sapphire 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 General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with Sapphire.  If not, write to the Free Software Foundation,
; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

;----- Overview -------------------------------------------------------------
;
; Functions provided:
;
;  msgs_load
;  msgs_build
;  msgs_error
;  msgs_lookup
;  msgs_init

		[	:LNOT::DEF:msgs__dfn
		GBLL	msgs__dfn

; --- msgs_load ---
;
; On entry:	R0 == pointer to filename
;
; On exit:	May return an error
;
; Use:		Reads in the given messages file.

		IMPORT	msgs_load

; --- msgs_build ---
;
; On entry:	R0 == pointer to a message string
;		R1 == pointer to output buffer
;
; On exit:	R0 == pointer to buffer (R1 on entry)
;		R1 == pointer to terminating null
;
; Use:		Builds a message string, by substituting message references
;		by their values.  Each reference of the form `$tag' (or
;		optionally `$(tag)', to avoid having to have a trailing)
;		space is replaced by the actual message.  A literal `$' sign
;		may be represented as `$$'.

		IMPORT	msgs_build

; --- msgs_error ---
;
; On entry:	R0 == pointer to an error skeleton string:
;		        R0+0 == error number
;		        R0+4 == message tag-and-default (null-terminated)
;		R2-R11 == filler strings (not message tags)
;
; On exit:	R0 == pointer to translated error message (in error buffer)
;		R1 == pointer to null terminator of message
;
; Use:		Performs string sustitution on an error message (as done by
;		str_subst), but translating the error string.

		IMPORT	msgs_error

; --- msgs_lookup ---
;
; On entry:	R0 == message tag (and default message)
;
; On exit:	R0 == pointer to located message
;
; Use:		Returns the real message from its tag. If the tag does not
;		exist, then the default message is used. If that is not
;		supplied, then the tag name itself is returned (ie. R0
;		is preserved).

		IMPORT	msgs_lookup

; --- msgs_init ---
;
; On entry:	--
;
; On exit:	--
;
; Use:		Initialises the message system.

		IMPORT	msgs_init

		]

;----- That's all, folks ----------------------------------------------------

		END
