1 /* errexit.c -- print message and exit 2 * 3 * Part of HTML-XML-utils, see: 4 * http://www.w3.org/Tools/HTML-XML-utils/ 5 * 6 * Copyright © 1994-2000 World Wide Web Consortium 7 * See http://www.w3.org/Consortium/Legal/copyright-software 8 * 9 * Author: Bert Bos <bert@w3.org> 10 * Created: 12 May 1998 11 **/ 12 #include "config.h" 13 #include <stdarg.h> 14 #include <stdio.h> 15 #include <stdlib.h> 16 #ifdef HAVE_STRING_H 17 # include <string.h> 18 #elif HAVE_STRINGS_H 19 # include <strings.h> 20 #endif 21 #include "export.h" 22 23 /* errexit -- print message and exit */ errexit(char * format,...)24EXPORT int errexit(char *format,...) 25 { 26 va_list ap; 27 28 va_start(ap, format); 29 vfprintf(stderr, format, ap); 30 va_end(ap); 31 exit(1); 32 } 33 34 35