Commit Graph

465 Commits

Author SHA1 Message Date
mainzelm 64d35131f3 Fixed a subtle bug in the macro for the << redirection: The port
opened by open-input-string could be closed by the GC before the exec().
Now << stores the port in a global variable.
The test to reveal the bug was:

(let lp ()
  (run (head) (<< "a"))
  (lp))

printing a "closed channel" message after some a few hundred interations.
2002-09-12 07:30:30 +00:00
eknauel 87846eef58 - support for SQLNativeSql()
- dynamic memory allocation for return values in these functions:
  - odbc_sql_get_info_string()
  - odbc_sql_get_connect_attr_string()
  - odbc_sql_get_stmt_attr_string()
  - odbc_sql_get_desc_field_string()
  - odbc_sql_get_cursor_name()
  - odbc_sql_native_sql()
  - odbc_sql_get_data()
  - odbc_sql_describe_col()
  - odbc_sql_get_diag_recs()
- odbc_sql_data_sources() is still broken: sometimes the result string
  is truncated. I'm not sure if this not a unixODBC-bug...
2002-09-11 14:12:30 +00:00
mainzelm e811e1d729 Direct interface to directory streams (stolen from S48). 2002-09-06 13:22:16 +00:00
mainzelm aa57bec9c2 Support for uname. 2002-09-06 12:23:18 +00:00
mainzelm 48a009c698 Create a fresh vector of handlers on startup. 2002-09-06 11:25:59 +00:00
mainzelm ff0ce8fdfb + user-effective-uid and -gid per thread.
+ alignments for euid- and egid-resource
+ argument to chdir is now optional and defaults to (home-dir)
2002-09-06 09:57:32 +00:00
eknauel 97744da0da - Support for SQLGetDescField() (odbc-sql-get-desc-field-int and
odbc-sql-get-desc-field-string)

- Support for SQLNativeSql() (odbc-sql-native-sql)
2002-09-05 14:23:52 +00:00
eknauel 2e4ac7c244 Support for SQLMoreResults() (odbc-sql-more-results) 2002-09-04 13:53:10 +00:00
eknauel 78b653e815 Support for SQLSetPos() (odbc-sql-set-pos) and SQLBulkOperations()
(odbc-sql-bulk-operations)
2002-09-04 13:32:21 +00:00
eknauel 7ddfc3211c Added support for catalog functions:
- SQLColumPrivileges() (odbc-sql-column-privileges)
- SQLColumns() (odbc-sql-columns)
- SQLForeignKeys() (odbc-sql-foreign-keys)
- SQLPrimaryKeys() (odbc-sql-primary-keys)
- SQLProcedureColumns() (odbc-sql-proecedure-columns)
- SQLProcedures() (odbc-sql-procedures)
- SQLSpecialColumns() (odbc-sql-special-columns)
- SQLStatistics() (odbc-sql-statistics)
- SQLTablePrivileges() (odbc-sql-table-privileges)
- SQLTables() (odbc-sql-tables)
2002-09-04 12:09:35 +00:00
eknauel 7b409e8371 Support for SQLRowCount() (odbc-sql-row-count) 2002-09-03 14:08:04 +00:00
eknauel f0fdf618fe Support for SQLGetCursorName() and SQLSetCursorName() 2002-09-03 13:44:06 +00:00
sperber 3d7f50ada2 Cosmetic fix: the file uses explicit STRUCTURE-REFs for all
references to THREADS-INTERNAL except one.  Make that one reference
into a STRUCTURE-REF also.
2002-09-03 13:23:54 +00:00
sperber efb2ad6bed Factor SCSH-ENDIAN out of SCSH-LEVEL-0. 2002-09-03 13:12:32 +00:00
sperber 5eda8d0713 Fix some obscure import issues with DELIMITED-READERS. 2002-09-03 12:53:47 +00:00
sperber 416769997a Factored DELIMITED-READERS out of SCSH-LEVEL-0. 2002-09-03 12:41:45 +00:00
eknauel 64b6410756 New record type odbc-column for SQLDescribeCol()
(odbc-sql-describe-col) return values.
2002-09-03 12:34:18 +00:00
eknauel a76fdbfe59 Fixed SQLDescribeCol (odbc-sql-describe-col) 2002-09-03 12:33:17 +00:00
sperber 9772b62b54 Factored STRING-COLLECTORS out of SCSH-LEVEL-0. 2002-09-03 12:30:08 +00:00
sperber 0d4943b9b5 Factor SCSH-ERRORS out of SCSH-LEVEL-0. 2002-09-03 12:25:12 +00:00
eknauel 186f745306 - Fixed confusion of database-handles (which basically are
non-existent) and descript-handles.
- sql-datatype-* defintion for use with SQLGetTypeInfo() (odbc-sql-get-type-info)
2002-09-03 08:18:42 +00:00
eknauel 23151f3ad1 - Don't distinguish between SQL_SUCCESS and SQL_SUCCESS_WITH_INFO.
- Don't call SQLGetDiagRec() automatically on SQL_ERROR, some ODBC
  seem to have a broken SQLGetDiagRec() implementation. Let user call
  SQLGetDiagRec() from Scheme at his own risk.

