Commit Graph

3464 Commits

Author SHA1 Message Date
Tim J. Robbins
c8e804757d Add a manual page for wcswidth(). 2002-08-20 03:40:45 +00:00
Andrey A. Chernov
353450fbbe Move just committed version of wcswidth.c here (from "locale"),
a bit optimized now.
2002-08-20 02:06:28 +00:00
Andrey A. Chernov
c1a0a78d00 Remove wcswidth.c from here (and move it to "string") 2002-08-20 01:59:26 +00:00
Andrey A. Chernov
8077fafd28 Remove space at the end of continuation line in prev. commit 2002-08-20 01:16:06 +00:00
Bruce Evans
80ee2492c5 xdr.3 is added to MAN in ../xdr/Makefile.inc where it belongs, so don't
add it here.
2002-08-19 23:06:00 +00:00
Andrey A. Chernov
f999b4ba69 Implement wcswidth() 2002-08-19 20:46:10 +00:00
Andrey A. Chernov
1da6b56aca Use modern-style arguments declaration 2002-08-19 20:32:27 +00:00
Andrey A. Chernov
853c779d87 Write null wide-character as L'\0' like in other places 2002-08-19 20:12:38 +00:00
Andrey A. Chernov
1e2cd54448 According to SUSv2, always return 0 for null wide-character code 2002-08-19 18:06:18 +00:00
Juli Mallett
a10a751f68 s/trailing NULL/trailing NUL/ 2002-08-19 17:14:58 +00:00
Andrey A. Chernov
9424df445a Move internal defines from ctype.h here 2002-08-19 09:02:49 +00:00
Juli Mallett
6879bea818 Leave room for a trailing NUL not a NULL, that's not an ASCII character. 2002-08-19 03:52:36 +00:00
Tim J. Robbins
e92a3d83fc Implement the ISO C90 Amd.1 restartable wide and multibyte character
manipulation functions mbrlen(), mbrtowc(), mbsinit(), mbsrtowcs(),
wcrtomb(), wcsrtombs().
2002-08-18 06:30:10 +00:00
Andrey A. Chernov
d8d0cebecd Move wcwidth() to separate file, it doesn't belong to iswctype.c at all 2002-08-17 20:30:34 +00:00
Andrey A. Chernov
1c15ec1eab According to SUSv2, wcwidth() should return -1 for non-printing characters 2002-08-17 20:11:31 +00:00
Andrey A. Chernov
88c669d2ea Cosmetic - remove unneded brackets and #undef 2002-08-17 20:03:44 +00:00
Andrey A. Chernov
c87e6b26b0 wcwidth: fix espression to work correctly with SWIDTH0 2002-08-17 14:16:14 +00:00
Bosko Milekic
b8606fe660 Fix libc build breakage by defining FSTYPENAMES before including
disklabel.h; broken originally by 1.87 of sys/disklabel.h, which
made the split between DKTYPENAMES and FSTYPENAMES.
Someone who knows disklabel.c: do we still need DKTYPENAMES to be
defined here now?
2002-08-16 15:33:20 +00:00
Michael C . Wu
dff784192b Add iswctype wcwidth function code
Submitted by:	clkao@clkao.org
Reviewed by:	keichii
Obtained from:	NetBSD
MFC after:	1 month
2002-08-16 13:45:23 +00:00
Robert Drehmel
085f131a15 - Fix a bug that wrote one char behind the end of the
supplied buffer in case the size of it was equal to
   the number of characters the converted address consumed.
   The bug occurred when converting an AF_INET address.
 - Remove the SPRINTF macro and use sprintf instead.
 - Do not do string formatting using sprintf(3) and a
   temporary buffer which is copied when the supplied
   buffer provides enough space.  Instead, use snprintf(3)
   and the real destination buffer, thus avoid the copy.

Reported by:	Stefan Farfeleder <e0026813@stud3.tuwien.ac.at> (1)
PR:		misc/41289
2002-08-15 21:19:31 +00:00
Robert Drehmel
7cfcd02787 Put each function argument on its own line to keep lines shorter
than 80 columns.
2002-08-15 20:33:44 +00:00
Robert Drehmel
2caa6a5afe Use one line for each function argument to keep the line
width smaller than 80 columns.

