srchpref.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. char *sa_attrlabel;
  40. char *sa_attr;
  41. /* max 32 matchtypes for now */
  42. unsigned long sa_matchtypebitmap;
  43. char *sa_selectattr;
  44. char *sa_selecttext;
  45. struct ldap_searchattr *sa_next;
  46. };
  47. struct ldap_searchmatch {
  48. char *sm_matchprompt;
  49. char *sm_filter;
  50. struct ldap_searchmatch *sm_next;
  51. };
  52. struct ldap_searchobj {
  53. char *so_objtypeprompt;
  54. unsigned long so_options;
  55. char *so_prompt;
  56. short so_defaultscope;
  57. char *so_filterprefix;
  58. char *so_filtertag;
  59. char *so_defaultselectattr;
  60. char *so_defaultselecttext;
  61. struct ldap_searchattr *so_salist;
  62. struct ldap_searchmatch *so_smlist;
  63. struct ldap_searchobj *so_next;
  64. };
  65. #define NULLSEARCHOBJ ((struct ldap_searchobj *)0)
  66. /*
  67. * global search object options
  68. */
  69. #define LDAP_SEARCHOBJ_OPT_INTERNAL 0x00000001
  70. #define LDAP_IS_SEARCHOBJ_OPTION_SET( so, option ) \
  71. (((so)->so_options & option ) != 0 )
  72. #define LDAP_SEARCHPREF_VERSION_ZERO 0
  73. #define LDAP_SEARCHPREF_VERSION 1
  74. #define LDAP_SEARCHPREF_ERR_VERSION 1
  75. #define LDAP_SEARCHPREF_ERR_MEM 2
  76. #define LDAP_SEARCHPREF_ERR_SYNTAX 3
  77. #define LDAP_SEARCHPREF_ERR_FILE 4
  78. LDAP_API(int)
  79. LDAP_CALL
  80. ldap_init_searchprefs( char *file, struct ldap_searchobj **solistp );
  81. LDAP_API(int)
  82. LDAP_CALL
  83. ldap_init_searchprefs_buf( char *buf, long buflen,
  84. struct ldap_searchobj **solistp );
  85. LDAP_API(void)
  86. LDAP_CALL
  87. ldap_free_searchprefs( struct ldap_searchobj *solist );
  88. LDAP_API(struct ldap_searchobj *)
  89. LDAP_CALL
  90. ldap_first_searchobj( struct ldap_searchobj *solist );
  91. LDAP_API(struct ldap_searchobj *)
  92. LDAP_CALL
  93. ldap_next_searchobj( struct ldap_searchobj *sollist,
  94. struct ldap_searchobj *so );
  95. #ifdef __cplusplus
  96. }
  97. #endif
  98. #endif /* _SRCHPREF_H */