srchpref.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. * Copyright (c) 1993, 1994 Regents of the University of Michigan.
  14. * All rights reserved.
  15. *
  16. * Redistribution and use in source and binary forms are permitted
  17. * provided that this notice is preserved and that due credit is given
  18. * to the University of Michigan at Ann Arbor. The name of the University
  19. * may not be used to endorse or promote products derived from this
  20. * software without specific prior written permission. This software
  21. * is provided ``as is'' without express or implied warranty.
  22. *
  23. * searchpref.h: display template library defines
  24. * 16 May 1994 by Gordon Good
  25. */
  26. #ifndef _SRCHPREF_H
  27. #define _SRCHPREF_H
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. /* calling conventions used by library */
  32. #ifndef LDAP_CALL
  33. #define LDAP_C
  34. #define LDAP_CALLBACK
  35. #define LDAP_PASCAL
  36. #define LDAP_CALL
  37. #endif /* LDAP_CALL */
  38. struct ldap_searchattr
  39. {
  40. char *sa_attrlabel;
  41. char *sa_attr;
  42. /* max 32 matchtypes for now */
  43. unsigned long sa_matchtypebitmap;
  44. char *sa_selectattr;
  45. char *sa_selecttext;
  46. struct ldap_searchattr *sa_next;
  47. };
  48. struct ldap_searchmatch
  49. {
  50. char *sm_matchprompt;
  51. char *sm_filter;
  52. struct ldap_searchmatch *sm_next;
  53. };
  54. struct ldap_searchobj
  55. {
  56. char *so_objtypeprompt;
  57. unsigned long so_options;
  58. char *so_prompt;
  59. short so_defaultscope;
  60. char *so_filterprefix;
  61. char *so_filtertag;
  62. char *so_defaultselectattr;
  63. char *so_defaultselecttext;
  64. struct ldap_searchattr *so_salist;
  65. struct ldap_searchmatch *so_smlist;
  66. struct ldap_searchobj *so_next;
  67. };
  68. #define NULLSEARCHOBJ ((struct ldap_searchobj *)0)
  69. /*
  70. * global search object options
  71. */
  72. #define LDAP_SEARCHOBJ_OPT_INTERNAL 0x00000001
  73. #define LDAP_IS_SEARCHOBJ_OPTION_SET(so, option) \
  74. (((so)->so_options & option) != 0)
  75. #define LDAP_SEARCHPREF_VERSION_ZERO 0
  76. #define LDAP_SEARCHPREF_VERSION 1
  77. #define LDAP_SEARCHPREF_ERR_VERSION 1
  78. #define LDAP_SEARCHPREF_ERR_MEM 2
  79. #define LDAP_SEARCHPREF_ERR_SYNTAX 3
  80. #define LDAP_SEARCHPREF_ERR_FILE 4
  81. LDAP_API(int)
  82. LDAP_CALL
  83. ldap_init_searchprefs(char *file, struct ldap_searchobj **solistp);
  84. LDAP_API(int)
  85. LDAP_CALL
  86. ldap_init_searchprefs_buf(char *buf, long buflen, struct ldap_searchobj **solistp);
  87. LDAP_API(void)
  88. LDAP_CALL
  89. ldap_free_searchprefs(struct ldap_searchobj *solist);
  90. LDAP_API(struct ldap_searchobj *)
  91. LDAP_CALL
  92. ldap_first_searchobj(struct ldap_searchobj *solist);
  93. LDAP_API(struct ldap_searchobj *)
  94. LDAP_CALL
  95. ldap_next_searchobj(struct ldap_searchobj *sollist,
  96. struct ldap_searchobj *so);
  97. #ifdef __cplusplus
  98. }
  99. #endif
  100. #endif /* _SRCHPREF_H */