convert_charset

March 26, 2020 Contributors

Name

convert_charset

Synopsis

#include "hooks/sieve/convert_charset.h"

| int **convert_charset** ( | closure, |   |
|   | srccharset, |   |
|   | destcharset, |   |
|   | inbuf, |   |
|   | inbytesleft, |   |
|   | outbuf, |   |
|   | outbytesleft); |   |

void * <var class="pdparam">closure</var>;
const char * <var class="pdparam">srccharset</var>;
const char * <var class="pdparam">destcharset</var>;
char ** <var class="pdparam">inbuf</var>;
size_t * <var class="pdparam">inbytesleft</var>;
char ** <var class="pdparam">outbuf</var>;
size_t * <var class="pdparam">outbytesleft</var>;

| int **has_sieve_convert_charset_hook** ( | ); |   |

| void **register_sieve_convert_charset_hook_first** ( | hook, |   |
|   | closure); |   |

ec_hook_sieve_convert_charset_func_t <var class="pdparam">hook</var>;
void *<var class="pdparam">closure</var>;

| void **register_sieve_convert_charset_hook_last** ( | hook, |   |
|   | closure); |   |

ec_hook_sieve_convert_charset_func_t <var class="pdparam">hook</var>;
void *<var class="pdparam">closure</var>;

| int **call_sieve_convert_charset_hook** ( | srccharset, |   |
|   | destcharset, |   |
|   | inbuf, |   |
|   | inbytesleft, |   |
|   | outbuf, |   |
|   | outbytesleft); |   |

const char * <var class="pdparam">srccharset</var>;
const char * <var class="pdparam">destcharset</var>;
char ** <var class="pdparam">inbuf</var>;
size_t * <var class="pdparam">inbytesleft</var>;
char ** <var class="pdparam">outbuf</var>;
size_t * <var class="pdparam">outbytesleft</var>;

Description

Parameters:

closure

the implementation specific closure, this is not needed for the hook’s caller

srccharset

the source character set

destcharset

the destination chaaracter set

inbuf

the buffer containing data to be converted

inbytesleft

the length of the inbuf

outbuf

the buffer containing converted data after the conversion takes place

outbytesleft

space remaining in the output buffer for conversion

Called on the conversion of one character set to another. Return the number of bytes successfully converted.