2
* pstdio.h -- $Id: pstdio.h 685 2003-03-08 15:26:51Z travo $
3
* portability layer I/O wrappers
5
* Copyright (c) 1998. See accompanying LEGAL file for details.
8
/* filesystem services (mostly ANSI or POSIX)
9
* - necessary to implement UNIX-like filenaming semantics universally
10
* - p_free frees result of p_getcwd, p_frall for p_lsdir result */
17
typedef struct p_file p_file;
18
typedef struct p_dir p_dir;
20
extern p_file *p_fopen(const char *unix_name, const char *mode);
21
extern p_file *p_popen(const char *command, const char *mode);
23
extern unsigned long p_fsize(p_file *file);
24
extern unsigned long p_ftell(p_file *file);
25
extern int p_fseek(p_file *file, unsigned long addr);
27
extern char *p_fgets(p_file *file, char *buf, int buflen);
28
extern int p_fputs(p_file *file, const char *buf);
29
extern unsigned long p_fread(p_file *file,
30
void *buf, unsigned long nbytes);
31
extern unsigned long p_fwrite(p_file *file,
32
const void *buf, unsigned long nbytes);
34
extern int p_feof(p_file *file);
35
extern int p_ferror(p_file *file);
36
extern int p_fflush(p_file *file);
37
extern int p_fclose(p_file *file);
39
extern int p_remove(const char *unix_name);
40
extern int p_rename(const char *unix_old, const char *unix_new);
42
extern int p_chdir(const char *unix_name);
43
extern int p_rmdir(const char *unix_name);
44
extern int p_mkdir(const char *unix_name);
45
extern char *p_getcwd(void);
47
extern p_dir *p_dopen(const char *unix_name);
48
extern int p_dclose(p_dir *dir);
49
/* returned filename does not need to be freed, but
50
* value may be clobbered by dclose, next dnext, or p_wkspc use
51
* . and .. do not appear in returned list */
52
extern char *p_dnext(p_dir *dir, int *is_dir);