Owen Shepherd [Wed, 20 Feb 2013 01:21:15 +0000 (01:21 +0000)]
Namespace cleanliness: Rename all ***_unlocked functions to _PDCLIB_***_unlocked.
Trivial forwarders ***_unlocked -> _PDCLIB_***_unlocked will be implemented (but these functions avoid exposing the _unlocked symbols to code which is only requesting the standard-defined versions)
Owen Shepherd [Mon, 31 Dec 2012 16:16:01 +0000 (16:16 +0000)]
PDCLIB-2 PDCLIB-9: Add char32/char16 conversions to header, incl. optional extras providing string conversions (which will be used internally by the library to implement wide character conversions)
Owen Shepherd [Mon, 31 Dec 2012 01:38:06 +0000 (01:38 +0000)]
PDCLIB-2 PDCLIB-12: If the internal character conversion routines are called
with p_outbuf == NULL, then they will perform the conversion but *not* store
the result. This facilitates the implementation of mbrlen and similar
functions.
Added (optional) UTF-16 variants of the conversion routines. If provided them,
then PDCLib will use them whenever it needs a UTF-16 conversion (e.g. uchar.h
UTF-16 routines, or wchar_t on win32)
Owen Shepherd [Sun, 30 Dec 2012 22:55:11 +0000 (22:55 +0000)]
Add _PDCLIB_UNREACHABLE (defines block of code as unreachable) and _PDCLIB_UNDEFINED(var) (defines the contents of the passed variable to be undefined) macros to _PDCLIB_aux.h
Owen Shepherd [Sun, 30 Dec 2012 21:43:19 +0000 (21:43 +0000)]
PDCLIB-2 PDCLIB-12: Move _PDCLIB_mbstate_t to _PDCLIB_encoding.h, the new home for character-related functions. Update wchar.h to reference this. Define mbstate_t to be 128 bytes; a very conservative size
Owen Shepherd [Thu, 27 Dec 2012 00:27:28 +0000 (00:27 +0000)]
Move existing errno handling to tss_errno, to allow the POSIX platform to just use the underlying OS's errno implementation. Eventually, tss_errno will use the thread specific primitives.
Owen Shepherd [Wed, 26 Dec 2012 18:53:47 +0000 (18:53 +0000)]
win32: _PDCLIB_config.h cleaned up:
* _PDCLIB_NOHANDLE removed (obsolete)
* _PDCLIB_NORETURN removed (obsolete)
* Temp name length was greated than max guaranteed file name length. This has obvious issus.
Owen Shepherd [Wed, 5 Dec 2012 02:20:16 +0000 (02:20 +0000)]
PDCLIB-8: First phase of intergation of new I/O backend system (with minimal
disruption of existing code)
* _PDCLIB_fdopen: renamed _PDCLIB_fvopen to more clearly deliniate from POSIX
fdopen function and state purpose
* _PDCLIB_fd_t is now a library provided union type
Contains members of type void*, uintptr_t, intptr_t. If another type is
required, define _PDCLIB_OSFD_T to that type in _PDCLIB_config.h
* _PDCLIB_fileops_t added. This structure contains the file operations
* _PDCLIB_fillbuffer, _PDCLIB_flushbuffer, _PDCLIB_seek become internal APIs
(_PDCLIB_seek's days are numbered!)
* _PDCLIB_close is removed
* tmpfile() and fopen() should now call through to _PDCLIB_fvopen and provide
a pointer to an appropriate _PDCLIB_fileops_t structure
Owen Shepherd [Mon, 12 Nov 2012 04:09:02 +0000 (04:09 +0000)]
PDCLIB-16: Add _unlocked variations of all I/O routines; move work into these versions
PDCLIB-15: Make most stdio routines lock the stream and then call through to the _unlocked version
Owen Shepherd [Thu, 8 Nov 2012 23:17:29 +0000 (23:17 +0000)]
PDCLIB-15 PDCLIB-16:
* Move _PDCLIB_file_t to _PDCLIB_io.h, compertmentalizing dependencies.
Removes I/O specific structures from _PDCLIB_int.h. Allows _PDCLIB_io.h
to depend upon _PDCLIB_threadconfig.h without recursive dependencies
happening.
* Add "lock" member to _PDCLIB_file_t as the stream locking mutex
* Add flockfile/ftrylockfile/funlockfile as functions which manipulate the
locking mutex explicitly
* Add man page on flockfile/funlockfile/ftrylockfile
* Add flockfile/ftrylockfile/funlockfile and *_unlocked to <stdio.h> and
<wchar.h> as appropriate
* win32: Initialize mutex member correctly
Owen Shepherd [Wed, 10 Oct 2012 15:01:48 +0000 (16:01 +0100)]
PDCLIB-13: fwrite did not reset it's offset after doing a buffer flush.
TODO: Evaluate if fwrite should move to using an offset stored inside the FILE structure
Patch submitted by Rink Springer (complexity: trivial)
PDCLIB-2: Pure wide character functions
* functions/wchar/: functions which only involve wide characters & no locale dependent characters
* opt/mincoll: new option providing bare minimum collation support (pure wchar_t binary comparison)
* platform/win32: Use mincoll
* testing/_PDCLIB_test.h: Provide wide character strings for testing the wide character functions