Thanks to Ruslan for an explanation of multiple ways to
achieve this.
2002-08-15 18:57:57 +00:00
Bruce Evans
ea1df4b7bb Removed duplicated MLINKS which make(1) recently started warning about. 2002-08-15 12:31:01 +00:00
Robert Drehmel
b78411b153 Include <stdlib.h> to have abort() and exit() declared. 2002-08-15 11:58:24 +00:00
Robert Drehmel
f8418db73e - For compliance with IEEE Std 1003.1-2001, add the 'restrict'
qualifier to function prototypes and definitions where
   appropriate using the '__restrict' macro.
 - Update the manual page.
2002-08-15 10:28:52 +00:00
Robert Drehmel
71a00a449f - Introduce the 'restrict' qualifier to function prototypes and
definitions to comply with IEEE Std 1003.1-2001.
 - Update the manual pages.
2002-08-15 09:47:10 +00:00
Robert Drehmel
5618f72405 - Add the 'restrict' qualifier to the function prototypes and
definitions of the functions that convert strings to numbers
   and are defined by IEEE Std 1003-1.2001.
 - Use ANSI-C function definitions for all of the functions
   mentioned above plus strtouq and strtoq.
 - Update the prototypes in the manual pages.
2002-08-15 09:25:04 +00:00
Robert Drehmel
3248d0a517 - Add the 'restrict' qualifier to the function definitions and
public prototypes of setbuf(3) and setvbuf(3) using the
   '__restrict' macro from <sys/cdefs.h> to be compliant with
   IEEE Std 1003.1-2001.
 - Replace the K&R with ANSI-C function definitions.
 - Bring the manual page up-to-date.
2002-08-14 23:45:42 +00:00
Robert Drehmel
620035ef89 - Add the 'restrict' qualifier to the function definition of
strftime(3) for IEEE Std 1003.1-2001 compliance and remove
   excessive usage of the 'const' qualifier that was neither
   present in the prototype in the publice header, nor in the
   local prototype just above the function definition.
 - Replace the K&R function definition with a ANSI-C one.
 - Update the prototype of strftime(3) in its manual page.
2002-08-14 23:20:48 +00:00
Robert Drehmel
ad90696815 - Add the 'restrict' qualifier to the definitions of the string
concatenation and copy functions using the '__restrict' macro.
   This is to satisfy IEEE Std 1003-1.2001.
 - Use ANSI-C function definitions.
 - Add the 'restrict' keyword to the manual pages, too.
2002-08-14 22:59:22 +00:00
Robert Drehmel
d542f511a0 - Add the C99 'restrict' qualifier using the '__restrict' macro to
function prototype and definition of strptime(3).
 - Update the manual page.
2002-08-14 22:36:22 +00:00
Robert Drehmel
840b798c83 - Add the 'restrict' qualifier to match the IEEE Std 1003.1-2001
prototype of the tdelete(3) function.
 - Remove duplicated space.
 - Use an ANSI-C function definition for tdelete(3).
 - Update the manual page.
2002-08-14 21:16:41 +00:00
Robert Drehmel
33f9b60eee - Add the 'restrict' qualifier required by IEEE Std 1003.1-2001
to the function definition of strxfrm(3) in form of our
   '__restrict' macro.
 - Use an ANSI-C function definition for strxfrm(3).
 - Change the manual page accordingly.
2002-08-14 21:01:04 +00:00
Robert Drehmel
b7dbaf7b46 -Add the restrict required by IEEE Std 1003.1-2001 in form
of our __restrict macro to the prototypes and function
   definitions of inet_pton and inet_ntop.
 - Use ANSI-C function argument lists.
 - Adjust the prototypes in the manual page.
2002-08-14 20:40:35 +00:00
Poul-Henning Kamp
209c34ba95 Unbreak one of the most confusing breaks of the tree I've seen.
The last commit cannot possibly have been tested.
2002-08-13 18:55:51 +00:00
Andrey A. Chernov
a2a26d0a3d Reduce BSS size for programs which not load collate by eliminating
static buffer.
2002-08-13 14:55:17 +00:00
David Malone
ea33013bc4 Use a union to access the words of a double as this is less likely
to cause bugs when gcc is more aggressively optimising things.

There are still problems with dtoa mentioned in the PR - maybe
Dan could suggest a patch.

