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. */
12 #ifndef OPENAFS_WINNT_CLIENT_OSI_OSIFD_H
13 #define OPENAFS_WINNT_CLIENT_OSI_OSIFD_H 1
21 /* operations on a file descriptor */
22 typedef struct osi_fdOps {
23 /* create an object, passed in the type info and returns
24 * the newly created fd. This is the only function not passed
25 * in the object, since it creates it.
27 long (*Create)(struct osi_fdType *, struct osi_fd **);
29 /* gets info about the object; fields are type specific, and eventually
32 long (*GetInfo)(struct osi_fd *, osi_remGetInfoParms_t *);
34 /* close an object; frees the storage associated with it */
35 long (*Close)(struct osi_fd *);
38 /* header structure that must be at the start of all FDs so that we can find
39 * them generically from the network layer by fd number.
41 typedef struct osi_fd {
47 /* represents a specific file descriptor for iterating over all file
50 typedef struct osi_typeFD {
51 osi_fd_t fd; /* header */
52 struct osi_fdType *curp; /* type scan is about to return next */
55 typedef struct osi_fdTypeFormat {
56 struct osi_fdTypeFormat *nextp;
63 /* describes type of file descriptor; anyone can register a new one */
64 typedef struct osi_fdType {
65 osi_queue_t q; /* for threading together so we can find by name */
66 char *namep; /* name */
67 void *rockp; /* opaque for type owner */
68 osi_fdOps_t *opsp; /* operations */
69 osi_fdTypeFormat_t *formatListp; /* list of formatting info */
72 extern osi_fdType_t *osi_FindFDType(char *);
74 extern osi_fdType_t *osi_RegisterFDType(char *, osi_fdOps_t *, void *);
76 extern long osi_UnregisterFDType(char *);
78 extern int osi_AddFDFormatInfo(osi_fdType_t *typep, long region, long index,
79 char *labelp, long format);
81 extern int osi_InitFD(void);
83 extern osi_fd_t *osi_AllocFD(char *);
85 extern osi_fd_t *osi_FindFD(long);
87 extern int osi_CloseFD(osi_fd_t *);
89 extern long osi_FDTypeCreate(osi_fdType_t *, osi_fd_t **);
91 extern long osi_FDTypeGetInfo(osi_fd_t *, osi_remGetInfoParms_t *);
93 extern long osi_FDTypeClose(osi_fd_t *);
95 #endif /* OPENAFS_WINNT_CLIENT_OSI_OSIFD_H */