summaryrefslogtreecommitdiff
path: root/lib/libc/string
Commit message (Collapse)AuthorAgeFilesLines
* Simplify by removing unneeded local variables and explicit null termination.Tim J. Robbins2002-09-261-12/+8
| | | | Notes: svn path=/head/; revision=103999
* Simplify by removing useless local variables and explicit null termination.Tim J. Robbins2002-09-261-9/+5
| | | | Notes: svn path=/head/; revision=103998
* Remove unnecessary #include <assert.h>; it was used to bring in theTim J. Robbins2002-09-2120-20/+0
| | | | | | | _DIAGASSERT macro on NetBSD, but we don't need it. Notes: svn path=/head/; revision=103724
* Replace a stray reference to strtok() with one to wcstok().Tim J. Robbins2002-09-081-1/+1
| | | | Notes: svn path=/head/; revision=103095
* Add an implementation of wcstok(), based on strtok_r().Tim J. Robbins2002-09-073-3/+213
| | | | Notes: svn path=/head/; revision=103067
* Sync prototypes with <wchar.h> with respect to the restrict qualifier.Tim J. Robbins2002-09-071-6/+6
| | | | Notes: svn path=/head/; revision=103060
* Add restrict qualifiers where C99 permits them. All of these already hadTim J. Robbins2002-09-076-12/+12
| | | | | | | restrict qualifiers on their prototypes in <wchar.h>. Notes: svn path=/head/; revision=103059
* Call strtok_r() via a libc private name from within strtok().Tim J. Robbins2002-09-071-2/+6
| | | | Notes: svn path=/head/; revision=103057
* Style: One space between "restrict" qualifier and "*".Tim J. Robbins2002-09-068-10/+10
| | | | Notes: svn path=/head/; revision=103012
* - Let their manual pages show the reader that the bzero(3) andRobert Drehmel2002-09-014-22/+33
| | | | | | | | | | | | | bcopy(3) functions are prototyped in <strings.h> and not in <string.h> anymore. - Add a sentence about that to the respective HISTORY sections. In the C source files: - Include <string.h> or <strings.h> depending on what function is to be compiled. - Use ANSI-C function definitions. Notes: svn path=/head/; revision=102809
* Add the 'restrict' type qualifier to the function prototypeRobert Drehmel2002-08-301-1/+1
| | | | | | | | of the swab(3) function in its manual page to match the standardization by POSIX.1-2001. Notes: svn path=/head/; revision=102643
* - Update the manual page of bcmp(3) by replacingRobert Drehmel2002-08-302-7/+12
| | | | | | | | | | | | | .In string.h with .In strings.h and adding a sentence to the HISTORY section. - Use an ANSI-C function definition. - Include <strings.h> instead of <string.h>. - Apply style(9): Put a space after return keywords. Notes: svn path=/head/; revision=102642
* - Convert the function definition to declare its argumentsRobert Drehmel2002-08-301-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | in the ANSI-C format. - Change the code a bit to hopefully save some cycles. I.e. (simplified) change a = b + 1; while (--b & 0x7) /* ... */ to a = b; for (; b & 0x7; b--) /* ... */ and while (--a >= 0) /* ... */ to for (; a > 0; a--) /* ... */ - Equip two function arguments of swab() with the 'restrict' type qualifier in form of the '__restrict' macro. This is specified by POSIX.1-2001. Notes: svn path=/head/; revision=102639
* - Update the manual pages of index() and rindex() to showRobert Drehmel2002-08-304-17/+38
| | | | | | | | | | | | | | | | | | | | | <strings.h> as the associated header file. The prototypes have been moved there from <string.h> because POSIX.1-2001 said so. - Conditionally include either <strings.h> or <string.h> based on whether the [r]index() or str[r]chr() functions are compiled, respectively. - Style(9) tells us to - put a space after the return keyword - to check for a NUL character without using the ! operator. - use NULL instead of (type *)NULL where the compiler knows the type. Apply these rules. - Rather use ANSI-C function definitions than K&R ones. - For index(3), correct second function argument's type; it was declared to be a `const char' before and is now an `int'. Notes: svn path=/head/; revision=102637
* - Update the manual page to show that the associated header fileRobert Drehmel2002-08-302-4/+10
| | | | | | | | | | is <strings.h> and not <string.h> anymore. - Tell the reader about this change in the HISTORY section. - Switch to use an ANSI-C function definition. - Include <strings.h> instead of <string.h> in the source file. Notes: svn path=/head/; revision=102635
* - Update strcasecmp(3)/strncasecmp(3) to reflect the fact thatRobert Drehmel2002-08-302-2/+9
| | | | | | | | | | | the prototypes for both functions are now in the <strings.h> header, as required by IEEE Std 1003.1-2001. - Add one sentence about that in the HISTORY section. - Include <strings.h> in the source file to have the prototypes in scope when the _ANSI_SOURCE macro is defined. Notes: svn path=/head/; revision=102624
* Add a manual page for wcswidth().Tim J. Robbins2002-08-202-1/+62
| | | | Notes: svn path=/head/; revision=102166
* Move just committed version of wcswidth.c here (from "locale"),Andrey A. Chernov2002-08-202-25/+31
| | | | | | | a bit optimized now. Notes: svn path=/head/; revision=102159
* - Add the 'restrict' qualifier to the definitions of the stringRobert Drehmel2002-08-146-18/+8
| | | | | | | | | | 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. Notes: svn path=/head/; revision=101887
* - Add the 'restrict' qualifier required by IEEE Std 1003.1-2001Robert Drehmel2002-08-142-5/+2
| | | | | | | | | | 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. Notes: svn path=/head/; revision=101881
* Correct an inaccuracy in this man page regarding detecting empty fields.Archie Cobbs2002-08-071-4/+5
| | | | | | | MFC after: 2 days Notes: svn path=/head/; revision=101485
* Fix off-by-one error.Jonathan Mini2002-07-031-1/+1
| | | | | | | | | PR: misc/40104 Submitted by: Neal Fachan <neal@isilon.com> MFC after: 3 days Notes: svn path=/head/; revision=99331
* Fix the style of the SCM ID's.David E. O'Brien2002-03-2227-5/+59
| | | | | | | I believe have made all of libc .c's as consistent as possible. Notes: svn path=/head/; revision=92986
* Remove 'register' keyword.David E. O'Brien2002-03-2128-76/+76
| | | | Notes: svn path=/head/; revision=92889
* Revert last commit. stdio.h include is for perror(), not strerror()Chris D. Faulhaber2002-01-311-1/+1
| | | | Notes: svn path=/head/; revision=90021
* strerror(3) is in string.h, not stdio.hChris D. Faulhaber2002-01-311-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=90017
* Add a few cleanups from rev 1.1:Mike Barcroft2002-01-151-10/+12
| | | | | | | | | | | o Restore vendor ID. o Order variable types by size. o Remove a gratuitous temporary variable. Submitted by: bde Notes: svn path=/head/; revision=89400
* o Add prototype for printf(3).Mike Barcroft2002-01-151-9/+12
| | | | | | | | | | style(9): o Order variables in declarations. o Move initialization out of declaration. o Fix over-indents in previous delta. Notes: svn path=/head/; revision=89387
* style(9)Mike Barcroft2002-01-151-95/+63
| | | | | | | | Submitted by: Joseph Mallett <jmallett@xmach.org> Reviewed by: md5(1) Notes: svn path=/head/; revision=89385
* mdoc(7) police:Ruslan Ermilov2002-01-092-3/+4
| | | | | | | Stop abusing the .%J macro for where the .Pa macro should have been used. Notes: svn path=/head/; revision=89138
* Suggest using memmove(3) if src and dst may overlap.Dima Dorfman2002-01-071-2/+7
| | | | | | | | PR: 33298 Submitted by: Tim J. Robbins <tim@robbins.dropbear.id.au> Notes: svn path=/head/; revision=88983
* Add a new `SECURITY CONSIDERATIONS' section. Sample code similar toChris Costello2002-01-051-0/+63
| | | | | | | | | | | | the first revision of strcpy(3)'s section is included, but should be removed as the Security Architecture document is committed and completed. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=88940
* Include a section cross-reference to `EXAMPLES' in `SECURITYChris Costello2002-01-051-1/+3
| | | | | | | | | | CONSIDERATIONS' as a source for relevant sample code. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=88939
* Remove the example from SECURITY CONSIDERATIONS. This is mostlyChris Costello2002-01-051-54/+0
| | | | | | | | | | duplicated code from EXAMPLES. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=88938
* Copy the sample `SECURITY CONSIDERATIONS' section from sec-doc.7.Chris Costello2002-01-021-0/+66
| | | | | | | | | | | This will be trimmed as the FreeBSD Security Architecture document is fleshed out and committed. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=88830
* mdoc(7) police: minor markup nits.Ruslan Ermilov2001-12-121-20/+20
| | | | Notes: svn path=/head/; revision=87739
* Make strerror and strerror_r use sys_errlist[0] for errnum = 0. BeWes Peters2001-12-072-6/+32
| | | | | | | | | | | | | | more careful about reporting truncation with ERANGE in strerror_r. Set errno to EINVAL for "unknown" errnum in strerror as required by P1003.1-200x Draft June 14, 2001. More carefully document the handling of strerrbuf when errors (ERANGE, EINVAL) are encountered in strerror_r. Reviewed by: bde (ongoing discussion) Notes: svn path=/head/; revision=87480
* New, improved, more Posix-compliant strerror_r implementation,Wes Peters2001-12-062-72/+78
| | | | | | | | | | complete with documentation. Reviewed by: mike@ gad@ MFC after: 1 week Notes: svn path=/head/; revision=87434
* Must link strerror manpage to strerror_r.Wes Peters2001-11-271-0/+1
| | | | | | | | | Thanks for the review, Mike. Submitted by: Mike Barcroft <mike@FreeBSD.org> Notes: svn path=/head/; revision=86945
* Add strerror_r function per Posix prototype.Wes Peters2001-11-272-23/+107
| | | | | | | | Reviewed by: Mike Barcroft <mike@FreeBSD.org> MFC after: 2 weeks Notes: svn path=/head/; revision=86944
* mdoc(7) police: minor markup and spelling fixes.Ruslan Ermilov2001-11-201-4/+7
| | | | Notes: svn path=/head/; revision=86658
* Increment the loop counter.Dag-Erling Smørgrav2001-11-101-0/+1
| | | | | | | | PR: bin/29218 Submitted by: Goran Lowkrantz <goran.lowkrantz@ismobile.com> Notes: svn path=/head/; revision=86241
* rcsid[]->__FBSDIDDavid E. O'Brien2001-11-0755-248/+95
| | | | Notes: svn path=/head/; revision=86170
* Note that strncmp() will not compare characters after a NUL character.Mike Barcroft2001-10-111-1/+8
| | | | | | | | | | Add a missing word. Bump document date. Inspired by: IEEE Std 1003.1-200x (Draft 7) MFC after: 3 days Notes: svn path=/head/; revision=84810
* Clarify that strnstr() will stop searching after in encounters a NULMike Barcroft2001-10-111-5/+8
| | | | | | | character. Bump document date. Add a missing comma. Notes: svn path=/head/; revision=84808
* Implement strcasestr() which many others (f.e. Linux) already have.Andrey A. Chernov2001-10-103-2/+79
| | | | Notes: svn path=/head/; revision=84740
* Document the fact that the strnstr(3) function is not portable.Mike Barcroft2001-10-091-0/+5
| | | | | | | Requested by: brian, gad Notes: svn path=/head/; revision=84728
* Add a new libc function, strnstr(3), which allows one to limit theMike Barcroft2001-10-093-11/+122
| | | | | | | | | | | number of characters that are searched. This is especially useful with file operations and non-NUL terminated strings. Silence from: -audit, -hackers MFC after: 5 days Notes: svn path=/head/; revision=84699
* Fixed syntax errors in synopsis. The restrict keyword doesn't exist yet.Bruce Evans2001-10-031-5/+5
| | | | | | | | | The corresponding bugs in <wchar.h> have no effect because the function prototypes there don't have args so the __restrict "keyword" is misinterpreted as an arg. Notes: svn path=/head/; revision=84398
* mdoc(7) police: Use the new .In macro for #include statements.Ruslan Ermilov2001-10-0135-36/+36
| | | | Notes: svn path=/head/; revision=84306