PR:		40209
Submitted by:	Dan Lukes <dan@obluda.cz>
Approved by:	bde
MFC after:	2 weeks
2002-08-13 14:17:39 +00:00
Ruslan Ermilov
e091d0c2ac can not -> cannot. 2002-08-13 14:10:36 +00:00
Tim J. Robbins
439cb19e04 Tidy up SRCS and MAN assignments. 2002-08-13 11:56:02 +00:00
Tim J. Robbins
73ab4b2b33 Remove the Bugs section, which is not relevant to FreeBSD: there is no
one-character ungetwc(3) buffer limit.
2002-08-13 10:50:22 +00:00
Tim J. Robbins
46624699bd FreeBSD-ify: use In macro for header files in Synopsis, St C-99 instead of
St C99 in Standards section.
2002-08-13 10:47:17 +00:00
Tim J. Robbins
e74101e4ef Basic support for wide character I/O: getwc(), fgetwc(), getwchar(),
putwc(), fputwc(), putwchar(), ungetwc(), fwide().
2002-08-13 09:30:41 +00:00
Andrey A. Chernov
e34fe8a408 Now malloc() is fixed, remove errno hardcoding to ENOMEM 2002-08-12 17:14:04 +00:00
Tim J. Robbins
01533af5a0 Manual pages for fwide(), getwc(), fgetwc(), getwchar(), putwc(), fputwc(),
putwchar(), ungetwc() from NetBSD and Citrus Project, unmodified except
for the addition of $FreeBSD$.

Obtained from:	NetBSD, Citrus Project
2002-08-12 13:23:12 +00:00
Andrey A. Chernov
7e3c1a3cb7 Now, malloc is fixed, remove ENOMEM hardcode 2002-08-12 11:47:19 +00:00
David Malone
3ab539dcb4 Add a missing copyright for Doug. There are other files missing this
copyright in -stable.

PR:		41397
Submitted by:	dfr
2002-08-11 19:31:02 +00:00
Jens Schweikhardt
2b239dd118 Fix typos; each file has at least one s/seperat/separat/
(I skipped those in contrib/, gnu/ and crypto/)
While I was at it, fixed a lot more found by ispell that I
could identify with certainty to be errors. All of these
were in comments or text, not in actual code.

Suggested by:	bde
MFC after:	3 days
2002-08-11 13:05:30 +00:00
Maxime Henrion
5965373e69 - Introduce a new struct xvfsconf, the userland version of struct vfsconf.
- Make getvfsbyname() take a struct xvfsconf *.
- Convert several consumers of getvfsbyname() to use struct xvfsconf.
- Correct the getvfsbyname.3 manpage.
- Create a new vfs.conflist sysctl to dump all the struct xvfsconf in the
  kernel, and rewrite getvfsbyname() to use this instead of the weird
  existing API.
- Convert some {set,get,end}vfsent() consumers to use the new vfs.conflist
  sysctl.
- Convert a vfsload() call in nfsiod.c to kldload() and remove the useless
  vfsisloadable() and endvfsent() calls.
- Add a warning printf() in vfs_sysctl() to tell people they are using
  an old userland.

After these changes, it's possible to modify struct vfsconf without
breaking the binary compatibility.  Please note that these changes don't
break this compatibility either.

