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
Owen Shepherd [Sat, 25 Aug 2012 14:31:04 +0000 (15:31 +0100)]
PDCLIB-6: _PDCLIB_status_t: change members from size_t to unsigned or int as appropriate. >int will overflow into error return anyway. Aligns types to better support negative precisions.
Owen Shepherd [Sat, 25 Aug 2012 02:09:07 +0000 (03:09 +0100)]
PDCLIB-6: Inside _PDCLIB_print, remove intformat and completely rewrite int2base. The new code is non-recursive and far more logical. Additionally, because everything occurs in one place, it vastly simplifies some aspects of the handling
Owen Shepherd [Sat, 25 Aug 2012 00:43:23 +0000 (01:43 +0100)]
_PDCLIB_iotest.h: the code for determining if the result matched or not was too clever, and operator short circuiting was casuing the "actual" result for cases where the return codes didn't match to be stale (i.e. the result from a previous test). This should make fixing PDCLIB-6 much simpler
Owen Shepherd [Fri, 24 Aug 2012 16:54:44 +0000 (17:54 +0100)]
Manual pages: renmae man->man3 to follow existing conventions. Add files _Exit.3, quick_exit.3, at_quick_exit.3, strndup.3 aliasing the file which documents said function, using .so inclusion directive. (While symlinks would be ideal, they are not sufficiently portable)
Owen Shepherd [Wed, 22 Aug 2012 13:20:55 +0000 (14:20 +0100)]
rename: test driver checked for rv == -1 on failure. Standard defines failure as any non-zero return; now check rv != 0. This makes the testsuite complete on win32 without failures (excepting disabled/not yet tested warnings)
Owen Shepherd [Thu, 16 Aug 2012 23:13:35 +0000 (00:13 +0100)]
<float.h> is now implemented in the platform independent portion. It is based
upon a macro family defined in _PDCLIB_float.h, which is similar in structore
to the existing _PDCLIB_int.h. It is controlled by three definitions in
_PDCLIB_config.h, which define which IEEE 754 format the floating point types
are in. This removes a GCC dependency from all of the targets, and should help
in making PDCLib support other compilers