The ODBC documentation thinks it's a good idea to call SQLGetDiagRec()
after each ODBC-call that might return SQL_SUCCESS_WITH_INFO. IMHO
this sucks. However it's now possible to do so in the user's Scheme
code.
2002-09-03 08:14:14 +00:00
eknauel 7efd91d54f Support for SQLGetDiagRec (odbc-sql-get-diag-recs) 2002-09-02 15:05:43 +00:00
eknauel 180850580c Fixed odbc_sql_get_diag_recs 2002-09-02 14:45:28 +00:00
eknauel a62bf26d5b - support for SQLGetDiagRec
- bugfixes fpr odbc_sql_data_sources and odbc_sql_drivers
2002-09-02 13:36:00 +00:00
eknauel 9b85dcf9da - represent handles as Scheme records of diffrent types
(environment-handle, connection-handle, statement-handle,
  database-handle)
- make ODBC functions these records
- Tons of constants for SQLGetInfo()
- get rid of some stupid pseudo-highlevel-ODBC-functions
2002-08-29 13:52:25 +00:00
eknauel 29115fc716 Scheme records for ODBC structures date, time, timestamp and numeric 2002-08-29 13:49:14 +00:00
eknauel 00dc5a0296 Don't call SQLGetDiagRec on SQL_ERROR return values, this causes
certain odbc drivers to crash.
2002-08-29 13:47:26 +00:00
mainzelm c8864c6c9a Remove duplicate initialization of cwd. 2002-08-27 16:46:02 +00:00
sperber 6eb3a1b0cc Obsolete. 2002-08-20 14:22:33 +00:00
sperber 33c14d7901 First stab at implementing SELECT/SELECT!:
- extend the VM interrupts to distinguish between read and write
  events
- add new ADD-PENDING-CHANNEL instruction to the VM
- add WAIT-FOR-CHANNELS procedure to the run-time system
- implement SELECT and SELECT! on top of that in newports.scm

This runs some basic tests, but in general should be considered
largely untested.

Moreover, SELECT/SELECT! never detect any exceptional conditions---the
returned vectors are always empty.  This is because the VM doesn't
really track those, and it's unclear whether it would be worth the
effort.
2002-08-20 14:03:01 +00:00
sperber ac343ba970 Replace Martin's implementation of selective blocking by the one in
Scheme 48 1.0.1.

Namely, instead of associating a list of queues with every thread, we
associate a single cell, holding the thread.  That cell is stored in
thread queues, and once a thread is made runnable again, the cell is
set to #f.  The thread-queue accessors ignore cells containing #f.

