repl_objset.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. /*
  13. */
  14. /* repl_objset.h */
  15. /*
  16. * Support for lifetime management of sets of objects.
  17. * Objects are refcounted. NOTE: This API should go away
  18. * in favor of the objset API provided by libslapd.
  19. */
  20. #ifndef _REPL_OBJSET_H
  21. #define __REPL_OBJSET_H
  22. #include "llist.h"
  23. #define REPL_OBJSET_SUCCESS 0
  24. #define REPL_OBJSET_DUPLICATE_KEY 1
  25. #define REPL_OBJSET_INTERNAL_ERROR 2
  26. #define REPL_OBJSET_KEY_NOT_FOUND 3
  27. typedef struct repl_objset Repl_Objset;
  28. Repl_Objset *repl_objset_new(FNFree destructor);
  29. void repl_objset_destroy(Repl_Objset **o, time_t maxwait, FNFree panic_fn);
  30. int repl_objset_add(Repl_Objset *o, const char *name, void *obj);
  31. int repl_objset_acquire(Repl_Objset *o, const char *key, void **obj, void **handle);
  32. void repl_objset_release(Repl_Objset *o, void *handle);
  33. void repl_objset_delete(Repl_Objset *o, void *handle);
  34. void *repl_objset_next_object(Repl_Objset *o, void *cookie, void **handle);
  35. void *repl_objset_first_object(Repl_Objset *o, void **cookie, void **handle);
  36. void repl_objset_iterator_destroy(void **itcontext);
  37. #endif /* _REPL_OBJSET_H */