diff options
Diffstat (limited to 'module/vcomponent/formats')
-rw-r--r-- | module/vcomponent/formats/common/types.scm | 4 | ||||
-rw-r--r-- | module/vcomponent/formats/ical/output.scm | 14 | ||||
-rw-r--r-- | module/vcomponent/formats/ical/parse.scm | 4 | ||||
-rw-r--r-- | module/vcomponent/formats/ical/types.scm | 6 | ||||
-rw-r--r-- | module/vcomponent/formats/vdir/parse.scm | 5 | ||||
-rw-r--r-- | module/vcomponent/formats/vdir/save-delete.scm | 5 | ||||
-rw-r--r-- | module/vcomponent/formats/xcal/output.scm | 6 | ||||
-rw-r--r-- | module/vcomponent/formats/xcal/parse.scm | 3 | ||||
-rw-r--r-- | module/vcomponent/formats/xcal/types.scm | 4 |
9 files changed, 29 insertions, 22 deletions
diff --git a/module/vcomponent/formats/common/types.scm b/module/vcomponent/formats/common/types.scm index 1a7ec0da..a8a923da 100644 --- a/module/vcomponent/formats/common/types.scm +++ b/module/vcomponent/formats/common/types.scm @@ -7,7 +7,7 @@ :use-module (srfi srfi-71) :use-module (datetime timespec) :use-module (calp translation) - ) + :export (get-parser)) ;; BINARY (define (parse-binary props value) @@ -136,7 +136,7 @@ (hashq-set! type-parsers 'URI parse-uri) (hashq-set! type-parsers 'UTC-OFFSET parse-utc-offset) -(define-public (get-parser type) +(define (get-parser type) (or (hashq-ref type-parsers type #f) (scm-error 'misc-error "get-parser" (_ "No parser for type ~a") (list type) #f))) diff --git a/module/vcomponent/formats/ical/output.scm b/module/vcomponent/formats/ical/output.scm index 489cdc00..fbb9c862 100644 --- a/module/vcomponent/formats/ical/output.scm +++ b/module/vcomponent/formats/ical/output.scm @@ -17,7 +17,11 @@ :use-module (vcomponent recurrence) :use-module (calp translation) :autoload (vcomponent util instance) (global-event-object) - ) + :export (component->ical-string + print-components-with-fake-parent + print-all-events + print-events-in-interval + )) (define (prodid) (format #f "-//hugo//calp ~a//EN" @@ -140,7 +144,7 @@ (parameters vline))) ":" (value-format key vline)))) -(define-public (component->ical-string component) +(define (component->ical-string component) (format #t "BEGIN:~a\r\n" (type component)) (for-each ;; Special cases depending on key. @@ -192,7 +196,7 @@ CALSCALE:GREGORIAN\r '("dummy" "local"))) -(define-public (print-components-with-fake-parent events) +(define (print-components-with-fake-parent events) ;; The events are probably sorted before, but until I can guarantee ;; that we sort them again here. We need them sorted from earliest @@ -216,7 +220,7 @@ CALSCALE:GREGORIAN\r (print-footer)) -(define-public (print-all-events) +(define (print-all-events) (print-components-with-fake-parent (append (get-fixed-events global-event-object) ;; TODO RECCURENCE-ID exceptions @@ -225,7 +229,7 @@ CALSCALE:GREGORIAN\r ;; the given date range. (get-repeating-events global-event-object)))) -(define-public (print-events-in-interval start end) +(define (print-events-in-interval start end) (print-components-with-fake-parent (append (fixed-events-in-range start end) ;; TODO RECCURENCE-ID exceptions diff --git a/module/vcomponent/formats/ical/parse.scm b/module/vcomponent/formats/ical/parse.scm index cca306c5..49f8f101 100644 --- a/module/vcomponent/formats/ical/parse.scm +++ b/module/vcomponent/formats/ical/parse.scm @@ -12,7 +12,7 @@ :use-module (vcomponent geo) :use-module (vcomponent formats common types) :use-module (calp translation) - ) + :export (parse-calendar)) (define string->symbol (let ((ht (make-hash-table 1000))) @@ -23,7 +23,7 @@ symb))))) ;; TODO rename to parse-vcomponent, or parse-ical (?). -(define-public (parse-calendar port) +(define (parse-calendar port) (parse (map tokenize (read-file port)))) (define-immutable-record-type <line> diff --git a/module/vcomponent/formats/ical/types.scm b/module/vcomponent/formats/ical/types.scm index 67f9f633..7b6aad2e 100644 --- a/module/vcomponent/formats/ical/types.scm +++ b/module/vcomponent/formats/ical/types.scm @@ -6,7 +6,7 @@ :use-module (datetime) :use-module (datetime timespec) :use-module (calp translation) - ) + :export (escape-chars get-writer)) ;; TODO shouldn't these really take vline:s? @@ -45,7 +45,7 @@ ((@ (vcomponent recurrence internal) recur-rule->rrule-string) value)) -(define-public (escape-chars str) +(define (escape-chars str) (define (escape char) (string #\\ char)) (string-concatenate @@ -92,6 +92,6 @@ (hashq-set! type-writers 'URI write-uri) (hashq-set! type-writers 'UTC-OFFSET write-utc-offset) -(define-public (get-writer type) +(define (get-writer type) (or (hashq-ref type-writers type #f) (error (_ "No writer for type") type))) diff --git a/module/vcomponent/formats/vdir/parse.scm b/module/vcomponent/formats/vdir/parse.scm index b21a5f2b..46626402 100644 --- a/module/vcomponent/formats/vdir/parse.scm +++ b/module/vcomponent/formats/vdir/parse.scm @@ -18,7 +18,8 @@ :use-module (calp translation) :use-module (vcomponent formats ical parse) - ) + + :export (parse-vdir)) @@ -26,7 +27,7 @@ ;; All VTIMEZONE's seem to be in "local" time in relation to ;; themselves. Therefore, a simple comparison should work, ;; and then the TZOFFSETTO properties can be subtd. -(define-public (parse-vdir path) +(define (parse-vdir path) ;; TODO empty files here cause "#<eof>" to appear in the output XML, which is *really* bad. (let ((color (catch 'system-error diff --git a/module/vcomponent/formats/vdir/save-delete.scm b/module/vcomponent/formats/vdir/save-delete.scm index fb84d59c..ac520463 100644 --- a/module/vcomponent/formats/vdir/save-delete.scm +++ b/module/vcomponent/formats/vdir/save-delete.scm @@ -17,10 +17,11 @@ :use-module (vcomponent) :use-module (calp translation) :use-module ((hnh util io) :select (with-atomic-output-to-file)) + :export (save-event remove-event) ) -(define-public (save-event event) +(define (save-event event) (define calendar (parent event)) (unless calendar @@ -50,7 +51,7 @@ uid)) -(define-public (remove-event event) +(define (remove-event event) (define calendar (parent event)) (unless (eq? 'vdir (prop calendar '-X-HNH-SOURCETYPE)) (scm-error 'wrong-type-arg "remove-event" diff --git a/module/vcomponent/formats/xcal/output.scm b/module/vcomponent/formats/xcal/output.scm index 26018d92..87ebd32b 100644 --- a/module/vcomponent/formats/xcal/output.scm +++ b/module/vcomponent/formats/xcal/output.scm @@ -8,7 +8,7 @@ :use-module (datetime) :use-module (srfi srfi-1) :use-module (calp translation) - ) + :export (vcomponent->sxcal ns-wrap)) (define (vline->value-tag vline) @@ -94,7 +94,7 @@ (unless (null? outparams) `(parameters ,@outparams))) -(define-public (vcomponent->sxcal component) +(define (vcomponent->sxcal component) (define tagsymb (downcase-symbol (type component))) @@ -129,6 +129,6 @@ ,(unless (null? (children component)) `(components ,@(map vcomponent->sxcal (children component))))))) -(define-public (ns-wrap sxml) +(define (ns-wrap sxml) `(icalendar (@ (xmlns "urn:ietf:params:xml:ns:icalendar-2.0")) ,sxml)) diff --git a/module/vcomponent/formats/xcal/parse.scm b/module/vcomponent/formats/xcal/parse.scm index d9020858..8537956a 100644 --- a/module/vcomponent/formats/xcal/parse.scm +++ b/module/vcomponent/formats/xcal/parse.scm @@ -10,6 +10,7 @@ :use-module (datetime) :use-module (srfi srfi-1) :use-module (calp translation) + :export (sxcal->vcomponent) ) ;; symbol, ht, (list a) -> non-list @@ -179,7 +180,7 @@ ;; are possibilities, which other parts of the code will crash on. ;; TODO ;; since we are feeding user input into this it really should be fixed. -(define-public (sxcal->vcomponent sxcal) +(define (sxcal->vcomponent sxcal) (define type (symbol-upcase (car sxcal))) (define component (make-vcomponent type)) diff --git a/module/vcomponent/formats/xcal/types.scm b/module/vcomponent/formats/xcal/types.scm index 8f13d3d1..a88b6b04 100644 --- a/module/vcomponent/formats/xcal/types.scm +++ b/module/vcomponent/formats/xcal/types.scm @@ -3,7 +3,7 @@ :use-module (vcomponent formats ical types) :use-module (datetime) :use-module (calp translation) - ) + :export (get-writer)) (define (write-boolean _ v) `(boolean ,(if v "true" "false"))) @@ -50,6 +50,6 @@ (hashq-set! sxml-writers 'RECUR write-recur) (hashq-set! sxml-writers 'TEXT write-text) -(define-public (get-writer type) +(define (get-writer type) (or (hashq-ref sxml-writers type #f) (error (_ "No writer for type") type))) |