return the number of bytes occupied by the CH_UNIX character, or
-1 on failure
*/
-_PUBLIC_ ssize_t push_codepoint(struct smb_iconv_convenience *ic,
+_PUBLIC_ ssize_t push_codepoint_convenience(struct smb_iconv_convenience *ic,
char *str, codepoint_t c)
{
smb_iconv_t descriptor;
}
return 5 - olen;
}
+
+
extern struct smb_iconv_convenience *global_iconv_convenience;
codepoint_t next_codepoint(const char *str, size_t *size);
+ssize_t push_codepoint(char *str, codepoint_t c);
/* codepoints */
codepoint_t next_codepoint_convenience(struct smb_iconv_convenience *ic,
const char *str, size_t *size);
-ssize_t push_codepoint(struct smb_iconv_convenience *ic,
+ssize_t push_codepoint_convenience(struct smb_iconv_convenience *ic,
char *str, codepoint_t c);
codepoint_t toupper_m(codepoint_t val);
codepoint_t tolower_m(codepoint_t val);
size_t size, size2;
codepoint_t c;
- size = push_codepoint(lp_iconv_convenience(tctx->lp_ctx), (char *)buf, codepoint);
+ size = push_codepoint_convenience(lp_iconv_convenience(tctx->lp_ctx), (char *)buf, codepoint);
torture_assert(tctx, size != -1 || (codepoint >= 0xd800 && codepoint <= 0x10000),
"Invalid Codepoint range");
c = tolower_m(c);
- c_size = push_codepoint(iconv_convenience, dest+size, c);
+ c_size = push_codepoint_convenience(iconv_convenience, dest+size, c);
if (c_size == -1) {
talloc_free(dest);
return NULL;
c = toupper_m(c);
- c_size = push_codepoint(iconv_convenience, dest+size, c);
+ c_size = push_codepoint_convenience(iconv_convenience, dest+size, c);
if (c_size == -1) {
talloc_free(dest);
return NULL;
while (*s) {
size_t c_size, c_size2;
codepoint_t c = next_codepoint_convenience(iconv_convenience, s, &c_size);
- c_size2 = push_codepoint(iconv_convenience, d, tolower_m(c));
+ c_size2 = push_codepoint_convenience(iconv_convenience, d, tolower_m(c));
if (c_size2 > c_size) {
DEBUG(0,("FATAL: codepoint 0x%x (0x%x) expanded from %d to %d bytes in strlower_m\n",
c, tolower_m(c), (int)c_size, (int)c_size2));
while (*s) {
size_t c_size, c_size2;
codepoint_t c = next_codepoint_convenience(iconv_convenience, s, &c_size);
- c_size2 = push_codepoint(iconv_convenience, d, toupper_m(c));
+ c_size2 = push_codepoint_convenience(iconv_convenience, d, toupper_m(c));
if (c_size2 > c_size) {
DEBUG(0,("FATAL: codepoint 0x%x (0x%x) expanded from %d to %d bytes in strupper_m\n",
c, toupper_m(c), (int)c_size, (int)c_size2));
{
return next_codepoint_convenience(get_iconv_convenience(), str, size);
}
+
+_PUBLIC_ ssize_t push_codepoint(char *str, codepoint_t c)
+{
+ return push_codepoint(get_iconv_convenience(), str, c);
+}