1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00
Commit Graph

137 Commits

Author SHA1 Message Date
c3a10b88b5 - Added NAN, INFINITY, FLT_EVAL_METHOD, float_t and double_t to
<math.h>.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14959 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-29 10:09:55 +00:00
2ced1d3293 - Modified the locale-aware isalnum(), isalpha(), iscntrl(),
isdigit(), isgraph(), islower(), isprint(), ispunct(), isspace(),
  isupper(), isxdigit(), tolower() and toupper() functions
  to clamp the input parameter to the "unsigned char" range before
  it is submitted to the respective locale.library function. This
  should be in sync with what the specs demand, which state that
  if the input parameter is neither EOF nor in the range of an
  "unsigned char" variable, then the results are undefined.

- ungetc() now returns the input character, clamped to an unsigned
  char value, upon success. Previously, if the input parameter was
  negative and not EOF, the result was identical to the input, which
  could have had negative side-effects.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14958 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-29 09:56:09 +00:00
a03ced93b0 - The record locking code in fcntl() is no longer part of the
regular libc.a, but only of libunix.a.

- Changed the definition of the D_S() macro to cast the pointer
  address to an unsigned 32 bit integer.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14956 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-27 13:19:30 +00:00
a19d60f524 - For %C strtime() should return the century number, not the
year number mod 100.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14955 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-19 13:57:53 +00:00
a1ffc20864 - Documented __strip_double_slash() and plugged in a memmove()
in place of the copying loop.

- Modified __translate_unix_to_amiga_path_name() and
  __translate_amiga_to_unix_path_name() to not to call strlen()
  on the results of __strip_double_slash().


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14951 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-15 12:32:59 +00:00
13c857ba0a - Added %D, %e, %F, %g, %G and %h for strftime(); repaired %I.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14950 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-14 14:47:46 +00:00
fa31c468dc - fpclassify() now returns FP_ZERO both for 0 and -0.
- nan() and nanf() now return quiet NaNs.

- Added internal __inf() and __inff() functions.

- strtof() now calls nanf() and __inff(), respectively, to produce
  the special floating point values for nan/inf/infinity.

- strtod() now calls nan() and __inf(), respectively, to produce
  the special floating point values for nan/inf/infinity.

- The scanf() family now calls nan() and __inf(), respectively, to
  produce the special floating point values for nan/inf/infinity.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14948 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-14 10:52:31 +00:00
c5087c78ce - Getting ready for the 1.192 release.
- Floating point output in hexadecimal notation can now show a sign
  in front of the hex prefix string.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14945 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-12 14:42:32 +00:00
539cc3553d - Added isunordered(), isgreater(), isgreaterequal(), isless(),
islessequal() and islessgreater() to <math.h> for C99.

- The wchar_t type is now an 'unsigned short' integer (16 bits wide).

- Added PTRDIFF_MIN/PTRDIFF_MAX, WCHAR_MIN/WCHAR_MAX and
  WINT_MIN/WINT_MAX to <stdint.h> for C99.

- Added imaxdiv() and imaxabs() for C99.

- Added strtoimax() and strtoumax() for C99.

- Added nextafter() and nextafterf() for C99.

- Added copysign() and copysignf() for C99.

- Unless I missed something, clib2 should now be functionally complete
  with regard to C99, except for the floating point operations covered.
  These are a major challenge all by themselves, and I wonder both
  whether they are worth the effort and how one could implement them
  correctly.

- fflush() now consistently supports a NULL parameter, causing all
  streams to be flushed for which this behaviour is defined.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14943 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-12 13:21:47 +00:00
bc65dd2877 - Added isblank().
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14942 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-11 20:15:28 +00:00
ec027fa510 - The strftime() %z conversion now prints the time zone difference as a
"decimal" number. That is, if the difference is 5 hours and 30 minutes,
  then %z will now print "530" rather than "330".

- mktime() now handles one leap second gracefully.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14941 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-09 13:47:24 +00:00
89b568bcb8 - Small fixes to the scanf() family.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14938 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-08 11:27:26 +00:00
9e32991a6d - For the printf() "%a" conversion the exponent now comes out as a binary
number rather than a decimal one. Now how odd is that?

- strtod() and strtof() now support "inf"/"infinity"/"nan"/"nan(..)" and
  hexadecimal floating point numbers, for C99.

- Added the fpclassify(), isfinite(), isnormal() and signbit() macros for C99.

