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

176 Commits

Author SHA1 Message Date
42963b39c4 - Moved data out of stdlib_data.c and into the code that references
or initializes it.

- The stdlib constructor now performs the CPU/FPU compatibility test.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14879 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-11 09:37:29 +00:00
678cab02fb - The macro definitions deserved better documentation. Well, they probably still do...
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14878 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-10 13:58:13 +00:00
59d7f8d07f - Fixed another interesting bug in the OS4 destructor code.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14877 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-10 13:30:11 +00:00
9a7c8a8705 - Corrected a typo in the OS4 destructor code.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14876 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-10 13:28:05 +00:00
96e74015f0 - Added S_IREAD, S_IWRITE and S_IEXEC aliases to <sys/stat.h>.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14875 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-10 11:40:57 +00:00
db8710d2ae - Reimplemented the constructor/destructor invocation code for GCC.
Both the 68k and PowerPC platform now invoke them in the same order
  and the 68k code uses the designated invocation priorities. The
  PowerPC destructor function now sets up the exit() jmp_buf before
  the destructor functions are called.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14874 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-10 09:55:03 +00:00
91f12dd8f0 - Reworked the constructor/destructor macros again.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14873 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-10 07:53:57 +00:00
d2f157b0a1 - Cleaned up the GCC constructor/destructor macros again. There is more to come.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14872 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-10 07:47:51 +00:00
e3e82b3657 - Thanks to Joerg Strohmayer, the GCC library build now manages to
invoke the library's constructor/destructor functions in a
  very particular order. That way, you can use constructor/destructor
  functions in your own code and not have them clash with the library's
  own functions.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14871 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-09 21:07:25 +00:00
4d3dc4a77f - The stdio destructor no longer resets the __iob pointer to NULL. This
avoids trouble with destructor functions which use stdio code. Unsolved
  problem: the order in which destructors and constructors are called.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14870 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-09 16:56:05 +00:00
ee556fcb35 - Moved a few __delete_semaphore() calls into conditional compilation
sections where they should have been in the first place.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14869 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-09 12:06:10 +00:00
cc8a8e42c0 - Moved the data declarations out of math_data.c, stat_data.c,
socket_data.c, dirent_data.c and stdio_data.c and into the
  code that initializes them.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14868 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-09 10:48:59 +00:00
0fad53e56e - Moved the CPU/FPU type tests into the respective linker
libraries.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14867 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-07 16:56:36 +00:00
d33e3e909e - Cleaned up the 68k build makefile, so that the CPU and FPU
tests and the error message display can run safely even
  on plain 68000 machines. This won't work for the 32 bit small
  data model, which implies 68020 code, but so there...


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14866 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-07 14:04:09 +00:00
ef43011783 - Made the file descriptor checks in the fsync() and fdatasync()
functions more robust.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14865 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-07 11:58:50 +00:00
a9c8cdc554 - Moved the Workbench console stream initialization into the
initialization code for the stdin/stdout/stderr streams and
  out of the program parameter setup.

- The current program name is now set up in the stdlib
  initialization function.

- Simplified the machine test code; moved the FPU check into
  the math initialization code.

- Added more safety checks to verify that file descriptor
  file handles are valid.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14864 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-07 11:16:43 +00:00
d370bd123b - Corrected the names of macros.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14863 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-06 09:04:44 +00:00
6931123dc1 - DoTimer() now calls AllocSysObject() rather than making up
a MsgPort locally.

- The record locking semaphore code now builds a semaphore to add
  before it tries to find the public one in memory. That way, the
  code can spend less time in Forbid() state and, heaven forbid,
  refrain from allocating memory while in that state.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14862 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-06 09:00:16 +00:00
b2ddf28fa7 - Replaced the plain text documentation with HTML versions.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14861 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-05 18:34:01 +00:00
1bc19a04d3 - Fixed a compiler problem in the socket setup.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14860 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-05 17:55:26 +00:00
1a0999bc1c - Feature freeze!
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14859 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-05 17:16:55 +00:00
1bf430d1d6 - In the thread-safe variant, the library now tries to allow
multiple concurrent callers to use the socket functions. Note
  that this works only with the Roadshow TCP/IP stack, and the
  results with other TCP/IP stacks are rather unpredictable.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14858 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-04 20:08:19 +00:00
f2d1a3238d - Rewrote the code that allocates the file descriptor and file
buffer tables so that all the memory allocations are in one
  place and it's possible to specify exactly how many table
  entries are required at a time.

- Creation and initialization of semaphores now uses the AmigaOS4
  specific functions for this purpose, if available.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14857 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-04 09:07:09 +00:00
2c3bd39f71 - Added a very simple test program, just to see how much of the library
it will pull in when linked.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14856 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-03 15:12:18 +00:00
0deb0e3e2d - Added uname command, as contributed by Peter Bengtsson. Thank you very much!
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14855 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-03 15:02:26 +00:00
dd380f8479 - Fixed the OS4 specific build makefile.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14854 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-03 14:46:10 +00:00
ec3d921f7b - Moved the signal semaphore allocation/initialization/deallocation
into a dedicated module. This also has the advantage that it's
  harder to break code by accidentally forgetting to call
  InitSemaphore() after having allocated the memory for it.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14853 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-03 14:20:55 +00:00
