aboutsummaryrefslogtreecommitdiff
path: root/jim-aio.c
AgeCommit message (Collapse)AuthorFilesLines
2010-11-24Remove the bio extension and add 'copyto' to aio.Steve Bennett1-0/+51
The bio extension is a hangover from TinyTcl. Since Jim supports binary strings, there isn't much need for it except for 'bio copy'. So move this to aio as 'copyto' and implement 'file copy' in terms of it. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-09Allow jim to be used as an autoconf subdirSteve Bennett1-0/+1
Ensure that no public headers include the autoconf header, jimautoconf.h, as it leads to problems with redefined symbols. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-30Fix segfault with unix domain socketsSteve Bennett1-4/+4
Path argument was not being set. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-30Add aio '$handle filename'Steve Bennett1-0/+12
Retrieves the original filename Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Licence wording updates.Steve Bennett1-2/+0
Per v0.51, don't refer to the FreeBSD licence Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Portability fixesSteve Bennett1-44/+82
Especially for eCos, mingw32 and cygwin Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Implement Tcl I/O wrappers in TclSteve Bennett1-110/+17
This allows 'rename' etc. to work correctly and is smaller, simpler code Also, read -nonewline is mutually exclusive with 'numChars' Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Ensure that Tcl extensions can be built-in or externalSteve Bennett1-0/+3
All C extensions must call Jim_PackageProvide() make-c-ext ensures that Tcl extensions call Jim_PackageProvide() if compiled in. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15eventloop improvements and enhancementsSteve Bennett1-1/+1
Move Jim_EvalObjBackground() out of the core to eventloop Time events are now kept and triggered in time order Time handlers are removed before execution Add 'update' Add 'after info' and 'after idle' Include time events in the return from Jim_ProcessEvents() Add Tcl eventloop tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Make sure all static data is marked read-onlySteve Bennett1-1/+1
This reduces the size of the non-shared data segment Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Implement open "|..."Steve Bennett1-17/+17
Uses a Tcl wrapper, popen, from tclcompat Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Reduce excessive stack usageSteve Bennett1-3/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix some eventloop problemsSteve Bennett1-48/+18
File handlers now pass through the error code and the handler is deleted on error. If there is nothing to do, vwait returns. If bgerror doesn't exist, print the original error to stderr. Also remove the 'eof' event handler since it isn't needed. Can just call [eof $f]. This also fixes source locations within 'readable' scripts. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15fh error not cleared after signalSteve Bennett1-5/+6
Use clearerr() after a read fails to avoid repeated failures after a signal. Also, dont' treat EINTR as an error in gets. And remove some leftover perror() calls. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15aio recvfrom was not null terminating the resultSteve Bennett1-0/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add basic ipv6 support to JimSteve Bennett1-76/+241
Use -ipv6 to signify that ipv6 should be used Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Clean up the indentation messSteve Bennett1-195/+213
Use 'indent'. Not perfect, but at least consistent. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to jim configureSteve Bennett1-124/+149
Create and use config.h Check for backtrace, fork, vfork, syslog, regcomp and others Disable extensions which require missing functions/features Check for one arg vs. two arg mkdir() Distinguish between mingw and native windows The aio extension has reduced functionality for ANSI C only Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Make udp sockets usefulSteve Bennett1-19/+103
Separate socket types: udp client and udp server Allow client sockets to 'connect' to an address Allow server sockets to 'bind' to an address Add support for 'sendto' and 'recvfrom' Add socket client and server examples Document new udp sockets Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Documentation, build system updatesSteve Bennett1-3/+3
Document reference-related commands *: ref, getref, setref, finalize, lambda were missing Build system updates *: Add check for long long to configure *: Change -Dwith_jim_ext_... to -Djim_ext_... *: Fix jim-eventloop when compiling with no long long
2010-10-15Add Jim_SetResultFormatted() for simplied messagesSteve Bennett1-3/+1
Makes creating error messages much simpler Also convert a couple of long if/else to switch Also some error message improvements Also fix some memory leaks
2010-10-15Various general fixes and cleanupsSteve Bennett1-7/+3
Add lsearch -command, update case to use lsearch Rename tcl6.tcl to tclcompat.tcl Remove // style comments Expand some tabs to spaces Fix some compiler warnings Remove some unused functions Don't close fd=-1 in exec
2010-10-15Implement 'socket pipe'Steve Bennett1-36/+85
------------------------------------------------------------------------
2010-10-15Bug fixes, documentation updatesSteve Bennett1-2/+6
jimsh - retry on EINTR from fgets() Fix 0 -> NULL for 64 bit systems Fix overlapping memcpy Fix jim array dereferencing bug *: Counting of parentheses was incorrect with nested array references *: The result for array dereference wasn't being used properly Add os.uptime command Documentation: autogenerated command index Fix gets when last line has no newline
2010-10-15aio fixesSteve Bennett1-33/+65
Fix argument checking/rearrangement in Tcl I/O compat Better aio error messages
2010-10-15Implement unix domain sockets for socketSteve Bennett1-92/+181
*: aio.socket now supports unix and unix.server *: Also, rename aio.open as open and aio.socket as socket
2010-10-15Bugs, features and testsSteve Bennett1-7/+5
source fails with zero length file unknown can't be called recursively *: This can be useful when using unknown to dynamically load code, which may in turn want to dynamically load code *: Limit it to 50 recursions though Allow string greater/less comparison *: Comparing two strings for order did not work Implement file join *: It's not to hard and is handy when working with the current dir, "" Don't omit [unknown] completely from stack trace *: Since we lose valuable informtion, just omit the name Fix return from case Turn regexp patterns into real objects *: Thus caching the compiled regexps Allow error to rethrow an error Replace bcopy() with more standard memcpy() Fixes to parray, improve errorInfo *: errorInfo takes an optional stack trace Add tests for rethrowing errors via errorInfo Fix ndelay *: Was looking at wrong param *: Also fix usage/help for aio.socket Package should be able to call exit *: Currently any return from a package is changed to JIM_ERR Line counting is incorrect for backlash newline
2010-10-15Enhance exec, bioSteve Bennett1-0/+9
Support @filehandle syntax Support for nommu Disable os.fork for nommu Remove trailing newline No need for binary escaping in bio module ------------------------------------------------------------------------
2010-10-15Build even if eventloop is not enabledSteve Bennett1-22/+22
2010-10-15Convert jim-aio.c to use subcmdSteve Bennett1-342/+416
Also: - make stream.server set SO_REUSEADDR - do object reference properly for callbacks - white space cleanup in jim-eventloop.c - fix the pwd command - add support for JIM_MODFLAG_FULLARGV to subcmd - make verbose runtests easier to read - bio might not be available
2010-10-15Small improvementsSteve Bennett1-9/+13
Save (but then cleanup) generated extensions Add package and readdir to 'all' extensions Order of static extensions matters!! Simple C define support for configured extensions Fix some compiler warnings
2010-10-15Lots of improvementsSteve Bennett1-37/+100
jim --- Add a unique id facility to jim (Jim_GetId()) Remove unused jim_vasprintf(), Jim_AppendString_sprintf() Remove duplicate output in Jim_Panic() Add support for catch -signal aio --- Use this for aio handles aio automatically creates stdin, stdout and stderr channels Jim_AioFilehandle() returns the 'FILE *' filehandle for a channel If JIM_TCL_COMPAT is set, create top level open, close, read, puts, etc. load ---- load core command split out into jim-load.c package ------- package core command split out into jim-package.c added 'package list' posix ----- Remove os.sleep, os.usleep, os.sethostname, os.signal, pit, Jpit Most of these are in 'signal'
2010-10-15Make static extensions buildSteve Bennett1-133/+119
Also clean up some white space
2010-10-15Add file and exec (along with subcmd support)Steve Bennett1-1/+1
2010-10-15Strip out unneeded junk from JimSteve Bennett1-73/+24
Nvp, getopt, move interactive processing to jim-interactive.c
2010-10-15Cutover to new workware fork of Jim TclSteve Bennett1-0/+2
Note that this commit removes some files and undoes some commits which will be reapplied later. This is the easiest way to switch across. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-02-01Bring corrected license as mentioned in freebsd/...Wojciech A. Koszek1-2/+0
Remove "FreeBSD license" statements, since it's not a correct term I believe. Small cleanup while being here.
2010-02-01Revert "Bring correct license -- I think freebsd/ directory has an agreements"Wojciech A. Koszek1-0/+2
This reverts commit 1e2fdd7d9e877fbe2c88a4c32f098ce1e575dc1d.
2010-02-01Bring correct license -- I think freebsd/ directory has an agreementsWojciech A. Koszek1-2/+0
for relicensing all files within Jim project. "FreeBSD license" isn't correct term, so basically remove it. Try to make the whole place consistent.
2008-07-23Uwe Klein:oharboe1-2/+6
* fix missing vararg.h in some files ( included in jim.h ) * in aio.socket return an error when hosti resolution fails instead of just carrying on.
2008-07-23JIM_SUPPORT_EVENTLOOP addedoharboe1-0/+10
2008-07-23 * jim.c: reduce stack usage. Important for embedded devices withoutoharboe1-8/+12
MMU. * jim.c, jim-aio.c, jim-eventloop.c, jim-eventloop.h: emergency repairs to make code compile with eCos after event loops was added. event loop stuff compiles under eCos at least, but this was not tested for regressions.
2008-07-21 * src/jim.c: very slightly improved error messages.oharboe1-17/+39
* FreeBSD license cleanup wip
2008-07-142008-07-13 Uwe Klein <uklein@klein-messgeraete.de>oharboe1-10/+383
* This adds open async, fileevents and sockets ( tcp server, client ) to jim-aio, using fileevents requires the jim-eventloop package .
2008-06-18 * ChangeLog, jim-aio.c: Andrew spotted a bug in theoharboe1-1/+1
aio.gets implementation for lines that are more than AIO_BUF_LEN long. GCC 4.3.1 pointed out this problem.
2008-06-16 * retire CVS keyword expansion. Plays havoc with patches.oharboe1-2/+0
2008-06-15 * ChangeLog, jim.c, jim.h, jim-aio.c: Support for eCos.oharboe1-1/+8
2007-01-31Fixed the stdio declarations to work on Windows and likely on Solaris.patthoyts1-3/+4
A number of MSVC related fixes including support for creating a jim dll
2006-11-06Jim-aio is now able to be statically linked with jim.cantirez1-4/+12
on systems like eCos where there is no dynamic libraries support.
2005-04-12AIO fix: the Id is not get with the GetGlobalVar function.antirez1-2/+2