chickadee » ldif-sexpr

ldif-sexpr

Read/write LDIF, LDAP search strings and related data formats. (RFCs 2849, 4514, 2254)

Requirements

Irregex, ports, uri-common, base64.

API

ldif-dn LDIFprocedure

Returns the distinguished name (as S-expression) from LDIF object.

ldif-attributes LDIFprocedure

Returns the attributes (as list of S-expression) from LDIF object.

make-ldif DN ATTRIBUTESprocedure

Create an ldif record from DN and ATTRIBUTES.

read #!optional PORTprocedure

Reads a LDIF record from PORT (default: current-input-port). Returns the ldif record or an eof-object.

write LDIF #!optional PORTprocedure

Writes the LDIF object to PORT (default: current-output-port).

rfc4514-read STRINGprocedure

Parse STRING as RDN.

rfc4514-write SEXPR #!optional PORTprocedure

Write SEXPR as RDN.

write-ldap-filter OBJ #!optional PORTprocedure

Write OBJ as LDAP filter (RFC 2254) to PORT (default current-output-port).

ldap-filter-string OBJprocedure

Returns a string with the output of write-ldap-filter applied to OBJ.

Examples

(use (prefix ldif-sexpr ldif:))

(assert (equal? (ldif:ldif-attributes (with-input-from-string "dn: CN=foobar\nfoo: bar" ldif:read))
	 '(("foo" "bar"))))


(assert (equal? (ldif:ldap-filter-string
		 '(and (exists name) (= foo "bar")))
		"(&(name=*)(foo=bar))"))

About this egg

Author

Jörg F. Wittenberger

Source Code

The ldif-sexpr egg repository is maintained on github.

Version History

0.3.1: Ported to CHICKEN 5

0.1: Initial release.

License

BSD

Contents »