summaryrefslogtreecommitdiff
path: root/NetWare/nw5iop.h
blob: 0026b3218117a2d6876bf7404e2190b3aec05938 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205

/*
 * Copyright © 2001 Novell, Inc. All Rights Reserved.
 *
 * You may distribute under the terms of either the GNU General Public
 * License or the Artistic License, as specified in the README file.
 *
 */

/*
 * FILENAME		:	nw5iop.h
 * DESCRIPTION	:	Redefined functions for NetWare.
 * Author		:	SGP, HYAK
 * Date			:	January 2001.
 *
 */



#ifndef NW5IOP_H
#define NW5IOP_H


#ifndef START_EXTERN_C
#ifdef __cplusplus
#  define START_EXTERN_C extern "C" {
#  define END_EXTERN_C }
#  define EXTERN_C extern "C"
#else
#  define START_EXTERN_C 
#  define END_EXTERN_C 
#  define EXTERN_C
#endif
#endif

#if defined(_MSC_VER) || defined(__MINGW32__)
#  include <sys/utime.h>
#else
#  include <utime.h>
#endif

/*
 * defines for flock emulation
 */
#define LOCK_SH 1
#define LOCK_EX 2
#define LOCK_NB 4
#define LOCK_UN 8


/*
 * Make this as close to original stdio as possible.
 */

/*
 * function prototypes for our own win32io layer
 */
/********CHKSGP ****/
//making DLLExport as nothing
#define DllExport	
/*******************/

START_EXTERN_C

int * 	nw_errno(void);
char *** 	nw_environ(void);

FILE*	nw_stdin(void);
FILE*	nw_stdout(void);
FILE*	nw_stderr(void);
int		nw_ferror(FILE *fp);
int		nw_feof(FILE *fp);

char*	nw_strerror(int e);

int		nw_fprintf(FILE *pf, const char *format, ...);
int		nw_printf(const char *format, ...);
int		nw_vfprintf(FILE *pf, const char *format, va_list arg);
int		nw_vprintf(const char *format, va_list arg);

size_t	nw_fread(void *buf, size_t size, size_t count, FILE *pf);
size_t	nw_fwrite(const void *buf, size_t size, size_t count, FILE *pf);
FILE*	nw_fopen(const char *path, const char *mode);
FILE*	nw_fdopen(int fh, const char *mode);
FILE*	nw_freopen(const char *path, const char *mode, FILE *pf);
int		nw_fclose(FILE *pf);

int		nw_fputs(const char *s,FILE *pf);
int		nw_fputc(int c,FILE *pf);
int		nw_ungetc(int c,FILE *pf);
int		nw_getc(FILE *pf);
int		nw_fileno(FILE *pf);
void	nw_clearerr(FILE *pf);
int		nw_fflush(FILE *pf);
long	nw_ftell(FILE *pf);
int		nw_fseek(FILE *pf,long offset,int origin);
int		nw_fgetpos(FILE *pf,fpos_t *p);
int		nw_fsetpos(FILE *pf,const fpos_t *p);
void	nw_rewind(FILE *pf);
FILE*	nw_tmpfile(void);

void	nw_abort(void);

int  	nw_stat(const char *name,struct stat *sbufptr);

FILE* nw_Popen(char* command, char* mode, int* e);
int nw_Pclose(FILE* file, int* e);
int nw_Pipe(int* a, int* e);

int		nw_rename( const char *oname, const char *newname);
//int		nw_setmode( int fd, int mode);
int		nw_setmode( FILE *fp, int mode);
long	nw_lseek( int fd, long offset, int origin);
int		nw_dup( int fd);
int		nw_dup2(int h1, int h2);
int		nw_open(const char *path, int oflag,...);
int		nw_close(int fd);
int		nw_read(int fd, void *buf, unsigned int cnt);
int		nw_write(int fd, const void *buf, unsigned int cnt);

int nw_spawnvp(int mode, char *cmdname, char **argv);

int		nw_rmdir(const char *dir);
int		nw_chdir(const char *dir);
int		nw_flock(int fd, int oper);

int nw_execv(char *cmdname, char **argv);
int nw_execvp(char *cmdname, char **argv);

void	nw_setbuf(FILE *pf, char *buf);
int		nw_setvbuf(FILE *pf, char *buf, int type, size_t size);
char*	nw_fgets(char *s, int n, FILE *pf);

int		nw_fgetc(FILE *pf);

int		nw_putc(int c, FILE *pf);

int		nw_open_osfhandle(long handle, int flags);
long	nw_get_osfhandle(int fd);

DIR*	nw_opendir(char *filename);
struct direct*	nw_readdir(DIR *dirp);
long nw_telldir(DIR *dirp);
void nw_seekdir(DIR *dirp, long loc);
void nw_rewinddir(DIR *dirp);
int		nw_closedir(DIR *dirp);

unsigned int 	nw_sleep(unsigned int);
int		nw_times(struct tms *timebuf);

int		nw_stat(const char *path, struct stat *buf);
int nw_link(const char *oldname, const char *newname);
int		nw_unlink(const char *f);
int		nw_utime(const char *f, struct utimbuf *t);
DllExport  int		nw_uname(struct utsname *n);

int		nw_wait(int *status);

int nw_waitpid(int pid, int *status, int flags);
int nw_kill(int pid, int sig);

unsigned long	nw_os_id(void);
void*	nw_dynaload(const char*filename);

int		nw_access(const char *path, int mode);
int		nw_chmod(const char *path, int mode);
int		nw_getpid(void);

char *	nw_crypt(const char *txt, const char *salt);

int nw_isatty(int fd);
char* nw_mktemp(char *Template);
int nw_chsize(int handle, long size);
END_EXTERN_C


/*
 * the following six(6) is #define in stdio.h
 */
#ifndef WIN32IO_IS_STDIO
#undef environ
#undef feof
#undef pipe
#undef pause
#undef sleep
#undef times
#undef alarm
#undef ioctl
#undef unlink
#undef utime
#undef uname
#undef wait


#define environ				(*nw_environ())


#if !defined(MYMALLOC) || !defined(PERL_CORE)

#endif


#endif /* WIN32IO_IS_STDIO */
#endif /* NW5IOP_H */