diff --git a/src/commands2.el b/src/commands2.el index 216955c8edf7cbc91075394ff18e287f0d9b1037..9ba4546e37265c5884bf0e03d4532b81be9aee80 100644 --- a/src/commands2.el +++ b/src/commands2.el @@ -1444,6 +1444,7 @@ current conference to another session." ;;; ======================================================= ;;; Listing people using regexps. + (defun kom-list-re (regexp) "List all persons and conferences whose name matches REGEXP." (interactive "sSearch regexp: ") diff --git a/src/komtypes.el b/src/komtypes.el index 9f6627585e789a1b19a954e3a903464965dff927..e624601df2420955158d32c735a5b4a46e462cc2 100644 --- a/src/komtypes.el +++ b/src/komtypes.el @@ -1574,4 +1574,88 @@ The MAPS must be consecutive. No gaps or overlaps are currently allowed." (eq (car-safe object) 'SERVER-INFO)) + ;;; ================================================================ +;;; conf-z-info-list + + +;;; Constructor: + +(defun lyskom-create-conf-z-info-list (conf-z-infos) + "Create a conf-z-info-list from all parameters." + (cons + 'CONF-Z-INFO-LIST + (vector conf-z-infos))) + + +;;; Selector: + +(defun conf-z-info-list->conf-z-infos (conf-z-info-list) + "Get conf-z-infos from conf-z-info-list." + (elt (cdr conf-z-info-list) 0)) + + +;;; Modifier: + +(defun set-conf-z-info-list->conf-z-infos (conf-z-info-list newval) + "Set conf-z-infos in conf-z-info-list to NEWVAL." + (aset (cdr conf-z-info-list) 0 newval)) + + +;;; Predicate: + +(defun lyskom-conf-z-info-list-p (object) + "Return t if OBJECT is a conf-z-info-list." + (eq (car-safe object) 'CONF-Z-INFO-LIST)) + +;;; ================================================================ +;;; conf-z-info + +;;; Constructor: + +(defun lyskom-create-conf-z-info (name + conf-type + conf-no) + "Create a conf-z-info from all parameters." + (cons + 'CONF-Z-INFO + (vector name conf-type conf-no))) + + +;;; Selectors: + +(defun conf-z-info->name (conf-z-info) + "Get name from conf-z-info." + (elt (cdr conf-z-info) 0)) + +(defun conf-z-info->conf-type (conf-z-info) + "Get conf-type from conf-z-info." + (elt (cdr conf-z-info) 1)) + +(defun conf-z-info->conf-no (conf-z-info) + "Get conf-no from conf-z-info." + (elt (cdr conf-z-info) 2)) + + +;;; Modifiers: + +(defun set-conf-z-info->name (conf-z-info newval) + "Set name in conf-z-info to NEWVAL." + (aset (cdr conf-z-info) 0 newval)) + +(defun set-conf-z-info->conf-type (conf-z-info newval) + "Set conf-type in conf-z-info to NEWVAL." + (aset (cdr conf-z-info) 1 newval)) + +(defun set-conf-z-info->conf-no (conf-z-info newval) + "Set conf-no in conf-z-info to NEWVAL." + (aset (cdr conf-z-info) 2 newval)) + + +;;; Predicate: + +(defun lyskom-conf-z-info-p (object) + "Return t if OBJECT is a conf-z-info." + (eq (car-safe object) 'CONF-Z-INFO)) + +;;; ======================================================= diff --git a/src/parse.el b/src/parse.el index 16ecc4aff6ce48c756388b4569c797f60675a3c5..2008d9c89446dad8f8f5c54f842610aa3b64d4a7 100644 --- a/src/parse.el +++ b/src/parse.el @@ -668,6 +668,29 @@ Args: TEXT-NO. Value: text-stat." (lyskom-parse-vector (lyskom-parse-num) 'lyskom-parse-who-info)) + +;;; ================================================================ +;;; Parsing things for the regexp-matching of persons +;;; + +(defun lyskom-parse-conf-z-info-list () + "Parse result from functions that return a conf-z-info-list." + (let* ((list-len (lyskom-parse-num))) + (lyskom-create-conf-z-info-list + (lyskom-parse-vector list-len 'lyskom-parse-conf-z-info)))) + +(defun lyskom-parse-conf-z-info () + "Parse a conf-z-info." + (lyskom-create-conf-z-info + (lyskom-parse-string) ;name + (lyskom-parse-conf-type) ;conf-type + (lyskom-parse-num))) ;conf-no + + + +;;; ================================================================ +;;; Initialization of the parsing buffer. + (defun lyskom-init-parse () "Does all initialization of the parsing routines. i.e creates the buffer, sets all markers and pointers." diff --git a/src/services.el b/src/services.el index 5dcb56beb1d9c0d48a1af552c1e55d80fc2fb0ef..c6d757f0a8e0fbe0ee4ce4d44c582d8f169aea07 100644 --- a/src/services.el +++ b/src/services.el @@ -620,6 +620,16 @@ Args: KOM-QUEUE HANDLER &rest DATA." (lyskom-send-packet kom-queue (lyskom-format-objects 56))) +(defun initiate-re-z-lookup (kom-queue handler regexp want-persons want-confs + &rest data) + "Perform a regexp lookup. +Args: KOM-QUEUE HANDLER REGEXP WANT-PERSONS WANT-CONFS &rest DATA." + (lyskom-call kom-queue lyskom-ref-no handler data + 'lyskom-parse-conf-z-info-list) + (lyskom-send-packet kom-queue (lyskom-format-objects 74 regexp want-persons + want-confs))) + + ;;; ================================================================