Changeset View
Changeset View
Standalone View
Standalone View
stand/libsa/stand.h
Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | struct fs_ops { | ||||
int (*fo_close)(struct open_file *f); | int (*fo_close)(struct open_file *f); | ||||
int (*fo_read)(struct open_file *f, void *buf, | int (*fo_read)(struct open_file *f, void *buf, | ||||
size_t size, size_t *resid); | size_t size, size_t *resid); | ||||
int (*fo_write)(struct open_file *f, const void *buf, | int (*fo_write)(struct open_file *f, const void *buf, | ||||
size_t size, size_t *resid); | size_t size, size_t *resid); | ||||
off_t (*fo_seek)(struct open_file *f, off_t offset, int where); | off_t (*fo_seek)(struct open_file *f, off_t offset, int where); | ||||
int (*fo_stat)(struct open_file *f, struct stat *sb); | int (*fo_stat)(struct open_file *f, struct stat *sb); | ||||
int (*fo_readdir)(struct open_file *f, struct dirent *d); | int (*fo_readdir)(struct open_file *f, struct dirent *d); | ||||
int (*fo_mount)(const char *, const char *, void **); | |||||
int (*fo_unmount)(const char *, void *); | |||||
}; | }; | ||||
/* | /* | ||||
* libstand-supplied filesystems | * libstand-supplied filesystems | ||||
*/ | */ | ||||
extern struct fs_ops ufs_fsops; | extern struct fs_ops ufs_fsops; | ||||
extern struct fs_ops tftp_fsops; | extern struct fs_ops tftp_fsops; | ||||
extern struct fs_ops nfs_fsops; | extern struct fs_ops nfs_fsops; | ||||
▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | |||||
extern void twiddle(u_int callerdiv); | extern void twiddle(u_int callerdiv); | ||||
extern void twiddle_divisor(u_int globaldiv); | extern void twiddle_divisor(u_int globaldiv); | ||||
extern void ngets(char *, int); | extern void ngets(char *, int); | ||||
#define gets(x) ngets((x), 0) | #define gets(x) ngets((x), 0) | ||||
extern int fgetstr(char *buf, int size, int fd); | extern int fgetstr(char *buf, int size, int fd); | ||||
extern int mount(const char *dev, const char *path, int flags, void *data); | |||||
extern int unmount(const char *dev, int flags); | |||||
extern int open(const char *, int); | extern int open(const char *, int); | ||||
#define O_RDONLY 0x0 | #define O_RDONLY 0x0 | ||||
#define O_WRONLY 0x1 | #define O_WRONLY 0x1 | ||||
#define O_RDWR 0x2 | #define O_RDWR 0x2 | ||||
#define O_ACCMODE 0x3 | #define O_ACCMODE 0x3 | ||||
/* NOT IMPLEMENTED */ | /* NOT IMPLEMENTED */ | ||||
#define O_CREAT 0x0200 /* create if nonexistent */ | #define O_CREAT 0x0200 /* create if nonexistent */ | ||||
#define O_TRUNC 0x0400 /* truncate to zero length */ | #define O_TRUNC 0x0400 /* truncate to zero length */ | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
extern struct env_var *environ; | extern struct env_var *environ; | ||||
extern struct env_var *env_getenv(const char *name); | extern struct env_var *env_getenv(const char *name); | ||||
extern int env_setenv(const char *name, int flags, | extern int env_setenv(const char *name, int flags, | ||||
const void *value, ev_sethook_t sethook, | const void *value, ev_sethook_t sethook, | ||||
ev_unsethook_t unsethook); | ev_unsethook_t unsethook); | ||||
extern void env_discard(struct env_var *); | extern void env_discard(struct env_var *); | ||||
extern int mount_currdev(struct env_var *ev, int flags, | |||||
imp: Likewise, I'd put this in common/bootstrap.h
| |||||
const void *value); | |||||
extern char *getenv(const char *name); | extern char *getenv(const char *name); | ||||
extern int setenv(const char *name, const char *value, | extern int setenv(const char *name, const char *value, | ||||
int overwrite); | int overwrite); | ||||
extern int putenv(char *string); | extern int putenv(char *string); | ||||
extern int unsetenv(const char *name); | extern int unsetenv(const char *name); | ||||
extern ev_sethook_t env_noset; /* refuse set operation */ | extern ev_sethook_t env_noset; /* refuse set operation */ | ||||
extern ev_unsethook_t env_nounset; /* refuse unset operation */ | extern ev_unsethook_t env_nounset; /* refuse unset operation */ | ||||
▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines |
Likewise, I'd put this in common/bootstrap.h