Commit Graph

162 Commits

Author SHA1 Message Date
Ruslan Ermilov
588a200ce1 .St -ansiC -> .St -isoC 2001-02-26 13:23:47 +00:00
Alexey Zelkin
41b55591ce Fix visibility of empty variable -- it should be static.
Submitted by:	bde and Hartmut Brandt <brandt@fokus.gmd.de> (via PR)
PR:		bin/25308
2001-02-24 13:13:48 +00:00
Alexey Zelkin
e1467aa917 cleanup commentaries 2001-02-19 19:09:00 +00:00
Andrey A. Chernov
c80a91609d Deal properly with "0" 2001-02-19 06:19:51 +00:00
Andrey A. Chernov
8a8e51d8e8 CRNCYSTR: determine '.' too 2001-02-17 11:15:30 +00:00
Andrey A. Chernov
59dde0d08d Implement CRNCYSTR 2001-02-17 07:35:01 +00:00
Andrey A. Chernov
d6a3432e11 Return {YES,NO}STR from locale
Approved by:	phantom
2001-02-13 23:32:48 +00:00
Alexey Zelkin
39d2c772eb catch up to __part_load_locale() interface change 2001-02-13 15:32:21 +00:00
Alexey Zelkin
fc38c1e548 add additional function parameter: bufsize_min. it's possible
to check two sizes per one function invocation now.

Suggested by: ache
2001-02-13 15:29:39 +00:00
Alexey Zelkin
b161fb0061 Make comparsions more clear (per style(9)) 2001-02-12 08:56:39 +00:00
Alexey Zelkin
ba4a5c925a Assume that "" passed as parameter also means "no grouping"
Make comparsions more clear (per style(9))
2001-02-12 08:55:12 +00:00
Robert Watson
4be19dddae o Fix build of libc broken in revision 1.2. offsetof() requires the
inclusion of stddef.h.

Reviewed by:	peter
2001-02-12 02:44:33 +00:00
Alexey Zelkin
fc19bba6aa Don't use hardcoded struct size, use offsetof() instead (make size calculations
dynamic)
2001-02-11 15:09:31 +00:00
Alexey Zelkin
9040b756dd Don't try to convert grouping strings in case if C or POSIX locale
was explicitly specified.

Submitted by:	ache
2001-02-11 15:07:26 +00:00
Alexey Zelkin
cb03ae3061 make it possible to specify grouping number from range 0..CHAR_MAX,
not only one-digit number
2001-02-10 20:22:45 +00:00
Alexey Zelkin
7d2cc62ba3 Use "namespace.h" and "un-namespace.h"
Requested by:	deischen
2001-02-10 19:57:26 +00:00
Alexey Zelkin
1bd7723d09 . Fix semantics of grouping (LC_MONETARY::mon_grouping,
LC_NUMERIC::grouping) values.
. Always set __XXX_changed flags then loading numeric & monetary locale
  categories to allow localeconv() to use C locale also.
2001-02-10 15:36:46 +00:00
Andrey A. Chernov
ab9577f234 As temporary workaround for missing *grouping fields parser always return "no
grouping" (CHAR_MAX, '\0').
Fixme: grouping parser needs to be implemented.
2001-02-10 04:32:55 +00:00
Andrey A. Chernov
96be743f80 According to Garrett, POSIX widely use -1 to indicate CHAR_MAX, so back out
all my "-1" -> "something" fixes and replace -1 with CHAR_MAX directly in
strtol() in cnv()
2001-02-10 03:31:23 +00:00
Andrey A. Chernov
d2712eafa7 Use __XSTRING(CHAR_MAX) instead of "127" and strtol() base 0 to parse it (0x7f) 2001-02-10 02:00:56 +00:00
Andrey A. Chernov
1506a668dc Correct myself a bit: situation is broken not for _all_ numeric LC_MONETARY,
LC_NUMERIC fields, but only for *grouping fields - other fields are converted
to a chars in localeconv(), so final change is:

"-1" -> "127"

127 here is because CHAR_MAX supposed, which is _positive_ (SUSv2 requirement),
not negative as 255. It is still a bit of hack. To find real CHAR_MAX will be
better to sprintf() it once somewhere in static buffer. *grouping parsing
still broken and missing and needs to be implemented.
2001-02-10 01:38:18 +00:00
Andrey A. Chernov
051f867fe1 NOTE: according to SUSV2 and other implementations, numeric elements in
LC_MONETARY, LC_NUMERIC are byte-arrays, not ASCII strings!

Fix "C" locale, change "-1" to {CHAR_MAX, '\0'} according to standards.

