mdc.h 905 B

12345678910111213141516171819202122232425262728293031323334353637
  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_mdc_h
  9. #define __zlog_mdc_h
  10. #include "zc_defs.h"
  11. typedef struct zlog_mdc_s zlog_mdc_t;
  12. struct zlog_mdc_s {
  13. zc_hashtable_t *tab;
  14. };
  15. zlog_mdc_t *zlog_mdc_new(void);
  16. void zlog_mdc_del(zlog_mdc_t * a_mdc);
  17. void zlog_mdc_profile(zlog_mdc_t *a_mdc, int flag);
  18. void zlog_mdc_clean(zlog_mdc_t * a_mdc);
  19. int zlog_mdc_put(zlog_mdc_t * a_mdc, const char *key, const char *value);
  20. char *zlog_mdc_get(zlog_mdc_t * a_mdc, const char *key);
  21. void zlog_mdc_remove(zlog_mdc_t * a_mdc, const char *key);
  22. typedef struct zlog_mdc_kv_s {
  23. char key[MAXLEN_PATH + 1];
  24. char value[MAXLEN_PATH + 1];
  25. size_t value_len;
  26. } zlog_mdc_kv_t;
  27. zlog_mdc_kv_t *zlog_mdc_get_kv(zlog_mdc_t * a_mdc, const char *key);
  28. #endif