2 * Copyright (C) 2018 "IoT.bzh"
3 * Author José Bollo <jose.bollo@iot.bzh>
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
20 #include <sys/epoll.h>
24 #if defined(FDEV_PROVIDER)
27 void (*unref)(void *closure);
28 void (*disable)(void *closure, const struct fdev *fdev);
29 void (*enable)(void *closure, const struct fdev *fdev);
30 void (*update)(void *closure, const struct fdev *fdev);
33 extern struct fdev *fdev_create(int fd);
34 extern void fdev_set_itf(struct fdev *fdev, struct fdev_itf *itf, void *closure_itf);
35 extern void fdev_dispatch(struct fdev *fdev, uint32_t events);
38 extern struct fdev *fdev_addref(struct fdev *fdev);
39 extern void fdev_unref(struct fdev *fdev);
41 extern int fdev_fd(const struct fdev *fdev);
42 extern uint32_t fdev_events(const struct fdev *fdev);
43 extern int fdev_repeat(const struct fdev *fdev);
44 extern int fdev_autoclose(const struct fdev *fdev);
46 extern void fdev_set_callback(struct fdev *fdev, void (*callback)(void*,uint32_t,struct fdev*), void *closure);
47 extern void fdev_set_events(struct fdev *fdev, uint32_t events);
48 extern void fdev_set_repeat(struct fdev *fdev, int count);
49 extern void fdev_set_autoclose(struct fdev *fdev, int autoclose);