/************************************************************************* * * (c) Copyright 1992,1993,1994 by G & A Technical Software, Inc., * 28 Research Drive, Hampton, Virginia, 23666. * * All Rights Reserved. No part of this software or publication may be * reproduced, stored in a retrieval system, or transmitted, in any form * or by any means, electronic, mechanical, photocopying, recording, or * otherwise without the prior written permission of G & A Technical * Software, Inc. * ************************************************************************* * * Filename: * * Purpose: * * Author: John Burton * * Date: 5/31/94 * ************************************************************************* * * Modification History: * * $Log: s3_error.c,v $ * Revision 2.1 1994/07/08 18:07:40 jcburt * No changes since last commit. Just bringing everything up to the same * revision number * * Revision 2.0.0.1 1994/06/28 18:48:27 jcburt * S3 Version 2.0 Initial Source * * Revision 1.4 1993/02/03 16:21:44 jcburt * Ported to Linux V 0.99.4 * * Revision 1.3 1992/12/01 20:12:29 jcburt * Misc. bug fixes for succesful compilation under XLC * * Revision 1.2 1992/12/01 18:31:18 jcburt * added rcsid character string and rcs $Log: s3_error.c,v $ * Revision 2.1 1994/07/08 18:07:40 jcburt * No changes since last commit. Just bringing everything up to the same * revision number * * Revision 2.0.0.1 1994/06/28 18:48:27 jcburt * S3 Version 2.0 Initial Source * * Revision 1.4 1993/02/03 16:21:44 jcburt * Ported to Linux V 0.99.4 * * Revision 1.3 1992/12/01 20:12:29 jcburt * Misc. bug fixes for succesful compilation under XLC * ************************************************************************* * * Revision Control Information: * *************************************************************************/ static char rcsid[] = "$Id: s3_error.c,v 2.1 1994/07/08 18:07:40 jcburt Exp $"; static char rcsrev[] = "$Revision: 2.1 $"; /************************************************************************* * * Include Files * *************************************************************************/ #include "s3_defines.h" #include "s3_typedefs.h" #include "s3_externals.h" #include "s3_globals.h" #include //#include /************************************************************************* * * Defines and Macros * *************************************************************************/ #define _doprnt(fmt,val,fp) vfprintf(fp,fmt,val) /************************************************************************* * * Global Variables * *************************************************************************/ /************************************************************************* * * Module: * * Description: * * Syntax: * * Inputs: * * Outputs: * * Returns: * * Modules Called: * *************************************************************************/ void s3_internal_error(char *file, int line, int type, char *tmp, ...) { va_list ap; char *fmt; va_start(ap,tmp); // file = va_arg(ap, char *); // line = va_arg(ap, int); // type = va_arg(ap, int); fmt = va_arg(ap, char *); fprintf(fperr,"%s: Caught internal error: file = %s, line = %d: ",progname,file,line); vfprintf(fperr,fmt, ap); fprintf(fperr,"\nContact G & A Technical Software: (804) 865-7491\n"); va_end(ap); if(type == SYS) fprintf(fperr,": %s",strerror(errno)); fprintf(fperr, "\n\n"); exit(1); } /************************************************************************* * * Module: * * Description: * * Syntax: * * Inputs: * * Outputs: * * Returns: * * Modules Called: * *************************************************************************/ void s3_error(int type, char *tmp, ...) { va_list ap; char *fmt; va_start(ap,tmp); fprintf(fperr, "%s: ", progname); vfprintf(fperr, tmp, ap); va_end(ap); if(type == SYS) fprintf(fperr,": %s",strerror(errno)); fprintf(fperr, "\n"); exit(1); } /************************************************************************* * * Module: * * Description: * * Syntax: * * Inputs: * * Outputs: * * Returns: * * Modules Called: * *************************************************************************/ /* VARARGS */ void s3_warning(int type, char *tmp, ...) { va_list ap; char *fmt; va_start(ap,tmp); fprintf(fperr, "%s: ", progname); vfprintf(fperr, tmp, ap); va_end(ap); if(type == SYS) fprintf(fperr,": %s",strerror(errno)); fprintf(fperr, "\n"); } /************************************************************************* * * Module: * * Description: * * Syntax: * * Inputs: * * Outputs: * * Returns: * * Modules Called: * *************************************************************************/ /* VARARGS */ void s3_dprint(char *tmp, ...) { va_list ap; char *fmt; if(debug) { va_start(ap,tmp); if (fmt = va_arg(ap, char *)) (void) fprintf(fperr, "%s: ", progname); else fmt = va_arg(ap, char *); _doprnt(fmt, ap, fperr); va_end(ap); fprintf(fperr, "\n"); } }