Create vcarded module and egg

This commit is contained in:
Jaidyn Ann 2024-02-07 00:44:46 -06:00
parent 1e202b3c55
commit 6c744928f8
2 changed files with 140 additions and 127 deletions

8
vcarded.egg Normal file
View File

@ -0,0 +1,8 @@
;; -*- Scheme -*-
((synopsis "Simple vCard parser.")
(author "Jaidyn Ann")
(category net)
(license "GPLv3")
(dependencies srfi-1 srfi-13 srfi-130 uri-common)
(components
(extension vcarded)))

View File

@ -13,12 +13,17 @@
;; You should have received a copy of the GNU General Public License ;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>. ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
(module vcarded
(read-vcard)
(import (import
scheme scheme
(chicken base)
(chicken condition)
(chicken io) (chicken io)
srfi-1 srfi-1
srfi-13 srfi-13
srfi-19
srfi-130 srfi-130
(prefix uri-common uri:)) (prefix uri-common uri:))
@ -66,7 +71,7 @@
(map (lambda (uri-prop) (map (lambda (uri-prop)
(list uri-prop (list uri-prop
(lambda strs (or (uri:uri-reference (string-join strs ";")) (lambda strs (or (uri:uri-reference (string-join strs ";"))
(string-join sts ";"))) (string-join strs ";")))
(lambda (url) (uri:uri->string url)))) (lambda (url) (uri:uri->string url))))
vcard-url-properties) vcard-url-properties)
(map (lambda (date-prop) (map (lambda (date-prop)
@ -170,4 +175,4 @@
(string-concatenate (string-concatenate
(list line (list line
(string-drop (read-folded-line) 1))) (string-drop (read-folded-line) 1)))
line))) line))))