home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / program / gs300sr1 / gs300sr1.exe / GSIO.H < prev    next >
C/C++ Source or Header  |  1994-07-27  |  2KB  |  56 lines

  1. /* Copyright (C) 1989, 1990, 1993 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* gsio.h */
  20. /* stdio redirection */
  21.  
  22. /* The library and interpreter never use stdin/out/err directly. */
  23. extern FILE *gs_stdin, *gs_stdout, *gs_stderr;
  24.  
  25. /* Redefine all the relevant stdio functions to use the above. */
  26. /* Some functions we make illegal, rather than redefining them. */
  27. #undef stdin
  28. #define stdin gs_stdin
  29. #undef stdout
  30. #define stdout gs_stdout
  31. #undef stderr
  32. #define stderr gs_stderr
  33. #undef fgetchar
  34. #define fgetchar() fgetc(stdin)
  35. #undef fputchar
  36. #define fputchar(c) fputc(c, stdout)
  37. #undef getchar
  38. #define getchar() getc(stdin)
  39. #undef gets
  40. #define gets Function._gets_.unavailable
  41. /* We should do something about perror, but since many Unix systems */
  42. /* don't provide the strerror function, we can't.  (No Aladdin-maintained */
  43. /* code uses perror.) */
  44. #undef printf
  45. #define printf Function._printf_.unavailable
  46. #undef putchar
  47. #define putchar(c) fputc(c, stdout)
  48. #undef puts
  49. #define puts(s) (fputs(s, stdout), putchar('\n'))
  50. #undef scanf
  51. #define scanf Function._scanf_.unavailable
  52. #undef vprintf
  53. #define vprintf Function._vprintf_.unavailable
  54. #undef vscanf
  55. #define vscanf Function._vscanf_.unavailable
  56.