1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-08 05:57:51 +03:00

7 Commits

Author SHA1 Message Date
Andrew Tridgell
ec32b22ed5 r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the
large commit. I thought this was worthwhile to get done for
consistency.
2007-10-10 13:09:15 -05:00
Andrew Tridgell
814881f0e5 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;
}
2007-10-10 12:59:39 -05:00
Andrew Tridgell
8d879cf54c r2776: if there are no wildcard characters then use StrCaseCmp()
note that this is not just an optimisation, it fixes a rare edge case
when LANMAN1 is negotiated
2007-10-10 12:59:32 -05:00
Andrew Tridgell
bae2baeb02 r2775: rewrote our ms_fnmatch code to be much more efficient, and to exactly
match w2k behaviour for older negotiated protocols.
2007-10-10 12:59:32 -05:00
Andrew Tridgell
e227ac1edf r2400: make ms_fnmatch() case insensitive. This is much more efficient than
uppercasing the two whole strings before the call is made, is less
error-prone, and also copes with strings where the upper case version
is longer than the lower case version due to different multi-byte lengths.
2007-10-10 12:58:48 -05:00
Jeremy Allison
fb7a529c4c r2212: Optimisation. Passes masktest against W2K3.
Jeremy.
2007-10-10 12:58:32 -05:00
Andrew Tridgell
b0510b5428 first public release of samba4 code -