Ejemplo n.º 1
0
Archivo: data.c Proyecto: luxuan/tbox
static tb_void_t tb_object_data_exit(tb_object_ref_t object)
{
    tb_object_data_t* data = tb_object_data_cast(object);
    if (data) 
    {
        tb_buffer_exit(&data->buffer);
        tb_free(data);
    }
}
Ejemplo n.º 2
0
/* //////////////////////////////////////////////////////////////////////////////////////
 * main
 */ 
tb_int_t tb_demo_memory_buffer_main(tb_int_t argc, tb_char_t** argv)
{
    tb_buffer_t b;
    tb_buffer_init(&b);

    tb_buffer_memncpy(&b, (tb_byte_t const*)"hello ", 6);
    tb_buffer_memncat(&b, (tb_byte_t const*)"world", 6);
    tb_trace_i("%s", tb_buffer_data(&b));

    tb_buffer_exit(&b);

    return 0;
}
Ejemplo n.º 3
0
tb_void_t tb_filter_exit(tb_filter_ref_t self)
{
    // check
    tb_filter_t* filter = (tb_filter_t*)self;
    tb_assert_and_check_return(filter);
    
    // exit it
    if (filter->exit) filter->exit(filter);

    // exit idata
    tb_buffer_exit(&filter->idata);

    // exit odata
    tb_queue_buffer_exit(&filter->odata);

    // free it
    tb_free(filter);
}
Ejemplo n.º 4
0
Archivo: string.c Proyecto: richwu/tbox
tb_void_t tb_string_exit(tb_string_ref_t string)
{
    if (string) tb_buffer_exit(string);
}