ObjFW  Diff

Differences From Artifact [ca01c9a5ad]:

To Artifact [9e2d46e499]:


198
199
200
201
202
203
204

205
206
207
208
209
210
211
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212







+







		    @"xml", @"http://www.w3.org/XML/1998/namespace",
		    @"xmlns", @"http://www.w3.org/2000/xmlns/", nil];
		[namespaces addObject: dict];

		acceptProlog = YES;
		lineNumber = 1;
		encoding = OF_STRING_ENCODING_UTF_8;
		depthLimit = 32;

		objc_autoreleasePoolPop(pool);
	} @catch (id e) {
		[self release];
		@throw e;
	}

231
232
233
234
235
236
237










238
239
240
241
242
243
244
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255







+
+
+
+
+
+
+
+
+
+







	return delegate;
}

- (void)setDelegate: (id <OFXMLParserDelegate>)delegate_
{
	delegate = delegate_;
}

- (size_t)depthLimit
{
	return depthLimit;
}

- (void)setDepthLimit: (size_t)depthLimit_
{
	depthLimit = depthLimit_;
}

- (void)parseBuffer: (const char*)buffer
	     length: (size_t)length
{
	size_t i, last = 0;

	for (i = 0; i < length; i++) {
360
361
362
363
364
365
366





367
368
369
370
371
372
373
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389







+
+
+
+
+







		break;
	case '!':
		*last = *i + 1;
		state = OF_XMLPARSER_IN_EXCLAMATIONMARK;
		acceptProlog = NO;
		break;
	default:
		if (depthLimit > 0 && [previous count] >= depthLimit)
			@throw [OFMalformedXMLException
			    exceptionWithClass: [self class]
					parser: self];

		state = OF_XMLPARSER_IN_TAG_NAME;
		acceptProlog = NO;
		(*i)--;
		break;
	}
}