collate.h 1.0 KB

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