record.h 821 B

123456789101112131415161718192021222324252627282930313233
  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_record_h
  9. #define __zlog_record_h
  10. #include "zc_defs.h"
  11. /* record is user-defined output function and it's name from configure file */
  12. typedef struct zlog_msg_s {
  13. char *buf;
  14. size_t len;
  15. char *path;
  16. } zlog_msg_t; /* 3 of this first, see need thread or not later */
  17. typedef int (*zlog_record_fn)(zlog_msg_t * msg);
  18. typedef struct zlog_record_s {
  19. char name[MAXLEN_PATH + 1];
  20. zlog_record_fn output;
  21. } zlog_record_t;
  22. zlog_record_t *zlog_record_new(const char *name, zlog_record_fn output);
  23. void zlog_record_del(zlog_record_t *a_record);
  24. void zlog_record_profile(zlog_record_t *a_record, int flag);
  25. #endif