/*
 * $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 *
 */

/*	Copyright (c) 1984 AT&T	*/
/*	  All Rights Reserved  	*/

/*	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T	*/
/*	The copyright notice above does not evidence any   	*/
/*	actual or intended publication of such source code.	*/

#ident	"$Header: agettxt.c 1.4 90/06/22 $@(#)nlp:lib/oam/agettxt.c	1.3"
/* EMACS_MODES: !fill, lnumb, !overwrite, !nodelete, !picture */

#include "oam.h"
#include <sys/types.h>
#include <string.h>

char			**_oam_msg_base_	= 0;

char			*gettxt();	

char			*agettxt (msg_id, buf, buflen)
	long			msg_id;
	char			*buf;
	int			buflen;
{
	char			*msg,
				no[4],
				MSNO[9];
	size_t			no_len;
	if (_oam_msg_base_)
		strncpy (buf, _oam_msg_base_[msg_id], buflen-1); 
	else
		strncpy (buf, "No message defined--get help!", buflen-1);
	buf[buflen-1] = 0;
	if (*buf != '\0') {
		strcpy(MSNO, "lper:");
		no[0] = no[1] = no[2] = no[3] = '\0';
		msg = strchr(buf,':');
		no_len = (msg - buf);
		strncpy(no, buf, no_len);
		strcat(MSNO, no);
		buf += (no_len + 1);
		buf = gettxt(MSNO,buf);
	}
	return (buf);
}
