summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale/collate.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary inclusion of <rune.h> to make it obvious that this filetjr2002-10-291-1/+0
| | | | does not use the deprecated rune system.
* Use ntohl() to read cnains number in new formatache2002-08-311-2/+4
|
* Style fixache2002-08-301-3/+3
|
* Prepare for switching to unlimited chains format.ache2002-08-301-20/+43
| | | | Optimize chains lookup a bit.
* Reduce BSS size for programs which not load collate by eliminatingache2002-08-131-10/+10
| | | | static buffer.
* Now malloc() is fixed, remove errno hardcoding to ENOMEMache2002-08-121-3/+6
|
* Rewrite locale loading procedures, so any load failure will not affectache2002-08-081-39/+87
| | | | | | | | currently cached data. It allows a number of nice things, like: removing fallback code from single locale loading, remove memory leak when LC_CTYPE data loaded again and again, efficient cache use, not only for setlocale(locale1); setlocale(locale1), but for setlocale(locale1); setlocale("C"); setlocale(locale1) too (i.e. data file loaded only once).
* Style fixes in preparation for rewrittingache2002-08-071-15/+15
|
* Do not use __progname directly (except in [gs]etprogname(3)).markm2002-03-291-2/+3
| | | | | | Also, make an internal _getprogname() that is used only inside libc. For libc, getprogname(3) is a weak symbol in case a function of the same name is defined in userland.
* Fix the style of the SCM ID's.obrien2002-03-221-2/+3
| | | | I believe have made all of libc .c's as consistent as possible.
* Remove _THREAD_SAFE and make libc thread-safe by default bydeischen2001-01-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in. Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo. Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible. Remove uneeded includes of <errno.h> from a few files. Add $FreeBSD$ to a few files in order to pass commitprep. Approved by: -arch
* Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),jasone2000-01-271-6/+6
| | | | | | | | | | | | | | | | | just use _foo() <-- foo(). In the case of a libpthread that doesn't do call conversion (such as linuxthreads and our upcoming libpthread), this is adequate. In the case of libc_r, we still need three names, which are now _thread_sys_foo() <-- _foo() <-- foo(). Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(), nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo(). Remove all internal libc usage of: creat(), pause(), sleep(), system(), tcdrain(), wait(), and waitpid(). Make thread cancellation fully POSIX-compliant. Suggested by: deischen
* Add three-tier symbol naming in support of POSIX thread cancellationjasone2000-01-121-6/+6
| | | | | | points. For library functions, the pattern is __sleep() <-- _libc_sleep() <-- sleep(). The arrows represent weak aliases. For system calls, the pattern is _read() <-- _libc_read() <-- read().
* __collate_substitute() do something non-trivial only for German. For everyonedt1999-09-121-2/+13
| | | | | | | | else, it is equivalent to strdup(). So, we will check if the substitution tables are trivial at the load time, and possibly save 2 calls to __collate_substitute() in strcoll(). Still, __collate_substitute() should not exist.
* Reduce time of __collate_substitute() from O(strlen(s)^2) to O(strlen(s)).dt1999-09-121-8/+11
| | | | | | | | Other minor optimizations. I got ~30% speedup in strcoll() for 50 char strings, ~40% speedup for 100 char strings, and unmeasurable speedup for 1M strings. Collates are still terribly slow. To make them reasonable fast, __collate_substitute() should be killed.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Replace memory leaking instances of realloc with non-leaking reallocf.imp1998-09-161-2/+2
| | | | | | | | | | | In some cases replace if (a == null) a = malloc(x); else a = realloc(a, x); with simple reallocf(a, x). Per ANSI-C, this is guaranteed to be the same thing. I've been running these on my system here w/o ill effects for some time. However, the CTM-express is at part 6 of 34 for the CAM changes, so I've not been able to do a build world with the CAM in the tree with these changes. Shouldn't impact anything, but...
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Use symbolic constants instead of hardcoded digitsache1997-02-061-1/+1
| | | | | | | | Add range check for setrunelocale since it can be called directly. Remove _startup_setlocale compatibility function Should go into 2.2
* Update the comment why range checking not neededache1997-02-051-1/+1
| | | | | | | Fix setrunelocale fail if called directly without prior setlocale call Should go in 2.2
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Add comment that range checking is already done at upper levelache1996-12-281-3/+6
| | | | | | Kill snprintf left in collate.c from previous backout Should go in 2.2
* Fix yet another buffer overflow. :-(joerg1996-12-161-5/+3
| | | | | | | | Vulnerable: all programs that use setlocale(LC_COLLATE), setlocale(LC_CTYPE), or setlocale(LC_ALL). The only setuid/setgid binary i've found for this is w(1). Should go into 2.2.
* PATH_LOCALE: use this non-standard env variable first time only, i.e.ache1996-11-261-4/+6
| | | | | | | | | | | | | | | | strdup() it to prevent unsetenv() or setenv() effects. Check its length to not allow user to overflow internal locale buffer. Move PATH_LOCALE handling code into one place. POSIX: make better stub for LC_MONETARY & LC_NUMERIC, now it check locale directory existance instead of refusing all non-C non-POSIX locales. POSIX treats empty locale env variable as unset variable while our old code treats it as "C" locale, fix it. Implement previous locale restoring, if locale setting fails. Old code assumes success if some of LC_ALL subset is successed even other fails, POSIX treats it as failure with previous locale restoring, fix it. Remove unneccessary length checking in currentlocale()
* Simplify debug outputache1996-10-231-1/+2
| | | | Simplify collate_range_cmp for ASCII-compatible collate we have now
* Save half of space in LC_COLLATE and remove unneded code.ache1996-10-151-28/+7
| | | | | | This change is not compatible with previous variant, however proper error code returned in both cases. Colldef changes will follows.
* Don't use __dead or __pure in user code. They were obfuscationsbde1996-09-141-3/+4
| | | | | | for gcc >= 2.5 and no-ops for gcc >= 2.6. Converted to use __dead2 or __pure2 where it wasn't already done, except in math.h where use of __pure was mostly wrong.
* Optimize PathLocale handling.ache1995-10-231-7/+15
| | | | | Handle C/POSIX/"" properly. Don't reset collate to C when it is unnecessary
* Remove trailing whitespace.rgrimes1995-05-301-2/+2
|
* Minor optimizationache1995-02-181-7/+4
|
* Don't pick _warn module nowache1995-02-171-10/+34
|
* Add 8-bit collate stuffache1995-02-161-0/+184
Submitted by: alex@elvisti.kiev.ua
OpenPOWER on IntegriCloud