]> git.sur5r.net Git - openldap/blobdiff - libraries/liblber/options.c
Deal with sb_trans_needs_read and sb_trans_needs_write
[openldap] / libraries / liblber / options.c
index a323bbee963504ddbb8a36b8ed972748fd6cfc11..160aac597dcc58c2cf4ebe3b4bfc6ad0401e222f 100644 (file)
@@ -4,9 +4,12 @@
  */
 #include "portable.h"
 
-#include <stdlib.h>
+#include <ac/stdlib.h>
 #include <ac/string.h>
 
+#undef LDAP_F_PRE
+#define LDAP_F_PRE LDAP_F_EXPORT
+
 #include "lber-int.h"
 
 struct lber_options ber_int_options = {
@@ -73,7 +76,8 @@ ber_set_option(
                && ( option == LBER_OPT_MEMORY_FNS )
                && ( invalue != NULL ))
        {
-               BerMemoryFunctions *f = (BerMemoryFunctions *) invalue;
+               const BerMemoryFunctions *f =
+                       (const BerMemoryFunctions *) invalue;
 
                /* make sure all functions are provided */
                if(!( f->bmf_malloc && f->bmf_calloc
@@ -104,7 +108,7 @@ ber_set_option(
 
        if(item == NULL) {
                if(option == LBER_OPT_BER_DEBUG) {
-                       ber_int_debug = * (int *) invalue;
+                       ber_int_debug = * (const int *) invalue;
                        return LBER_OPT_SUCCESS;
 
                } else if(option == LBER_OPT_LOG_PRINT_FN) {
@@ -121,12 +125,12 @@ ber_set_option(
        switch(option) {
        case LBER_OPT_BER_OPTIONS:
                assert( BER_VALID( ber ) );
-               ber->ber_options = * (int *) invalue;
+               ber->ber_options = * (const int *) invalue;
                return LBER_OPT_SUCCESS;
 
        case LBER_OPT_BER_DEBUG:
                assert( BER_VALID( ber ) );
-               ber->ber_debug = * (int *) invalue;
+               ber->ber_debug = * (const int *) invalue;
                return LBER_OPT_SUCCESS;
 
        default: