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

Re: char* parameters -> const char* ?

Greg Stein writes:
> Adding in the macro just serves to complicate the API, it would seem.
> What gain would exist from that flexibility?

Well, some C++ programs might care.
A program may expect the library to follow the rfc's prototype - like
	int (*add) ( LDAP *, char *, LDAPMod ** );
	add = (async ? ldap_add : ldap_add_s);
You can remove the prototype above in C, but not in C++.

But the LDAP C API doesn't encourage such code anyway since few
functions have the same prototypes.  So I guess the main benefit is to
be able to say "we follow the standard (rfc1823)":-)