1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

21 Commits

Author SHA1 Message Date
Andrew Tridgell
759da3b915 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.
(This used to be commit ec32b22ed5)
2007-10-10 13:09:15 -05:00
Andrew Tridgell
26c6b4c70b r3449: more include file reduction
the ldb part isn't ideal, I will have to think of a better solution
(This used to be commit 6b1f86aea8)
2007-10-10 13:05:13 -05:00
Andrew Tridgell
173ec86fc0 r2902: make toupper_w() and tolower_w() slightly faster by putting the most common
conditions first
(This used to be commit 878f6b565f)
2007-10-10 12:59:46 -05:00
Andrew Tridgell
51009f7052 r2901: if we can't load upcase.dat or lowcase.dat then don't waste 256k
making fake tables, instead just do the approximate upper/lower inline
with toupper() and tolower().
(This used to be commit 994392d085)
2007-10-10 12:59:46 -05:00
Andrew Tridgell
7b7619e0ba r2871: - got rid of the last bits of non-threadsafe data in util_str.o
- switch the fallback case tables to use talloc

- moved the used-once octal_string() inline in loadparm.c
(This used to be commit b04202eaac)
2007-10-10 12:59:40 -05:00
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
Andrew Tridgell
525a993469 r2644: removed an unused function
(This used to be commit bc779cb2ce)
2007-10-10 12:59:16 -05:00
Andrew Tridgell
17cb5517f8 r2639: we doon't need the valid_table code, so get rid of it
(This used to be commit 480636ebbc)
2007-10-10 12:59:15 -05:00
Andrew Tridgell
6310f40448 r2634: use discard_const_p() in a few places
(This used to be commit 56ecda2178)
2007-10-10 12:59:14 -05:00
Andrew Tridgell
48c97988ca r2631: the strchr family of functions should not return const strings.
(This used to be commit 2a7e5f0708)
2007-10-10 12:59:14 -05:00
Andrew Bartlett
9a9dcc7250 r2552: Character set conversion and string handling updates.
The intial motivation for this commit was to merge in some of the
bugfixes present in Samba3's chrcnv and string handling code into
Samba4.  However, along the way I found a lot of unused functions, and
decided to do a bit more...

The strlen_m code now does not use a fixed buffer, but more work is
needed to finish off other functions in str_util.c.  These fixed
length buffers hav caused very nasty, hard to chase down bugs at some
sites.

The strupper_m() function has a strupper_talloc() to replace it (we
need to go around and fix more uses, but it's a start).  Use of these
new functions will avoid bugs where the upper or lowercase version of
a string is a different length.

I have removed the push_*_allocate functions, which are replaced by
calls to push_*_talloc.  Likewise, pstring and other 'fixed length'
wrappers are removed, where possible.

I have removed the first ('base pointer') argument, used by push_ucs2,
as the Samba4 way of doing things ensures that this is always on an
even boundary anyway.  (It was used in only one place, in any case).
(This used to be commit dfecb01506)
2007-10-10 12:59:05 -05:00
Andrew Tridgell
f25681b120 r2402: to make ms_fnmatch() case-insensitive we need toupper_w() exposed
(This used to be commit 69413bdcfc)
2007-10-10 12:58:48 -05:00
Andrew Tridgell
31c1c7846f r2159: converted samba4 over to UTF-16.
I had previously thought this was unnecessary, as windows doesn't use
standards compliant UTF-16, and for filesystem operations treats bytes
as UCS-2, but Bjoern Jacke has pointed out to me that this means we
don't correctly store extended UTF-16 characters as UTF-8 on
disk. This can be seen with (for example) the gothic characters with
codepoints above 64k.

This commit also adds a LOCAL-ICONV torture test that tests the first
1 million codepoints against the system iconv library, and tests 5
million random UTF-16LE buffers for identical error handling to the
system iconv library.

the lib/iconv.c changes need backporting to samba3
(This used to be commit 756f28ac95)
2007-10-10 12:58:27 -05:00
Andrew Tridgell
b83ba93eae r1983: a completely new implementation of talloc
This version does the following:

  1) talloc_free(), talloc_realloc() and talloc_steal() lose their
     (redundent) first arguments

  2) you can use _any_ talloc pointer as a talloc context to allocate
     more memory. This allows you to create complex data structures
     where the top level structure is the logical parent of the next
     level down, and those are the parents of the level below
     that. Then destroy either the lot with a single talloc_free() or
     destroy any sub-part with a talloc_free() of that part

  3) you can name any pointer. Use talloc_named() which is just like
     talloc() but takes the printf style name argument as well as the
     parent context and the size.

The whole thing ends up being a very simple piece of code, although
some of the pointer walking gets hairy.

So far, I'm just using the new talloc() like the old one. The next
step is to actually take advantage of the new interface
properly. Expect some new commits soon that simplify some common
coding styles in samba4 by using the new talloc().
(This used to be commit e35bb094c5)
2007-10-10 12:58:14 -05:00
Stefan Metzmacher
fcd718c7d8 r890: convert samba4 to use [u]int8_t instead of [u]int8
metze
(This used to be commit 2986c5f08c)
2007-10-10 12:56:16 -05:00
Andrew Tridgell
f7a7192eff r827: remove a few more unused functions that we are unlikely to use again
(This used to be commit 121dd9ba00)
2007-10-10 12:53:53 -05:00
Andrew Tridgell
7602aa50fd * got rid of UNISTR2 and everything that depends on it
* removed a bunch of code that needs to be rewritten using the new
    interfaces
(This used to be commit 9b02b486ef)
2003-12-01 00:17:30 +00:00
Andrew Tridgell
fa062af11a * removed a bunch of unused code
* made some functions static
(This used to be commit 829b87f30d)
2003-11-30 23:40:04 +00:00
Andrew Tridgell
d47d14f2ff reduced the number of magic types we need in mkproto.pl
In general I prefer "struct foo" to just "foo" for most
structures. There are exceptions.
(This used to be commit 04eb12b56c)
2003-11-23 01:53:54 +00:00
Andrew Tridgell
de10237719 more fixes from the IRIX compiler (thanks herb!)
(This used to be commit 02d068ba7d)
2003-08-15 18:54:44 +00:00
Andrew Tridgell
ef2e26c91b first public release of samba4 code
(This used to be commit b0510b5428)
2003-08-13 01:53:07 +00:00