2 * UVT - Userspace Virtual Terminals
4 * Copyright (c) 2011-2013 David Herrmann <dh.herrmann@gmail.com>
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files
8 * (the "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 * Userspace Virtual Terminals Internals
28 * Internal header of the UVT implementation.
31 #ifndef UVT_INTERNAL_H
32 #define UVT_INTERNAL_H
37 #include "shl_array.h"
38 #include "shl_dlist.h"
42 #include <fuse/fuse.h>
43 #include <fuse/fuse_common.h>
44 #include <fuse/fuse_lowlevel.h>
45 #include <fuse/fuse_opt.h>
46 #include <fuse/cuse_lowlevel.h>
54 struct ev_eloop *eloop;
58 unsigned int minor_offset;
59 struct shl_array *minors;
62 /* character devices */
71 struct shl_hook *hook;
73 struct fuse_session *session;
75 struct fuse_chan *channel;
81 struct shl_dlist clients;
88 struct shl_dlist list;
89 struct uvt_cdev *cdev;
93 struct fuse_pollhandle *ph;
94 struct shl_dlist waiters;
96 const struct uvt_vt_ops *vt;
100 unsigned int vt_retry;
103 void uvt_client_cleanup(struct uvt_client *client);
105 int uvt_client_ll_open(struct uvt_client **out, struct uvt_cdev *cdev,
106 fuse_req_t req, struct fuse_file_info *fi);
107 void uvt_client_ll_release(fuse_req_t req, struct fuse_file_info *fi);
108 void uvt_client_ll_read(fuse_req_t req, size_t size, off_t off,
109 struct fuse_file_info *fi);
110 void uvt_client_ll_write(fuse_req_t req, const char *buf, size_t size,
111 off_t off, struct fuse_file_info *fi);
112 void uvt_client_ll_poll(fuse_req_t req, struct fuse_file_info *fi,
113 struct fuse_pollhandle *ph);
114 void uvt_client_ll_ioctl(fuse_req_t req, int cmd, void *arg,
115 struct fuse_file_info *fi, unsigned int flags,
116 const void *in_buf, size_t in_bufsz, size_t out_bufsz);
118 #endif /* UVT_INTERNAL_H */