[inseparable changes from match from perl-5.003_97g to perl-5.003_97h]
[p5sagit/p5-mst-13.2.git] / win32 / win32iop.h
index 7b7a521..f630000 100644 (file)
@@ -5,10 +5,12 @@
 /*
  * Make this as close to original stdio as possible.
  */
-//
-// function prototypes for our own win32io layer
-//
+
+/*
+ * function prototypes for our own win32io layer
+ */
 EXT int *      win32_errno();
+EXT char ***   win32_environ();
 EXT FILE*      win32_stdin(void);
 EXT FILE*      win32_stdout(void);
 EXT FILE*      win32_stderr(void);
@@ -16,9 +18,10 @@ EXT int              win32_ferror(FILE *fp);
 EXT int                win32_feof(FILE *fp);
 EXT char*      win32_strerror(int e);
 
-EXT    int             win32_fprintf(FILE *pf, const char *format, ...);
-EXT    int             win32_printf(const char *format, ...);
-EXT    int             win32_vfprintf(FILE *pf, const char *format, va_list arg);
+EXT int                win32_fprintf(FILE *pf, const char *format, ...);
+EXT int                win32_printf(const char *format, ...);
+EXT int                win32_vfprintf(FILE *pf, const char *format, va_list arg);
+EXT int                win32_vprintf(const char *format, va_list arg);
 EXT size_t     win32_fread(void *buf, size_t size, size_t count, FILE *pf);
 EXT size_t     win32_fwrite(const void *buf, size_t size, size_t count, FILE *pf);
 EXT FILE*      win32_fopen(const char *path, const char *mode);
@@ -28,17 +31,17 @@ EXT int             win32_fclose(FILE *pf);
 EXT int                win32_fputs(const char *s,FILE *pf);
 EXT int                win32_fputc(int c,FILE *pf);
 EXT int                win32_ungetc(int c,FILE *pf);
-EXT    int             win32_getc(FILE *pf);
+EXT int                win32_getc(FILE *pf);
 EXT int                win32_fileno(FILE *pf);
-EXT    void    win32_clearerr(FILE *pf);
+EXT void       win32_clearerr(FILE *pf);
 EXT int                win32_fflush(FILE *pf);
 EXT long       win32_ftell(FILE *pf);
-EXT    int             win32_fseek(FILE *pf,long offset,int origin);
-EXT    int             win32_fgetpos(FILE *pf,fpos_t *p);
-EXT    int             win32_fsetpos(FILE *pf,const fpos_t *p);
-EXT    void    win32_rewind(FILE *pf);
-EXT    FILE*   win32_tmpfile(void);
-EXT    void    win32_abort(void);
+EXT int                win32_fseek(FILE *pf,long offset,int origin);
+EXT int                win32_fgetpos(FILE *pf,fpos_t *p);
+EXT int                win32_fsetpos(FILE *pf,const fpos_t *p);
+EXT void       win32_rewind(FILE *pf);
+EXT FILE*      win32_tmpfile(void);
+EXT void       win32_abort(void);
 EXT int        win32_fstat(int fd,struct stat *bufptr);
 EXT int        win32_stat(const char *name,struct stat *bufptr);
 EXT int                win32_pipe( int *phandles, unsigned int psize, int textmode );
@@ -54,24 +57,29 @@ EXT int             win32_close(int fd);
 EXT int                win32_eof(int fd);
 EXT int                win32_read(int fd, void *buf, unsigned int cnt);
 EXT int                win32_write(int fd, const void *buf, unsigned int cnt);
-EXT int                win32_spawnvpe(int mode, const char *cmdname, const char *const *argv, const char *const *envp);
+EXT int                win32_spawnvpe(int mode, const char *cmdname,
+                              const char *const *argv, const char *const *envp);
 EXT int                win32_spawnle(int mode, const char *cmdname, const char *,...);
+EXT int                win32_mkdir(const char *dir, int mode);
+EXT int                win32_rmdir(const char *dir);
+EXT int                win32_chdir(const char *dir);
 
-//
-// these two are win32 specific but still io related
-//
+/*
+ * these two are win32 specific but still io related
+ */
 int            stolen_open_osfhandle(long handle, int flags);
-long   stolen_get_osfhandle(int fd);
+long           stolen_get_osfhandle(int fd);
 
-#include <win32io.h>   // pull in the io sub system structure
+#include <win32io.h>   /* pull in the io sub system structure */
 
 void * SetIOSubSystem(void     *piosubsystem);
-//
-// the following six(6) is #define in stdio.h
-//
-//
+
+/*
+ * the following six(6) is #define in stdio.h
+ */
 #ifndef WIN32IO_IS_STDIO
 #undef errno
+#undef environ
 #undef stderr
 #undef stdin
 #undef stdout
@@ -84,14 +92,16 @@ void *      SetIOSubSystem(void     *piosubsystem);
 #define feof(f)                                win32_feof(f)
 #define ferror(f)                      win32_ferror(f)
 #define errno                          (*win32_errno())
+#define environ                                (*win32_environ())
 #define strerror                       win32_strerror
 
-//
-// redirect to our own version
-//
+/*
+ * redirect to our own version
+ */
 #define        fprintf                 win32_fprintf
 #define        vfprintf                win32_vfprintf
 #define        printf                  win32_printf
+#define        vprintf                 win32_vprintf
 #define fread(buf,size,count,f)        win32_fread(buf,size,count,f)
 #define fwrite(buf,size,count,f)       win32_fwrite(buf,size,count,f)
 #define fopen                  win32_fopen
@@ -125,8 +135,11 @@ void *     SetIOSubSystem(void     *piosubsystem);
 #define write(fd,b,s)          win32_write(fd,b,s)
 #define _open_osfhandle                stolen_open_osfhandle
 #define _get_osfhandle         stolen_get_osfhandle
-#define spawnvpe                       win32_spawnvpe
-#define spawnle                                win32_spawnle
-#endif //WIN32IO_IS_STDIO
+#define spawnvpe               win32_spawnvpe
+#define spawnle                        win32_spawnle
+#define mkdir                  win32_mkdir
+#define rmdir                  win32_rmdir
+#define chdir                  win32_chdir
+#endif /* WIN32IO_IS_STDIO */
 
-#endif // WIN32IOP_H
+#endif /* WIN32IOP_H */