main-private.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. *
  3. * Embedded Linux library
  4. *
  5. * Copyright (C) 2021 Intel Corporation. All rights reserved.
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  20. *
  21. */
  22. typedef void (*watch_event_cb_t) (int fd, uint32_t events, void *user_data);
  23. typedef void (*watch_destroy_cb_t) (void *user_data);
  24. typedef void (*idle_event_cb_t) (void *user_data);
  25. typedef void (*idle_destroy_cb_t) (void *user_data);
  26. int watch_add(int fd, uint32_t events, watch_event_cb_t callback,
  27. void *user_data, watch_destroy_cb_t destroy);
  28. int watch_modify(int fd, uint32_t events, bool force);
  29. int watch_remove(int fd, bool epoll_del);
  30. int watch_clear(int fd);
  31. #define IDLE_FLAG_NO_WARN_DANGLING 0x10000000
  32. int idle_add(idle_event_cb_t callback, void *user_data, uint32_t flags,
  33. idle_destroy_cb_t destroy);
  34. void idle_remove(int id);