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
  
188
  
189
  
190
  
191
  
192
  
193
  
194
  
195
  
196
  
197
  
198
  
199
  
200
  
201
  
202
  
203
  
204
  
205
  
206
  
207
  
208
  
209
  
210
  
211
  
212
  
213
  
214
  
215
  
216
  
217
  
218
  
219
  
220
  
221
  
222
  
223
  
224
  
225
  
226
  
227
  
228
  
229
  
230
  
231
  
232
  
233
  
234
  
235
  
236
  
237
  
238
  
239
  
240
  
241
  
242
  
243
  
244
  
245
  
246
  
247
  
248
  
249
  
250
  
251
  
252
  
253
  
254
  
255
  
256
  
257
  
258
  
259
  
260
  
261
  
262
  
263
  
264
  
265
  
266
  
267
  
268
  
269
  
270
  
271
  
272
  
273
  
274
  
275
  
276
  
277
  
278
  
279
  
280
  
281
  
282
  
283
  
284
  
285
  
286
  
287
  
288
  
289
  
290
  
291
  
292
  
293
  
294
  
295
  
296
  
297
  
298
  
299
  
300
  
301
  
302
  
303
  
304
  
305
  
306
  
307
  
308
  
309
  
310
  
311
  
312
  
313
  
314
  
315
  
316
  
317
  
318
  
319
  
320
  
321
  
322
  
323
  
324
  
325
  
326
  
327
  
328
  
329
  
330
  
331
  
332
  
333
  
334
  
335
  
336
  
337
  
338
  
339
  
340
  
341
  
342
  
343
  
344
  
345
  
346
  
347
  
348
  
349
  
350
  
351
  
352
  
353
  
354
  
355
  
356
  
357
  
358
  
359
  
360
  
361
  
362
  
363
  
364
  
#pike __REAL_VERSION__ 
 
constant CONNECTION_CLOSED=-100; 
 
string encode(mixed ... z) // encode arguments 
{ 
   return ((array(string))z)*" "; 
} 
 
string H(string what) // encode hollerith 
{ 
   return sizeof(what)+"H"+what; 
} 
 
string B(int(0..1) ... z) // encode bitfield 
{ 
   string res=""; 
   res=((array(string))z)*""; 
   return res; 
} 
 
array(string) A(array z) // encode array 
{ 
   return ({ ""+sizeof(z), "{ "+encode(@Array.flatten(z))+" }" }); 
} 
 
class LysKOMError 
{ 
   constant iserror=1; 
   constant is_generic_error=1; 
 
   int no; 
   string name; 
   string desc; 
   int status; 
   array(mixed) __backtrace; 
 
   void create(int _no,string _name,string _desc,void|int _status) 
   { 
      no=_no; 
      name=_name; 
      desc=_desc; 
      status=_status; 
      __backtrace=backtrace(); 
      __backtrace=__backtrace[..<2]; 
   } 
 
   LysKOMError clone(int status) 
   { 
      return LysKOMError(no,name,desc,status); 
   } 
 
   mixed `[](mixed z) 
   { 
      switch (z) 
      { 
         case 0: return "Protocols.LysKOM: ["+no+"] "+name+"\n"; 
         case 1: return __backtrace; 
      } 
      return ::`[](z); 
   } 
} 
 
LysKOMError lyskom_error(int no,void|int status) 
{ 
   return LysKOMError(@_lyskomerror[no],status); 
} 
 
