home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / trash / part01 / vcouldnot.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-22  |  855 b   |  52 lines

  1. #include    <varargs.h>
  2. #include    <stdio.h>
  3. #include    "register.h"
  4. #include    "symtab.h"
  5. #include    "diblock.h"
  6. #include    "instrn.h"
  7. #include    "process.h"
  8.  
  9. extern char        *myname();
  10. extern void        format();
  11. extern char        *sysmess();
  12. extern char        *proc_text_address();
  13.  
  14. extern int        errno;
  15. extern FILE        *outfp;
  16.  
  17. static
  18. int
  19. vcouldnot_putc(c)
  20. int    c;
  21. {
  22.     putc(c, outfp);
  23. }
  24.  
  25. /*
  26.  * "vcouldnot(printf_like_format, printf_like_arg, ...);"
  27.  */
  28. void
  29. vcouldnot(va_alist)
  30. va_dcl
  31. {
  32.     char    *cp;
  33.     va_list    ap;
  34.  
  35.     fprintf(outfp, "%s: could not ", myname());
  36.     va_start(ap);
  37.     format(vcouldnot_putc, &ap);
  38.     va_end(ap);
  39.     cp = sysmess();
  40.     if (cp != (char *)0 && *cp != '\0')
  41.     {
  42.         fprintf(outfp, ": %s", cp);
  43.         errno = 0;
  44.     }
  45.  
  46.     fprintf(outfp, ": pc=%s", proc_text_address((GLOBALdipc == (dinstrn *)0) ? (unsigned long)0 : GLOBALdipc->di_addr));
  47.  
  48.     fprintf(outfp, ".\n");
  49.     fflush(outfp);
  50.     _exit(1);
  51. }
  52.