3 * Copyright © 2001 Novell, Inc. All Rights Reserved.
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
12 * DESCRIPTION : Redefined functions for NetWare.
14 * Date : January 2001.
24 #ifndef START_EXTERN_C
26 # define START_EXTERN_C extern "C" {
27 # define END_EXTERN_C }
28 # define EXTERN_C extern "C"
30 # define START_EXTERN_C
36 #if defined(_MSC_VER) || defined(__MINGW32__)
37 # include <sys/utime.h>
43 * defines for flock emulation
52 * Make this as close to original stdio as possible.
56 * function prototypes for our own win32io layer
59 //making DLLExport as nothing
66 char *** nw_environ(void);
69 FILE* nw_stdout(void);
70 FILE* nw_stderr(void);
71 int nw_ferror(FILE *fp);
72 int nw_feof(FILE *fp);
74 char* nw_strerror(int e);
76 int nw_fprintf(FILE *pf, const char *format, ...);
77 int nw_printf(const char *format, ...);
78 int nw_vfprintf(FILE *pf, const char *format, va_list arg);
79 int nw_vprintf(const char *format, va_list arg);
81 size_t nw_fread(void *buf, size_t size, size_t count, FILE *pf);
82 size_t nw_fwrite(const void *buf, size_t size, size_t count, FILE *pf);
83 FILE* nw_fopen(const char *path, const char *mode);
84 FILE* nw_fdopen(int fh, const char *mode);
85 FILE* nw_freopen(const char *path, const char *mode, FILE *pf);
86 int nw_fclose(FILE *pf);
88 int nw_fputs(const char *s,FILE *pf);
89 int nw_fputc(int c,FILE *pf);
90 int nw_ungetc(int c,FILE *pf);
91 int nw_getc(FILE *pf);
92 int nw_fileno(FILE *pf);
93 void nw_clearerr(FILE *pf);
94 int nw_fflush(FILE *pf);
95 long nw_ftell(FILE *pf);
96 int nw_fseek(FILE *pf,long offset,int origin);
97 int nw_fgetpos(FILE *pf,fpos_t *p);
98 int nw_fsetpos(FILE *pf,const fpos_t *p);
99 void nw_rewind(FILE *pf);
100 FILE* nw_tmpfile(void);
104 int nw_stat(const char *name,struct stat *sbufptr);
106 FILE* nw_Popen(char* command, char* mode, int* e);
107 int nw_Pclose(FILE* file, int* e);
108 int nw_Pipe(int* a, int* e);
110 int nw_rename( const char *oname, const char *newname);
111 //int nw_setmode( int fd, int mode);
112 int nw_setmode( FILE *fp, int mode);
113 long nw_lseek( int fd, long offset, int origin);
115 int nw_dup2(int h1, int h2);
116 int nw_open(const char *path, int oflag,...);
117 int nw_close(int fd);
118 int nw_read(int fd, void *buf, unsigned int cnt);
119 int nw_write(int fd, const void *buf, unsigned int cnt);
121 int nw_spawnvp(int mode, char *cmdname, char **argv);
123 int nw_rmdir(const char *dir);
124 int nw_chdir(const char *dir);
125 int nw_flock(int fd, int oper);
127 int nw_execv(char *cmdname, char **argv);
128 int nw_execvp(char *cmdname, char **argv);
130 void nw_setbuf(FILE *pf, char *buf);
131 int nw_setvbuf(FILE *pf, char *buf, int type, size_t size);
132 char* nw_fgets(char *s, int n, FILE *pf);
134 int nw_fgetc(FILE *pf);
136 int nw_putc(int c, FILE *pf);
138 int nw_open_osfhandle(long handle, int flags);
139 long nw_get_osfhandle(int fd);
141 DIR* nw_opendir(char *filename);
142 struct direct* nw_readdir(DIR *dirp);
143 long nw_telldir(DIR *dirp);
144 void nw_seekdir(DIR *dirp, long loc);
145 void nw_rewinddir(DIR *dirp);
146 int nw_closedir(DIR *dirp);
148 unsigned int nw_sleep(unsigned int);
149 int nw_times(struct tms *timebuf);
151 int nw_stat(const char *path, struct stat *buf);
152 int nw_link(const char *oldname, const char *newname);
153 int nw_unlink(const char *f);
154 int nw_utime(const char *f, struct utimbuf *t);
155 DllExport int nw_uname(struct utsname *n);
157 int nw_wait(int *status);
159 int nw_waitpid(int pid, int *status, int flags);
160 int nw_kill(int pid, int sig);
162 unsigned long nw_os_id(void);
163 void* nw_dynaload(const char*filename);
165 int nw_access(const char *path, int mode);
166 int nw_chmod(const char *path, int mode);
169 char * nw_crypt(const char *txt, const char *salt);
171 int nw_isatty(int fd);
172 char* nw_mktemp(char *Template);
173 int nw_chsize(int handle, long size);
178 * the following six(6) is #define in stdio.h
180 #ifndef WIN32IO_IS_STDIO
203 #define environ (*nw_environ())
206 #if !defined(MYMALLOC) || !defined(PERL_CORE)
211 #endif /* WIN32IO_IS_STDIO */
212 #endif /* NW5IOP_H */