#include <ac/stdarg.h>
#include "lber-int.h"
+char ber_pvt_opt_on; /* used to get a non-NULL address for *_OPT_ON */
+
struct lber_options ber_int_options = {
- LBER_UNINITIALIZED, 0, 0 };
+ LBER_UNINITIALIZED, 0, 0, 0 };
int
ber_get_option(
*((ber_len_t *) outvalue) = ber_pvt_ber_write(ber);
return LBER_OPT_SUCCESS;
+ case LBER_OPT_BER_MEMCTX:
+ assert( LBER_VALID( ber ) );
+ *((void **) outvalue) = ber->ber_memctx;
+ return LBER_OPT_SUCCESS;
+
default:
/* bad param */
ber_errno = LBER_ERROR_PARAM;
}
ber_int_memory_fns = (BerMemoryFunctions *)
- (*(f->bmf_malloc))(sizeof(BerMemoryFunctions));
+ (*(f->bmf_malloc))(sizeof(BerMemoryFunctions), NULL);
if ( ber_int_memory_fns == NULL ) {
ber_errno = LBER_ERROR_MEMORY;
ber->ber_ptr = &ber->ber_buf[* (const ber_len_t *) invalue];
return LBER_OPT_SUCCESS;
+ case LBER_OPT_BER_MEMCTX:
+ assert( LBER_VALID( ber ) );
+ ber->ber_memctx = *(void **)invalue;
+ return LBER_OPT_SUCCESS;
+
default:
/* bad param */
ber_errno = LBER_ERROR_PARAM;