cl4.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * END COPYRIGHT BLOCK **/
  9. #ifdef HAVE_CONFIG_H
  10. # include <config.h>
  11. #endif
  12. /* cl4.h - global declarations used by the 4.0 style changelog module
  13. */
  14. #ifndef CL4_H
  15. #define CL4_H
  16. #include "slapi-private.h"
  17. #include "portable.h" /* GGOODREPL - is this cheating? */
  18. #define CONFIG_CHANGELOG_SUFFIX_ATTRIBUTE "nsslapd-changelogsuffix"
  19. /* A place to store changelog config info */
  20. typedef struct _chglog4Info chglog4Info;
  21. /* in cl4.c */
  22. chglog4Info* changelog4_new (Slapi_Entry *e, char *errorbuf);
  23. void changelog4_free (chglog4Info** cl4);
  24. void changelog4_lock (Object *obj, PRBool write);
  25. void changelog4_unlock (Object *obj);
  26. const char * changelog4_get_dir (const chglog4Info* cl4);
  27. const char * changelog4_get_suffix (const chglog4Info* cl4);
  28. time_t changelog4_get_maxage (const chglog4Info* cl4);
  29. unsigned long changelog4_get_maxentries (const chglog4Info* cl4);
  30. void changelog4_set_dir (chglog4Info* cl4, const char *dir);
  31. void changelog4_set_suffix (chglog4Info* cl4, const char *suffix);
  32. void changelog4_set_maxage (chglog4Info* cl4, const char *maxage);
  33. void changelog4_set_maxentries (chglog4Info* cl4, const char* maxentries);
  34. /* In cl4_suffix.c */
  35. char *get_changelog_dataversion(const chglog4Info* cl4);
  36. void set_changelog_dataversion(chglog4Info* cl4, const char *dataversion);
  37. /* In cl4_config.c */
  38. int changelog4_config_init();
  39. void changelog4_config_destroy();
  40. /*
  41. * backend configuration information
  42. * Previously, these two typedefs were in ../../slapd/slapi-plugin.h but
  43. * the CL4 code is the only remaining code that references these definitions.
  44. */
  45. typedef struct config_directive
  46. {
  47. char *file_name; /* file from which to read directive */
  48. int lineno; /* line to read */
  49. int argc; /* number of argvs */
  50. char **argv; /* directive in agrv format */
  51. } slapi_config_directive;
  52. typedef struct be_config
  53. {
  54. char *type; /* type of the backend */
  55. char *suffix; /* suffix of the backend */
  56. int is_private; /* 1 - private, 0 -not */
  57. int log_change; /* 1 - write change to the changelog; 0 - don't */
  58. slapi_config_directive *directives;/* configuration directives */
  59. int dir_count; /* number of directives */
  60. } slapi_be_config;
  61. #endif