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
Owen Shepherd [Sun, 26 Aug 2012 15:33:48 +0000 (16:33 +0100)]
PDCLIB-7: Add _PDCLIB_ftell64 to give us full precision file positioning information. Rewrite ftell to use it, and fseek to use it for the SEEK_CUR case. This should resolve PDCLIB-7
Owen Shepherd [Sun, 26 Aug 2012 15:04:22 +0000 (16:04 +0100)]
PDCLIB-7: When fseek is called with SEEK_CUR, internally calculate the new offset and then hand SEEK_SET to the glue layer, as our offset may differ from the offset of the underlying file descriptor due to buffering