2 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 struct lber_options ber_int_options = {
12 LBER_UNINITIALIZED, 0, 0 };
23 ber_int_options.lbo_valid = LBER_INITIALIZED;
25 if(outvalue == NULL) {
26 /* no place to get to */
27 return LBER_OPT_ERROR;
31 if(option == LBER_OPT_BER_DEBUG) {
32 * (int *) outvalue = ber_int_debug;
33 return LBER_OPT_SUCCESS;
36 return LBER_OPT_ERROR;
39 ber = (BerElement *) item;
40 sb = (Sockbuf *) item;
43 case LBER_OPT_BER_OPTIONS:
44 assert( BER_VALID( ber ) );
45 * (int *) outvalue = ber->ber_options;
46 return LBER_OPT_SUCCESS;
48 case LBER_OPT_BER_DEBUG:
49 assert( BER_VALID( ber ) );
50 * (int *) outvalue = ber->ber_debug;
51 return LBER_OPT_SUCCESS;
58 return LBER_OPT_ERROR;
65 LDAP_CONST void *invalue)
70 if( (ber_int_options.lbo_valid == LBER_UNINITIALIZED)
71 && ( option == LBER_OPT_MEMORY_FN )
72 && ( invalue != NULL ))
74 ber_int_realloc = (BER_MEMORY_FN) invalue;
75 ber_int_options.lbo_valid = LBER_INITIALIZED;
76 return LBER_OPT_SUCCESS;
79 ber_int_options.lbo_valid = LBER_INITIALIZED;
82 /* no place to set from */
83 return LBER_OPT_ERROR;
87 if(option == LBER_OPT_BER_DEBUG) {
88 ber_int_debug = * (int *) invalue;
89 return LBER_OPT_SUCCESS;
91 } else if(option == LBER_OPT_LOG_PRINT_FN) {
92 ber_pvt_log_print = (BER_LOG_PRINT_FN) invalue;
93 return LBER_OPT_SUCCESS;
96 return LBER_OPT_ERROR;
99 ber = (BerElement *) item;
100 sb = (Sockbuf *) item;
103 case LBER_OPT_BER_OPTIONS:
104 assert( BER_VALID( ber ) );
105 ber->ber_options = * (int *) invalue;
106 return LBER_OPT_SUCCESS;
108 case LBER_OPT_BER_DEBUG:
109 assert( BER_VALID( ber ) );
110 ber->ber_debug = * (int *) invalue;
111 return LBER_OPT_SUCCESS;
118 return LBER_OPT_ERROR;