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

131 Commits

Author SHA1 Message Date
cfa6f566db - Simplified the fcntl() code to use the varargs functions more carefully.
Also, the file descriptor duplication code no longer uses a goto to
  deliver its result.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14834 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-20 09:03:02 +00:00
99547756fe - Major, major changes! Moved most of the monolithic code out of
the file descriptor hook and into the respective functions,
  such as dup2(), fchmod(), fchown(), fcntl(), fdatasync(), fstatfs(),
  fsync(), ftruncate() and lseek(). Code which is not strictly
  required will no longer find its way into your programs if you
  link with the updated library.

  NOTE: these changes require that the entire library is rebuilt!


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14833 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-18 18:53:17 +00:00
ea638f0970 - Moved the slash translation code around a bit more. Now ".//" comes out as
"" rather than ":".


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14832 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-16 14:48:17 +00:00
4aa85e1d12 - Rewrote the __translate_unix_to_amiga_path_name() function to
translate patterns such as "foo/bar/../../baz" properly, and to
  use strlen() less.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14831 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-15 17:27:22 +00:00
fcb8cfc0dc - Small changes to make this build properly for OS4.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14830 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-07 11:19:32 +00:00
a626336b7b - Tweaked the build makefiles to produce fewer meaningless warnings.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14828 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-07 10:52:32 +00:00
07d09bb185 - Added the fsync() and fdatasync() functions and the <stdint.h> and
<inttypes.h> header files contributed by Peter Bengtsson. Thank
  you very much!


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14827 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-04 15:03:14 +00:00
6ad88ff97f - The library no longer sends ACTION_DISK_INFO packets to the console
handler. The side-effects were too varied and irritating after all.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14826 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-04 08:49:10 +00:00
2ddfeab0cf - Added some extra documentation on the WBStartup variable.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14825 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-03 17:33:54 +00:00
91028c63bc - Lost the __not_a_number and __infinity variables, including the
code which initialized them.

- Reading/changing the errno variable is no longer done directly, but
  involves accessor functions.

- References to the HUGE_VAL quantity now involve an accessor function, too.

- Changed the manner in which the __huge_val constant is initialized by
  the __math_init() function.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14824 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-03 16:56:20 +00:00
209884bd1f - We now allocate the AnchorPath used in the unistd_wildcard_expand.c
code. Also, the contents of the AnchorPath structure are no longer
  modified between calls. MatchEnd() has to be sufficient.

- Moved redundant code out of the readdir()/opendir()/closedir()
  functions which is not required unless the code is built for
  Unix compatibility mode.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14823 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-03 12:16:38 +00:00
3548d3cf7e - We now allocate the AnchorPath used in the unistd_wildcard_expand.c
code. Also, the contents of the AnchorPath structure are no longer
  modified between calls. MatchEnd() has to be sufficient.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14822 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-03 12:14:55 +00:00
50b8b623cc - Folded duplicate code in "time_mktime.c"; also, errno is no longer
modified unless the library is built with the "CHECK_FOR_NULL_POINTERS"
  option.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14821 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-30 16:10:59 +00:00
49bc1d6b13 - Updated the ".cvsignore" file.
- Moved the date/time conversion test code around in "test.c".


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14820 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-30 10:23:26 +00:00
fce21e21d6 - The functions in stdlib.h which require a compiler that supports the
"long long" data type are no longer prototyped if the library is built
  for SAS/C.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14819 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-30 09:48:06 +00:00
f8b1e7516f - Folded duplicate code stdio_init_exit.c into a common function.
- Simplified the code in time_asctime_r.c which builds the time
  string. It gracefully handles buffer sizes which are too short
  by returning an empty string.

- Moved the tm->tm_wday initialization out of the hook function
  in time_strftime.c since it was to be called only once anyway.

- Lost a few compiler warnings in unistd_time_delay.c and
  time_gettimeofday.c.

