home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / mntlib32.zoo / eprintf.c < prev    next >
C/C++ Source or Header  |  1993-05-25  |  1KB  |  51 lines

  1. #include <stdio.h>
  2. #include <stdarg.h>
  3. #include <string.h>
  4. #include "lib.h"
  5.  
  6. /* new file 4/15/92 sb
  7.    This function had to be split from the [vf]printf functions to accommodate
  8.    Sozobon's floating point libs.  Originally, anything that used the assert()
  9.    macro [like malloc()] would pull in this function and bring with it
  10.    definitions of printf et.al.; if we've already included the printf() from
  11.    libm.a, this will cause a conflict.
  12.  
  13.    5/2/92 sb
  14.    Modified to do its own work rather than call fprintf().
  15.  
  16.    5/4/93 uo
  17.    Threw away a static buffer.
  18. */
  19.   
  20.   
  21. #if 0
  22.       /* why here? to waste space? */
  23.   static char buf[20];  /* big enough for any value of a long */
  24. #endif
  25.  
  26. static void _say __PROTO((const char *s));
  27.  
  28. static void _say(s)
  29. const char *s;
  30. {
  31.     _write(2,s,(long)(strlen(s)));
  32. }
  33.  
  34. /* This is used by the `assert' macro.  */
  35. void __eprintf (expression, line, filename)
  36. const char *expression;
  37. const long line;
  38. const char *filename;
  39. {
  40.     char buf[20];
  41.  
  42.     _ltoa(line, buf, 10);
  43.     _say("assertion `");
  44.     _say(expression);
  45.     _say("' failed at line ");
  46.     _say(buf);
  47.     _say(" of file ");
  48.     _say(filename);
  49.     _say("\r\n");
  50. }
  51.