Implement an experimental OBTAIN-LOCK-MULTIPLE to test the whole
thing.
2002-08-16 14:11:50 +00:00
mainzelm 51230dfab1 Remove debugging message which isn't printed anyway. 2002-08-16 12:33:00 +00:00
mainzelm 4540ad4589 Don't call install-env when initializing scsh because this is already
done by a reinitializer in scsh.scm.
2002-08-16 12:12:31 +00:00
sperber 671f2c0181 Remove even more unneeded crud from utilities.scm. 2002-08-14 15:04:50 +00:00
sperber 8ebe0fe3f8 Obsolete. 2002-08-14 14:47:38 +00:00
sperber 09db2fed71 Remove a bunch of crud from utilities.scm as well as the dependencies
upon that crud.
2002-08-14 14:45:33 +00:00
sperber 7f1879b497 Remove the old LIST-LIB, STRING-LIB, and CHAR-SET-LIB libraries, now
that the corresponding SRFIs are in the Scheme 48 core.

All this hopefully preserving backwards compatibility.
2002-08-14 14:23:41 +00:00
sperber 4381ac9095 Add a whole bunch of S48_GC_PROTECT annotations in functions which
call s48_extract_integer.

s48_extract_integer can cause a callback for bignums, and, hence, heap
allocation.

This fixes a bug report by Seth Alves <alves@hungry.com> noting
spurious failures in SET-FILE-TIMES.
2002-08-13 15:46:17 +00:00
mainzelm d30130ab03 Deadlock-free resource locking. 2002-08-13 06:49:22 +00:00
eknauel f456608175 - record-types for sql-data, sql-time and sql-numeric
- tons of function ids for usage with SQLGetFunctions (sql-api-*)
- some key values for SQLGetInfo (sql-get-info-*). Need to be sorted (renamed?) by type of return value.
- minor code cleanups
2002-08-06 14:02:38 +00:00
eknauel 992bc80409 minor code clean-ups 2002-08-06 13:52:06 +00:00
mainzelm 96b40e8846 Fix to allow single character here strings. 2002-08-05 14:27:12 +00:00
mainzelm f172795016 Pass start argument of cre-search? to regexp-match. 2002-08-05 14:22:11 +00:00
mainzelm cad4096910 Finished implementation for pending interrupts. 2002-08-05 11:30:33 +00:00
mainzelm 66c2ae5d38 Check enabled interrupts before calling the handler. 2002-07-18 08:04:34 +00:00
mainzelm e74e23388e Initialize t.c_lflag before reading it.
Fixes #577473.
2002-07-04 16:46:23 +00:00
mainzelm b951e1c933 Use flush-all-ports-no-threads on exit. 2002-06-27 12:26:23 +00:00
mainzelm 1aadf4e87f Added md5 support. 2002-06-27 12:14:23 +00:00
mainzelm 16fdcca89f Imports and exports for scsh-top-package. 2002-06-26 12:19:04 +00:00
mainzelm f197f3b06c Minor fixes. 2002-06-26 11:56:14 +00:00
mainzelm d17a682498 Added scsh-version-string for internal use in top.scm. 2002-06-26 11:28:47 +00:00
mainzelm 4e5b87209d Added ignore-port-locks? flag to output-port-forcers and use it in
flush-all-ports-no-threads.
2002-06-26 11:25:33 +00:00
mainzelm 4e295e26d1 More about exit hooks. 2002-06-26 11:18:25 +00:00
mainzelm 71e3326079 Reintroduce run-as-long-as to ensure the threads exit on an error
while evaluating -c and -s flags.
2002-06-26 10:02:10 +00:00
mainzelm 54a3d86c67 Spawn-on-root the deliver-interrupts thread. 2002-06-10 08:49:13 +00:00
mainzelm e710e9b121 Dynamically allocate space for symbolic link if MAXPATHLEN is not defined. 2002-06-10 08:47:48 +00:00
mainzelm 8d0a620457 + Spawn auto-reaping thread on root scheduler
+ Don't mark a child dead if it simply received SIGSTOP.
2002-06-10 08:38:57 +00:00
mainzelm 1585024cd4 Some minor improvements.
dump-libscsh-image is now the only export of the libscsh package.
2002-05-23 09:52:26 +00:00
mainzelm e8fe6105bf Use vsprintf if vasprintf is not available. 2002-05-23 09:51:24 +00:00
eknauel 6dd03e81a2 support for SQLNumResultCols and SQLDescribeCol 2002-05-21 13:48:47 +00:00
eknauel f70889ccc8 removed parameter 'direction' for odbc_sql_data_sources
support for SQLNumResultCols and SQLDescribeCol
2002-05-21 13:48:37 +00:00
eknauel 5ab07b6398 Renamed some confusing parameter names
Support for SQLEndTransaction
2002-05-17 12:22:15 +00:00
mainzelm aed248d24b First version of libscsh. 2002-05-16 14:50:46 +00:00
mainzelm dcebc64e8b Unify initialization of scsh-specific stuff. 2002-05-16 14:34:58 +00:00
mainzelm 021cd1efc1 + Let WITH-HANDLER take care of the resource lock.
+ Removed some duplicate alignments of process resources and moved
other closer the the actual system call
2002-05-15 17:05:02 +00:00
mainzelm 73092cb733 Adjust the test for exec-path-list. 2002-05-10 07:24:37 +00:00
mainzelm 0b35dbbe2f exec-path-list is a thread-fluid now. 2002-05-07 08:58:53 +00:00
sperber 37948e173d Preserve ports in forked child.
The use of NARROW had borked this.
2002-05-06 15:54:38 +00:00
sperber 1d35626709 Redo the forking-without-the-threads fix in a way not involving
command levels (as there *are* no command levels for things like scsh
-c):

