Exemple #1
0
/*************************************************************************
*
* Name:		info_msg()
* Type		void
*
* Type		Parameter	IOGF	Description
* unsigned long	sts		I	error message to print.
*
* Description:
*	If the message is a error, warning or info message it is printed.
*
**************************************************************************/
void sutil_msg( unsigned long 	sts)
{
	static int msgsts;
	static int msglen;
	static char msg[256];
	struct dsc$descriptor_s	msgdesc = {sizeof(msg)-1,DSC$K_DTYPE_T,
					DSC$K_CLASS_S,};

	msgdesc.dsc$a_pointer = msg;

	if ( ( EVEN(sts)) || ((sts & 1) && (sts & 2)) )
	{
	  msgsts = sts;
	  lib$sys_getmsg(&msgsts, &msglen, &msgdesc, 0, 0);
	  msg[msglen]='\0';
	  printf("%s\n", msg);
	}
}
Exemple #2
0
static char *errmsg_c(int n)
/*
  Return the error message associated with some error number.
------------------------------------------------------------------------*/
{
#ifdef vms
#include <descrip.h>
  $DESCRIPTOR(string_descriptor,string);
  static char string[128];
  short int len0;
  int one;

  one = 1;
  lib$sys_getmsg(&n,&len0,&string_descriptor,&one);
  string[len0] = 0;
  return(string);
#else
  return strerror(n);
#endif
}
Exemple #3
0
bool
EXsys_report( register EX_ARGS	*exargs, char *buffer )
{
    /*
    ** Number of message arguments; we add 2 because the PC and PSL are
    ** present in exarg_array (which is simply the exception signal vector)
    ** but aren't counted in exarg_count.
    */
    i4 arg_count = exargs->exarg_count + 2;

    /* Report Hardware Exceptions
    **
    **	This should report all hardware or system exceptions (including
    **	those that get mapped into internal Ingres exceptions.  All available
    **  program information should be formatted and printed into the output
    **	buffer.
    **
    **  We return FALSE for normal INGRES exceptions.  These are exceptions
    **  where:
    **	1.	The exception number is in the correct range for INGRES
    **		exceptions.  Unfortunately, this will also be true if someone
    **		signals an RMS failure.  So in addition, we check that:
    **	2.	The signal array's PC is where lib$signal returns to EXsignal,
    **		meaning that EXsignal signaled this exception.
    */
    /*
    **    if (CLERROR(exargs->exarg_num) &&
    **        exargs->exarg_array[arg_count-2] == &EXsignal_PC)
    */
    if (CLERROR(exargs->exarg_num))
    {
        return FALSE;
    }
    else
    {
        char	bufs[256];
        $DESCRIPTOR(buf, bufs);
        unsigned short	len;
        unsigned char	info[4];

        EXdump(EV_SIGVIO_DUMP);

        if ( !in_sysrep )
        {
            in_sysrep = TRUE;

            if (Ex_print_stack)
            {
                Ex_print_stack(NULL, NULL, NULL, ex_print_error, TRUE);
            }

            in_sysrep = FALSE;
        }

        lib$sys_getmsg(&exargs->exarg_num, &len, &buf, 0, info);
        if (info[1] == 0 || arg_count < info[1])
        {
            /*
            ** No args or insufficient args; don't try to format it.
            */
            STlcopy(bufs, buffer, len);
        }
        else
        {
            $DESCRIPTOR(obuf, buffer);

            /* Format it.  Use lib$sys_faol, so any number of args works */
            obuf.dsc$w_length = buf.dsc$w_length;
            buf.dsc$w_length = len;
            lib$sys_faol(&buf, &len, &obuf, exargs->exarg_array);
            buffer[len] = '\0';
        }
        return TRUE;
    }
}