When bp will have updated mount_smbfs(8) with the patch I sent him, there
will be no more consumers of the {set,get,end}vfsent(), vfsisloadable()
and vfsload() API, and I will promptly delete it.
2002-08-10 20:19:04 +00:00
Poul-Henning Kamp
9b14c27a86 Update with new error return code.
Reminded by:	rwatson
2002-08-09 13:22:21 +00:00
Ruslan Ermilov
55dd392cb4 mdoc(7) police: punctuation. 2002-08-09 11:36:48 +00:00
Ruslan Ermilov
0df8febf2c mdoc(7) police: sort xrefs. 2002-08-09 11:33:23 +00:00
Ruslan Ermilov
a8272f7106 mdoc(7) police: punctuation. 2002-08-09 11:24:21 +00:00
Ruslan Ermilov
bebfe08f18 mdoc(7) police: whitespace nits. 2002-08-09 11:17:56 +00:00
Ruslan Ermilov
e0fe2c62de mdoc(7) police: laundry. 2002-08-09 11:15:49 +00:00
Ruslan Ermilov
760d968629 mdoc(7) police: laundry. 2002-08-09 11:06:03 +00:00
Poul-Henning Kamp
f42f7c54c8 Make sure we set errno sensibly in case of failure.
Spotted by:	ache
2002-08-09 10:16:24 +00:00
Poul-Henning Kamp
9d6d1ee63e Introduce a new error return code:
#define EDOFUS          88              /* Programming error */
This can be used to signal error situations which indicate that the
program logic or assumptions is deficient.
2002-08-09 10:15:48 +00:00
Andrey A. Chernov
ec5ca2eba7 Add safeguards to never use errno == 0 as setrunelocale() error return code 2002-08-09 08:22:29 +00:00
Robert Watson
ecfbf7e46d Update TE policy and MAC text conversion routines to support partial
label updates.  Biba and MLS already supported this.  This permits the
userland library to submit relative updates on MAC labels, rather
than submitting an entire label to replace the current label.  This
also requires changes to the MAC modules, which are forthcoming.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-09 03:09:38 +00:00
Robert Watson
1355f6d016 X-ref mac.3. 2002-08-09 03:03:08 +00:00
Alexander Kabaev
dc0f86a25d Use '_end' symbol instead of 'end' to initialize minbrk and curbrk
variables. Both symbols are set to the same value by the linker,
and _end symbol has less chances to clash with application defined
global symbols.

alpha, ia64 and sparc64 ports already use _end, i386 is now
consistent with them.

Reviewed by:	bde
Approved by:	obrien
Reported by:	pirzyk
2002-08-08 17:28:07 +00:00
Andrey A. Chernov
76692b8025 Rewrite locale loading procedures, so any load failure will not affect
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).
2002-08-08 05:51:54 +00:00
Mike Barcroft
af8c0bce98 Implement POSIX.1-2001 (XSI)'s ulimit(3).
Submitted by:	Kyle Martin <mkm@ieee.org>
2002-08-08 04:50:36 +00:00
Andrey A. Chernov
315009a483 Set errno to ENOMEM for strdup too (due to malloc errno bug) 2002-08-07 23:52:28 +00:00
Andrey A. Chernov
cb9772d882 Always set errno to ENOMEM after malloc failed (as workaround).
Our malloc sometimes forget to set errno, f.e. for size overflow case.
2002-08-07 22:03:46 +00:00
Andrey A. Chernov
57473ad215 Reset __mb_cur_max to 1 when "C" or "POSIX" locales loaded after multibyte one 2002-08-07 20:49:25 +00:00
Andrey A. Chernov
45206d5c69 Fix wrong address when EucInfo > "variable" size 2002-08-07 20:20:56 +00:00
Archie Cobbs
a8ee7a0256 Correct an inaccuracy in this man page regarding detecting empty fields.
MFC after:	2 days
2002-08-07 20:08:50 +00:00
Garrett Wollman
4879739808 Document file descriptor reopening and current standardization status. 2002-08-07 18:03:30 +00:00
Andrey A. Chernov
6892b144e8 Style fixes in preparation for rewritting 2002-08-07 18:02:45 +00:00
Andrey A. Chernov
1491b31e18 Style fixes 2002-08-07 16:49:20 +00:00
Andrey A. Chernov
ecc4c62066 Style fixes in preparation of code rewritting 2002-08-07 16:45:23 +00:00
Andrey A. Chernov
dfb18183be Close descriptor, if error happens in loadCat() 2002-08-07 07:02:37 +00:00
Tim J. Robbins
71a63bac1b Build iswctype.c and manual pages for the functions it defines. 2002-08-06 00:49:59 +00:00
Mike Barcroft
0f1bfcd283 o Fix a memory leak.
o Rewrite validmsgverb() so that it works (I'm not sure how it escaped
  my original testing).
o Document nextcomp().
2002-08-05 19:36:09 +00:00
Tim J. Robbins
677adc79c2 Add missing prototypes for extension functions to the SYNOPSIS. 2002-08-05 11:02:04 +00:00
Tim J. Robbins
21b7821a9e Use In macro instead of Fd. Add crossref to wctype(3). Refer to 1003.1-2001
in STANDARDS section. Document functions which are extensions to the standard.
2002-08-05 10:50:39 +00:00
Tim J. Robbins
15c57797bb Use the In macro instead of Fd. Add crossref to wctrans(3). Refer to
1003.1-2001 in STANDARDS section.
2002-08-05 10:48:05 +00:00
Tim J. Robbins
6b44a04d1c Implement the missing <wctype.h> functions: isw*() (iswalnum() etc.),
towlower() and towupper() required by ISO C90 Amd. 1.

