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

Re: omission in draft-ietf-ldapext-ldap-c-api-03.txt section 27.1



Mark Smith writes:
>   The prototype for ber_peek_tag was changed -- 'const' was added in
>   front of the ber parameter to indicate that API implementations
>   are not allowed to alter the contents of the BerElement when
>   executing the peek tag call.

Nitpick:

I think it's unwise to make opaque types 'const' (in ber_flatten and
ber_keep_tag): it makes it harder for the library to do internal
bookkeeping.  Example: The library might want to store huge BerElements
in files.  At the first access, an element's file would be opened and
the file descriptor would be stored in the BerElement.  You can kludge
around this with
    typedef struct berelement {
        struct {
            ...real meat of BerElement...
        } *contents;
    } BerElement;
but I don't think a mere 'const' is worth it.

-- 
Hallvard