This is only partial fix - locale loading procedure remains broken as before
and load too big values for all locales.  All numeric strings there should be
converted with something like atoi() and placed into bytes.  Maybe I do it
later, if someone will not fix it faster.
2001-02-10 00:43:32 +00:00
Andrey A. Chernov
d0e2083fdd Implement CODESET 2001-02-09 22:43:39 +00:00
Andrey A. Chernov
634c946524 Back out attempt to implement CRNCYSTR - require additional prefixes according
to SUSV2. Add comment explaining it instead.
2001-02-09 18:39:17 +00:00
Andrey A. Chernov
218bcbcb4d Explicitly mark deprecated entries.
Return currency_symbol for CRNCYSTR
Return "%r" for T_FMT_AMPM
Remove obsoleted comment about c_fmt
Return "" for {YES,NO}STR
2001-02-09 18:16:12 +00:00
Alexey Zelkin
747a8b55e8 add lmonetary.?, lnumeric.?, ldpart.?, lmessages.?, nl_langinfo.c
remove lconv.c
2001-02-08 17:13:24 +00:00
Alexey Zelkin
60e1d74ff8 Add SUSv2 compatible nl_langinfo() function. It still need some work, but
this is already usable one.
2001-02-08 17:12:03 +00:00
Alexey Zelkin
e690a5563f Make localeconv() actual function. Now it will use LC_MONETARY/LC_NUMERIC
information to fill return structure. Remove unused anymore stub.
2001-02-08 17:03:01 +00:00
Alexey Zelkin
90423ececf Make FreeBSD locale support complete: add support for rest locale categories
LC_MONETARY, LC_NUMERIC and LC_MESSAGES. Remove stub functions since they
don't need anymore.

Reviewed by:	silence on -i18n
2001-02-08 16:58:53 +00:00
Ruslan Ermilov
d0353b836e mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
Daniel Eischen
d201fe46e3 Remove _THREAD_SAFE and make libc thread-safe by default by
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
2001-01-24 13:01:12 +00:00
Ruslan Ermilov
4263595653 Prepare for mdoc(7)NG. 2000-12-29 14:08:20 +00:00
Ruslan Ermilov
c23155a43a mdoc(7) police: Er macro usage cleanup. 2000-11-22 16:02:00 +00:00
Kris Kennaway
b777873ec1 Disallow '/' characters in LC_* environment variables which might
be used to point to a bad locale file. This is only believed to be a
minor security risk - the only risk is if some program uses the result
of a localized string as a format specifier in a vulnerable function
like sprintf(). No such code is believed to exist in the FreeBSD base
system, although it is possible that badly written third party code
would do that.

Submitted by:	imp
Approved by:	ache
2000-09-08 07:29:48 +00:00
Warner Losh
12b92015dd The comparison against 0 should be against LC_ALL. category isn't a
boolean and it is LC_ALL that's special.

Someone submitted this to me a long time ago, but I can't find the
mail now.
2000-09-04 03:43:24 +00:00
Andrey A. Chernov
6ea9889255 fix comment 2000-07-07 08:24:50 +00:00
Andrey A. Chernov
3bc7ba9057 Describe agrument range correctly, according to multibyte(3)
Remove unneded comment
2000-07-03 13:03:15 +00:00
Andrey A. Chernov
8b96e6c916 Megre XPG4 code into libc 2000-06-03 12:24:08 +00:00
Alexey Zelkin
314c685440 mdoc related fixes:
. synchronize NAME and SYNOPSIS sections
. replace .Ev macros with .Dv / .Er / .Em macros  as mdoc(7)
  specification declare
2000-05-12 10:22:50 +00:00
Alexey Zelkin
25bb73e063 Introduce ".Lb" macro to libc manpages.
More libraries manpages updates following.
2000-04-21 09:42:15 +00:00
Andrey A. Chernov
70c1e1b6d9 Add comment after locales
Use .Li for type

Suggested-by: sheldonh
2000-04-12 18:38:30 +00:00
Andrey A. Chernov
199b1670eb Better wording according to multibyte(3)
Better man formatting
Add reference to multibyte(3)
2000-04-11 14:41:37 +00:00
Andrey A. Chernov
1c0a1964ab Back out valid argument domain change - sneak to this function by error.
Reword test condition better. Previous variant was true for negative
characters too.
2000-03-28 11:46:40 +00:00
Andrey A. Chernov
4c48fdaf53 Describe valid argument domain for 8-bit wide locales to prevent common error
calling ctype functions with signed char as an argument.
2000-03-28 11:36:31 +00:00
David E. O'Brien
f506ed7467 There is a problem in that one cannot use ctype.h at the same time as parts
of the C++ stdlib.  Our ctype.h uses symbols of the form _<X> to denote the
various character classes.  Our ctype.h also extends the usual ctype.h
offering by adding the "_T" (special) class.  Problem is parts of the STL
also use the symbol "_T" as its parameterized type.  These two uses are
incompatible.

Thus change the form of the symbols used in ctype to something that fixes
the current problem and is less likely to cause conflicts in the future.

Requested by:	Tomoaki NISHIYAMA <tomoaki@biol.s.u-tokyo.ac.jp>
Ok'ed by:	JKH
2000-02-08 07:43:26 +00:00
Jason Evans
9233c4d942 Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
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
2000-01-27 23:07:25 +00:00
Sheldon Hearn
99d751fbe3 Although it should be obvious that the 3-digit numeric values of the
characters shown are octal, state this explicitly for the easily
misled.
2000-01-19 16:21:05 +00:00
Jason Evans
929273386f Add three-tier symbol naming in support of POSIX thread cancellation
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().
2000-01-12 09:23:48 +00:00
Tim Vanderhoek
b91cc296c8 Add .Xrefs to tolower.3 and toupper.3, respectively. 1999-12-28 14:10:21 +00:00
Alexey Zelkin
94da96bf18 Back up following macros by functions: ishexnumber, isideogram, isnumber,
isphonogram, isrune, isspecial. Fix ordering.

Reviewed by: bde
1999-12-17 15:12:21 +00:00