1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/source4/smbd
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
..
build_options.c r890: convert samba4 to use [u]int8_t instead of [u]int8 2007-10-10 12:56:16 -05:00
config.m4 r2321: add complately untested LDAP server start 2007-10-10 12:58:43 -05:00
config.mk r2321: add complately untested LDAP server start 2007-10-10 12:58:43 -05:00
process_model.c r1486: commit the start of the generic server infastructure 2007-10-10 12:57:35 -05:00
process_model.h r1486: commit the start of the generic server infastructure 2007-10-10 12:57:35 -05:00
process_model.m4 r869: convert SUBSYSTEM PROCESS_MODEL to a *.mk file 2007-10-10 12:56:14 -05:00
process_model.mk r869: convert SUBSYSTEM PROCESS_MODEL to a *.mk file 2007-10-10 12:56:14 -05:00
process_single.c r2648: - use a destructor on struct server_connection to simplify the 2007-10-10 12:59:16 -05:00
process_standard.c r2723: fix some debug messages 2007-10-10 12:59:26 -05:00
process_thread.c r2648: - use a destructor on struct server_connection to simplify the 2007-10-10 12:59:16 -05:00
rewrite.c r2512: Remove unused stub functions. 2007-10-10 12:59:00 -05:00
server.c 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
server.h r2646: - use a talloc destructor to ensure that sockets from the new socket 2007-10-10 12:59:16 -05:00
service.c r2648: - use a destructor on struct server_connection to simplify the 2007-10-10 12:59:16 -05:00
service.h r2646: - use a talloc destructor to ensure that sockets from the new socket 2007-10-10 12:59:16 -05:00