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

LDAP C API: Data Types and Legacy Implementations



I support the addition of ber_len_t and ber_tag_t types as it
does allow source and binary compatibility to be maintained
between existing applications and implementations of this API
specification.  However, I believe much more can and should
be done in this area.

Another legacy compatibility issue is the use of 'int' in
ber_printf boolean, enum, and integer arguments and 'int *' in
ber_scanf boolean, enum, and integer arguments.   Many legacy
implementations currently use 'long' and 'long *', respectifully.
Changing these implementations to comply with the specification
would cause significant source and binary compatibility problems.
Due to the vararg prototypes of ber_printf/ber_scanf, mismatched
types would not be detected in most C environments.  (Secondly,
the currently required 'long' to 'int' may be non-trivial
change to existing implementations).  

To provide a mechanism which allows implementors to provide
compatibility with existing applications, I suggest that a
new type be introduced:

        typedef impl-specific-int ber_int_t; /* at least 32-bits */

This type would be would be used for booleans, enums,
and integers values passed to ber_printf and, by pointer, from
ber_scanf.

This change would have minimal impact upon API implementors as
they may simply select the currently used type when defining
this typedef and allow implementors to provide source and
binary compatibility with existing applications.

	Kurt