/* RCS $Id: o_tmsg.txt,v 1.1 1994/01/27 13:23:39 ae59 Exp ae59 $ */
/*
$Log: o_tmsg.txt,v $
# Revision 1.1  1994/01/27  13:23:39  ae59
# Put under RCS control
#
 */
/****************************************************************/
/*                                                              */
/*      Filename        : e_tmsg.c                              */
/*                                                              */
/*      Entry           : void e_tmsg(msgid)                    */
/*                        int msgid;                            */
/*                                                              */
/*      Arguments       : msgid  - message identification       */
/*                                                              */
/*      Description     : Message handling.                     */
/*                        Inline message text.                  */
/*                                                              */
/*      Date            : 1991-09-12                            */
/*      1991-09-12 : new routine                                */
/****************************************************************/

#ifndef ALL_IN_ONE
#ifdef AIX
#include "/u/p88c/runtime/o_defs.h"
#else
#include "o_defs.h"
#endif
#define local
extern char *e_head;
extern f_text f_errr;
#endif

static e_mtyp e_mfld[] =
{
/*----------------------------------------------*/
#ifdef AIX
#include "/u/p88c/runtime/o_msg1.h"
#else
#include "o_msg1.h"
#endif
/*----------------------------------------------*/

/* The first component of the last item         */
/* must be zero to indicate "END OF LIST".      */
{   0,  "" }
};

#ifdef LINT_ARGS
local void e_tmsg(int msgid)
#else
local void e_tmsg(msgid)
int msgid;
#endif
        {
        int i;  /* !!! must be int !!! */
        char *q;

        for (i=0;e_mfld[i].msgid;i++)
           {
           if (e_mfld[i].msgid==msgid)
              {
              q = e_mfld[i].text;
              if (*q)
                 {
                 if (*q!='\r') fprintf(f_errr.fp,"%s",e_head);
                 else q++;
                 while (*q)
                    {
                    if (*q=='\r')
                       {
                       fprintf(f_errr.fp,"\n");
                       if (q[1])
                          fprintf(f_errr.fp,"%*s",strlen(e_head)," ");
                       }
                    else if (*q=='\n')
                       {
                       fprintf(f_errr.fp,"\n");
                       if (q[1]) fprintf(f_errr.fp,"%s",e_head);
                       }
                    else
                       fprintf(f_errr.fp,"%c",*q);
                    q++;
                    }
                 }
              return;
              }
           }
        }

