@@ -28,36 +28,22 @@ (define *logging* #f) (define *functions* (make-hash-table)) ;; symbol => fn ### TEMPORARY!!! ;; (define *toppath* #f) (define *transport-type* 'http) -(define (exec-fn fn . params) +#;(define (exec-fn fn . params) (if (hash-table-exists? *functions* fn) (apply (hash-table-ref *functions* fn) params) (begin (debug:print-error 0 "exec-fn " fn " not found") #f))) -(define (set-fn fn-name fn) +#;(define (set-fn fn-name fn) (hash-table-set! *functions* fn-name fn)) (include "altdb.scm") -;; remote connection information - moved to alldat -;; -#;(defstruct remote - (hh-dat #f) ;; (exec-fn 'common:get-homehost)) ;; homehost record ( addr . hhflag ) - (server-url #f) ;; (if *toppath* (exec-fn 'server:check-if-running *toppath*))) ;; (server:check-if-running *toppath*) #f)) - (last-server-check 0) ;; last time we checked to see if the server was alive - (conndat #f) - (transport *transport-type*) - (server-timeout #f) ;; (exec-fn 'server:expiration-timeout)) - (force-server #f) - (ro-mode #f) - (ro-mode-checked #f) ;; flag that indicates we have checked for ro-mode - (ulex:conn #f) ;; ulex db conn is not exactly a db connector, more like a network connector - ) ;; Pulled from http-transport.scm (define (make-http-transport:server-dat)(make-vector 6)) (define (http-transport:server-dat-get-iface vec) (vector-ref vec 0)) @@ -362,14 +348,14 @@ (define (debug:print n e . params) (if (debug:debug-mode n) (with-output-to-port (or e (current-error-port)) (lambda () - (if *logging* - (exec-fn 'db:log-event (apply conc params)) - (apply print params) - ))))) + ;; (if *logging* + ;; (exec-fn 'db:log-event (apply conc params)) + (apply print params) + )))) ;; ) ;; Brandon's debug printer shortcut (indulge me :) (define *BB-process-starttime* (current-milliseconds)) (define (BB> . in-args) (let* ((stack (get-call-chain)) @@ -441,15 +427,15 @@ (define (debug:print-error n e . params) ;; normal print (if (debug:debug-mode n) (with-output-to-port (if (port? e) e (current-error-port)) (lambda () - (if *logging* - (exec-fn 'db:log-event (apply conc params)) + ;; (if *logging* + ;; (exec-fn 'db:log-event (apply conc params)) ;; (apply print "pid:" (current-process-id) " " params) - (apply print "ERROR: " params) - )))) + (apply print "ERROR: " params) + ))) ;; ) ;; pass important messages to stderr (if (and (eq? n 0)(not (eq? e (current-error-port)))) (with-output-to-port (current-error-port) (lambda () (apply print "ERROR: " params) @@ -457,19 +443,19 @@ (define (debug:print-info n e . params) (if (debug:debug-mode n) (with-output-to-port (if (port? e) e (current-error-port)) (lambda () - (if *logging* - (let ((res (format#format #f "INFO: (~a) ~a" n (apply conc params)))) - (exec-fn 'db:log-event res)) + ;; (if *logging* + ;; (let ((res (format#format #f "INFO: (~a) ~a" n (apply conc params)))) + ;; (exec-fn 'db:log-event res)) ;; (apply print "pid:" (current-process-id) " " "INFO: (" n ") " params) ;; res) - (apply print "INFO: (" n ") " params) ;; res) - ))))) + (apply print "INFO: (" n ") " params) ;; res) + )))) ;; ) ;; if a value is printable (i.e. string or number) return the value ;; else return an empty string (define-inline (printable val) (if (or (number? val)(string? val)) val ""))