pipe_.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Copyright (C) 1997, 1998, 1999 Aladdin Enterprises. All rights reserved.
  2. This software is provided AS-IS with no warranty, either express or
  3. implied.
  4. This software is distributed under license and may not be copied,
  5. modified or distributed except as expressly authorized under the terms
  6. of the license contained in the file LICENSE in this distribution.
  7. For more information about licensing, please refer to
  8. http://www.ghostscript.com/licensing/. For information on
  9. commercial licensing, go to http://www.artifex.com/licensing/ or
  10. contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  11. San Rafael, CA 94903, U.S.A., +1(415)492-9861.
  12. */
  13. /* $Id: pipe_.h,v 1.6 2002/09/05 08:34:00 ghostgum Exp $ */
  14. /* Declaration of popen and pclose */
  15. #ifndef pipe__INCLUDED
  16. # define pipe__INCLUDED
  17. #include "stdio_.h"
  18. #ifdef __WIN32__
  19. /*
  20. * MS Windows has popen and pclose in stdio.h, but under different names.
  21. * Unfortunately MSVC5 and 6 have a broken implementation of _popen,
  22. * so we use own. Our implementation only supports mode "wb".
  23. */
  24. extern FILE *mswin_popen(const char *cmd, const char *mode);
  25. # define popen(cmd, mode) mswin_popen(cmd, mode)
  26. /* # define popen(cmd, mode) _popen(cmd, mode) */
  27. # define pclose(file) _pclose(file)
  28. #else /* !__WIN32__ */
  29. /*
  30. * popen isn't POSIX-standard, so we declare it here.
  31. * Because of inconsistent (and sometimes incorrect) header files,
  32. * we must omit the argument list. Unfortunately, this sometimes causes
  33. * more trouble than it cures.
  34. */
  35. extern FILE *popen( /* const char *, const char * */ );
  36. extern int pclose(FILE *);
  37. #endif /* !__WIN32__ */
  38. #endif /* pipe__INCLUDED */