aboutsummaryrefslogtreecommitdiff
path: root/doc/ref/guile.texi
blob: 58c162e1a6f116e62c933c52f4619e0d2cab9e98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
@node Guile
@chapter Guile

@include guile/datetime.texi
@include guile/zic.texi
@include guile/srfi-41.texi
@include guile/util.texi
@include guile/util-path.texi
@include guile/util-config.texi
@include guile/util-type.texi
@include guile/util-object.texi
@include guile/base64.texi
@include guile/web.texi
@include guile/vcomponent.texi

@node Errors and Conditions
@section Errors and Conditions

@subsection ``Special'' Errors

@deftp{Error type} return
Thrown in some sub-mains to quickly return from the sub-function.
Should possibly be replaced by an explicit return-continuation.
@end deftp

@deftp{Error type} warning fmt args
Thrown when @code{warnings-are-errors} is true.
@end deftp

@deftp{Error type} max-page page-number
@end deftp

@subsection ``Regular'' Errors
All below mentioned error types behave as expected, e.g., they are
produced through @code{scm-error}.

@deftp{Error Type} configuration-error
Thrown by (calp util config), in some scenarios.
@TODO{Better documentation}
@end deftp

@deftp{Error Type} c-parse-error
Errors thrown by our make-shift C parser.
@end deftp

@deftp{Error Type} decoding-error
thrown by base64 in some cases
@end deftp

@deftp{Error Type} parse-error
Thrown by some things related to parsing, but not all.
@TODO{normalize parsing errors further}
@end deftp

@deftp{Error Type} graph-error
The first element of data is guaranteed to be the graph which caused
the error.
@end deftp

@deftp{Error Type} missing-helper
A helper program we wanted was missing, could be resolved by somehow
downloading it into one of the searched locations.

@example
data : (program-name : string)
     , (searched-locations : (list string))
@end example
@end deftp



@node Other
@section Other

@defun get-parser type
@example
get-parser ∷ type-name → hash-table x string → any
type = 'BINARY | 'BOOLEAN | 'CAL-ADDRES | 'DATE | 'DATE-TIME
     | 'DURATION | 'FLOAT | 'INTEGER | 'PERIOD | 'RECUR
     | 'TEXT | 'TIME | 'URI | 'UTC-OFFSET
@end example

@ref{ical-get-writer}
@end defun

@subsection formats ical
@subsubsection output

@defun component->ical-string component
@end defun

@defun print-components-with-fake-parent events
@end defun

@defun print-all-events
@end defun

@defun print-events-in-interval start end
@end defun

@subsubsection parse

@defun parse-calendar port
@end defun

@subsubsection types

@defun escape-chars str
Escape @code{,}, @code{;} and @code{\} with a
backslash, and encode newlines as @code{\n}.
@end defun

@defun get-writer type
@anchor{ical-get-writer}
@example
get-writer ∷ type-name → hash-table x value → string
type = 'BINARY | 'BOOLEAN | 'CAL-ADDRES | 'DATE | 'DATE-TIME
     | 'DURATION | 'FLOAT | 'INTEGER | 'PERIOD | 'RECUR
     | 'TEXT | 'TIME | 'URI | 'UTC-OFFSET
@end example
@end defun

@subsection formats vdir
@subsubsection parse

@defun parse-vdir path
@end defun

@subsubsection save-delete

@defun save-event event
@end defun

@defun remove-event event
@end defun

@subsection formats xcal
@subsubsection output

@defun vcomponent->sxcal component
@end defun

@defun ns-wrap
@lisp
(define (ns-wrap sxml)
  `(icalendar (@@ (xmlns "urn:ietf:params:xml:ns:icalendar-2.0"))
              ,sxml))
@end lisp
Where @var{sxml} is expected to be the output of @var{vcomponent->sxcal}.
@end defun

@subsubsection parse
@defun sxcal->vcomponent sxcal
Parses a vcomponent in sxcal format. Requires that the vcomponent is
the root of the document (fragment), so wrapping icalendar-tags or
similar @emph{must} be removed.

@example
(vcalendar
  (properties ...)
  (components ...))
@end example
@end defun

@subsubsection types
@defun get-writer type
@ref{ical-get-writer}
@end defun


@c --------------------------------------------------

@c TODO
This chapter will probably in the future be replaced by a proper
system overview in the future.

@c module (vcomponent control)

@defmac with-replaced-properties (component (key value) ...) body ...
Through the extent of @var{body} each @var{key}'s value in
@var{component} is replaced by its repspective @var{value}.

Note that @var{body} is guarded through a dynamic-wind, meaning that
even non-local exits will restore @var{component} to its initial
state.
@end defmac