ObjFW  Diff

Differences From Artifact [f063fde1b6]:

To Artifact [78a34e9941]:


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
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







-
+











-
-




















-
+
















-
-




















-
+














-
+









-
+












-
-







 * \return The object that caused the exception
 */
- (id)object;

/**
 * \return An error message for the exception as a C String
 */
- (char*)cString;
- (const char*)cString;
@end

/**
 * An OFException indicating there is not enough memory available.
 */
@interface OFNoMemException: OFException
{
	size_t req_size;
}

/**
 * Creates a new no memory exception.
 *
 * \param obj The object which caused the exception
 * \param size The size of the memory that couldn't be allocated
 * \return A new no memory exception
 */
+ newWithObject: (id)obj
	andSize: (size_t)size;

/**
 * Initializes an already allocated no memory exception.
 *
 * \param obj The object which caused the exception
 * \param size The size of the memory that couldn't be allocated
 * \return An initialized no memory exception
 */
- initWithObject: (id)obj
	 andSize: (size_t)size;

/**
 * \return An error message for the exception as a C String
 */
- (char*)cString;
- (const char*)cString;

/**
 * \return The size of the memoory that couldn't be allocated
 */
- (size_t)requestedSize;
@end

/**
 * An OFException indicating the given memory is not part of the object.
 */
@interface OFMemNotPartOfObjException: OFException
{
	void *pointer;
}

/**
 * Creates a new memory not part of object exception.
 *
 * \param obj The object which caused the exception
 * \param ptr A pointer to the memory that is not part of the object
 * \return A new memory not part of object exception
 */
+ newWithObject: (id)obj
     andPointer: (void*)ptr;

/**
 * Initializes an already allocated memory not part of object exception.
 *
 * \param obj The object which caused the exception
 * \param ptr A pointer to the memory that is not part of the object
 * \return An initialized memory not part of object exception
 */
- initWithObject: (id)obj
      andPointer: (void*)ptr;

/**
 * \return An error message for the exception as a C String
 */
- (char*)cString;
- (const char*)cString;

/**
 * \return A pointer to the memory which is not part of the object
 */
- (void*)pointer;
@end

/**
 * An OFException indicating the given value is out of range. 
 */
@interface OFOutOfRangeException: OFException {}
/**
 * \return An error message for the exception as a C String
 */
- (char*)cString;
- (const char*)cString;
@end

/**
 * An OFException indicating that the conversation between two charsets failed.
 */
@interface OFCharsetConversionFailedException: OFException {}
/**
 * \return An error message for the exception as a C String
 */
- (char*)cString;
- (const char*)cString;
@end

/**
 * An OFException indicating the file couldn't be opened.
 */
@interface OFOpenFileFailedException: OFException
{
	char *path;
	char *mode;
}

/**
 * Creates a new open file failed exception.
 *
 * \param obj The object which caused the exception
 * \param p A C string of the path to the file tried to open
 * \param m A C string of the mode in which the file should have been opened
 * \return A new open file failed exception
 */
+ newWithObject: (id)obj
	andPath: (const char*)p
181
182
183
184
185
186
187
188

189
190
191
192
193
194
195
175
176
177
178
179
180
181

182
183
184
185
186
187
188
189







-
+







	 andMode: (const char*)m;

- free;

/**
 * \return An error message for the exception as a C String
 */
- (char*)cString;
- (const char*)cString;

/**
 * \return A C string of the path to the file which couldn't be opened
 */
- (char*)path;

/**
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
199
200
201
202
203
204
205


206
207
208
209
210
211
212
213
214
215


216
217
218
219
220
221
222







-
-










-
-







{
	size_t req_size;
	size_t req_items;
	BOOL has_items;
}

/**
 * Creates a new read or write failed exception.
 *
 * \param obj The object which caused the exception
 * \param size The requested size of the data that couldn't be read / written
 * \param nitems The requested number of items that couldn't be read / written
 * \return A new open file failed exception
 */
+ newWithObject: (id)obj
	andSize: (size_t)size
      andNItems: (size_t)nitems;

/**
 * Creates a new read or write failed exception.
 *
 * \param obj The object which caused the exception
 * \param size The requested size of the data that couldn't be read / written
 * \return A new open file failed exception
 */
+ newWithObject: (id)obj
	andSize: (size_t)size;

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















































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







+
+
+
+
+









-
+









-
+









-
+










-
+





-
+



-
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 */
- (size_t)requestedSize;

/**
 * \return The requested number of items that coudln't be read / written
 */
- (size_t)requestedItems;

/**
 * \return Whether NItems was specified
 */
- (BOOL)hasNItems;
@end

/**
 * An OFException indicating a read to the file failed.
 */
@interface OFReadFailedException: OFReadOrWriteFailedException {}
/**
 * \return An error message for the exception as a C String
 */
- (char*)cString;
- (const char*)cString;
@end

/**
 * An OFException indicating a write to the file failed.
 */
@interface OFWriteFailedException: OFReadOrWriteFailedException {}
/**
 * \return An error message for the exception as a C String
 */
- (char*)cString;
- (const char*)cString;
@end

/**
 * An OFException indicating a socket is not connected or bound.
 */
@interface OFNotConnectedException: OFException {}
/**
 * \return An error message for the exception as a C string.
 */
- (char*)cString;
- (const char*)cString;
@end

/**
 * An OFException indicating an attempt to connect or bind an already connected
 * or bound socket 
 */
@interface OFAlreadyConnectedException: OFException {}
/**
 * \return An error message for the exception as a C string.
 */
- (char*)cString;
- (const char*)cString;
@end

/**
 * An OFException indicating that the specified port is invalid.
 */
@interface OFInvalidPortException: OFException
@interface OFInvalidPortException: OFException {}
/**
 * \return An error message for the exception as a C string.
 */
- (char*)cString;
- (const char*)cString;
@end

/**
 * An OFException indicating the translation of an address failed.
 */
@interface OFAddressTranslationFailedException: OFException
{
	char *node;
	char *service;
}

/**
 * \param n The node for which translation was requested
 * \param s The service of the node for which translation was requested
 * \return A new address translation failed exception
 */
+ newWithObject: (id)obj
	andNode: (const char*)n
     andService: (const char*)s;

/**
 * Initializes an already allocated address translation failed exception.
 *
 * \param n The node for which translation was requested
 * \param s The service of the node for which translation was requested
 * \return An initialized address translation failed exception
 */
- initWithObject: (id)obj
	 andNode: (const char*)n
      andService: (const char*)s;

- free;

/**
 * \return An error message for the exception as a C string.
 */
- (const char*)cString;

/**
 * /return The node for which translation was requested
 */
- (const char*)node;

/**
 * \return The service of the node for which translation was requested
 */
- (const char*)service;
@end