ebd6cc3639 - Added the missing header files required to rebuild ftw_ftw.c and
ftw_nftw.c.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14852 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-03 10:59:17 +00:00
7690bb8399 - Reworked the code that handles quoting for the wildcard expansion
routine. We no longer allocate memory and then modify it, but
  call a function for each quoted parameter which does whatever is
  necessary.

- The shell command parameter parser now considers the non-breaking
  space character (ISO code 160) to be a blank space character, too.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14851 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-03 09:32:09 +00:00
2aba208878 - The lstat() code now reliably detects that it found a soft link.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14850 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-02 18:49:01 +00:00
593caccb38 - Fixed the compilation problems I had introduced by mistake.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14849 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-02 14:47:10 +00:00
ac0cc97924 - Added atoll(), ffs(), ftw(), nftw(), lstat() and uname() code
contributed by Peter Bengtsson. Thank you very much!


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14848 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-03-02 12:57:56 +00:00
ef44c75126 - Cleaned up the header files some more; the POSIX stdio thread locking functions
are now defined as empty macros unless __THREAD_SAFE is defined.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14847 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-28 13:42:54 +00:00
9a8fe330a9 - Updated the README file to mention the PowerPC platform, the floating point
support and the thread-safety.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14846 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-28 13:32:59 +00:00
17d81c12c0 - The translation of Unix to Amiga path names now silently accepts
absolute Amiga path names passed to it and will use them without
  changing them.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14845 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-28 13:32:11 +00:00
c799b17bb9 - Extended the thread-safety locking to the file descriptors.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14844 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-28 13:22:53 +00:00
1df294c07e - The thread-safety code is now subject to conditional compilation.
Both the library and the user code need to be rebuilt with the
  preprocessor symbol __THREAD_SAFE defined to get thread-safe
  code.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14843 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-28 10:07:35 +00:00
f51faeb168 - Added more semaphore locking around the basic stdio, memory, locale
and dirent data operations. That should do it! While the library is
  not reentrant (this is not ixemul.library) it should be thread-safe
  now. Thread-safe in the sense of POSIX 1003.1c-1995.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14842 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-27 21:58:21 +00:00
c0c70bfd99 - Added stdio thread locking functions flockfile(), funlockfile(),
and ftrylockfile().

- Modified the internal FILE structure to allow for thread locking.
  Note that this again requires that the library is rebuilt!

- Added or modified macros for getc_unlocked(), getchar_unlocked(),
  putc_unlocked() and putchar_unlocked().

- Added rand_r().

- Added flockfile()/funlockfile() wrappers around all stdio
  functions.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14841 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-27 18:09:12 +00:00
b10d1ad38c - The process window pointer is now restored and reset between ^C
checks while wildcard patterns are expanded in the the command line.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14840 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-26 09:05:54 +00:00
1550c6fef3 - When using the wildcard expansion code for command line
parameters (which is by default linked in with libunix.a),
  regular expressions can no longer prompt dos.library requesters
  to appear. However, to be on the safe side, if you are expecting
  to pass regular expressions on the command line, do not use
  the wildcard expansion code such as by overriding the library
  symbols with dummy functions such as are used in the file
  "stdlib_wildcard_expand.c".

- Added a new variable '__open_locale' which can be used to
  restrict all library functions to use the "C" language locale
  rather than the current system locale settings. In addition
  to that, two new functions __locale_exit() and __locale_init()
  can be used to close and (re-)open the system locale at a
  later time.

- Local ("static") functions are now identified by the STATIC
  qualifier. This was done in preparation for changes that will
  deal with global and local data and the issue of thread safety.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14839 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-25 10:14:22 +00:00
53d99ac7a2 - Fixed a warning for a possibly uninitialized variable in the new iob hook
code.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14838 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-21 16:09:44 +00:00
c4c25649f2 - Cosmetic changes for (hopefully) better readability.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14837 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-21 10:22:02 +00:00
18f1f75479 - The lseek() function return code was not consistently treated as the
then current file position. Fixed.

- Numerous house-keeping changes.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14836 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-20 15:46:57 +00:00
410833d2ed - The buffered and unbuffered file hook code is now invoked through
function pointers alone. The utility.library/CallHookPkt mechanism
  is no longer required.

- Moved the entire lseek() code relevant for files into the hook
  function.

- Simplified the close() function which now just calls into the
  hook code to perform whatever is necessary. The hook code is
  responsible for cleaning up after aliases, etc. This change in
  turn made it possible to greatly simplify the hook code for
  buffered files which now bypasses close/read/write/lseek and
  directly invokes the hook code for unbuffered files.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14835 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-20 13:19:40 +00:00
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