- Reimplemented isnan() and isinf() as macros for C99. The corresponding
  functions will be dropped from the library. Note that the isinf() macro
  does not return -1, 0 or 1 like the old function did, but only 0 or 1
  depending upon whether the parameter represents +/- infinity or not.

- Added fabsf() for C99.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14935 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-08 08:51:30 +00:00
c8d29ea9c1 - Added HUGE_VALF to <math.h>.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14934 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-07 17:04:07 +00:00
28f561c61b - The printf() family now supports the %hh, %j, %t and %z modifiers and the
%a/%A conversions for C99. The %j is treated like %ll, %t and %z are treated
  like %l.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14933 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-07 16:39:27 +00:00
3bd6766484 - strftime() now ignores the E and O modifiers.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14931 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-07 13:40:19 +00:00
e01d58319d - Added strtof(), llabs(), lldiv(), vsscanf() and vscanf() for C99.
- strftime() now supports %C, %n, %r, %R, %t, %T, %u, %V, and %z for C99.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14930 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-05-07 13:21:49 +00:00
ec4fd3c2cb - The libunix.a flavour of system() no longer attempts to translate the name
of a command unless it contains path separator characters.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14929 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-28 15:38:47 +00:00
90a192134e - If fread()/fwrite() fail to read/write any data because either the number
of records or the size of each record is zero, both now call clearerr() to
  avoid giving the caller the wrong impression that an EOF or error occured.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14927 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-24 19:38:59 +00:00
3660b26c9f - Fixed two linker errors which were caused by duplicate symbol definitions.
- Added code to the startup routine which allows you to monitor where command
  was started from and which parameters it was invoked with.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14926 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-24 15:27:13 +00:00
876039440f - The record locking semaphore could wind up getting added to the public
list twice. Fixed.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14924 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-24 12:19:06 +00:00
0c553faff1 - Changed how errors are detected, as returned by Write(), Read() and
Seek(). Seek() is particularly challenging because the value it
  returns might be a valid file position and not an error.

- Replaced numeric function return codes of 0 and -1 with macros OK,
  SEEK_ERROR/ERROR to clarify the respective purposes.

- Changed how ftell() and fseek() are used, double-checking the return
  value and the errno code.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14923 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-24 09:53:12 +00:00
a50aba0b64 - Reversed the change in rename() which enforced deletion of the target file.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14921 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-21 10:23:17 +00:00
2e9ac7d003 - The Unix-like rename() now removes the target file even if that
file has been protected from deletion.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14920 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-20 12:06:00 +00:00
15c16efd07 - Final version bump before release.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14916 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-09 09:30:29 +00:00
92cc3e9a79 - The stdio locking in fcntl() wasn't working correctly. Fixed.
- Made the clearerr(), feof() and ferror() macros thread-safe.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14914 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-04 10:10:02 +00:00
3096691d75 - Added more code and changes contributed by Peter Bengtsson, thank you
very much! This includes the following:

  - Added SSIZE_MAX to <limits.h>.

  - Added <sys/uio.h>, readv() and writev().

  - Cut back the soft link resolution code in lstat().

  - In <fcntl.h> O_NDELAY is now an alias for O_NONBLOCK.

  - Added <complex.h>, carg(), cargf(), cargl(), cimag(), cimagf(),
    cimagl(), conj(), conjf(), conjl(), creal(), crealf() and creall().

  Note that the C99 support for the complex floating point data
  types is limited to GCC 3.x for now.

- Added va_copy() to <stdarg.h>.

- Added _Exit() to <stdlib.h>.

- Added <stdbool.h>.

- Added vfscanf() to <stdio.h>.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14912 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-03 10:22:48 +00:00
d5c36d66e4 - We now call IsInteractive() rather than send a type ACTION_DISK_INFO
to a likely console handler file's MsgPort.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14911 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-02 18:02:54 +00:00
7f9fbc453b - Invoking fstat() on what maps to a con-handler stream now produces
information identifying it as a character special file. Side-effect:
  if the input/output went to a CON:/AUTO window, that window will
  pop open and stay open.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14910 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-02 13:25:55 +00:00
6f010ddf87 - File descriptors produced by dup() or dup2() now work exactly like
the original file descriptors they are duplicates of. I modified the
  function which maps file descriptor numbers to file descriptor
  table entries to return the table entries of the original files.

- In the thread-safe library, duplicated stdin/stdout/stderr
  descriptors now work like the "real" ones. This is true even if
  the "real" ones were closed and only their former aliases remain.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14909 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-04-01 18:46:37 +00:00