There's now a new asynchronous event, similar to SPAWN, called NARROW.
It spawns off a new scheduler with just one thread (which runs the
thunk provided as an argument to NARROW) and blocks the current one
until the narrowed scheduler finishes.

For this to work, two schedulers need to be in place: the root
scheduler which performs the housekeeping, and another one inside that
which is the one the program uses---otherwise it's the root scheduler
that's blocked, and that means no housekeeping gets done.  This is
trivially the case for interactive mode, as the command-levels all
have their own schedulers, but we also need to make sure scsh's entry
point fires up its own initial scheduler.
2002-05-03 13:42:36 +00:00
mainzelm f5d958ac91 Added { and } to the characters to be quoted within literal strings. 2002-05-02 11:46:44 +00:00
mainzelm 43cd435bad Fixed cut and paste error in with-umask-aligned. 2002-04-29 11:25:17 +00:00
mainzelm 4a7620c882 Fixed bug in setenv: #f was not handled as deleting the variable.
Also removed superfluous list-copying before call to alist-update as
this has no side effects.
2002-04-28 18:47:00 +00:00
mainzelm 6a80f8df7c Fixed return value of accept for AF_UNIX. 2002-04-28 18:26:44 +00:00
eknauel d2ce1ffa08 - new record type: sql-date (SQL_DATE_STRUCT)
- new record type: sql-time (SQL_TIME_STRUCT)
- new record type: sql-timestamp (SQL_TIMESTAMP_STRUCT)
- added type identifier for SQL_C_*-types and SQL_*-types
- import c-functions: odbc_sql_bind_parameter_exec_out, odbc_sql_execute, odbc_sql_execute_direct, odbc_sql_get_data, odbc_sql_fetch
2002-04-25 08:54:43 +00:00
eknauel d88ed1c5b8 - fixed silly +1/-1 offset bug in odbc_sql_bin_parameter_exec_out
- fixed matching of SQL types in odbc_sql_bin_parameter_exec_out
- added new functions for sql-time<->SQL_TIME_STRUCT conversion
- added new functions for sql-date<->SQL_DATE_STRUCT conversion
- added new functions for sql-timestamp<->SQL_TIMESTAMP_STRUCT conversion
- use functions for sql-time/sql-date/sql-timestamp conversion
- print more debug information in odbc_sql_bin_parameter_exec_out
- added function odbc_sql_execute_direct
- added function odbc_sql_get_data, check_sql_get_data_result
- added function odbc_sql_fetch
- odbc_debug_msgs: do not print native_error
- renamed function odbc_set_env_attr to odbc_sql_set_env_attr
2002-04-25 08:51:11 +00:00
mainzelm 8cb11125ae + Fixed small bug in fork: command level wasn't resumed in the no-thunk case.
+ Optional continue-threads argument for fork/pipe and fork/pipe+
2002-04-21 16:29:16 +00:00
mainzelm 0741f2df4d Small renaming of a structure. 2002-04-21 16:26:09 +00:00
mainzelm af015e52bf Bump the version number to 0.6.2. 2002-04-21 15:59:38 +00:00
eknauel 3b2dbc5f65 Basic support for ODBC 3.0 API.
Tested partially: handle allocation, connection, prepare, execute
Missing: Support for SQLBindCol & several catalog functions. The scsh 0.53 API abstraction need
s to be implemented on top of the ODBC 3 API.
2002-04-21 08:56:53 +00:00
eknauel d21f901097 Tested partially: handle allocation, connection, prepare, execute
Missing: Support for SQLBindCol & several catalog functions. The scsh 0.53 API abstraction need
s to be implemented on top of the ODBC 3 API.
2002-04-21 08:56:02 +00:00
eknauel 570b5c11d2 Basic support for ODBC 3.0 API.
Tested partially: handle allocation, connection, prepare, execute
Missing: Support for SQLBindCol & several catalog functions. The scsh 0.53 API abstraction needs to be implemented on top of the ODBC 3 API.
2002-04-21 08:53:57 +00:00
mainzelm 0a8e312756 Compare symbols non-hygienic as well to support SREs within hygienic
macros.
2002-04-18 16:06:02 +00:00
sperber 3717053d60 Preserve thread fluids when forking. 2002-04-12 14:29:38 +00:00
sperber 349fff06c1 Basic FORK and and %FORK now start a new command level inside the
child process, thus preventing other threads from continuing to run.

Both take an additional optional argument that, when true, reverts the
old behavior of continuing all threads.

Moreover, use WITH-CONTINUATION NULL-CONTINUATION in CALL-TERMINALLY
to get us more space.
2002-04-10 15:03:02 +00:00
mainzelm b222cfe4c3 Default argument for tty-info as promised in the manual. 2002-03-22 10:23:34 +00:00
mainzelm c9c0535f41 Bug fix: 2 values were not converted to descriptors. 2002-03-22 10:22:59 +00:00
sperber 7fdde2527f Plug space leak in BIND-LISTEN-ACCEPT-LOOK: Errno handlers for failed
connections would accumulate indefinitely.
2002-03-06 08:24:32 +00:00
mainzelm cb6e8572d6 Added forgotten calls to with-cwd-aligned. 2002-03-05 16:57:43 +00:00
mainzelm 87d82f5011 Align cwd and umask. 2002-03-05 16:49:58 +00:00
sperber a7517a3f05 Add record discloser for FDPORT-DATA. 2002-02-26 14:40:59 +00:00
mainzelm 5f7ed5befe Fixed bug in test for sync-file. 2002-02-26 13:02:17 +00:00
mainzelm 13dabb8f4e Always signal an error if time returns -1. Not uses errno-error as
only few systems set errno if mktime fails.
2002-02-26 10:53:32 +00:00
mainzelm 45305e7555 Set-cloexec to #t for unrevealed ports. 2002-02-26 08:42:56 +00:00
sperber 380fee6612 Make FLUSH-ALL-PORTS blocking so FORK will do something more sensible.
Previously,

(begin
  (display "ha!") (newline)
  (fork (lambda ()
	  'foo)))

would print "ha!" twice because FLUSH-ALL-PORTS would not finish
before the actual FORK.
2002-02-25 20:29:15 +00:00
mainzelm 09ab472695 + Greet with scsh-version-string
+ call relinquish-timeslice twice before exit so the flushers may run
2002-02-25 09:00:39 +00:00
mainzelm 71cc8cf091 Fix for 0.6.1 2002-02-25 07:01:22 +00:00
sperber de0de38bb6 Remove obsolete comment about START argument to CRE-SEARCH not being
supported.
2002-02-22 10:27:07 +00:00
sperber 68aa82c4e7 Remove superfluous END-VEC parameter to CRE-SEARCH. 2002-02-22 10:25:42 +00:00
sperber dce89b2fa8 Translate submatches according to CRE:TVEC, fixing submatch bug
reported by Michel Schinz.
2002-02-22 10:22:38 +00:00