toolkit.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * category: [misc]
  3. * apply status:
  4. * edit status:
  5. * build status:
  6. * description:
  7. */
  8. #ifndef __TOOLKIT_GLOBAL_H__
  9. #define __TOOLKIT_GLOBAL_H__
  10. #include "config.h"
  11. #include <stdint.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. typedef struct tk_process_s tk_process_t;
  16. typedef struct tk_process_option_s tk_process_option_t;
  17. typedef void (*tk_exit_cb)(tk_process_t*, int64_t);
  18. struct tk_process_s
  19. {
  20. int pid;
  21. HANDLE handle;
  22. };
  23. struct tk_process_option_s
  24. {
  25. tk_exit_cb exit_cb;
  26. const char* file;
  27. char* params;
  28. uint32_t flags;
  29. };
  30. TOOLKIT_API int process_init(tk_process_t* proc);
  31. TOOLKIT_API int process_spawn(const tk_process_option_t* option, tk_process_t** proc);
  32. TOOLKIT_API int process_compare(const tk_process_t* proc1, const tk_process_t* proc2);
  33. TOOLKIT_API void process_close(tk_process_t* proc);
  34. TOOLKIT_API bool process_exist_or_not(int pid);
  35. TOOLKIT_API unsigned int toolkit_version(void);
  36. TOOLKIT_API const char* toolkit_version_string(void);
  37. #ifdef __cplusplus
  38. } // extern "C" {
  39. #endif
  40. #endif //__TOOLKIT_GLOBAL_H__