Commit 2db56f73 authored by David Byers's avatar David Byers
Browse files

Probably fixed bug 1078. Worked on bug 1075.

Detailed changes:
> 	Work on bug 1075:
> 	* parse.el (lyskom-parse-static-server-info): New function.
>
> 	* services.el (initiate-get-boottime-info): New function.
>
> 	* vars.el.in (lyskom-static-server-info): New variable.
>
> 	* komtypes.el (static-server-info): New type.
>
> 	Fix bug 1078:
> 	* vars.el.in (lyskom-global-variable-types): Change read of
> 	integer.
> 	(kom-default-mark): Put this both in the common area and the elisp
> 	area. This is a good thing when we set it to values that are not
> 	legal according to the protocol specification.
>
> 	* flags.el (lyskom-flag-read-integer): When reading integers,
> 	accept nil too.
>
parent ce295516
2003-08-13 David Byers <byers@lysator.liu.se> 2003-08-13 David Byers <byers@lysator.liu.se>
Work on bug 1075:
* parse.el (lyskom-parse-static-server-info): New function.
* services.el (initiate-get-boottime-info): New function.
* vars.el.in (lyskom-static-server-info): New variable.
* komtypes.el (static-server-info): New type.
Fix bug 1078:
* vars.el.in (lyskom-global-variable-types): Change read of
integer.
(kom-default-mark): Put this both in the common area and the elisp
area. This is a good thing when we set it to values that are not
legal according to the protocol specification.
* flags.el (lyskom-flag-read-integer): When reading integers,
accept nil too.
Delete initial value on change: Delete initial value on change:
* completing-read.el (lyskom-read-from-minibuffer-clear-initial): * completing-read.el (lyskom-read-from-minibuffer-clear-initial):
New function. New function.
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
(eval-when-compile (eval-when-compile
(require 'lyskom-command "command")) (require 'lyskom-command "command"))
(put 'lyskom-invalid-flag-type 'error-conditions
'(error lyskom-error lyskom-invalid-flag-type))
(defvar lyskom-options-text nil (defvar lyskom-options-text nil
"Text mass when reading options.") "Text mass when reading options.")
...@@ -118,16 +120,18 @@ settings and save them to your emacs init file." ...@@ -118,16 +120,18 @@ settings and save them to your emacs init file."
(common-block (common-block
(concat (concat
(mapconcat (lambda (var) (mapconcat (lambda (var)
(let ((common-name (elt var 0)) (condition-case nil
(elisp-name (elt var 1)) (let ((common-name (elt var 0))
(type (elt var 2))) (elisp-name (elt var 1))
(lyskom-format-objects (type (elt var 2)))
(symbol-name common-name) (lyskom-format-objects
(funcall (symbol-name common-name)
(cdr (assq 'write (funcall
(cdr (assq (or type t) (cdr (assq 'write
lyskom-global-variable-types)))) (cdr (assq (or type t)
(symbol-value elisp-name))))) lyskom-global-variable-types))))
(symbol-value elisp-name))))
(lyskom-invalid-flag-type "")))
lyskom-global-variables lyskom-global-variables
"\n") "\n")
)) ))
...@@ -469,3 +473,11 @@ elisp variable VAR." ...@@ -469,3 +473,11 @@ elisp variable VAR."
(defun lyskom-flag-read-from-string (str) (defun lyskom-flag-read-from-string (str)
(car (read-from-string str))) (car (read-from-string str)))
(defun lyskom-flag-read-integer (str)
(cond ((equal str "nil") nil)
(t (string-to-int str))))
(defun lyskom-flag-write-integer (val)
(cond ((integerp val) (prin1-to-string val))
(t (signal 'lyskom-invalid-flag-type nil))))
...@@ -841,6 +841,17 @@ Do nothing if the TLIST is less than N elements long." ...@@ -841,6 +841,17 @@ Do nothing if the TLIST is less than N elements long."
(values :default nil)) (values :default nil))
:nil-safe) :nil-safe)
(def-komtype static-server-info
((boot-time :read-only t)
(save-time :read-only t)
(db-status :read-only t)
(existing-texts :read-only t)
(highest-text-no :read-only t)
(existing-confs :read-only t)
(existing-persons :read-only t)
(highest-conf-no :read-only t))
:nil-safe)
;;; ================================================================ ;;; ================================================================
......
...@@ -1107,6 +1107,17 @@ Args: TEXT-NO. Value: text-stat." ...@@ -1107,6 +1107,17 @@ Args: TEXT-NO. Value: text-stat."
"Parse an array of Stats" "Parse an array of Stats"
(lyskom-parse-vector (lyskom-parse-num) 'lyskom-parse-stats)) (lyskom-parse-vector (lyskom-parse-num) 'lyskom-parse-stats))
(defun lyskom-parse-static-server-info ()
"Parse a static-server-info"
(lyskom-create-static-server-info (lyskom-parse-time)
(lyskom-parse-time)
(lyskom-parse-string)
(lyskom-parse-num)
(lyskom-parse-num)
(lyskom-parse-num)
(lyskom-parse-num)
(lyskom-parse-num)))
;;; ================================================================ ;;; ================================================================
;;; Parsing of complex datatypes without cache. ;;; Parsing of complex datatypes without cache.
......
...@@ -1313,6 +1313,11 @@ Args: KOM-QUEUE HANDLER SESSION-NO &rest DATA" ...@@ -1313,6 +1313,11 @@ Args: KOM-QUEUE HANDLER SESSION-NO &rest DATA"
(lyskom-call kom-queue lyskom-ref-no handler data 'lyskom-parse-stats-array) (lyskom-call kom-queue lyskom-ref-no handler data 'lyskom-parse-stats-array)
(lyskom-send-packet kom-queue (lyskom-format-objects 112 what)))) (lyskom-send-packet kom-queue (lyskom-format-objects 112 what))))
(defun initiate-get-boottime-info (kom-queue handler &rest data)
(lyskom-server-call
(lyskom-call kom-queue lyskom-ref-no handler data 'lyskom-parse-static-server-info)
(lyskom-send-packet kom-queue (lyskom-format-objects 113))))
;;; ================================================================ ;;; ================================================================
......
...@@ -356,10 +356,11 @@ clients of the event. See lyskom-mode for details on lyskom." ...@@ -356,10 +356,11 @@ clients of the event. See lyskom-mode for details on lyskom."
(defun lyskom-accept-async () (defun lyskom-accept-async ()
(blocking-do 'accept-async '(5 7 8 9 11 12 13 14 15 16 17 18 19)) (blocking-do 'accept-async '(5 7 8 9 11 12 13 14 15 16 17 18 19 20 21))
(let* ((ans (blocking-do 'query-async))) (let* ((ans (blocking-do 'query-async)))
(unless (memq 15 (listify-vector ans)) (unless (memq 15 (listify-vector ans))
(blocking-do 'accept-async '(0 5 7 8 9 11 12 13 14 16 17 18 19))))) ;; async-new-text is not implemented, so use async-new-text-old
(blocking-do 'accept-async '(0 5 7 8 9 11 12 13 14 16 17 18 19 20 21)))))
(defun lyskom-www-proxy-connect-filter (proc output) (defun lyskom-www-proxy-connect-filter (proc output)
......
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
(defconst lyskom-global-variable-types (defconst lyskom-global-variable-types
'((boolean (read . lyskom-flag-read-boolean) '((boolean (read . lyskom-flag-read-boolean)
(write . lyskom-flag-write-boolean)) (write . lyskom-flag-write-boolean))
(integer (read . string-to-int) (integer (read . lyskom-flag-read-integer)
(write . prin1-to-string)) (write . lyskom-flag-write-integer))
(symbol-list (read . lyskom-flag-read-symbol-list) (symbol-list (read . lyskom-flag-read-symbol-list)
(write . lyskom-flag-write-symbol-list)) (write . lyskom-flag-write-symbol-list))
(t (read . lyskom-flag-read-from-string) (t (read . lyskom-flag-read-from-string)
...@@ -673,7 +673,8 @@ simply mark with that number. When set to `nil', `kom-mark-text' will ...@@ -673,7 +673,8 @@ simply mark with that number. When set to `nil', `kom-mark-text' will
ask for a mark. ask for a mark.
Values other than integers and `nil' are reserved for future use." Values other than integers and `nil' are reserved for future use."
common default-mark integer) common default-mark integer
server)
(def-kom-var kom-symbolic-marks-alist '(("Standard" . 100)) (def-kom-var kom-symbolic-marks-alist '(("Standard" . 100))
"**Association list that maps symbolic marks to mark numbers. "**Association list that maps symbolic marks to mark numbers.
...@@ -3272,6 +3273,10 @@ will be shown." ...@@ -3272,6 +3273,10 @@ will be shown."
"Cache of conference statuses." "Cache of conference statuses."
local) local)
(def-kom-var lyskom-static-server-info nil
"Cache of static-server-info"
local)
(def-kom-var lyskom-uconf-cache nil (def-kom-var lyskom-uconf-cache nil
"Cache of small conference statuses." "Cache of small conference statuses."
local) local)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment