about summary refs log tree commit diff
path: root/include/string.h
Commit message (Collapse)AuthorAgeFilesLines
* feature test macros: make _GNU_SOURCE enable everythingRich Felker2012-12-031-3/+0
| | | | | | | | | | | | | | | | previously, a few BSD features were enabled only by _BSD_SOURCE, not by _GNU_SOURCE. since _BSD_SOURCE is default in the absence of other feature test macros, this made adding _GNU_SOURCE to a project not a purely additive feature test macro; it actually caused some features to be suppressed. most of the changes made by this patch actually bring musl in closer alignment with the glibc behavior for _GNU_SOURCE. the only exceptions are the added visibility of functions like strlcpy which were BSD-only due to being disliked/rejected by glibc maintainers. here, I feel the consistency of having _GNU_SOURCE mean "everything", and especially the property of it being purely additive, are more valuable than hiding functions which glibc does not have.
* add memmem function (gnu extension)Rich Felker2012-10-151-0/+1
| | | | based on strstr. passes gnulib tests and a few quick checks of my own.
* strsep is BSD|GNU, not GNU-only; it's originally from BSDRich Felker2012-09-131-1/+4
|
* default features: make musl usable without feature test macrosRich Felker2012-09-071-5/+1
| | | | | | | | | | the old behavior of exposing nothing except plain ISO C can be obtained by defining __STRICT_ANSI__ or using a compiler option (such as -std=c99) that predefines it. the new default featureset is POSIX with XSI plus _BSD_SOURCE. any explicit feature test macros will inhibit the default. installation docs have also been updated to reflect this change.
* use restrict everywhere it's required by c99 and/or posix 2008Rich Felker2012-09-061-12/+18
| | | | | | | | to deal with the fact that the public headers may be used with pre-c99 compilers, __restrict is used in place of restrict, and defined appropriately for any supported compiler. we also avoid the form [restrict] since older versions of gcc rejected it due to a bug in the original c99 standard, and instead use the form *restrict.
* support _BSD_SOURCE feature test macroRich Felker2012-05-221-5/+12
| | | | | patch by Isaac Dunham. matched closely (maybe not exact) to glibc's idea of what _BSD_SOURCE should make visible.
* omit declaration of basename wrongly interpreted as prototype in C++Rich Felker2012-05-091-0/+2
| | | | | | | | | | | | | | | | | | | the non-prototype declaration of basename in string.h is an ugly compromise to avoid breaking 2 types of broken software: 1. programs which assume basename is declared in string.h and thus would suffer from dangerous pointer-truncation if an implicit declaration were used. 2. programs which include string.h with _GNU_SOURCE defined but then declare their own prototype for basename using the incorrect GNU signature for the function (which would clash with a correct prototype). however, since C++ does not have non-prototype declarations and interprets them as prototypes for a function with no arguments, we must omit it when compiling C++ code. thankfully, all known broken apps that suffer from the above issues are written in C, not C++.
* replace prototype for basename in string.h with non-prototype declarationRich Felker2012-02-241-1/+1
| | | | | | | | GNU programs may expect the GNU version of basename, which has a different prototype (argument is const-qualified) and prototype it themselves too. of course if they're expecting the GNU behavior for the function, they'll still run into problems, but at least this eliminates some compile-time failures.
* declare basename in string.h when _GNU_SOURCE is definedRich Felker2012-02-071-0/+1
| | | | | | note that it still will have the standards-conformant behavior, not the GNU behavior. but at least this prevents broken code from ending up with truncated pointers due to implicit declarations...
* more locale_t interfaces (string stuff) and header updatesRich Felker2012-02-061-0/+8
| | | | | | this should be everything except for some functions where the non-_l version isn't even implemented yet (mainly some non-ISO-C wcs* functions).
* add dummied strverscmp (obnoxious GNU function)Rich Felker2011-09-111-0/+1
| | | | | | programs that use this tend to horribly botch international text support, so it's questionable whether we want to support it even in the long term... for now, it's just a dummy that calls strcmp.
* function signature fix: add const qualifier to mempcpy src argRich Felker2011-04-261-1/+1
|
* typo in prototype for mempcpyRich Felker2011-04-261-1/+1
|
* prototype for mempcpyRich Felker2011-04-261-0/+1
|
* implement memrchr (nonstandard) and optimize strrchr in terms of itRich Felker2011-04-131-0/+1
|
* fix prototype for strsepRich Felker2011-04-061-1/+1
|
* add some missing prototypes for nonstandard functions (strsep, clearenv)Rich Felker2011-03-301-0/+1
|
* fix missing prototype for strsignalRich Felker2011-02-261-0/+1
|
* apply feature test protection to memccpyRich Felker2011-02-241-1/+4
|
* prototype for gnu strcasestr (currently a stub)Rich Felker2011-02-151-0/+1
|
* more header cleanup and conformance fixes - string.hRich Felker2011-02-141-7/+12
|
* initial check-in, version 0.5.0 v0.5.0Rich Felker2011-02-121-0/+72