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
Owen Shepherd [Mon, 13 Aug 2012 20:11:29 +0000 (21:11 +0100)]
* Test cleanups: surround the code for all functions by #ifndef REGTEST
* Don't REGTEST internal functions (it doesn't make sense)
* <stdio.h>: add _PDCLIB_fdopen, which opens a file based upon its _PDCLIB_fd_t
file descriptor
TODO: Should this be public or not? POSIX fdopen demonstrates utility
TODO: Can we stop storing the file name? Is that useful?
* fopen: rewrite based upon _PDCLIB_fdopen to consolidate code
* strndup: don't REGTEST - mingw doesn't implement.
* <stddef.h>: conditional definition of wchar_t for <wchar.h>
* <wchar.h>: Add 4 simple functions for dependencies
* <_PDCLIB_aux.h>: rename _PDCLIB_ALL to _PDCLIB_EXTENSIONS
* platform/example/functions/stdio/tmpfile.c: return NULL, not 1
* Build system: SubInclude the platform directory to enable the building of
support routines (e.g. app startup files)
* Test system: If $(CRT0) is set, link the contents of it into the tests. This
enables the platform code to provide startup files.
Owen Shepherd [Sun, 12 Aug 2012 18:47:31 +0000 (19:47 +0100)]
* New feature check macro system. See _PDCLIB_aux.h for details
* remove "#pragma weak" from strdup.c. It's nonportable and shouldn't be
necessary
* <string.h> changed to use new feature test system for strdup + strndup
* add strndup implementation
* <assert.h> more reliable handling of error messages
Build system:
* The CoreMake system is dead. It proved to be unscalable
* The old Make based system is gone, also
* We now use a Jam based system (requires the latest FT_Jam). Reasons:
* Make is hard to scale in a non-recursive manner. The interactions get
intractably complex
* The build system depended upon GNU Make. GNU Make's license (the GPLv3) is
about as diametrically opposed to PDCLib's CC0 as you can get without being
closed source
* Jam is actually more portable. In particular, it doesn't require a Unix
emulation layer (unlike GMake)
* The Jam system, as is, can be incorporated into the build system of a larger
project.
Why Jam?
* GNU make is too low level. It also incorporates too much magic: it can spend
significant ammounts of time trying to update source files from SCCS and RCS
files for example (a feature it is doubtful somebody has used in the last
decade)
* Systems like CMake are too high level: CMake is very difficult to use in a
cross compilation environment.
* Systems like Scons and Waf pose similar issues. Scons is also incredibly
slow.