collate.h 981 B

123456789101112131415161718192021222324252627282930313233343536
  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. #ifndef _COLLATE_H_
  7. #define _COLLATE_H_
  8. #include <stddef.h> /* size_t */
  9. #include <dirlite_strings.h> /* PLUGIN_MAGIC_VENDOR_STR */
  10. struct indexer_t;
  11. typedef void (*ix_destroy_t) (struct indexer_t*);
  12. typedef struct berval** (*ix_index_t) (struct indexer_t*, struct berval** values,
  13. struct berval** prefixes /* inserted into each key */);
  14. typedef struct indexer_t
  15. {
  16. char* ix_oid;
  17. ix_index_t ix_index; /* map values to index keys */
  18. ix_destroy_t ix_destroy;
  19. void* ix_etc; /* whatever state the implementation needs */
  20. } indexer_t;
  21. extern void
  22. collation_init( char *configpath );
  23. extern int
  24. collation_config (size_t argc, char** argv, const char* fname, size_t lineno);
  25. extern indexer_t*
  26. collation_indexer_create (const char* oid);
  27. #endif