ObjFW  Diff

Differences From Artifact [31de543f61]:

To Artifact [a82fc80af9]:


56
57
58
59
60
61
62
63
64

65
66
67
68
69
70
71

static OFCharacterSet *URLAllowedCharacterSet = nil;
static OFCharacterSet *URLSchemeAllowedCharacterSet = nil;
static OFCharacterSet *URLPathAllowedCharacterSet = nil;
static OFCharacterSet *URLQueryOrFragmentAllowedCharacterSet = nil;
static OFCharacterSet *URLQueryKeyValueAllowedCharacterSet = nil;

static of_once_t URLAllowedCharacterSetOnce = OF_ONCE_INIT;
static of_once_t URLQueryOrFragmentAllowedCharacterSetOnce = OF_ONCE_INIT;


static void
initURLAllowedCharacterSet(void)
{
	URLAllowedCharacterSet = [[OFURLAllowedCharacterSet alloc] init];
}








|
|
>







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

static OFCharacterSet *URLAllowedCharacterSet = nil;
static OFCharacterSet *URLSchemeAllowedCharacterSet = nil;
static OFCharacterSet *URLPathAllowedCharacterSet = nil;
static OFCharacterSet *URLQueryOrFragmentAllowedCharacterSet = nil;
static OFCharacterSet *URLQueryKeyValueAllowedCharacterSet = nil;

static OFOnceControl URLAllowedCharacterSetOnce = OFOnceControlInitValue;
static OFOnceControl URLQueryOrFragmentAllowedCharacterSetOnce =
    OFOnceControlInitValue;

static void
initURLAllowedCharacterSet(void)
{
	URLAllowedCharacterSet = [[OFURLAllowedCharacterSet alloc] init];
}

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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403

	objc_autoreleasePoolPop(pool);
}

@implementation OFCharacterSet (URLCharacterSets)
+ (OFCharacterSet *)URLSchemeAllowedCharacterSet
{
	static of_once_t onceControl = OF_ONCE_INIT;
	of_once(&onceControl, initURLSchemeAllowedCharacterSet);

	return URLSchemeAllowedCharacterSet;
}

+ (OFCharacterSet *)URLHostAllowedCharacterSet
{
	of_once(&URLAllowedCharacterSetOnce, initURLAllowedCharacterSet);

	return URLAllowedCharacterSet;
}

+ (OFCharacterSet *)URLUserAllowedCharacterSet
{
	of_once(&URLAllowedCharacterSetOnce, initURLAllowedCharacterSet);

	return URLAllowedCharacterSet;
}

+ (OFCharacterSet *)URLPasswordAllowedCharacterSet
{
	of_once(&URLAllowedCharacterSetOnce, initURLAllowedCharacterSet);

	return URLAllowedCharacterSet;
}

+ (OFCharacterSet *)URLPathAllowedCharacterSet
{
	static of_once_t onceControl = OF_ONCE_INIT;
	of_once(&onceControl, initURLPathAllowedCharacterSet);

	return URLPathAllowedCharacterSet;
}

+ (OFCharacterSet *)URLQueryAllowedCharacterSet
{
	of_once(&URLQueryOrFragmentAllowedCharacterSetOnce,
	    initURLQueryOrFragmentAllowedCharacterSet);

	return URLQueryOrFragmentAllowedCharacterSet;
}

+ (OFCharacterSet *)URLQueryKeyValueAllowedCharacterSet
{
	static of_once_t onceControl = OF_ONCE_INIT;
	of_once(&onceControl, initURLQueryKeyValueAllowedCharacterSet);

	return URLQueryKeyValueAllowedCharacterSet;
}

+ (OFCharacterSet *)URLFragmentAllowedCharacterSet
{
	of_once(&URLQueryOrFragmentAllowedCharacterSetOnce,
	    initURLQueryOrFragmentAllowedCharacterSet);

	return URLQueryOrFragmentAllowedCharacterSet;
}
@end

@implementation OFURL







|
|






|






|






|






|
|






|







|
|






|







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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404

	objc_autoreleasePoolPop(pool);
}

@implementation OFCharacterSet (URLCharacterSets)
+ (OFCharacterSet *)URLSchemeAllowedCharacterSet
{
	static OFOnceControl onceControl = OFOnceControlInitValue;
	OFOnce(&onceControl, initURLSchemeAllowedCharacterSet);

	return URLSchemeAllowedCharacterSet;
}

+ (OFCharacterSet *)URLHostAllowedCharacterSet
{
	OFOnce(&URLAllowedCharacterSetOnce, initURLAllowedCharacterSet);

	return URLAllowedCharacterSet;
}

+ (OFCharacterSet *)URLUserAllowedCharacterSet
{
	OFOnce(&URLAllowedCharacterSetOnce, initURLAllowedCharacterSet);

	return URLAllowedCharacterSet;
}

+ (OFCharacterSet *)URLPasswordAllowedCharacterSet
{
	OFOnce(&URLAllowedCharacterSetOnce, initURLAllowedCharacterSet);

	return URLAllowedCharacterSet;
}

+ (OFCharacterSet *)URLPathAllowedCharacterSet
{
	static OFOnceControl onceControl = OFOnceControlInitValue;
	OFOnce(&onceControl, initURLPathAllowedCharacterSet);

	return URLPathAllowedCharacterSet;
}

+ (OFCharacterSet *)URLQueryAllowedCharacterSet
{
	OFOnce(&URLQueryOrFragmentAllowedCharacterSetOnce,
	    initURLQueryOrFragmentAllowedCharacterSet);

	return URLQueryOrFragmentAllowedCharacterSet;
}

+ (OFCharacterSet *)URLQueryKeyValueAllowedCharacterSet
{
	static OFOnceControl onceControl = OFOnceControlInitValue;
	OFOnce(&onceControl, initURLQueryKeyValueAllowedCharacterSet);

	return URLQueryKeyValueAllowedCharacterSet;
}

+ (OFCharacterSet *)URLFragmentAllowedCharacterSet
{
	OFOnce(&URLQueryOrFragmentAllowedCharacterSetOnce,
	    initURLQueryOrFragmentAllowedCharacterSet);

	return URLQueryOrFragmentAllowedCharacterSet;
}
@end

@implementation OFURL