cl4.h 2.3 KB

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