format.h 810 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_format_h
  9. #define __zlog_format_h
  10. #include "thread.h"
  11. #include "zc_defs.h"
  12. typedef struct zlog_format_s zlog_format_t;
  13. struct zlog_format_s {
  14. char name[MAXLEN_CFG_LINE + 1];
  15. char pattern[MAXLEN_CFG_LINE + 1];
  16. zc_arraylist_t *pattern_specs;
  17. };
  18. zlog_format_t *zlog_format_new(char *line, int * time_cache_count);
  19. void zlog_format_del(zlog_format_t * a_format);
  20. void zlog_format_profile(zlog_format_t * a_format, int flag);
  21. int zlog_format_gen_msg(zlog_format_t * a_format, zlog_thread_t * a_thread);
  22. #define zlog_format_has_name(a_format, fname) \
  23. STRCMP(a_format->name, ==, fname)
  24. #endif