2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 /* Copyright (C) 1994 Cazamar Systems, Inc. */
13 #define _OSIFD_H_ENV_ 1
23 /* operations on a file descriptor */
24 typedef struct osi_fdOps {
25 /* create an object, passed in the type info and returns
26 * the newly created fd. This is the only function not passed
27 * in the object, since it creates it.
29 long (*Create)(struct osi_fdType *, struct osi_fd **);
32 /* gets info about the object; fields are type specific, and eventually
35 long (*GetInfo)(struct osi_fd *, osi_remGetInfoParms_t *);
38 /* close an object; frees the storage associated with it */
39 long (*Close)(struct osi_fd *);
42 /* header structure that must be at the start of all FDs so that we can find
43 * them generically from the network layer by fd number.
45 typedef struct osi_fd {
51 /* represents a specific file descriptor for iterating over all file
54 typedef struct osi_typeFD {
55 osi_fd_t fd; /* header */
56 struct osi_fdType *curp; /* type scan is about to return next */
59 typedef struct osi_fdTypeFormat {
60 struct osi_fdTypeFormat *nextp;
67 /* describes type of file descriptor; anyone can register a new one */
68 typedef struct osi_fdType {
69 osi_queue_t q; /* for threading together so we can find by name */
70 char *namep; /* name */
71 void *rockp; /* opaque for type owner */
72 osi_fdOps_t *opsp; /* operations */
73 osi_fdTypeFormat_t *formatListp; /* list of formatting info */
76 extern osi_fdType_t *osi_FindFDType(char *);
78 extern osi_fdType_t *osi_RegisterFDType(char *, osi_fdOps_t *, void *);
80 extern long osi_UnregisterFDType(char *);
82 extern osi_AddFDFormatInfo(osi_fdType_t *typep, long region, long index,
83 char *labelp, long format);
85 extern osi_InitFD(void);
87 extern osi_fd_t *osi_AllocFD(char *);
89 extern osi_fd_t *osi_FindFD(long);
91 extern osi_CloseFD(osi_fd_t *);
93 extern long osi_FDTypeCreate(osi_fdType_t *, osi_fd_t **);
96 extern long osi_FDTypeGetInfo(osi_fd_t *, osi_remGetInfoParms_t *);
99 extern long osi_FDTypeClose(osi_fd_t *);
101 #endif /* _OSIFD_H_ENV_ */