mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
lib:charset: Add utility functions reinit_iconv_handle() and free_iconv_handle(void)
Not yet used. Will enable us to make global_iconv_handle private. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
3afbdb7a0e
commit
c28e2c937a
lib/util/charset
@ -170,6 +170,11 @@ struct smb_iconv_handle *get_iconv_testing_handle(TALLOC_CTX *mem_ctx,
|
||||
const char *dos_charset,
|
||||
const char *unix_charset,
|
||||
bool use_builtin_handlers);
|
||||
struct smb_iconv_handle *reinit_iconv_handle(TALLOC_CTX *mem_ctx,
|
||||
const char *dos_charset,
|
||||
const char *unix_charset);
|
||||
void free_iconv_handle(void);
|
||||
|
||||
smb_iconv_t get_conv_handle(struct smb_iconv_handle *ic,
|
||||
charset_t from, charset_t to);
|
||||
const char *charset_name(struct smb_iconv_handle *ic, charset_t ch);
|
||||
|
@ -16521,6 +16521,24 @@ struct smb_iconv_handle *get_iconv_testing_handle(TALLOC_CTX *mem_ctx,
|
||||
dos_charset, unix_charset, use_builtin_handlers, NULL);
|
||||
}
|
||||
|
||||
struct smb_iconv_handle *reinit_iconv_handle(TALLOC_CTX *mem_ctx,
|
||||
const char *dos_charset,
|
||||
const char *unix_charset)
|
||||
{
|
||||
global_iconv_handle =
|
||||
smb_iconv_handle_reinit(mem_ctx,
|
||||
dos_charset,
|
||||
unix_charset,
|
||||
true,
|
||||
global_iconv_handle);
|
||||
return global_iconv_handle;
|
||||
}
|
||||
|
||||
void free_iconv_handle(void)
|
||||
{
|
||||
TALLOC_FREE(global_iconv_handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of a charset to give to iconv().
|
||||
**/
|
||||
|
Loading…
Reference in New Issue
Block a user