--
--	Inmos Libraries
--	Copyright (C) 1988, 1989, 1990, 1991, 1993  Inmos Limited
--
--	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 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
--

--** @module string

#OPTION "E V" -- no compiler libraries, no vector space
#COMMENT "String library V1.1 22/03/90"
#COMMENT "(c) Copyright INMOS Limited 1988"
#USE "convert.lib"
--{{{  history
-- V1.0 1-Jul-88
-- V1.1 22-Mar-90 SRH
--}}}
--{{{  append.real32
--* Write an ASCII representation of a single precision real number
-- into a given string.
--
-- If str overflows this routine acts as an invalid process.
--
-- @param len on entry: the index of str at which the first character
--   of the representation of number is to be placed; on exit: the
--   index of str of the byte immediately following the last character
--   in str of the representation of number, or (SIZE str) if the last
--   character of the representation was placed into the last byte of
--   str
-- @param str the string into which to place the ASCII representation
--   of number
-- @param number a single precision real number in IEEE format
-- @param Ip, Dp formatting values for the real number; see
--   REAL32TOSTRING for their effect
PROC append.real32 (INT len, []BYTE str,
                    VAL REAL32 number, VAL INT Ip, Dp)
  INT addlen:
  SEQ
    VAL rest IS (SIZE str) - len:
    REAL32TOSTRING (addlen, [str FROM len FOR rest], number, Ip, Dp)
    len := len + addlen
:
--}}}
--{{{  append.real64
--* Write an ASCII representation of a double precision real number
-- into a given string.
--
-- If str overflows this routine acts as an invalid process.
--
-- @param len on entry: the index of str at which the first character
--   of the representation of number is to be placed; on exit: the
--   index of str of the byte immediately following the last character
--   in str of the representation of number, or (SIZE str) if the last
--   character of the representation was placed into the last byte of
--   str
-- @param str the string into which to place the ASCII representation
--   of number
-- @param number a double precision real number in IEEE format
-- @param Ip, Dp formatting values for the real number; see
--   REAL64TOSTRING for their effect
PROC append.real64 (INT len, []BYTE str,
                    VAL REAL64 number, VAL INT Ip, Dp)
  INT addlen:
  SEQ
    VAL rest IS (SIZE str) - len:
    REAL64TOSTRING (addlen, [str FROM len FOR rest], number, Ip, Dp)
    len := len + addlen
:
--}}}
