1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
samba-mirror/source4/libcli
Andrew Tridgell 7d32679e96 r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots of associated functions.
The motivation for this change was to avoid having to convert to/from
ucs2 strings for so many operations. Doing that was slow, used many
static buffers, and was also incorrect as it didn't cope properly with
unicode codepoints above 65536 (which could not be represented
correctly as smb_ucs2_t chars)

The two core functions that allowed this change are next_codepoint()
and push_codepoint(). These functions allow you to correctly walk a
arbitrary multi-byte string a character at a time without converting
the whole string to ucs2.

While doing this cleanup I also fixed several ucs2 string handling
bugs. See the commit for details.

The following code (which counts the number of occuraces of 'c' in a
string) shows how to use the new interface:

size_t count_chars(const char *s, char c)
{
	size_t count = 0;

	while (*s) {
		size_t size;
		codepoint_t c2 = next_codepoint(s, &size);
		if (c2 == c) count++;
		s += size;
	}

	return count;
}
(This used to be commit 814881f0e5)
2007-10-10 12:59:39 -05:00
..
auth r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots of associated functions. 2007-10-10 12:59:39 -05:00
ldap r2853: add torture test to find the defaultNamingContext on the RootDSE 2007-10-10 12:59:38 -05:00
raw r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots of associated functions. 2007-10-10 12:59:39 -05:00
util r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots of associated functions. 2007-10-10 12:59:39 -05:00
cliconnect.c r2710: continue with the new style of providing a parent context whenever 2007-10-10 12:59:25 -05:00
clideltree.c r1654: rename cli_ -> smbcli_ 2007-10-10 12:57:47 -05:00
clidfs.c r2710: continue with the new style of providing a parent context whenever 2007-10-10 12:59:25 -05:00
clifile.c r2405: expose unix_perms_to_wire() for use by the posix backend, in supporting the UNIX extensions 2007-10-10 12:58:49 -05:00
clilist.c r2787: force masktest to use RAW_SEARCH_BOTH_DIRECTORY_INFO so it can obtain the short name 2007-10-10 12:59:33 -05:00
climessage.c r1654: rename cli_ -> smbcli_ 2007-10-10 12:57:47 -05:00
clireadwrite.c r2101: fixed a signed/unsigned char warning 2007-10-10 12:58:25 -05:00
clitrans2.c r1654: rename cli_ -> smbcli_ 2007-10-10 12:57:47 -05:00
config.m4 r1449: Use the config system somewhat better in libcli/auth 2007-10-10 12:56:57 -05:00
config.mk r1449: Use the config system somewhat better in libcli/auth 2007-10-10 12:56:57 -05:00
libsmb.m4 r2328: add the start of a new system and protocol 2007-10-10 12:58:44 -05:00
namecache.c first public release of samba4 code 2003-08-13 01:53:07 +00:00
namequery_dc.c r1654: rename cli_ -> smbcli_ 2007-10-10 12:57:47 -05:00
namequery.c r2019: fix compiler warnings 2007-10-10 12:58:17 -05:00
nmblib.c r1897: added a choose_called_name() function that allows us to more sanely 2007-10-10 12:58:09 -05:00
unexpected.c r1131: remove an error msg for failing to open unexpected.tdb 2007-10-10 12:56:39 -05:00