repl_objset.h 1.3 KB

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