Commit ad1cd4af authored by David Byers's avatar David Byers
Browse files

Updated to handle and use eight-bit conf types

parent ab2bf333
Tue Jun 11 09:25:24 1996 David Byers <davby@sen2.ida.liu.se>
* parse.el (lyskom-parse-conf-type): Hanterar Any-Conf-Type.
(lyskom-maybe-parse-1-or-0): Ny funktion.
* english-strings.el,swedish-strings.el (lyskom-strings): Lade till
anonymous-allowed.
* commands1.el (kom-create-conf): Frga om man fr skriva anonyma
texter.
* komtypes.el (conf-type->anarchy): Ny funktion.
(lyskom-create-conf-type): Hantera anarkibiten.
(conf-type->rsv1): Ny funktion.
(conf-type->rsv2): Ny funktion.
(conf-type->rsv3): Ny funktion.
* lyskom-rest.el (lyskom-format-conf-type): Skicka alltid
extended-conf-type till servern.
* commands2.el (kom-change-conf-type): Frga om man fr skriva anonyma
texter.
Thu Jun 6 02:59:01 1996 David Kgedal <davidk@lysator.liu.se>
* startup.el (kom-start-anew): Anropa clear-all-caches.
......
......@@ -533,12 +533,17 @@ of the person."
(secret (if (not open)
(j-or-n-p (lyskom-get-string 'secret-conf))))
(orig (j-or-n-p (lyskom-get-string 'comments-allowed)))
(anarchy (j-or-n-p (lyskom-get-string 'anonymous-allowed)))
(conf-no (blocking-do 'create-conf
conf-name
(lyskom-create-conf-type (not open)
(not orig)
secret
nil))))
nil
anarchy
nil
nil
nil))))
(if (null conf-no)
(lyskom-format-insert 'could-not-create-conf
conf-name
......
......@@ -1382,14 +1382,19 @@ membership info."
(open (j-or-n-p (lyskom-get-string 'anyone-member)))
(secret (if (not open)
(j-or-n-p (lyskom-get-string 'secret-conf))))
(orig (j-or-n-p (lyskom-get-string 'comments-allowed))))
(orig (j-or-n-p (lyskom-get-string 'comments-allowed)))
(anarchy (j-or-n-p (lyskom-get-string 'anonymous-allowed))))
(cache-del-conf-stat conf-no)
(if (not (blocking-do 'set-conf-type
conf-no
(lyskom-create-conf-type (not open)
(not orig)
secret
nil)))
nil
anarchy
nil
nil
nil)))
(progn (lyskom-insert-string 'nope)
(lyskom-format-insert 'error-code
(lyskom-get-error-text lyskom-errno)
......
......@@ -1469,13 +1469,19 @@ The MAPS must be consecutive. No gaps or overlaps are currently allowed."
;;; Constructor:
(defsubst lyskom-create-conf-type (rd_prot original secret letterbox)
(defsubst lyskom-create-conf-type (rd_prot original secret letterbox
&optional anarchy
rsv1 rsv2 rsv3)
"Create a conf-type object. Args: RD_PROT ORIGINAL SECRET LETTERBOX."
(list 'CONF-TYPE
rd_prot
original
secret
letterbox
anarchy
rsv1
rsv2
rsv3
))
......@@ -1497,6 +1503,22 @@ The MAPS must be consecutive. No gaps or overlaps are currently allowed."
"Get letterbox from conf-type."
(elt (cdr conf-type) 3))
(defsubst conf-type->anarchy (conf-type)
"Get anarchy from conf-type."
(elt (cdr conf-type) 4))
(defsubst conf-type->rsv1 (conf-type)
"Get reserved bit from conf-type."
(elt (cdr conf-type) 5))
(defsubst conf-type->rsv2 (conf-type)
"Get reserved bit from conf-type."
(elt (cdr conf-type) 5))
(defsubst conf-type->rsv3 (conf-type)
"Get reserved bit from conf-type."
(elt (cdr conf-type) 5))
;;; ================================================================
;;; text-list
......
No preview for this file type
......@@ -180,6 +180,22 @@ Signal lyskom-parse-incomplete if there is no nonwhite char to parse."
lyskom-parse-pos
(buffer-string)))))))
(defun lyskom-maybe-parse-1-or-0 ()
"Parse next char and return t if it was 1, nil if it was 0 or 'space if
it was whitespace. Signal lyskom-protocol-error if it was anything else.
Signal lyskom-parse-incomplete if there was nothing to parse."
(let ((char (lyskom-parse-char)))
(cond
((eq char ?0) nil)
((eq char ?1) t)
((or (eq char ? ) (eq char ?\t) (eq char ?\n) (eq char ?\r))
'space)
(t (signal 'lyskom-protocol-error
(list 'lyskom-parse-1-or-0 char
lyskom-parse-pos
(buffer-string)))))))
(defun lyskom-parse-time ()
"Parse a time from server. Args: none."
......@@ -261,11 +277,22 @@ result is assigned to the element."
(defun lyskom-parse-conf-type ()
"Parse a conf-type. No args."
(lyskom-create-conf-type
(lyskom-parse-1-or-0) ;rd_prot
(lyskom-parse-1-or-0) ;original
(lyskom-parse-1-or-0) ;secret
(lyskom-parse-1-or-0))) ;letterbox
(let ((rd_prot (lyskom-parse-1-or-0))
(original (lyskom-parse-1-or-0))
(secret (lyskom-parse-1-or-0))
(letterbox (lyskom-parse-1-or-0))
(anarchy (lyskom-maybe-parse-1-or-0)))
(lyskom-create-conf-type rd_prot
original
secret
letterbox
anarchy
(and (not (eq anarchy 'space))
(lyskom-parse-1-or-0))
(and (not (eq anarchy 'space))
(lyskom-parse-1-or-0))
(and (not (eq anarchy 'space))
(lyskom-parse-1-or-0)))))
(defun lyskom-parse-privs ()
......
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