ldap_schemah.inc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. (* $OpenLDAP: pkg/ldap/include/ldap_schema.h,v 1.32.2.3 2005/01/20 17:00:59 kurt Exp $ *)
  2. (* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  3. *
  4. * Copyright 1998-2005 The OpenLDAP Foundation.
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted only as authorized by the OpenLDAP
  9. * Public License.
  10. *
  11. * A copy of this license is available in file LICENSE in the
  12. * top-level directory of the distribution or, alternatively, at
  13. * <http://www.OpenLDAP.org/license.html>.
  14. *)
  15. (* ldap-schema.h - Header for basic schema handling functions that can be
  16. * used by both clients and servers.
  17. * these routines should be renamed ldap_x_...
  18. *)
  19. (* Codes for parsing errors *)
  20. const
  21. LDAP_SCHERR_OUTOFMEM = 1;
  22. LDAP_SCHERR_UNEXPTOKEN = 2;
  23. LDAP_SCHERR_NOLEFTPAREN = 3;
  24. LDAP_SCHERR_NORIGHTPAREN = 4;
  25. LDAP_SCHERR_NODIGIT = 5;
  26. LDAP_SCHERR_BADNAME = 6;
  27. LDAP_SCHERR_BADDESC = 7;
  28. LDAP_SCHERR_BADSUP = 8;
  29. LDAP_SCHERR_DUPOPT = 9;
  30. LDAP_SCHERR_EMPTY = 10;
  31. LDAP_SCHERR_MISSING = 11;
  32. LDAP_SCHERR_OUT_OF_ORDER = 12;
  33. type
  34. pldap_schema_extension_item = ^ldap_schema_extension_item;
  35. ldap_schema_extension_item = record
  36. lsei_name : pcchar;
  37. lsei_values : ppcchar;
  38. end;
  39. PPLDAPSchemaExtensionItem = ^PLDAPSchemaExtensionItem;
  40. PLDAPSchemaExtensionItem = ^LDAPSchemaExtensionItem;
  41. LDAPSchemaExtensionItem = ldap_schema_extension_item;
  42. pldap_syntax = ^ldap_syntax;
  43. ldap_syntax = record
  44. syn_oid : pcchar; (* REQUIRED *)
  45. syn_names : ppcchar; (* OPTIONAL *)
  46. syn_desc : pcchar; (* OPTIONAL *)
  47. syn_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
  48. end;
  49. PLDAPSyntax = ^ldap_syntax;
  50. LDAPSyntax = ldap_syntax;
  51. pldap_matchingrule = ^ldap_matchingrule;
  52. ldap_matchingrule = record
  53. mr_oid : pcchar; (* REQUIRED *)
  54. mr_names : ppcchar; (* OPTIONAL *)
  55. mr_desc : pcchar; (* OPTIONAL *)
  56. mr_obsolete : cint; (* OPTIONAL *)
  57. mr_syntax_oid : pcchar; (* REQUIRED *)
  58. mr_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
  59. end;
  60. PLDAPMatchingRule = ^LDAPMatchingRule;
  61. LDAPMatchingRule = ldap_matchingrule;
  62. pldap_matchingruleuse = ^ldap_matchingruleuse;
  63. ldap_matchingruleuse = record
  64. mru_oid : pcchar; (* REQUIRED *)
  65. mru_names : ppcchar; (* OPTIONAL *)
  66. mru_desc : pcchar; (* OPTIONAL *)
  67. mru_obsolete : cint; (* OPTIONAL *)
  68. mru_applies_oids: ppcchar; (* REQUIRED *)
  69. mru_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
  70. end;
  71. PLDAPMatchingRuleUse = ^LDAPMatchingRuleUse;
  72. LDAPMatchingRuleUse = ldap_matchingruleuse;
  73. pldap_attributetype = ^ldap_attributetype;
  74. ldap_attributetype = record
  75. at_oid : pcchar; (* REQUIRED *)
  76. at_names : ppcchar; (* OPTIONAL *)
  77. at_desc : pcchar; (* OPTIONAL *)
  78. at_obsolete : cint; (* 0=no, 1=yes *)
  79. at_sup_oid : pcchar; (* OPTIONAL *)
  80. at_equality_oid : pcchar; (* OPTIONAL *)
  81. at_ordering_oid : pcchar; (* OPTIONAL *)
  82. at_substr_oid : pcchar; (* OPTIONAL *)
  83. at_syntax_oid : pcchar; (* OPTIONAL *)
  84. at_syntax_len : cint; (* OPTIONAL *)
  85. at_single_value : cint; (* 0=no, 1=yes *)
  86. at_collective : cint; (* 0=no, 1=yes *)
  87. at_no_user_mod : cint; (* 0=no, 1=yes *)
  88. at_usage : cint; (* 0=userApplications, 1=directoryOperation, 2=distributedOperation, 3=dSAOperation *)
  89. at_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
  90. end;
  91. PLDAPAttributeType = ^LDAPAttributeType;
  92. LDAPAttributeType = ldap_attributetype;
  93. pldap_objectclass = ^ldap_objectclass;
  94. ldap_objectclass = record
  95. oc_oid : pcchar; (* REQUIRED *)
  96. oc_names : ppcchar; (* OPTIONAL *)
  97. oc_desc : pcchar; (* OPTIONAL *)
  98. oc_obsolete : cint; (* 0=no, 1=yes *)
  99. oc_sup_oids : ppcchar; (* OPTIONAL *)
  100. oc_kind : cint; (* 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY *)
  101. oc_at_oids_must : ppcchar; (* OPTIONAL *)
  102. oc_at_oids_may : ppcchar; (* OPTIONAL *)
  103. oc_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
  104. end;
  105. PLDAPObjectClass = ^LDAPObjectClass;
  106. LDAPObjectClass = ldap_objectclass;
  107. pldap_contentrule = ^ldap_contentrule;
  108. ldap_contentrule = record
  109. cr_oid : pcchar; (* REQUIRED *)
  110. cr_names : ppcchar; (* OPTIONAL *)
  111. cr_desc : pcchar; (* OPTIONAL *)
  112. cr_sup_oids : ppcchar; (* OPTIONAL *)
  113. cr_obsolete : cint; (* 0=no, 1=yes *)
  114. cr_oc_oids_aux : ppcchar; (* OPTIONAL *)
  115. cr_at_oids_must : ppcchar; (* OPTIONAL *)
  116. cr_at_oids_may : ppcchar; (* OPTIONAL *)
  117. cr_at_oids_not : ppcchar; (* OPTIONAL *)
  118. cr_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
  119. end;
  120. PLDAPContentRule = ^LDAPContentRule;
  121. LDAPContentRule = ldap_contentrule;
  122. pldap_nameform = ^ldap_nameform;
  123. ldap_nameform = record
  124. nf_oid : pcchar; (* REQUIRED *)
  125. nf_names : ppcchar; (* OPTIONAL *)
  126. nf_desc : pcchar; (* OPTIONAL *)
  127. nf_obsolete : cint; (* 0=no, 1=yes *)
  128. nf_objectclass : pcchar; (* REQUIRED *)
  129. nf_at_oids_must : ppcchar; (* REQUIRED *)
  130. nf_at_oids_may : ppcchar; (* OPTIONAL *)
  131. nf_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
  132. end;
  133. PLDAPNameForm = ^LDAPNameForm;
  134. LDAPNameForm = ldap_nameform;
  135. pldap_structurerule = ^ldap_structurerule;
  136. ldap_structurerule = record
  137. sr_ruleid : cint; (* REQUIRED *)
  138. sr_names : ppcchar; (* OPTIONAL *)
  139. sr_desc : pcchar; (* OPTIONAL *)
  140. sr_obsolete : cint; (* 0=no, 1=yes *)
  141. sr_nameform : pcchar; (* REQUIRED *)
  142. sr_nsup_ruleids : cint; (* number of sr_sup_ruleids *)
  143. sr_sup_ruleids : pcint; (* OPTIONAL *)
  144. sr_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
  145. end;
  146. PLDAPStructureRule = ^LDAPStructureRule;
  147. LDAPStructureRule = ldap_structurerule;
  148. (*
  149. * Misc macros
  150. *)
  151. const
  152. LDAP_SCHEMA_NO = 0;
  153. LDAP_SCHEMA_YES = 1;
  154. LDAP_SCHEMA_USER_APPLICATIONS = 0;
  155. LDAP_SCHEMA_DIRECTORY_OPERATION = 1;
  156. LDAP_SCHEMA_DISTRIBUTED_OPERATION = 2;
  157. LDAP_SCHEMA_DSA_OPERATION = 3;
  158. LDAP_SCHEMA_ABSTRACT = 0;
  159. LDAP_SCHEMA_STRUCTURAL = 1;
  160. LDAP_SCHEMA_AUXILIARY = 2;
  161. (*
  162. * Flags that control how liberal the parsing routines are.
  163. *)
  164. const
  165. LDAP_SCHEMA_ALLOW_NONE = $00; (* Strict parsing *)
  166. LDAP_SCHEMA_ALLOW_NO_OID = $01; (* Allow missing oid *)
  167. LDAP_SCHEMA_ALLOW_QUOTED = $02; (* Allow bogus extra quotes *)
  168. LDAP_SCHEMA_ALLOW_DESCR = $04; (* Allow descr instead of OID *)
  169. LDAP_SCHEMA_ALLOW_DESCR_PREFIX = $08; (* Allow descr as OID prefix *)
  170. LDAP_SCHEMA_ALLOW_OID_MACRO = $10; (* Allow OID macros in slapd *)
  171. LDAP_SCHEMA_ALLOW_OUT_OF_ORDER_FIELDS = $20; (* Allow fields in most any order *)
  172. LDAP_SCHEMA_ALLOW_ALL = $3f; (* Be very liberal in parsing *)
  173. LDAP_SCHEMA_SKIP = $80; (* Don't malloc any result *)
  174. function ldap_syntax2name(syn: PLDAPSyntax): pcchar; cdecl; external;
  175. function ldap_matchingrule2name(mr: PLDAPMatchingRule): pcchar; cdecl; external;
  176. function ldap_matchingruleuse2name(mru: PLDAPMatchingRuleUse): pcchar; cdecl; external;
  177. function ldap_attributetype2name(_at: PLDAPAttributeType): pcchar; cdecl; external;
  178. function ldap_objectclass2name(oc: PLDAPObjectClass): pcchar; cdecl; external;
  179. function ldap_contentrule2name(cr: PLDAPContentRule): pcchar; cdecl; external;
  180. function ldap_nameform2name(nf: PLDAPNameForm): pcchar; cdecl; external;
  181. function ldap_structurerule2name(sr: PLDAPStructureRule): pcchar; cdecl; external;
  182. procedure ldap_syntax_free(syn: PLDAPSyntax); cdecl; external;
  183. procedure ldap_matchingrule_free(mr: PLDAPMatchingRule); cdecl; external;
  184. procedure ldap_matchingruleuse_free(mru: PLDAPMatchingRuleUse); cdecl; external;
  185. procedure ldap_attributetype_free(_at: PLDAPAttributeType); cdecl; external;
  186. procedure ldap_objectclass_free(oc: PLDAPObjectClass); cdecl; external;
  187. procedure ldap_contentrule_free(cr: PLDAPContentRule); cdecl; external;
  188. procedure ldap_nameform_free(nf: PLDAPNameForm); cdecl; external;
  189. procedure ldap_structurerule_free(sr: PLDAPStructureRule); cdecl; external;
  190. function ldap_str2structurerule(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPStructureRule; cdecl; external;
  191. function ldap_str2nameform(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPNameForm; cdecl; external;
  192. function ldap_str2contentrule(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPContentRule; cdecl; external;
  193. function ldap_str2objectclass(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPObjectClass; cdecl; external;
  194. function ldap_str2attributetype(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPAttributeType; cdecl; external;
  195. function ldap_str2syntax(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPSyntax; cdecl; external;
  196. function ldap_str2matchingrule(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPMatchingRule; cdecl; external;
  197. function ldap_str2matchingruleuse(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPMatchingRuleUse; cdecl; external;
  198. function ldap_structurerule2str(sr: PLDAPStructureRule): pcchar; cdecl; external;
  199. function ldap_structurerule2bv(sr: PLDAPStructureRule; bv: PBerval): PBerval; cdecl; external;
  200. function ldap_nameform2str(nf: PLDAPNameForm): pcchar; cdecl; external;
  201. function ldap_nameform2bv(nf: PLDAPNameForm; bv: PBerval): PBerval; cdecl; external;
  202. function ldap_contentrule2str(cr: PLDAPContentRule): pcchar; cdecl; external;
  203. function ldap_contentrule2bv(cr: PLDAPContentRule; bv: PBerval): PBerval; cdecl; external;
  204. function ldap_objectclass2str(oc: PLDAPObjectClass): pcchar; cdecl; external;
  205. function ldap_objectclass2bv(oc: PLDAPObjectClass; bv: PBerval): PBerval; cdecl; external;
  206. function ldap_attributetype2str(_at: PLDAPAttributeType): pcchar; cdecl; external;
  207. function ldap_attributetype2bv(_at: PLDAPAttributeType; bv: PBerval): PBerval; cdecl; external;
  208. function ldap_syntax2str(syn: PLDAPSyntax): pcchar; cdecl; external;
  209. function ldap_syntax2bv(syn: PLDAPSyntax; bv: PBerval): PBerval; cdecl; external;
  210. function ldap_matchingrule2str(mr: PLDAPMatchingRule): pcchar; cdecl; external;
  211. function ldap_matchingrule2bv(mr: PLDAPMatchingRule; bv: PBerval): PBerval; cdecl; external;
  212. function ldap_matchingruleuse2str(mru: PLDAPMatchingRuleUse): pcchar; cdecl; external;
  213. function ldap_matchingruleuse2bv(mru: PLDAPMatchingRuleUse; bv: PBerval): PBerval; cdecl; external;
  214. function ldap_scherr2str(code: cint): pcchar; cdecl; external;