iswascii(), iswhexnumber(), iswideogram(), iswnumber(), iswphonogram(),
iswrune() and iswspecial() have also been implemented for consistency
with the BSD extensions in <ctype.h>.
2002-08-05 10:45:23 +00:00
Andrey A. Chernov
3a317a1229 Reject encoding > ENCODING_LEN at early stage instead of truncating it.
Use ptr == NULL instead of !ptr in few places.
Move saverr declaration to global section.
2002-08-05 09:58:45 +00:00
Tim J. Robbins
008a2c53ce Manual pages for wide character classification (isw*) and case conversion
(tow*) functions from NetBSD, unmodified except for the addition of $FreeBSD$.

Obtained from:	NetBSD
2002-08-05 08:04:58 +00:00
Mike Barcroft
823f68a28a Implement POSIX.1-2001 (XSI)'s fmtmsg(3). 2002-08-05 06:49:58 +00:00
Andrey A. Chernov
97c54f7797 Try harder to check lang as path component (".", "..", / inside).
Try harder to not overwrite failure errno.
style(9) whitespace reformatting for code readability.
2002-08-04 14:03:59 +00:00
Tim J. Robbins
4bd5585fbd Change wctype_t to an unsigned type to avoid warnings. 2002-08-04 12:43:53 +00:00
Tim J. Robbins
4645079944 Add the ISO C90 Amd. 1 wctrans(3) and towctrans(3) functions. 2002-08-04 12:09:08 +00:00
Tim J. Robbins
92ece88d16 Add btowc(3) to SEE ALSO section. 2002-08-04 11:02:21 +00:00
Andrey A. Chernov
f75bb0aa25 Use errno to indicate failure reason.
Remove incomplete checks for 'name' and 'PatchLocale', they must be
already checked at this point.
2002-08-04 09:37:28 +00:00
Bruce Evans
1a2140f531 Fixed some style bugs (unsorting of MLINKS, and more than 1 assignment to
MAN per section).
2002-08-04 07:54:41 +00:00
Andrey A. Chernov
10bc1114ce Rewrite loadlocale() to eliminate LOAD_CATEGORY macro to save space. 2002-08-04 04:29:54 +00:00
Andrey A. Chernov
27ebcacbb0 Nonexistent SIZE_MAX -> SIZE_T_MAX 2002-08-04 04:11:48 +00:00
Tim J. Robbins
d4ba1c2249 Signal an error instead of giving the caller less memory than they asked
for when num * size would cause integer overflow.

MFC after:	1 week
2002-08-04 02:52:11 +00:00
Andrey A. Chernov
9bb322433e Add ERRORS section according to POSIX (no errors) 2002-08-03 17:20:45 +00:00
Andrey A. Chernov
2f6754febb Catch empty encoding name too 2002-08-03 17:09:21 +00:00
Andrey A. Chernov
40b97dcb2a Fix return codes to match what setrunelocale() returns 2002-08-03 16:26:47 +00:00
Andrey A. Chernov
5740f28044 Preserve errno in fallback code 2002-08-03 15:56:25 +00:00
Tim J. Robbins
e9fb70115f Add ISO C90 Amd. 1 btowc(3) and wctob(3) functions. 2002-08-03 13:49:55 +00:00
Tim J. Robbins
196099d661 Correct use of Nm macro in NAME section and a broken cross reference. 2002-08-03 12:39:41 +00:00
Andrey A. Chernov
710d708144 Return errno provided by fopen, not always ENOENT.
Return EFTYPE instead of EINVAL for wrong locale file format.
Whitespaces.
2002-08-03 11:55:19 +00:00
Andrey A. Chernov
256ddd5999 Check encoding for ".", ".." and / inside 2002-08-03 10:23:06 +00:00
Andrey A. Chernov
5568219d15 Return EINVAL for NULL or too long encoding, not EFAULT 2002-08-03 09:10:31 +00:00