Commit | Line | Data |
---|---|---|
460b9539 | 1 | .\" |
2 | .\" Copyright (C) 2004, 2005, 2006 Richard Kettlewell | |
3 | .\" | |
4 | .\" This program is free software; you can redistribute it and/or modify | |
5 | .\" it under the terms of the GNU General Public License as published by | |
6 | .\" the Free Software Foundation; either version 2 of the License, or | |
7 | .\" (at your option) any later version. | |
8 | .\" | |
9 | .\" This program is distributed in the hope that it will be useful, but | |
10 | .\" WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | .\" General Public License for more details. | |
13 | .\" | |
14 | .\" You should have received a copy of the GNU General Public License | |
15 | .\" along with this program; if not, write to the Free Software | |
16 | .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | |
17 | .\" USA | |
18 | .\" | |
19 | .TH disorder_protocol 5 | |
20 | .SH NAME | |
21 | disorder_protocol \- DisOrder communication protocol | |
22 | .SH DESCRIPTION | |
23 | The DisOrder client and server communicate via the protocol described | |
24 | in this man page. | |
25 | .PP | |
26 | The protocol is liable to change without notice. You are recommended to check | |
27 | the implementation before believing this document. | |
28 | .SH "GENERAL SYNTAX" | |
f9635e06 RK |
29 | Everything is encoded using UTF-8. See |
30 | .B "CHARACTER ENCODING" | |
31 | below for more detail on character encoding issues. | |
460b9539 | 32 | .PP |
f9635e06 RK |
33 | Commands and responses consist of a line perhaps followed (depending on the |
34 | command or response) by a body. | |
460b9539 | 35 | .PP |
36 | The line syntax is the same as described in \fBdisorder_config\fR(5) except | |
37 | that comments are prohibited. | |
38 | .PP | |
39 | Bodies borrow their syntax from RFC821; they consist of zero or more ordinary | |
40 | lines, with any initial full stop doubled up, and are terminated by a line | |
41 | consisting of a full stop and a line feed. | |
42 | .SH COMMANDS | |
43 | Commands always have a command name as the first field of the line; responses | |
44 | always have a 3-digit response code as the first field. See below for more | |
45 | details about this field. | |
46 | .PP | |
47 | All commands require the connection to have been already authenticated unless | |
eb5dc014 RK |
48 | stated otherwise. If not stated otherwise, the \fBread\fR right is sufficient |
49 | to execute the command. | |
460b9539 | 50 | .PP |
51 | Neither commands nor responses have a body unless stated otherwise. | |
52 | .TP | |
0f55e905 | 53 | .B adduser \fIUSERNAME PASSWORD \fR[\fIRIGHTS\fR] |
5818980a | 54 | Create a new user with the given username and password. The new user's rights |
0f55e905 RK |
55 | list can be specified; if it is not then the \fBdefault_rights\fR setting |
56 | applies instead. Requires the \fBadmin\fR right, and only works on local | |
57 | connections. | |
eb5dc014 | 58 | .TP |
460b9539 | 59 | .B allfiles \fIDIRECTORY\fR [\fIREGEXP\fR] |
5818980a | 60 | List all the files and directories in \fIDIRECTORY\fR in a response body. |
460b9539 | 61 | If \fIREGEXP\fR is present only matching files and directories are returned. |
62 | .TP | |
ba39faf6 RK |
63 | .B confirm \fICONFIRMATION |
64 | Confirm user registration. \fICONFIRMATION\fR is as returned from | |
65 | \fBregister\fR below. This command can be used without logging in. | |
66 | .TP | |
eb5dc014 | 67 | .B cookie \fICOOKIE |
0227f67d RK |
68 | Log a user back in using a cookie created with \fBmake-cookie\fR. The response |
69 | contains the username. | |
eb5dc014 RK |
70 | .TP |
71 | .B deluser \fIUSERNAME | |
5818980a | 72 | Delete the named user. Requires the \fBadmin\fR right, and only works on |
eb5dc014 | 73 | local connections. |
460b9539 | 74 | .TP |
75 | .B dirs \fIDIRECTORY\fR [\fIREGEXP\fR] | |
5818980a | 76 | List all the directories in \fIDIRECTORY\fR in a response body. |
460b9539 | 77 | If \fIREGEXP\fR is present only matching directories are returned. |
78 | .TP | |
79 | .B disable \fR[\fBnow\fR] | |
5818980a | 80 | Disable further playing. If the optional \fBnow\fR argument is present then |
eb5dc014 RK |
81 | the current track is stopped. Requires the \fBglobal prefs\fR right. |
82 | .TP | |
83 | .B edituser \fIUSERNAME PROPERTY VALUE | |
5818980a | 84 | Set a user property. With the \fBadmin\fR right any username and property may |
eb5dc014 RK |
85 | be specified. Otherwise the \fBuserinfo\fR right is required and only the |
86 | \fBemail\fR and \fBpassword\fR properties may be set. | |
460b9539 | 87 | .TP |
88 | .B enable | |
5818980a | 89 | Re-enable further playing, and is the opposite of \fBdisable\fR. Requires the |
eb5dc014 | 90 | \fBglobal prefs\fR right. |
460b9539 | 91 | .TP |
92 | .B enabled | |
5818980a | 93 | Report whether playing is enabled. The second field of the response line will |
460b9539 | 94 | be \fByes\fR or \fBno\fR. |
95 | .TP | |
96 | .B exists \fITRACK\fR | |
5818980a | 97 | Report whether the named track exists. The second field of the response line |
460b9539 | 98 | will be \fByes\fR or \fBno\fR. |
99 | .TP | |
100 | .B files \fIDIRECTORY\fR [\fIREGEXP\fR] | |
5818980a | 101 | List all the files in \fIDIRECTORY\fR in a response body. |
460b9539 | 102 | If \fIREGEXP\fR is present only matching files are returned. |
103 | .TP | |
104 | .B get \fITRACK\fR \fIPREF\fR | |
5818980a | 105 | Getsa preference value. On success the second field of the response line will |
460b9539 | 106 | have the value. |
fb1bc1f5 RK |
107 | .IP |
108 | If the track or preference do not exist then the response code is 555. | |
460b9539 | 109 | .TP |
110 | .B get-global \fIKEY\fR | |
111 | Get a global preference. | |
fb1bc1f5 RK |
112 | .IP |
113 | If the preference does not exist then the response code is 555. | |
460b9539 | 114 | .TP |
115 | .B length \fITRACK\fR | |
5818980a | 116 | Get the length of the track in seconds. On success the second field of the |
460b9539 | 117 | response line will have the value. |
118 | .TP | |
119 | .B log | |
5818980a | 120 | Send event log messages in a response body. The command will never terminate. |
397ef7bb RK |
121 | Any further data sent to the server will be discarded (explicitly; i.e. it will |
122 | not accumulate in a buffer somewhere). | |
460b9539 | 123 | .IP |
124 | See \fBEVENT LOG\fR below for more details. | |
125 | .TP | |
eb5dc014 RK |
126 | .B make-cookie |
127 | Returns an opaque string that can be used by the \fBcookie\fR command to log | |
128 | this user back in on another connection (until the cookie expires). | |
129 | .TP | |
460b9539 | 130 | .B move \fITRACK\fR \fIDELTA\fR |
131 | Move a track in the queue. The track may be identified by ID (preferred) or | |
132 | name (which might cause confusion if it's there twice). \fIDELTA\fR should be | |
133 | an negative or positive integer and indicates how many steps towards the head | |
134 | of the queue the track should be moved. | |
eb5dc014 RK |
135 | .IP |
136 | Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights | |
137 | depending on how the track came to be added to the queue. | |
460b9539 | 138 | .TP |
139 | .B moveafter \fITARGET\fR \fIID\fR ... | |
140 | Move all the tracks in the \fIID\fR list after ID \fITARGET\fR. If | |
141 | \fITARGET\fR is the empty string then the listed tracks are put at the head of | |
142 | the queue. If \fITARGET\fR is listed in the ID list then the tracks are moved | |
143 | to just after the first non-listed track before it, or to the head if there is | |
144 | no such track. | |
eb5dc014 RK |
145 | .IP |
146 | Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights | |
147 | depending on how the tracks came to be added to the queue. | |
460b9539 | 148 | .TP |
2a10b70b | 149 | .B new \fR[\fIMAX\fR] |
5818980a | 150 | Send the most recently added \fIMAX\fR tracks in a response body. If the |
2a10b70b RK |
151 | argument is ommitted, all recently added tracks are listed. |
152 | .TP | |
7858930d | 153 | .B nop |
154 | Do nothing. Used by | |
155 | .BR disobedience (1) | |
eb5dc014 | 156 | as a keepalive measure. This command does not require authentication. |
7858930d | 157 | .TP |
460b9539 | 158 | .B part \fITRACK\fR \fICONTEXT\fI \fIPART\fR |
159 | Get a track name part. Returns an empty string if a name part cannot be | |
160 | constructed. | |
161 | .IP | |
162 | .I CONTEXT | |
163 | is one of | |
164 | .B sort | |
165 | or | |
166 | .B display | |
167 | and | |
168 | .I PART | |
169 | is usually one of | |
170 | .BR artist , | |
171 | .B album | |
172 | or | |
173 | .BR title . | |
174 | .TP | |
175 | .B pause | |
fce810c2 | 176 | Pause the current track. Requires the \fBpause\fR right. |
460b9539 | 177 | .TP |
178 | .B play \fITRACK\fR | |
81e440ce | 179 | Add a track to the queue. The response contains the queue ID of the track. |
eb5dc014 | 180 | Requires the \fBplay\fR right. |
460b9539 | 181 | .TP |
182 | .B playing | |
5818980a | 183 | Report what track is playing. |
460b9539 | 184 | .IP |
185 | If the response is \fB252\fR then the rest of the response line consists of | |
186 | track information (see below). | |
187 | .IP | |
188 | If the response is \fB259\fR then nothing is playing. | |
189 | .TP | |
190 | .B prefs \fBTRACK\fR | |
5818980a | 191 | Send back the preferences for \fITRACK\fR in a response body. |
460b9539 | 192 | Each line of the response has the usual line syntax, the first field being the |
193 | name of the pref and the second the value. | |
194 | .TP | |
195 | .B queue | |
5818980a | 196 | Send back the current queue in a response body, one track to a line, the track |
460b9539 | 197 | at the head of the queue (i.e. next to be be played) first. See below for the |
198 | track information syntax. | |
199 | .TP | |
200 | .B random-disable | |
eb5dc014 RK |
201 | Disable random play (but don't stop the current track). Requires the \fBglobal |
202 | prefs\fR right. | |
460b9539 | 203 | .TP |
204 | .B random-enable | |
eb5dc014 | 205 | Enable random play. Requires the \fBglobal prefs\fR right. |
460b9539 | 206 | .TP |
207 | .B random-enabled | |
5818980a | 208 | Report whether random play is enabled. The second field of the response line |
460b9539 | 209 | will be \fByes\fR or \fBno\fR. |
210 | .TP | |
211 | .B recent | |
5818980a | 212 | Send back the current recently-played list in a response body, one track to a |
460b9539 | 213 | line, the track most recently played last. See below for the track |
214 | information syntax. | |
215 | .TP | |
216 | .B reconfigure | |
eb5dc014 | 217 | Request that DisOrder reconfigure itself. Requires the \fBadmin\fR right. |
460b9539 | 218 | command. |
219 | .TP | |
ba39faf6 RK |
220 | .B register \fIUSER PASSWORD EMAIL |
221 | Register a new user. Requires the \fBregister\fR right. The result contains a | |
222 | confirmation string; the user will be be able to log in until this has been | |
223 | presented back to the server via the \fBconfirm\fR command. | |
224 | .TP | |
460b9539 | 225 | .B remove \fIID\fR |
eb5dc014 RK |
226 | Remove the track identified by \fIID\fR. Requires one of the \fBremove |
227 | mine\fR, \fBremove random\fR or \fBremove any\fR rights depending on how the | |
228 | track came to be added to the queue. | |
460b9539 | 229 | .TP |
230 | .B rescan | |
eb5dc014 | 231 | Rescan all roots for new or obsolete tracks. Requires the \fBrescan\fR right. |
460b9539 | 232 | .TP |
233 | .B resolve \fITRACK\fR | |
234 | Resolve a track name, i.e. if this is an alias then return the real track name. | |
235 | .TP | |
236 | .B resume | |
eb5dc014 RK |
237 | Resume the current track after a \fBpause\fR command. Requires the \fBpause\fR |
238 | right. | |
239 | .TP | |
240 | .B revoke \fBcookie\fR | |
5818980a | 241 | Revoke a cookie previously created with \fBmake-cookie\fR. It will not be |
eb5dc014 | 242 | possible to use this cookie in the future. |
460b9539 | 243 | .TP |
ca831831 | 244 | .B rtp-address |
5818980a | 245 | Report the RTP broadcast (or multicast) address, in the form \fIADDRESS |
eb5dc014 | 246 | PORT\fR. This command does not require authentication. |
ca831831 | 247 | .TP |
460b9539 | 248 | .B scratch \fR[\fIID\fR] |
249 | Remove the track identified by \fIID\fR, or the currently playing track if no | |
eb5dc014 RK |
250 | \fIID\fR is specified. Requires one of the \fBscratch mine\fR, \fBscratch |
251 | random\fR or \fBscratch any\fR rights depending on how the track came to be | |
252 | added to the queue. | |
460b9539 | 253 | .TP |
254 | .B search \fITERMS\fR | |
255 | Search for tracks matching the search terms. The results are put in a response | |
256 | body, one to a line. | |
257 | .IP | |
258 | The search string is split in the usual way, with quoting supported, into a | |
259 | list of terms. Only tracks matching all terms are included in the results. | |
260 | .IP | |
261 | Any terms of the form \fBtag:\fITAG\fR limits the search to tracks with that | |
262 | tag. | |
263 | .IP | |
264 | All other terms are interpreted as individual words which must be present in | |
265 | the track name. | |
266 | .IP | |
267 | Spaces in terms don't currently make sense, but may one day be interpreted to | |
268 | allow searching for phrases. | |
269 | .TP | |
270 | .B \fBset\fR \fITRACK\fR \fIPREF\fR \fIVALUE\fR | |
eb5dc014 | 271 | Set a preference. Requires the \fBprefs\fR right. |
460b9539 | 272 | .TP |
273 | .B set-global \fIKEY\fR \fIVALUE\fR | |
eb5dc014 | 274 | Set a global preference. Requires the \fBglobal prefs\fR right. |
460b9539 | 275 | .TP |
276 | .B stats | |
277 | Send server statistics in plain text in a response body. | |
278 | .TP | |
279 | .B \fBtags\fR | |
280 | Send the list of currently known tags in a response body. | |
281 | .TP | |
282 | .B \fBunset\fR \fITRACK\fR \fIPREF\fR | |
eb5dc014 | 283 | Unset a preference. Requires the \fBprefs\fR right. |
460b9539 | 284 | .TP |
285 | .B \fBunset-global\fR \fIKEY\fR | |
eb5dc014 | 286 | Unset a global preference. Requires the \fBglobal prefs\fR right. |
460b9539 | 287 | .TP |
288 | .B user \fIUSER\fR \fIRESPONSE\fR | |
5e3f9e08 RK |
289 | Authenticate as \fIUSER\fR. See |
290 | .B AUTHENTICATION | |
291 | below. | |
460b9539 | 292 | .TP |
eb5dc014 | 293 | .B users |
5818980a | 294 | Send the list of currently known users in a response body. |
eb5dc014 | 295 | .TP |
460b9539 | 296 | .B version |
297 | Send back a response with the server version as the second field. | |
298 | .TP | |
299 | .B volume \fR[\fILEFT\fR [\fIRIGHT\fR]] | |
300 | Get or set the volume. | |
301 | .IP | |
302 | With zero parameters just gets the volume and reports the left and right sides | |
303 | as the 2nd and 3rd fields of the response. | |
304 | .IP | |
305 | With one parameter sets both sides to the same value. With two parameters sets | |
eb5dc014 | 306 | each side independently. Setting the volume requires the \fBvolume\fR right. |
460b9539 | 307 | .SH RESPONSES |
308 | Responses are three-digit codes. The first digit distinguishes errors from | |
309 | succesful responses: | |
310 | .TP | |
311 | .B 2 | |
312 | Operation succeeded. | |
313 | .TP | |
314 | .B 5 | |
315 | Operation failed. | |
316 | .PP | |
317 | The second digit breaks down the origin of the response: | |
318 | .TP | |
319 | .B 0 | |
320 | Generic responses not specific to the handling of the command. Mostly this is | |
321 | parse errors. | |
322 | .TP | |
b4a80f69 | 323 | .B 1 |
324 | 51x errors indicate that the user had insufficient rights for the command. | |
325 | .TP | |
460b9539 | 326 | .B 3 |
327 | Authentication responses. | |
328 | .TP | |
329 | .B 5 | |
330 | Responses specific to the handling of the command. | |
331 | .PP | |
332 | The third digit provides extra information about the response: | |
333 | .TP | |
334 | .B 0 | |
335 | Text part is just commentary. | |
336 | .TP | |
337 | .B 1 | |
338 | Text part is a constant result e.g. \fBversion\fR. | |
339 | .TP | |
340 | .B 2 | |
341 | Text part is a potentially variable result. | |
342 | .TP | |
343 | .B 3 | |
344 | Text part is just commentary; a dot-stuffed body follows. | |
345 | .TP | |
346 | .B 4 | |
347 | Text part is just commentary; an indefinite dot-stuffed body follows. (Used | |
348 | for \fBlog\fR.) | |
349 | .TP | |
fb1bc1f5 RK |
350 | .B 5 |
351 | Used with "normal" errors, for instance a preference not being found. The text | |
352 | part is commentary. | |
353 | .TP | |
460b9539 | 354 | .B 9 |
355 | The text part is just commentary (but would normally be a response for this | |
356 | command) e.g. \fBplaying\fR. | |
7b32e917 RK |
357 | .PP |
358 | Result strings (not bodies) intended for machine parsing (i.e. xx1 and xx2 | |
359 | responses) are quoted. | |
460b9539 | 360 | .SH AUTHENTICATION |
5e3f9e08 | 361 | When a connection is made the server sends a \fB231\fR response before any |
7b32e917 RK |
362 | command is received. This contains a protocol generation, an algorithm name |
363 | and a challenge encoded in hex, all separated by whitespace. | |
364 | .PP | |
365 | The current protocol generation is \fB2\fR. | |
5e3f9e08 | 366 | .PP |
b3141726 RK |
367 | The possible algorithms are (currently) \fBsha1\fR, \fBsha256\fR, \fBsha384\fR |
368 | and \fBsha512\fR. \fBSHA1\fR etc work as synonyms. | |
460b9539 | 369 | .PP |
5e3f9e08 RK |
370 | The \fBuser\fR response consists of the selected hash of the user's password |
371 | concatenated with the challenge, encoded in hex. | |
460b9539 | 372 | .SH "TRACK INFORMATION" |
373 | Track information is encoded in a line (i.e. using the usual line syntax) as | |
374 | pairs of fields. The first is a name, the second a value. The names have the | |
375 | following meanings: | |
376 | .TP 12 | |
377 | .B expected | |
378 | The time the track is expected to be played at. | |
379 | .TP | |
380 | .B id | |
381 | A string uniquely identifying this queue entry. | |
382 | .TP | |
383 | .B played | |
384 | The time the track was played at. | |
385 | .TP | |
386 | .B scratched | |
387 | The user that scratched the track. | |
388 | .TP | |
389 | .B state | |
390 | The current track state. Valid states are: | |
391 | .RS | |
392 | .TP 12 | |
393 | .B failed | |
394 | The player failed (exited with nonzero status but wasn't scratched). | |
395 | .TP | |
396 | .B isscratch | |
397 | The track is actually a scratch. | |
398 | .TP | |
399 | .B no_player | |
400 | No player could be found for the track. | |
401 | .TP | |
402 | .B ok | |
403 | The track was played without any problems. | |
404 | .TP | |
405 | .B scratched | |
406 | The track was scratched. | |
407 | .TP | |
408 | .B started | |
409 | The track is currently playing. | |
410 | .TP | |
411 | .B unplayed | |
412 | In the queue, hasn't been played yet. | |
413 | .TP | |
414 | .B quitting | |
415 | The track was terminated because the server is shutting down. | |
416 | .RE | |
417 | .TP | |
418 | .B submitter | |
419 | The user that submitted the track. | |
420 | .TP | |
421 | .B track | |
422 | The filename of the track. | |
423 | .TP | |
424 | .B when | |
425 | The time the track was added to the queue. | |
426 | .TP | |
427 | .B wstat | |
428 | The wait status of the player in decimal. | |
429 | .SH NOTES | |
430 | Times are decimal integers using the server's \fBtime_t\fR. | |
431 | .PP | |
432 | For file listings, the regexp applies to the basename of the returned file, not | |
433 | the whole filename, and letter case is ignored. \fBpcrepattern\fR(3) describes | |
434 | the regexp syntax. | |
435 | .PP | |
436 | Filenames are in UTF-8 even if the collection they come from uses some other | |
437 | encoding - if you want to access the real file (in such cases as the filenames | |
438 | actually correspond to a real file) you'll have to convert to whatever the | |
439 | right encoding is. | |
440 | .SH "EVENT LOG" | |
441 | The event log consists of lines starting with a hexadecimal timestamp and a | |
442 | keyword followed by (optionally) parameters. The parameters are quoted in the | |
443 | usual DisOrder way. Currently the following keywords are used: | |
444 | .TP | |
445 | .B completed \fITRACK\fR | |
446 | Completed playing \fITRACK\fR | |
447 | .TP | |
448 | .B failed \fITRACK\fR \fIERROR\fR | |
449 | Completed playing \fITRACK\fR with an error status | |
450 | .TP | |
451 | .B moved \fIUSER\fR | |
452 | User \fIUSER\fR moved some track(s). Further details aren't included any | |
453 | more. | |
454 | .TP | |
455 | .B playing \fITRACK\fR [\fIUSER\fR] | |
456 | Started playing \fITRACK\fR. | |
457 | .TP | |
458 | .B queue \fIQUEUE-ENTRY\fR... | |
459 | Added \fITRACK\fR to the queue. | |
460 | .TP | |
461 | .B recent_added \fIQUEUE-ENTRY\fR... | |
462 | Added \fIID\fR to the recently played list. | |
463 | .TP | |
464 | .B recent_removed \fIID\fR | |
465 | Removed \fIID\fR from the recently played list. | |
466 | .TP | |
467 | .B removed \fIID\fR [\fIUSER\fR] | |
468 | Queue entry \fIID\fR was removed. This is used both for explicit removal (when | |
469 | \fIUSER\fR is present) and when playing a track (when it is absent). | |
470 | .TP | |
e025abff RK |
471 | .B rescanned |
472 | A rescan completed. | |
473 | .TP | |
460b9539 | 474 | .B scratched \fITRACK\fR \fIUSER\fR |
475 | \fITRACK\fR was scratched by \fIUSER\fR. | |
476 | .TP | |
477 | .B state \fIKEYWORD\fR | |
478 | Some state change occurred. The current set of keywords is: | |
479 | .RS | |
480 | .TP | |
5abe307a RK |
481 | .B completed |
482 | The current track completed successfully. | |
483 | .TP | |
460b9539 | 484 | .B disable_play |
485 | Playing was disabled. | |
486 | .TP | |
487 | .B disable_random | |
488 | Random play was disabled. | |
489 | .TP | |
490 | .B enable_play | |
491 | Playing was enabled. | |
492 | .TP | |
493 | .B enable_random | |
494 | Random play was enabled. | |
495 | .TP | |
5abe307a RK |
496 | .B failed |
497 | The current track failed. | |
498 | .TP | |
460b9539 | 499 | .B pause |
500 | The current track was paused. | |
501 | .TP | |
5abe307a RK |
502 | .B playing |
503 | A track started playing. | |
504 | .TP | |
460b9539 | 505 | .B resume |
506 | The current track was resumed. | |
5abe307a RK |
507 | .TP |
508 | .B scratched | |
509 | The current track was scratched. | |
510 | .PP | |
511 | To simplify client implementation, \fBstate\fR commands reflecting the current | |
512 | state are sent at the start of the log. | |
460b9539 | 513 | .RE |
514 | .TP | |
515 | .B volume \fILEFT\fR \fIRIGHT\fR | |
516 | The volume changed. | |
517 | .PP | |
518 | .IR QUEUE-ENTRY ... | |
519 | is as defined in | |
520 | .B "TRACK INFORMATION" | |
521 | above. | |
f9635e06 RK |
522 | .SH "CHARACTER ENCODING" |
523 | All data sent by both server and client is encoded using UTF-8. Moreover it | |
524 | must be valid UTF-8, i.e. non-minimal sequences are not permitted, nor are | |
525 | surrogates, nor are code points outside the Unicode code space. | |
526 | .PP | |
527 | There are no particular normalization requirements on either side of the | |
528 | protocol. The server currently converts internally to NFC, the client must | |
529 | normalize the responses returned if it needs some normalized form for further | |
530 | processing. | |
531 | .PP | |
532 | The various characters which divide up lines may not be followed by combining | |
533 | characters. For instance all of the following are prohibited: | |
534 | .TP | |
535 | .B o | |
536 | LINE FEED followed by a combining character. For example the sequence | |
537 | LINE FEED, COMBINING GRAVE ACCENT is never permitted. | |
538 | .TP | |
539 | .B o | |
540 | APOSTROPHE or QUOTATION MARK followed by a combining character when used to | |
541 | delimit fields. For instance a line starting APOSTROPHE, COMBINING CEDILLA | |
542 | is prohibited. | |
543 | .IP | |
544 | Note that such sequences are not prohibited when the quote character cannot be | |
545 | interpreted as a field delimiter. For instance APOSTROPHE, REVERSE SOLIDUS, | |
546 | APOSTROPHE, COMBINING CEDILLA, APOSTROPHE would be permitted. | |
547 | .TP | |
548 | .B o | |
549 | REVERSE SOLIDUS (BACKSLASH) followed by a combining character in a quoted | |
550 | string when it is the first character of an escape sequence. For instance a | |
551 | line starting APOSTROPHE, REVERSE SOLIDUS, COMBINING TILDE is prohibited. | |
552 | .IP | |
553 | As above such sequences are not prohibited when the character is not being used | |
554 | to start an escape sequence. For instance APOSTROPHE, REVERSE SOLIDUS, | |
555 | REVERSE SOLIDS, COMBINING TILDER, APOSTROPHE is permitted. | |
556 | .TP | |
557 | .B o | |
558 | Any of the field-splitting whitespace characters followed by a combining | |
559 | character when not part of a quoted field. For instance a line starting COLON, | |
560 | SPACE, COMBINING CANDRABINDU is prohibited. | |
561 | .IP | |
562 | As above non-delimiter uses are fine. | |
563 | .TP | |
564 | .B o | |
565 | The FULL STOP characters used to quote or delimit a body. | |
566 | .PP | |
567 | Furthermore none of these characters are permitted to appear in the context of | |
568 | a canonical decomposition (i.e. they must still be present when converted to | |
569 | NFC). In practice however this is not an issue in Unicode 5.0. | |
570 | .PP | |
571 | These rules are consistent with the observation that the split() function is | |
572 | essentially a naive ASCII parser. The implication is not that these sequences | |
573 | never actually appear in the protocol, merely that the server is not required | |
574 | to honor them in any useful way nor be consistent between versions: in current | |
575 | versions the result will be lines and fields that start with combining | |
576 | characters and are not necessarily split where you expect, but future versions | |
577 | may remove them, reject them or ignore some or all of the delimiters that have | |
578 | following combining characters, and no notice will be given of any change. | |
460b9539 | 579 | .SH "SEE ALSO" |
580 | \fBdisorder\fR(1), | |
581 | \fBtime\fR(2), | |
582 | \fBdisorder\fR(3), | |
583 | \fBpcrepattern\fR(3) | |
584 | \fBdisorder_config\fR(5), | |
585 | \fBdisorderd\fR(8), | |
586 | \fButf8\fR(7) | |
587 | .\" Local Variables: | |
588 | .\" mode:nroff | |
589 | .\" fill-column:79 | |
590 | .\" End: |