[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ldif.h



Ok the light bulb came on and I think I've figured out most of the standard library (ldap.h) functions. I misspoke about some of the depreciated functions. My library was not compiled correctly.

Now I am moving on to trying to read/write ldif files. ldif.c has everything I need. However there are some odd includes:
#include <ac/stdlib.h>
#include <ac/ctype.h>

#include <ac/string.h>
#include <ac/socket.h>
#include <ac/time.h>

Can these be converted to <stdlib.h> instead of <ac/stdlib.h>? I'd like to pull the minimal amount of code from the distribution to include in my code. Ultimately I'd love to see a standard ldif lib much like the ldap lib.

Can anyone assist? I am just starting into gcc and c and am a bit rusty. To someone experienced I would think it could be extracted rather quickly.
Thanks
Eric


Howard Chu wrote:
Eric Nichols wrote:
I've spent the past few days rooting around the openldap site.  I am
developing currently on Debian lenny using the libldap2-dev package.  My
small goal is to try and write my own rootdse program to better
understand the lib.  I am stuck on one piece of code.  I have no idea
where to get an LDIF library to parse/write ldif files.

Can anyone point me in the right direction on this?  It's been a long
time since I was coding in C and it took me a while just to gather that
I needed -lldap to make what I have work.

I believe this is the only piece I'm missing, the LDAP library calls
work flawlessly.  I also did learn that many of the depreciated
functions are still documented as valid functions (ldap_get_values,
ldap_count_values, ldap_value_free).  I couldn't find anything that
replaced these..

There is no complete library for LDIF parsing in OpenLDAP; probably there needs to be one. You should just copy the code in clients/tools/ldapmodify.c in the meantime. And you should read clients/tools/ldapsearch.c, regarding the other functions you mentioned.