Sockbuf * ber_sockbuf_alloc( void ) { Sockbuf *sb; sb = LBER_CALLOC( 1, sizeof( Sockbuf ) ); if( sb == NULL ) return NULL; ber_int_sb_init( sb ); return sb; }
Sockbuf * ber_sockbuf_alloc( void ) { Sockbuf *sb; ber_int_options.lbo_valid = LBER_INITIALIZED; sb = LBER_CALLOC( 1, sizeof( Sockbuf ) ); if( sb == NULL ) return NULL; ber_int_sb_init( sb ); return sb; }
int ber_int_sb_destroy( Sockbuf *sb ) { Sockbuf_IO_Desc *p; assert( sb != NULL); assert( SOCKBUF_VALID( sb ) ); while ( sb->sb_iod ) { p = sb->sb_iod->sbiod_next; ber_sockbuf_remove_io( sb, sb->sb_iod->sbiod_io, sb->sb_iod->sbiod_level ); sb->sb_iod = p; } return ber_int_sb_init( sb ); }