stdio1.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /****************************************************************
  2. Copyright (C) 1997-1999 Lucent Technologies
  3. All Rights Reserved
  4. Permission to use, copy, modify, and distribute this software and
  5. its documentation for any purpose and without fee is hereby
  6. granted, provided that the above copyright notice appear in all
  7. copies and that both that the copyright notice and this
  8. permission notice and warranty disclaimer appear in supporting
  9. documentation, and that the name of Lucent or any of its entities
  10. not be used in advertising or publicity pertaining to
  11. distribution of the software without specific, written prior
  12. permission.
  13. LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  14. INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  15. IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
  16. SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  17. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  18. IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  19. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
  20. THIS SOFTWARE.
  21. ****************************************************************/
  22. /* stdio1.h -- for using Printf, Fprintf, Sprintf while
  23. * retaining the system-supplied printf, fprintf, sprintf.
  24. */
  25. #ifndef STDIO1_H_included
  26. #define STDIO1_H_included
  27. #ifndef STDIO_H_included /* allow suppressing stdio.h */
  28. #include <stdio.h> /* in case it's already included, */
  29. #endif /* e.g., by cplex.h */
  30. #ifdef KR_headers
  31. #ifndef _SIZE_T
  32. #define _SIZE_T
  33. typedef unsigned int size_t;
  34. #endif
  35. #define ANSI(x) ()
  36. #include "varargs.h"
  37. #ifndef Char
  38. #define Char char
  39. #endif
  40. #else
  41. #define ANSI(x) x
  42. #include "stdarg.h"
  43. #ifndef Char
  44. #define Char void
  45. #endif
  46. #endif
  47. #ifndef NO_STDIO1
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51. extern int Fprintf ANSI((FILE*, const char*, ...));
  52. extern int Printf ANSI((const char*, ...));
  53. extern int Sprintf ANSI((char*, const char*, ...));
  54. extern int Snprintf ANSI((char*, size_t, const char*, ...));
  55. extern void Perror ANSI((const char*));
  56. extern int Vfprintf ANSI((FILE*, const char*, va_list));
  57. extern int Vsprintf ANSI((char*, const char*, va_list));
  58. extern int Vsnprintf ANSI((char*, size_t, const char*, va_list));
  59. #ifdef PF_BUF
  60. extern FILE *stderr_ASL;
  61. extern void (*pfbuf_print_ASL) ANSI((char*));
  62. extern char *pfbuf_ASL;
  63. extern void fflush_ASL ANSI((FILE*));
  64. #ifdef fflush
  65. #define old_fflush_ASL fflush
  66. #undef fflush
  67. #endif
  68. #define fflush fflush_ASL
  69. #endif
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73. #undef printf
  74. #undef fprintf
  75. #undef sprintf
  76. #undef perror
  77. #undef vfprintf
  78. #undef vsprintf
  79. #define printf Printf
  80. #define fprintf Fprintf
  81. #undef snprintf /* for MacOSX */
  82. #undef vsnprintf /* for MacOSX */
  83. #define snprintf Snprintf
  84. #define sprintf Sprintf
  85. #define perror Perror
  86. #define vfprintf Vfprintf
  87. #define vsnprintf Vsnprintf
  88. #define vsprintf Vsprintf
  89. #endif /* NO_STDIO1 */
  90. #endif /* STDIO1_H_included */