mapping _lyskomerror= 
([ 
   0:({0,"no-error", 
       "No error has occurred. This should never " 
       "happen, but it might."}), 
 
   2:({2,"not-implemented", 
       "The call has not been implemented yet."}), 
 
   3:({3,"obsolete-call", 
       "The call is obsolete and no longer " 
       "implemented. Status value is " 
       "undefined."}), 
 
   4:({4,"invalid-password", 
       "Attempt to set a password containing " 
       "illegal characters, or to use an " 
       "incorrect password."}), 
 
   5:({5,"string-too-long", 
       "A string was too long (see descriptions " 
       "of each call.) Status value indicates " 
       "the maximum string length."}), 
 
       6:({6,"login-first", 
           "Login is required before issuing the " 
           "call. Status value is undefined. "}), 
 
   7:({7,"login-disallowed", 
       "The system is in single-user mode. You " 
       "need to be privileged to log in despite " 
       "this. "}), 
 
   8:({8,"conference-zero", 
       "Attempt to use conference number 0. "}), 
 
   9:({9,"undefined-conference", 
       "Attempt to access a non-existent or " 
       "secret conference. Status value contains " 
       "the conference number in question."}), 
 
   10:({10,"undefined-person", 
        "Attempt to access a non-existent or" 
        "secret person. Status value contains the" 
        "person number in question."}), 
 
   11:({11,"access-denied", 
        "No read/write access to something. This" 
        "might be returned in response to an" 
        "attempt to create a text, when the" 
        "recipient conference and its super" 
        "conferences are read-only, or when" 
        "attempting to add a member to a" 
        "conference without enough permission to" 
        "do so. Status value indicates the object" 
        "to which we didn't have enough" 
        "permissions to."}), 
 
   12:({12,"permission-denied", 
        "Not enough permissions to do something." 
        "The exact meaning of this response" 
        "depends on the call. Status value" 
        "indicated the object for which" 
        "permission was lacking, or zero."}), 
 
   13:({13,"not-member", 
        "The call requires the caller to be a" 
        "member of some conference that the" 
        "caller is not a member of. Status value" 
        "indicates the conference in question."}), 
 
   14:({14,"no-such-text", 
        "Attempt to access a text that either" 
        "does not exist or is secret in some way." 
        "status value indicates the text number" 
        "in question."}), 
 
   15:({15,"text-zero", 
        "Attempt to use text number 0. "}), 
 
   16:({16,"no-such-local-text", 
        "Attempt to access a text using a local" 
        "text number that does not represent an" 
        "existing text. Status value indicates" 
        "the offending number."}), 
 
   17:({17,"local-text-zero", 
        "Attempt to use local text number zero."}), 
 
   18:({18,"bad-name", 
        "Attempt to use a name that's too long," 
        "too short or contains invalid" 
        "characters. "}), 
 
   19:({19,"index-out-of-range", 
        "Attempt to use a number that's out of" 
        "range. The range and meaning of the" 
        "numbers depends on the call issued." 
        "status value is undefined."}), 
 
   20:({20,"conference-exists", 
        "Attempt to create a conference or person" 
        "with a name that's already occupied. "}), 
 
   21:({21,"person-exists", 
        "Attempt to create a person with a name" 
        "that's already occupied. This error code" 
        "is probably not used, but you never know" 
        "for sure."}), 
 
   22:({22,"secret-public", 
        "Attempt to give a conference a type with" 
        "@code{secret} bit set and the" 
        "@code{rd-prot} bit unset. This is an" 
        "error since such a conference type is" 
        "inconsistent. "}), 
 
   23:({23,"letterbox", 
        "Attempt to change the @code{letterbox}" 
        "flag of a conference. Status value" 
        "indicates the conference number."}), 
 
   24:({24,"ldb-error", 
        "Database is corrupted. Status value is" 
        "an internal code."}), 
 
   25:({25,"illegal-misc", 
        "Attempt to create an illegal misc item." 
        "status value contains the index of the" 
        "illegal item."}), 
 
   26:({26,"illegal-info-type", 
        "Attempt to use a Misc-Info type that the" 
        "server knows nothing about. "}), 
 
   27:({27,"already-recipient", 
        "Attempt to add a recipient that is" 
        "already a recipient of the same type." 
        "status value contains the recipient that" 
        "already is."}), 
 
   28:({28,"already-comment", 
        "Attempt to add a comment to a text twice" 
        "over. Status value contains the text" 
        "number of the text that already is a" 
        "comment."}), 
 
   29:({29,"already-footnote", 
        "Attempt to add a footnote to a text" 
        "twice over. Status value contains the" 
        "text number of the text that already is" 
        "a footnote."}), 
 
   30:({30,"not-recipient", 
        "Attempt to remove a recipient that isn't" 
        "really a recipient. Status value" 
        "contains the conference number in" 
        "question."}), 
 
   31:({31,"not-comment", 
        "Attempt to remove a comment link that" 
        "does not exist. Status value contains" 
        "the text number that isn't a comment. "}), 
 
   32:({32,"not-footnote", 
        "Attempt to remove a footnote link that" 
        "does not exist. Status value contains" 
        "the text number that isn't a footnote."}), 
 
   33:({33,"recipient-limit", 
        "Attempt to add a recipient to a text" 
        "that already has the maximum number of" 
        "recipients. Status value is the text" 
        "that has the maximum number of" 
        "recipients."}), 
 
   34:({34,"comment-limit", 
        "Attempt to add a comment to a text that" 
        "already has the maximum number of" 
        "comments. Status value is the text with" 
        "the maximum number of comments. "}), 
 
   35:({35,"footnote-limit", 
        "Attempt to add a footnote to a text that" 
        "already has the maximum number of" 
        "footnote. Status value is the text with" 
        "the maximum number of footnote. "}), 
 
   36:({36,"mark-limit", 
        "Attempt to add a mark to a text that" 
        "already has the maximum number of marks." 
        "status value is the text with the" 
        "maximum number of marks. "}), 
 
   37:({37,"not-author", 
        "Attempt to manipulate a text in a way" 
        "that required the user to be the author" 
        "of the text, when not in fact the" 
        "author. Status value contains the text" 
        "number in question."}), 
 
   38:({38,"no-connect", 
        "Currently unused."}), 
 
   39:({39,"out-of-memory", 
        "The server ran out of memory."}), 
 
   40:({40,"server-is-crazy", 
        "Currently unused."}), 
 
   41:({41,"client-is-crazy", 
        "Currently unused."}), 
 
   42:({42,"undefined-session", 
        "Attempt to access a session that does" 
        "not exist. Status value contains the" 
        "offending session number."}), 
 
   43:({43,"regexp-error", 
        "Error using a regexp. The regexp may be" 
        "invalid or the server unable to compile" 
        "it for other reasons. "}), 
 
   44:({44,"not-marked", 
        "Attempt to manipulate a text in a way" 
        "that requires the text to be marked," 
        "when in fact it is not marked. Status" 
        "value indicates the text in question."}), 
 
   45:({45,"temporary-failure", 
        "Temporary failure. Try again later." 
        "@code{error-code} is undefined."}), 
 
   46:({46,"long-array", 
        "An array sent to the server was too" 
        "long. Status value is undefined."}), 
 
   47:({47,"anonymous-rejected", 
        "Attempt to send an anonymous text to a" 
        "conference that does not accept" 
        "anonymous texts. "}), 
 
   48:({48,"illegal-aux-item", 
        "Attempt to create an invalid aux-item." 
        "Probably the tag or data are invalid." 
        "status value contains the index in the" 
        "aux-item list where the invalid item" 
        "appears."}), 
 
   49:({49,"aux-item-permission", 
        "Attempt to manipulate an aux-item" 
        "without enough permissions. This" 
        "response is sent when attempting to" 
        "delete an item set by someone else or an" 
        "item that can't be deleted, and when" 
        "attempting to create an item without" 
        "permissions to do so. Status value" 
        "contains the index at which the item" 
        "appears in the aux-item list sent to the" 
        "server."}), 
 
   50:({50,"unknown-async", 
        "Sent in response to a request for an" 
        "asynchronous message the server does not" 
        "send. The call succeeds, but this is" 
        "sent as a warning to the client. Status" 
        "value contains the message type the" 
        "server did not understand."}), 
 
   51:({51,"internal-error", 
        "The server has encountered a possibly" 
        "recoverable internal error. "}), 
 
   52:({52,"feature-disabled", 
        "Attempt to use a feature that has been" 
        "explicitly disabled in the server. "}), 
 
   53:({53,"message-not-sent", 
        "Attempt to send an asynchronous message" 
        "failed for some reason. Perhaps the" 
        "recipient is not accepting messages at" 
        "the moment."}), 
 
   54:({54,"invalid-membership-type", 
        "A requested membership type was not" 
        "compatible with restrictions set on the" 
        "server or on a specific conference." 
        "status value is undefined unless" 
        "specifically mentioned in the" 
        "documentation for a specific call."}), 
 
   CONNECTION_CLOSED:({CONNECTION_CLOSED,"connection closed", 
                       "LysKOM module: connection has been closed"}) 
]);