- Folded duplicate code in time_mktime.c; also, errno is no longer
  modified unless the library is built with the CHECK_FOR_NULL_POINTERS
  option.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14818 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-30 09:37:59 +00:00
8e2820e9b7 - Added the missing 'time_convert_time.c'.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14816 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-29 18:22:19 +00:00
ab22a23f27 - Changed the algorithm that calculates the number of days that have passed
so far as used by the the __convert_time() function and the conversion
  code in strftime().

- Also changed the algorithm used by strftime() to produce the week numbers
  (the '%U' and '%W' format specifiers). The new method is much simpler
  than the old one.

- Made the code that converts a 'time_t' value into the 'struct DateStamp',
  as used by strftime() and utime(), into its own function. This also
  fixes a bug in the code strftime() would use which was completely
  unaware of the local time zone settings.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14815 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-29 18:05:14 +00:00
0ae8d68e64 - We also test the strftime() %U, %W and %j format specifiers.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14814 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-29 17:48:07 +00:00
0b1d21471d - Plugged in a different algorithm for calculating the day of the week in
strftime() and asctime_r(). This one isn't sensitive to the effects of
  adding/subtracting the local time zone.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14813 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-26 18:41:39 +00:00
987316e638 - Added a missing file.
- Updated the .cvsignore file.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14812 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-26 09:24:38 +00:00
e8d4187ea5 - The general test program now also exercises the time conversion functions.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14811 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-25 11:21:58 +00:00
003faf7a24 - mktime() is supposed to convert the time specification, given as local
time, into the number of seconds since January 1st, 1970, relative to
  UTC. This didn't really work up until now since the time value returned
  was given as local time.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14810 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-25 11:21:00 +00:00
d1aaa84bcc - Moved the common DateStamp to time_t conversion code into a shared
function.

- The fall-back function for converting time into a string in strftime()
  now calls itself for the "%x" and "%X" format specifiers.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14809 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-24 10:25:46 +00:00
e1476c15b3 - Added instructions for switching over an existing Amiga 68k GCC installation
to use "clib2".


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14808 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-20 12:47:31 +00:00
17fea5626a - Added a check against DBL_EPSILON in log() and log10() in place of the
check against 0 that used to be in there.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14807 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-18 20:00:08 +00:00
e4b70e946f - The default console output window opened when a program is launched
from Workbench would open and stay open. This was not intended to
  happen and is a side-effect of the new stdio initialization code which
  checks if the stdio streams are in non-blocking mode. Fixed.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14806 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-15 08:17:10 +00:00
56b0a74c61 - Added a missing definition to stdio_init_exit.c which is part of
the OS4 header files, but not of the older header file distributions.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14804 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-14 09:07:17 +00:00
d23f4318f9 - close() did not reset the non-blocking file property, as it should
have. This only worked for files which were closed anyway, but not
  for the stdio streams. Fixed.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14803 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-14 08:36:54 +00:00
23f70d0c53 - Lost some more code that is not required for AmigaOS 4.x and can be
handled conveniently through conditional compilation.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14802 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-13 15:39:39 +00:00
c6fcede4ce - Whether or not stdio console streams are blocking or non-blocking
is now determined at initialization time. The I/O mode is restored before
  the program exits. Previously, any changes to the I/O mode would persist.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14801 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-12 09:15:50 +00:00
5801d000d4 Added -a switch to cp so that it behaves like Copy CLONE.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14800 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-10 00:56:15 +00:00
619b64e6f4 - open() no longer examines a file after opening it in order to figure
out whether read/write accesses are permitted. This decision is now
  for the file system to make.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14799 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 16:07:27 +00:00
5191ee5660 - The V37/V40 compatibility code is no longer built for the AmigaOS4
version of the library.

