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

Function prototypes in libldap and liblber (ITS#578)



This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=_D58DDE5D.9FFE5600
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable


Full_Name: Alan Clark
Version: devel
OS: Linux / NetWare / WinNT
URL: ftp://ftp.openldap.org/incoming/aclark-000608

The enclosed patch cleans up externally visible
function declarations in libldap and liblber.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please note the following items that still need to be fixed:

ldap_is_ldap_url(), ldap_is_ldaps_url() are declared in ldap.h
  but ldap_is_ldapi_url() is not.

ldap_rename_ext(), and ldap_rename_ext_s are defined in ldap.h
but no code exists to support these function.

ldap_parent_dn(), ldap_relative_dn(), ldap_normalize_dn()
are defined in ldap.h but no code exists to support these function.

ldap_unbind_ext_s() is defined in ldap.h but no code exists to
support this function.

ber_print_error() is defined in lber.h.  The function in the code is =
ber_error_print.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

The following is a brief description of the changes:

The header file libldap.h declares functions with the form

LIBLDAP_F( char *)
ldap_err2string LDAP_P((
     int err ));

But the function in the code is declared as:

char *ldap_errstring( int err)

where it should be=20

LIBLDAP_F(char *)
ldap_errstring( int err)

I seemed to me that only externally visible functions
should be declared in this way in libldap and liblber.
If I am wrong, slap my hand.

This patch fixes all functions in the declared in the
external headers ldap.h and lber.h.

I also created a new macro LIBLBER_V for variables
which may need a slightly different syntax than functions.
Currently the only external variables are in liblber.

I removed the LIBLDAP_F and LIBLBER_F from the headers
ldap-int.h and lber-int.h and left the actual functions
unchanged.

The code also has the benefical side effect for win32 that
applications compiling with the headers get their ldap calls
compiled with the calling convention that the library is built
with.

-Steve Sonntag

-Alan Clark
Manager
Novell Directory Services

--=_D58DDE5D.9FFE5600
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3D"text/html; charset=3Diso-8859-1" http-equiv=3DContent-Type=
>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY style=3D"FONT: 8pt MS Sans Serif; MARGIN-LEFT: 2px; MARGIN-TOP: =
2px">
<DIV><BR>Full_Name: Alan Clark<BR>Version: devel<BR>OS: Linux / NetWare =
/=20
WinNT<BR>URL: <A=20
href=3D"ftp://ftp.openldap.org/incoming/aclark-000608";>ftp://ftp.openldap.o=
rg/incoming/aclark-000608</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>The enclosed patch cleans up externally visible<BR>function declaratio=
ns in=20
libldap and liblber.</DIV>
<DIV>&nbsp;</DIV>
<DIV>+++++++++++++++++++++++++++++++++++++++++++++++++++++++<BR>Please =
note the=20
following items that still need to be fixed:</DIV>
<DIV>&nbsp;</DIV>
<DIV>ldap_is_ldap_url(), ldap_is_ldaps_url() are declared in ldap.h<BR>&nbs=
p;=20
but ldap_is_ldapi_url() is not.</DIV>
<DIV>&nbsp;</DIV>
<DIV>ldap_rename_ext(), and ldap_rename_ext_s are defined in ldap.h<BR>but =
no=20
code exists to support these function.</DIV>
<DIV>&nbsp;</DIV>
<DIV>ldap_parent_dn(), ldap_relative_dn(), ldap_normalize_dn()<BR>are =
defined in=20
ldap.h but no code exists to support these function.</DIV>
<DIV>&nbsp;</DIV>
<DIV>ldap_unbind_ext_s() is defined in ldap.h but no code exists to<BR>supp=
ort=20
this function.</DIV>
<DIV>&nbsp;</DIV>
<DIV>ber_print_error() is defined in lber.h.&nbsp; The function in the =
code is=20
ber_error_print.<BR>+++++++++++++++++++++++++++++++++++++++++++++++++++++++=
</DIV>
<DIV>&nbsp;</DIV>
<DIV>The following is a brief description of the changes:</DIV>
<DIV>&nbsp;</DIV>
<DIV>The header file libldap.h declares functions with the form</DIV>
<DIV>&nbsp;</DIV>
<DIV>LIBLDAP_F( char *)<BR>ldap_err2string LDAP_P((<BR>&nbsp;&nbsp;&nbsp;&n=
bsp;=20
int err ));</DIV>
<DIV>&nbsp;</DIV>
<DIV>But the function in the code is declared as:</DIV>
<DIV>&nbsp;</DIV>
<DIV>char *ldap_errstring( int err)</DIV>
<DIV>&nbsp;</DIV>
<DIV>where it should be </DIV>
<DIV>&nbsp;</DIV>
<DIV>LIBLDAP_F(char *)<BR>ldap_errstring( int err)</DIV>
<DIV>&nbsp;</DIV>
<DIV>I seemed to me that only externally visible functions<BR>should be =
declared=20
in this way in libldap and liblber.<BR>If I am wrong, slap my hand.</DIV>
<DIV>&nbsp;</DIV>
<DIV>This patch fixes all functions in the declared in the<BR>external =
headers=20
ldap.h and lber.h.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I also created a new macro LIBLBER_V for variables</DIV>
<DIV>which may need a slightly different syntax than functions.</DIV>
<DIV>Currently the only external variables are in liblber.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I removed the LIBLDAP_F and LIBLBER_F from the headers<BR>ldap-int.h =
and=20
lber-int.h and left the actual functions<BR>unchanged.</DIV>
<DIV>&nbsp;</DIV>
<DIV>The code also has the benefical side effect for win32 that<BR>applicat=
ions=20
compiling with the headers get their ldap calls<BR>compiled with the =
calling=20
convention that the library is built<BR>with.</DIV>
<DIV>&nbsp;</DIV>
<DIV>-Steve Sonntag<BR></DIV>
<DIV>-Alan Clark</DIV>
<DIV>Manager</DIV>
<DIV>Novell Directory Services</DIV></BODY></HTML>

--=_D58DDE5D.9FFE5600--