Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
678 B

  1. #ifndef QUEUE_H
  2. #define QUEUE_H
  3. #include <stddef.h>
  4. #ifdef __linux__
  5. #include <sys/epoll.h>
  6. typedef struct epoll_event queue_event;
  7. #else
  8. #include <sys/types.h>
  9. #include <sys/event.h>
  10. #include <sys/time.h>
  11. typedef struct kevent queue_event;
  12. #endif
  13. enum queue_event_type {
  14. QUEUE_EVENT_IN,
  15. QUEUE_EVENT_OUT,
  16. };
  17. int queue_create(void);
  18. int queue_add_fd(int, int, enum queue_event_type, int, const void *);
  19. int queue_mod_fd(int, int, enum queue_event_type, const void *);
  20. int queue_rem_fd(int, int);
  21. ssize_t queue_wait(int, queue_event *, size_t);
  22. void *queue_event_get_data(const queue_event *);
  23. int queue_event_is_error(const queue_event *e);
  24. #endif /* QUEUE_H */