Changeset View
Changeset View
Standalone View
Standalone View
lib/libstand/stand.h
Show All 18 Lines | |||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
* From $NetBSD: stand.h,v 1.22 1997/06/26 19:17:40 drochner Exp $ | * From $NetBSD: stand.h,v 1.22 1997/06/26 19:17:40 drochner Exp $ | ||||
*/ | */ | ||||
/*- | /*- | ||||
* Copyright (c) 1993 | * Copyright (c) 1993 | ||||
* The Regents of the University of California. All rights reserved. | * The Regents of the University of California. All rights reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | |||||
extern struct fs_ops splitfs_fsops; | extern struct fs_ops splitfs_fsops; | ||||
extern struct fs_ops pkgfs_fsops; | extern struct fs_ops pkgfs_fsops; | ||||
/* where values for lseek(2) */ | /* where values for lseek(2) */ | ||||
#define SEEK_SET 0 /* set file offset to offset */ | #define SEEK_SET 0 /* set file offset to offset */ | ||||
#define SEEK_CUR 1 /* set file offset to current plus offset */ | #define SEEK_CUR 1 /* set file offset to current plus offset */ | ||||
#define SEEK_END 2 /* set file offset to EOF plus offset */ | #define SEEK_END 2 /* set file offset to EOF plus offset */ | ||||
/* | /* | ||||
* Device switch | * Device switch | ||||
*/ | */ | ||||
struct devsw { | struct devsw { | ||||
const char dv_name[8]; | const char dv_name[8]; | ||||
int dv_type; /* opaque type constant, arch-dependant */ | int dv_type; /* opaque type constant, arch-dependant */ | ||||
int (*dv_init)(void); /* early probe call */ | int (*dv_init)(void); /* early probe call */ | ||||
int (*dv_strategy)(void *devdata, int rw, daddr_t blk, | int (*dv_strategy)(void *devdata, int rw, daddr_t blk, | ||||
size_t size, char *buf, size_t *rsize); | size_t size, char *buf, size_t *rsize); | ||||
Show All 18 Lines | |||||
*/ | */ | ||||
struct devdesc | struct devdesc | ||||
{ | { | ||||
struct devsw *d_dev; | struct devsw *d_dev; | ||||
int d_type; | int d_type; | ||||
#define DEVT_NONE 0 | #define DEVT_NONE 0 | ||||
#define DEVT_DISK 1 | #define DEVT_DISK 1 | ||||
#define DEVT_NET 2 | #define DEVT_NET 2 | ||||
#define DEVT_CD 3 | #define DEVT_CD 3 | ||||
#define DEVT_ZFS 4 | #define DEVT_ZFS 4 | ||||
#define DEVT_FD 5 | #define DEVT_FD 5 | ||||
#define DEVT_EFI 6 | |||||
int d_unit; | int d_unit; | ||||
void *d_opendata; | void *d_opendata; | ||||
}; | }; | ||||
struct open_file { | struct open_file { | ||||
int f_flags; /* see F_* below */ | int f_flags; /* see F_* below */ | ||||
struct devsw *f_dev; /* pointer to device operations */ | struct devsw *f_dev; /* pointer to device operations */ | ||||
void *f_devdata; /* device specific data */ | void *f_devdata; /* device specific data */ | ||||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | |||||
extern int close(int); | extern int close(int); | ||||
extern void closeall(void); | extern void closeall(void); | ||||
extern ssize_t read(int, void *, size_t); | extern ssize_t read(int, void *, size_t); | ||||
extern ssize_t write(int, void *, size_t); | extern ssize_t write(int, void *, size_t); | ||||
extern struct dirent *readdirfd(int); | extern struct dirent *readdirfd(int); | ||||
extern void srandom(u_long seed); | extern void srandom(u_long seed); | ||||
extern u_long random(void); | extern u_long random(void); | ||||
/* imports from stdlib, locally modified */ | /* imports from stdlib, locally modified */ | ||||
extern long strtol(const char *, char **, int); | extern long strtol(const char *, char **, int); | ||||
extern unsigned long strtoul(const char *, char **, int); | extern unsigned long strtoul(const char *, char **, int); | ||||
extern char *optarg; /* getopt(3) external variables */ | extern char *optarg; /* getopt(3) external variables */ | ||||
extern int optind, opterr, optopt, optreset; | extern int optind, opterr, optopt, optreset; | ||||
extern int getopt(int, char * const [], const char *); | extern int getopt(int, char * const [], const char *); | ||||
/* pager.c */ | /* pager.c */ | ||||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | |||||
extern int null_close(struct open_file *f); | extern int null_close(struct open_file *f); | ||||
extern int null_read(struct open_file *f, void *buf, size_t size, size_t *resid); | extern int null_read(struct open_file *f, void *buf, size_t size, size_t *resid); | ||||
extern int null_write(struct open_file *f, void *buf, size_t size, size_t *resid); | extern int null_write(struct open_file *f, void *buf, size_t size, size_t *resid); | ||||
extern off_t null_seek(struct open_file *f, off_t offset, int where); | extern off_t null_seek(struct open_file *f, off_t offset, int where); | ||||
extern int null_stat(struct open_file *f, struct stat *sb); | extern int null_stat(struct open_file *f, struct stat *sb); | ||||
extern int null_readdir(struct open_file *f, struct dirent *d); | extern int null_readdir(struct open_file *f, struct dirent *d); | ||||
/* | /* | ||||
* Machine dependent functions and data, must be provided or stubbed by | * Machine dependent functions and data, must be provided or stubbed by | ||||
* the consumer | * the consumer | ||||
*/ | */ | ||||
extern int getchar(void); | extern int getchar(void); | ||||
extern int ischar(void); | extern int ischar(void); | ||||
extern void putchar(int); | extern void putchar(int); | ||||
extern int devopen(struct open_file *, const char *, const char **); | extern int devopen(struct open_file *, const char *, const char **); | ||||
extern int devclose(struct open_file *f); | extern int devclose(struct open_file *f); | ||||
extern void panic(const char *, ...) __dead2 __printflike(1, 2); | extern void panic(const char *, ...) __dead2 __printflike(1, 2); | ||||
extern struct fs_ops *file_system[]; | extern struct fs_ops *file_system[]; | ||||
Show All 40 Lines |