begin to write the function to parse response

This commit is contained in:
Renaud Casenave-Péré 2011-06-23 19:25:57 +09:00
parent 4520162ab1
commit c620cd8838

12
empc.el
View file

@ -73,6 +73,18 @@ return at the end of a request.")
(when empc-verbose
(message "empc: %s" msg)))
(defun empc-response-parse-message (msg)
"Check the result code and parse the response into a plist."
(let* ((data (split-string msg "\n" t))
(status (last data)))
(when (and (stringp (car data))
(string-match "^OK\\( MPD \\)?" (car data)))
(setq data (cdr data)))
;; TODO: checker le status.
;; (dolist (line )
;; )
))
(defun empc-response-parse-status (closure msg)
"Parse the response into a plist."
(let ((data (split-string msg "\n" t)))