adding comments
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Sat, 15 Apr 2023 13:33:48 +0000 (23:33 +1000)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Sat, 15 Apr 2023 13:33:48 +0000 (23:33 +1000)
lsp-dbus/lsp-dbus-marshal.lsp

index 81b6aa50184d682c66fa267375b3632dac125133..02859d6f006a2f4d7f314521a23bee1d8a428e92 100644 (file)
     (while (and (< AT (length DATA))
                 (setf M (unpack-data "yyyyuua(yv)" DATA AT)))
       (setf AT (M 1))
-      (setf M (M 0 -1)) ; Drop
+      (setf M (M 0 -1)) ; Drop all but the headers then map to symbol keys
       (dotimes (i (length M 0))
         (setf (M i 0) (MESSAGE-HEADERS (M i 0) 0)))
+      ;; Add the body, if any, keyed by "".
       (setf S (if (lookup 'SIGNATURE M) ($it 0) ""))
       (when (and (!= S "") (setf D (unpack-data S DATA AT)))
         (setf AT (D 1))
         (extend M (list (list "" (D 0)))))
-      (push  M OUT -1)
+      ;; Collate message and move to the next portion in DATA
+      (push M OUT -1)
       (setf DATA (AT DATA))
       (setf AT 0) 
       )
     OUT ))
+
+"lsp-dbus-marshal.lsp"