summaryrefslogtreecommitdiffstats
path: root/bstr/bstr.c
Commit message (Collapse)AuthorAgeFilesLines
* Move compat/ and bstr/ directory contents somewhere elsewm42014-08-291-437/+0
| | | | | | | | | bstr.c doesn't really deserve its own directory, and compat had just a few files, most of which may as well be in osdep. There isn't really any justification for these extra directories, so get rid of them. The compat/libav.h was empty - just delete it. We changed our approach to API compatibility, and will likely not need it anymore.
* bstr: preparation for next commitwm42014-08-291-1/+1
| | | | | | | | Just so I can move this file without modifying its contents in the next commit. compat/compiler.h is to be moved to osdep/ with the next commit, so add a dummy header.
* build: include <strings.h> for strcasecmp()wm42014-07-101-0/+1
| | | | | | | It happens to work without strings.h on glibc or with _GNU_SOURCE, but the POSIX standard requires including <strings.h>. Hopefully fixes OSX build.
* Audit and replace all ctype.h useswm42014-07-011-4/+4
| | | | | | | | | | | | | | | | Something like "char *s = ...; isdigit(s[0]);" triggers undefined behavior, because char can be signed, and thus s[0] can be a negative value. The is*() functions require unsigned char _or_ EOF. EOF is a special value outside of unsigned char range, thus the argument to the is*() functions can't be a char. This undefined behavior can actually trigger crashes if the implementation of these functions e.g. uses lookup tables, which are then indexed with out-of-range values. Replace all <ctype.h> uses with our own custom mp_is*() functions added with misc/ctype.h. As a bonus, these functions are locale-independent. (Although currently, we _require_ C locale for other reasons.)
* bstr: add function for splitting UTF-8wm42014-01-151-0/+11
|
* bstr: check for overflow in buffer allocationwm42014-01-031-0/+4
| | | | | We're being a little bit lazy here and limit the max allocation to SIZE_MAX/2, which is practically infinite anyway on 64 bit systems.
* bstr: use mp_append_utf8_bstr()wm42013-12-301-19/+4
| | | | Drop usage of the ugly PUT_UTF8() macro.
* bstr: add bstr_xappend functionwm42013-12-301-0/+51
| | | | | | Apparently this can be really useful when being paranoid and trying to avoid too much malloc/realloc, since it can be used to appending into a buffer (with transparent realloc only if the buffer is too small).
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-171-0/+385