Commit Graph

17 Commits

Author SHA1 Message Date
phantom
7cc1cf7c0d . Static'ize functions exported via function reference variables only.
. Replace inclusion of sys/param.h to sys/cdefs.h and sys/types.h where
  appropriate.
. move _*_init() prototypes to mblocal.h, and remove these prototypes
  from .c files
. use _none_init() in __setrunelocale() instead of duplicating code
. move __mb* variables from table.c to none.c allowing us to not to
  export _none_*() externs, and appropriately remove them from mblocal.h

Ok'ed by:	tjr
2005-02-27 15:11:09 +00:00
tjr
ce3f06531c Use a simpler and faster buffering scheme for partial multibyte characters. 2004-05-17 11:16:14 +00:00
tjr
45d4dc5289 Fix braino in previous: check that the second byte in the character
buffer is non-null when the character is two bytes long, not when
the buffer is two bytes long.
2004-05-13 03:08:28 +00:00
tjr
a768f66e22 Move prototypes of various encoding-related functions into a new header
file to avoid extern'ing them all over the place.
2004-05-12 14:09:04 +00:00
tjr
56369beb07 In the absence of proper validation, at least check that null bytes
do not appear as anything but the first byte of a multibyte character.
2004-05-11 14:08:22 +00:00
tjr
a0dcfbc296 Perform some basic validation of multibyte conversion state objects. 2004-04-12 13:09:18 +00:00
tjr
c29bd99207 Don't cast away const qualifiers.
Spotted by:	bde
2004-04-10 00:27:52 +00:00
tjr
dc1e42aa23 Allow partial multibyte characters to accumulate in conversion state
objects passed to mbrtowc(), mbsrtowcs(), and mbrlen(), as required
by C99.
2004-04-07 10:48:19 +00:00
tjr
41e6b08c54 Remove unused #includes. 2003-11-08 02:58:37 +00:00
tjr
dd0fb3809a Convert the Big5, EUC, MSKanji and UTF-8 encoding methods to implement
mbrtowc() and wcrtomb() directly. GB18030, GBK and UTF2 are left
unconverted; GB18030 will be done eventually, but GBK and UTF2 may just
be removed, as they are subsets of GB18030 and UTF-8 respectively.
2003-11-02 10:09:33 +00:00
obrien
8bfc34249b Fix the style of the SCM ID's.
I believe have made all of libc .c's as consistent as possible.
2002-03-22 21:53:29 +00:00
obrien
ffa08507e4 Remove __P() usage. 2002-03-21 22:49:10 +00:00
deischen
dd8c04d769 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
ache
751bfd4596 Megre XPG4 code into libc 2000-06-03 12:24:08 +00:00
foxfair
27610e9f2b PR: 10918
Submitted by:	Yung-Jen Hung <winard@u3717a.dorm.ccu.edu.tw>
Reviewed by:	bearscorp.bbs@bbs.life.nthu.edu.tw
_BIG5_sgetrune() in libc doesn't work well, this commit will fix it.
1999-05-07 13:24:58 +00:00
phk
1cbe1ae64a Add missing #include of <sys.types.h> 1998-08-15 20:53:34 +00:00
phk
1ed6b79eba I have added the support for BIG5 encoding into libc/libxpg4/mklocale.
the diff is attached below. This is done on the 3.0 source-tree.
I have test this on 2.2-stable before, but I don't have a 3.0 machine
right now.

This patch is mainly to make libc support BIG5 encoding, thus add
zh_TW.BIG5 locale to 3.0.

Submitted by:	Chen Hsiung Chan <frankch@waru.life.nthu.edu.tw>
1998-08-15 12:51:49 +00:00