Lines Matching defs:mbstring

69  * mbstring into a wide character string wcstring. No more than
78 smb_mbstowcs(smb_wchar_t *wcstring, const char *mbstring, size_t nwchars)
84 len = smb_mbtowc(wcstring, mbstring, MTS_MB_CHAR_MAX);
90 if (*mbstring == 0)
94 mbstring += len;
202 * into a multibyte character string mbstring. Up to nbytes bytes are
203 * stored in mbstring. Partial multibyte characters at the end of the
211 smb_wcstombs(char *mbstring, const smb_wchar_t *wcstring, size_t nbytes)
213 char *start = mbstring;
219 if ((mbstring == NULL) || (wcstring == NULL))
224 len = smb_wctomb(mbstring, wide_char);
228 return (mbstring - start);
230 mbstring += len;
237 *mbstring = 0;
241 bcopy(buf, mbstring, len);
242 mbstring += len;
247 return (mbstring - start);
309 * null terminated multi-byte string 'mbstring'. Only full converted
310 * UTF-8 characters will be written 'mbstring'. If a character will not
311 * fit within the remaining buffer space or 'mbstring' will overflow
312 * max_mblen, the conversion process will be terminated and 'mbstring'
315 * Returns the number of bytes written to 'mbstring', excluding the
318 * If either mbstring or string is a null pointer, -1 is returned.
321 smb_stombs(char *mbstring, char *string, int max_mblen)
323 char *start = mbstring;
330 if (!mbstring || !string)
335 len = smb_wctomb(mbstring, wide_char);
336 mbstring += len;
343 *mbstring = *buf;
344 mbstring += len;
349 *mbstring = '\0';
352 return (mbstring - start);
359 * Convert a null terminated multi-byte string 'mbstring' to a regular
360 * null terminated string 'string'. A 1-byte character in 'mbstring'
362 * 'mbstring' will be mapped to 2-bytes, if the upper byte is non-null.
370 * If either mbstring or string is a null pointer, -1 is returned.
373 smb_mbstos(char *string, const char *mbstring)
379 if (string == NULL || mbstring == NULL)
382 while (*mbstring) {
383 if ((len = smb_mbtowc(&wc, mbstring, MTS_MB_CHAR_MAX)) < 0) {
399 mbstring += len;