- Switched over the last use of DeviceProc() to GetDeviceProc(), etc.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14798 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 15:58:02 +00:00
64c1175f7b - Made the <ctype.h> macros more robust.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14797 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 15:20:33 +00:00
be827762de - Added the baserel directory to the .cvsignore file.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14796 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 10:44:25 +00:00
618299fb48 - Replaced ASSERT() macro invocation with assert() call.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14795 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 10:43:40 +00:00
fbc6d94840 - Dropped the special flag variable used by the abort() function that
tracks whether or not console output is possible. We now use the
  global "__no_standard_io" instead.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14794 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 10:10:41 +00:00
5cf80326bc - Removed a misplaced IsInteractive() from the stdio initialization
function. Now this could have been big trouble...

- Removed tests for FileHandle->fh_Type != NULL which used to precede
  all IsInterative() tests. I verified that IsInteractive() will always
  return FALSE for NIL: type file handles.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14793 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 09:54:33 +00:00
e571888f4f - The "char" limits in <limits.h> are now set up according to the current
compiler settings, which can either default to an unsigned or
  signed definition.

- Changed the rules again for the use of stderr/stdout redirection when
  printing error messages. It is always safe to redirect them now and
  no requester will appear unless you specifically set the value of the
  "__no_standard_io" variable to TRUE in your program.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14792 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 09:40:33 +00:00
f519aafaca - Redirecting stderr to a file no longer has the effect of showing error
messages and assertion failure notifications as requesters. The exception
  is in redirecting stderr to NIL: which will prompt the requester use.

- gettimeofday() now calls GetSysTime() rather than DateStamp() to obtain
  the current system time. This resolves granularity issues since the
  DateStamp() result was only accurate by 1/50 of a second.

- The "ptrdiff_t" definition in <stddef.h> now defaults to type 'int' rather
  than 'long int'.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14791 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-08 10:21:28 +00:00
984c6729c1 - Updated the copyright information.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14789 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-02 09:07:21 +00:00
49df44872d - fwrite() now flushes the entire "buffer" for unbuffered files. The
exception are "interactive" files such as console windows. For these
  line buffered output is used.

- Whether or not a file is bound to an interactive device, such as a
  console window, is now checked and remembered after a file descriptor
  has been associated with it.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14788 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2004-12-27 09:15:55 +00:00
e77cc97daf - The data structure alignment (file I/O buffer) is now configurable
at compile time. The default used to be 16 bytes, which is appropriate
  for the 68040/68060 but not for the PowerPC, which uses 32 or 128
  bytes per cache line.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14787 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2004-12-26 13:14:47 +00:00
ad0880d204 - Changed the definition of alloca() for GCC, which now defaults
to the built-in function.

- Updated the stdio.h, stdlib.h, string.h and unistd.h header files
  to declare function prototypes for the __MEM_DEBUG versions of the
  library functions only if that preprocessor symbol is defined.

- If a SIGINT signal is caught and processed by the default signal
  handler, the localized "*** BREAK" string will be printed rather
  than the built-in one.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14786 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2004-12-26 10:28:57 +00:00
d74535f87f - Tried to make it possible to have debug versions of the memory
management code in the default link library along with the
  normal versions. Let's see how well this works out in the GCC
  version. SAS/C does not seem to like it...


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14785 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2004-12-24 18:31:38 +00:00
73e6ccc14e - Moved the memory initialization and cleanup functions into the
malloc/free code itself and updated the alloca code to do its
  own data management.

- Finally optimized the alloca() memory cleanup code.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14784 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2004-12-24 11:46:12 +00:00
3c9f119046 - The common error reporting function __show_error() could throw Enforcer
hits if the program was not launched from Shell. Fixed.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14783 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2004-12-24 10:52:02 +00:00
76c68da3a5 - Moved the environment variable cleanup code into a destructor function.
- Fixed a typo in the hstrerror() function.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14782 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2004-12-19 16:42:51 +00:00
7b67ccdec1 - The Kickstart 1.x specific code for error requesters is no longer built
for the OS4 library.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14781 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2004-12-13 11:11:57 +00:00