|
|
1.1 root 1: /******************************************************************************
2: * Copyright (c) 2004, 2008 IBM Corporation
3: * All rights reserved.
4: * This program and the accompanying materials
5: * are made available under the terms of the BSD License
6: * which accompanies this distribution, and is available at
7: * http://www.opensource.org/licenses/bsd-license.php
8: *
9: * Contributors:
10: * IBM Corporation - initial implementation
11: *****************************************************************************/
12:
13: #ifndef FILEIO_H
14: #define FILEIO_H
15: #include <sys/socket.h>
16:
17: struct snk_fileio_type;
18: typedef struct snk_fileio_type snk_fileio_t;
19:
20: #define FILEIO_TYPE_EMPTY 0
21: #define FILEIO_TYPE_USED 1
22:
23: typedef long (*fileio_read_t)
24: (snk_fileio_t *fileio, char *buf, long len);
25: typedef long (*fileio_write_t)
26: (snk_fileio_t *fileio, char *buf, long len);
27: typedef int (*fileio_ioctl_t)
28: (snk_fileio_t *fileio, int request, void *data);
29: typedef int (*fileio_bind_t)
30: (snk_fileio_t *fileio, const struct sockaddr *, long len);
31: typedef int (*fileio_connect_t)
32: (snk_fileio_t *fileio, const struct sockaddr *, long len);
33: typedef int (*fileio_close_t)
34: (snk_fileio_t *fileio);
35:
36: struct snk_fileio_type {
37: int type;
38: int idx;
39:
40: fileio_read_t read;
41: fileio_write_t write;
42: fileio_ioctl_t ioctl;
43: fileio_bind_t bind;
44: fileio_connect_t connect;
45: fileio_close_t close;
46:
47: void *data;
48: };
49:
50: #define FILEIO_MAX 32
51: extern snk_fileio_t fd_array[FILEIO_MAX];
52:
53: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.