09b52e077f - Moved the __UtilityBase/__IUtility variable declarations into
a separate file.

- Simplified the library/open close code in "stdlib_main.c".


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14908 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-30 19:37:47 +00:00
9c2c44b008 - raise() no longer resets the signal handler before it invokes the one
currently configured. It merely blocks the delivery of the respective
  signal to prevent recursion.

- raise() now drops into abort() if a signal handler is set to
  SIG_DFL. The exception is in SIGINT delivery, which has the
  effect of printing a different termination message but otherwise
  program flow takes the same path as abort().


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14907 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-27 10:02:50 +00:00
df01f27551 - Moved the signal block mask and the signal function table out of
signal_data.c and into signal_raise.c where they are actually used.
  This makes it possible to override the default definition of the
  __check_abort_enabled variable in your own programs.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14906 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-26 11:01:13 +00:00
58d26ce8cb - The name of the public record locking semaphore has to be preallocated
for OS4 if the AllocSysObject() function is used to create it.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14905 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-26 10:53:35 +00:00
aafda37c84 - Ready for release...
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14903 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-25 09:14:38 +00:00
590d1b8eec - Small fixes to fcntl() and select() to cover the thread-safe
fd->fd_DefaultFile == ZERO case.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14901 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-25 08:50:59 +00:00
8edfcc3f86 - Activated the dormant thread-safe standard input/output/error
handling code.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14899 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-24 16:40:16 +00:00
a6daababe7 - The thread-safe system() call now blocks all standard I/O operations
until the function has returned. Which is harsh, but there is no
  elegant solution to the issue of keeping the same dos.library
  file handles from concurrent use which SystemTagList() might just
  end up using.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14898 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-24 15:31:16 +00:00
5695784272 - Moved stdlib_main.o into the regular lib.c, at least for
the 68k build. The PowerPC build may follow later, provided
  I manage to get the specs file fixed.

- Moved the check for the presence of an FPU into the
  math_init.c code.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14897 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-20 17:14:58 +00:00
c471c50784 - Turns out that the constructor/destructor calling sequence
was still wrongish for the OS4 library. So I had to change
  it *again*. Which probably means that the 68k library will
  need further changes...


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14894 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-20 11:18:06 +00:00
cd10dc9a1a - assertion failures early on during program initialization
should no longer spell big trouble on account of the stdio
  data structures possibly not being in a well-defined and
  initialized state.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14893 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-19 11:06:57 +00:00
7d3ea7fae6 - Moved the call chain printing out of stdlib_main.c and into
separate files.

- Removed some more redundant data from stdlib_main.c.

- Added the first real C99 function: _Exit().


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14892 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-19 10:15:56 +00:00
ead29c1850 - Reorganized the local header files, removing redundancies.
- Dropped unused stub code which is now redundant because of
  the constructor/destructor mechanism.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14891 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-18 12:38:25 +00:00
f492e6a6c0 - fcntl() did not work for sockets. Fixed.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14890 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-16 09:28:37 +00:00
966851e8bd - ftruncate() ended up changing the current file position, contrary
to what it is supposed to do. Fixed.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14888 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-14 10:03:06 +00:00
a60623bbc6 - Turns out that the 68k GCC port does not sort constructor and
destructor functions in any way at all. I reimplemented the
  entire library constructor/destructor functionality to use the
  same approach as libnix.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14887 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-12 14:10:09 +00:00
b048323196 - Aliases of file descriptors are now using the signal semaphore
of the original file descriptor.

- close() did not return 0 if the file descriptor in question
  was really just an alias. Fixed.

- Added a feature which makes it possible to have several clients
  use the standard I/O streams (stdin/stdout/stderr) and have these
  referring to their process' Input()/Output()/ErrorOutput()
  streams. This is intended to support the upcoming shared
  library feature.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14885 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-12 09:43:48 +00:00
08cc54d3fa - Fixed the SAS/C destructor function prototypes and verified
that the constructors/destructors are called in the proper
  order, too.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14884 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-11 18:27:27 +00:00
419172fb0e - The destructor function invocation code no longer calls
setjmp(). This is now done within stdlib_main.c prior to
  calling the destructor function invocation code.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14883 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-11 16:04:51 +00:00
f289140266 - Switched over the startup code and the library itself to use
constructor/destructor functions for initialization and cleanup
  purposes.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14882 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-11 13:23:18 +00:00