Difference between revisions of "Samba4/LDB/API"

From SambaWiki
Line 1: Line 1:
 
= DN =
 
= DN =
   
== const char *ldb_dn_get_linearized(struct ldb_dn *dn) ==
+
== ldb_dn_get_linearized() ==
  +
  +
const char *ldb_dn_get_linearized(struct ldb_dn *dn);
   
 
Get the linear form of a DN (without any extended components)
 
Get the linear form of a DN (without any extended components)
Line 8: Line 10:
 
* dn: The DN to linearize
 
* dn: The DN to linearize
   
== char *ldb_dn_alloc_linearized(TALLOC_CTX *mem_ctx, struct ldb_dn *dn) ==
+
== ldb_dn_alloc_linearized() ==
  +
  +
char *ldb_dn_alloc_linearized(TALLOC_CTX *mem_ctx, struct ldb_dn *dn);
   
 
Allocate a copy of the linear form of a DN (without any extended components) onto the supplied memory context
 
Allocate a copy of the linear form of a DN (without any extended components) onto the supplied memory context
Line 16: Line 20:
 
* mem_ctx: TALLOC context to return result on
 
* mem_ctx: TALLOC context to return result on
   
== char *ldb_dn_get_extended_linearized(void *mem_ctx, struct ldb_dn *dn, int mode) ==
+
== ldb_dn_get_extended_linearized() ==
  +
  +
char *ldb_dn_get_extended_linearized(void *mem_ctx, struct ldb_dn *dn, int mode);
   
 
Get the linear form of a DN (with any extended components)
 
Get the linear form of a DN (with any extended components)
Line 25: Line 31:
 
* mode: Style of extended DN to return (0 is HEX representation of binary form, 1 is a string form)
 
* mode: Style of extended DN to return (0 is HEX representation of binary form, 1 is a string form)
   
== const struct ldb_val *ldb_dn_get_extended_component(struct ldb_dn *dn, const char *name) ==
+
== ldb_dn_get_extended_component() ==
  +
  +
const struct ldb_val *ldb_dn_get_extended_component(struct ldb_dn *dn, const char *name);
  +
  +
== ldb_dn_set_extended_component() ==
  +
 
int ldb_dn_set_extended_component(struct ldb_dn *dn, const char *name, const struct ldb_val *val);
  +
 
== ldb_dn_remove_extended_components() ==
  +
  +
void ldb_dn_remove_extended_components(struct ldb_dn *dn);
  +
 
== ldb_dn_has_extended() ==
   
  +
bool ldb_dn_has_extended(struct ldb_dn *dn);
== int ldb_dn_set_extended_component(struct ldb_dn *dn, const char *name, const struct ldb_val *val) ==
 
   
  +
== ldb_dn_extended_add_syntax() ==
== void ldb_dn_remove_extended_components(struct ldb_dn *dn) ==
 
   
 
int ldb_dn_extended_add_syntax(struct ldb_context *ldb, unsigned flags, const struct ldb_dn_extended_syntax *syntax);
== bool ldb_dn_has_extended(struct ldb_dn *dn) ==
 
   
  +
== ldb_dn_new() ==
== int ldb_dn_extended_add_syntax(struct ldb_context *ldb, unsigned flags, const struct ldb_dn_extended_syntax *syntax) ==
 
   
== struct ldb_dn *ldb_dn_new(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, const char *dn) ==
+
struct ldb_dn *ldb_dn_new(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, const char *dn);
   
 
Allocate a new DN from a string
 
Allocate a new DN from a string

Revision as of 23:11, 23 September 2009

DN

ldb_dn_get_linearized()

const char *ldb_dn_get_linearized(struct ldb_dn *dn);

Get the linear form of a DN (without any extended components)

Parameters:

  • dn: The DN to linearize

ldb_dn_alloc_linearized()

char *ldb_dn_alloc_linearized(TALLOC_CTX *mem_ctx, struct ldb_dn *dn);

Allocate a copy of the linear form of a DN (without any extended components) onto the supplied memory context

Parameters:

  • dn: The DN to linearize
  • mem_ctx: TALLOC context to return result on

ldb_dn_get_extended_linearized()

char *ldb_dn_get_extended_linearized(void *mem_ctx, struct ldb_dn *dn, int mode);

Get the linear form of a DN (with any extended components)

Parameters:

  • mem_ctx: TALLOC context to return result on
  • dn: The DN to linearize
  • mode: Style of extended DN to return (0 is HEX representation of binary form, 1 is a string form)

ldb_dn_get_extended_component()

const struct ldb_val *ldb_dn_get_extended_component(struct ldb_dn *dn, const char *name);

ldb_dn_set_extended_component()

int ldb_dn_set_extended_component(struct ldb_dn *dn, const char *name, const struct ldb_val *val);

ldb_dn_remove_extended_components()

void ldb_dn_remove_extended_components(struct ldb_dn *dn);

ldb_dn_has_extended()

bool ldb_dn_has_extended(struct ldb_dn *dn);

ldb_dn_extended_add_syntax()

int ldb_dn_extended_add_syntax(struct ldb_context *ldb, unsigned flags, const struct ldb_dn_extended_syntax *syntax);

ldb_dn_new()

struct ldb_dn *ldb_dn_new(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, const char *dn);

Allocate a new DN from a string

Parameters:

  • mem_ctx: TALLOC context to return resulting ldb_dn structure on
  • dn: The new DN

The DN will not be parsed at this time. Use ldb_dn_validate to tell if the DN is syntacticly correct