void mbfl_filt_conv_html_dec_dtor(mbfl_convert_filter *filter) { filter->status = 0; if (filter->opaque) { mbfl_free((void*)filter->opaque); } filter->opaque = NULL; }
void mbfl_identify_filter_delete(mbfl_identify_filter *filter) { if (filter == NULL) { return; } mbfl_identify_filter_cleanup(filter); mbfl_free((void*)filter); }
void mbfl_memory_device_clear(mbfl_memory_device *device) { if (device) { if (device->buffer) { mbfl_free(device->buffer); } device->buffer = (unsigned char *)0; device->length = 0; device->pos = 0; } }
void mbfl_wchar_device_clear(mbfl_wchar_device *device) { if (device) { if (device->buffer) { mbfl_free(device->buffer); } device->buffer = (unsigned int*)0; device->length = 0; device->pos = 0; } }
mbfl_identify_filter *mbfl_identify_filter_new2(const mbfl_encoding *encoding) { mbfl_identify_filter *filter; /* allocate */ filter = (mbfl_identify_filter *)mbfl_malloc(sizeof(mbfl_identify_filter)); if (filter == NULL) { return NULL; } if (mbfl_identify_filter_init2(filter, encoding)) { mbfl_free(filter); return NULL; } return filter; }
mbfl_identify_filter *mbfl_identify_filter_new(enum mbfl_no_encoding encoding) { mbfl_identify_filter *filter; /* allocate */ filter = (mbfl_identify_filter *)mbfl_malloc(sizeof(mbfl_identify_filter)); if (filter == NULL) { return NULL; } if (mbfl_identify_filter_init(filter, encoding)) { mbfl_free(filter); return NULL; } return filter; }