waitresult.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #ifndef __WAITRESULT_H__
  2. #define __WAITRESULT_H__
  3. #pragma once
  4. #include "config.h"
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. typedef struct waitresult_t waitresult_t;
  9. typedef void (*waitresult_on_trigger)(waitresult_t *result, void *user_data);
  10. TOOLKIT_API int waitresult_create(waitresult_t **p_result);
  11. TOOLKIT_API int waitresult_set_cb(waitresult_t *result, waitresult_on_trigger on_trigger, void *user_data);
  12. TOOLKIT_API void waitresult_destroy(waitresult_t *result);
  13. TOOLKIT_API HANDLE waitresult_native_handle(waitresult_t *result);
  14. TOOLKIT_API int waitresult_wait(waitresult_t *result, int timeout);
  15. TOOLKIT_API int waitresult_get_result(waitresult_t *result, int *p_msg, int *p_param1, int *p_param2);
  16. TOOLKIT_API int waitresult_signal(waitresult_t *result, int msg, int param1, int param2);
  17. TOOLKIT_API int waitresult_reset(waitresult_t *result);
  18. TOOLKIT_API int waitresult_inc_ref(waitresult_t *result);
  19. TOOLKIT_API int waitresult_dec_ref(waitresult_t *result);
  20. TOOLKIT_API int watiresult_ref_cnt(waitresult_t *result);
  21. #ifdef __cplusplus
  22. } // extern "C" {
  23. #endif
  24. #endif //__WAITRESULT_H__