thread.h 963 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * This file is part of the zlog Library.
  3. *
  4. * Copyright (C) 2011 by Hardy Simpson <HardySimpson1984@gmail.com>
  5. *
  6. * Licensed under the LGPL v2.1, see the file COPYING in base directory.
  7. */
  8. #ifndef __zlog_thread_h
  9. #define __zlog_thread_h
  10. #include "zc_defs.h"
  11. #include "event.h"
  12. #include "buf.h"
  13. #include "mdc.h"
  14. typedef struct {
  15. int init_version;
  16. zlog_mdc_t *mdc;
  17. zlog_event_t *event;
  18. zlog_buf_t *pre_path_buf;
  19. zlog_buf_t *path_buf;
  20. zlog_buf_t *archive_path_buf;
  21. zlog_buf_t *pre_msg_buf;
  22. zlog_buf_t *msg_buf;
  23. } zlog_thread_t;
  24. void zlog_thread_del(zlog_thread_t * a_thread);
  25. void zlog_thread_profile(zlog_thread_t * a_thread, int flag);
  26. zlog_thread_t *zlog_thread_new(int init_version,
  27. size_t buf_size_min, size_t buf_size_max, int time_cache_count);
  28. int zlog_thread_rebuild_msg_buf(zlog_thread_t * a_thread, size_t buf_size_min, size_t buf_size_max);
  29. int zlog_thread_rebuild_event(zlog_thread_t * a_thread, int time_cache_count);
  30. #endif