procmon.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /* Copyright (c) 2011-2017, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. /**
  4. * \file procmon.h
  5. * \brief Headers for procmon.c
  6. **/
  7. #ifndef TOR_PROCMON_H
  8. #define TOR_PROCMON_H
  9. #include "compat.h"
  10. #include "compat_libevent.h"
  11. #include "torlog.h"
  12. typedef struct tor_process_monitor_t tor_process_monitor_t;
  13. /* DOCDOC tor_procmon_callback_t */
  14. typedef void (*tor_procmon_callback_t)(void *);
  15. int tor_validate_process_specifier(const char *process_spec,
  16. const char **msg);
  17. tor_process_monitor_t *tor_process_monitor_new(struct event_base *base,
  18. const char *process_spec,
  19. log_domain_mask_t log_domain,
  20. tor_procmon_callback_t cb,
  21. void *cb_arg,
  22. const char **msg);
  23. void tor_process_monitor_free_(tor_process_monitor_t *procmon);
  24. #define tor_process_monitor_free(procmon) \
  25. FREE_AND_NULL(tor_process_monitor_t, tor_process_monitor_free_, (procmon))
  26. #endif /* !defined(TOR_PROCMON_H) */