collate.h 1.0 KB

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