ObjFW  Diff

Differences From Artifact [799ad3d8c9]:

  • File src/OFIRIHandler.m — part of check-in [b8aeb99da6] at 2025-04-22 13:43:45 on branch trunk — Don't use performSelector: if method returns void (user: js size: 7369) [more...]

To Artifact [93dce43517]:

  • File src/OFIRIHandler.m — part of check-in [a4fcf79a82] at 2025-05-30 01:26:26 on branch trunk — Avoid deprecation warning with old GCC (user: js size: 7269) [more...]

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
			       andType: NULL
			       forName: name
			   ofItemAtIRI: IRI];

	return data;
}

#if defined(__clang__) || OF_GCC_VERSION >= 406
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
- (void)getExtendedAttributeData: (OFData **)data
			 andType: (id *)type
			 forName: (OFString *)name
		     ofItemAtIRI: (OFIRI *)IRI
{
	/*
	 * Only call into -[extendedAttributeDataForName:ofItemAtIRI:] if it
	 * has been overridden. This is to be backwards-compatible with
	 * subclasses that predate the introduction of
	 * -[getExtendedAttributeData:andType:forName:ofItemAtIRI:].
	 * Without this check, this would result in an infinite loop.
	 */
	SEL selector = @selector(extendedAttributeDataForName:ofItemAtIRI:);

	if (class_getMethodImplementation(object_getClass(self), selector) !=
	    class_getMethodImplementation([OFIRIHandler class], selector)) {



		*data = [self extendedAttributeDataForName: name
					       ofItemAtIRI: IRI];


		if (type != NULL)
			*type = nil;

		return;
	}

	OF_UNRECOGNIZED_SELECTOR
}
#if defined(__clang__) || OF_GCC_VERSION >= 406
# pragma GCC diagnostic pop
#endif

- (void)setExtendedAttributeData: (OFData *)data
			 forName: (OFString *)name
		     ofItemAtIRI: (OFIRI *)IRI
{
	[self setExtendedAttributeData: data
			       andType: nil
			       forName: name
			   ofItemAtIRI: IRI];
}

#if defined(__clang__) || OF_GCC_VERSION >= 406
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
- (void)setExtendedAttributeData: (OFData *)data
			 andType: (id)type
			 forName: (OFString *)name
		     ofItemAtIRI: (OFIRI *)IRI
{
	if (type == nil) {
		/*







<
<
<
<
















>
>
>
|
|
>









<
<
<











<
<
<
<







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
			       andType: NULL
			       forName: name
			   ofItemAtIRI: IRI];

	return data;
}





- (void)getExtendedAttributeData: (OFData **)data
			 andType: (id *)type
			 forName: (OFString *)name
		     ofItemAtIRI: (OFIRI *)IRI
{
	/*
	 * Only call into -[extendedAttributeDataForName:ofItemAtIRI:] if it
	 * has been overridden. This is to be backwards-compatible with
	 * subclasses that predate the introduction of
	 * -[getExtendedAttributeData:andType:forName:ofItemAtIRI:].
	 * Without this check, this would result in an infinite loop.
	 */
	SEL selector = @selector(extendedAttributeDataForName:ofItemAtIRI:);

	if (class_getMethodImplementation(object_getClass(self), selector) !=
	    class_getMethodImplementation([OFIRIHandler class], selector)) {
		/* Use -[methodForSelector:] to avoid deprecation warning. */
		OFData *(*imp)(id, SEL, OFString *, OFIRI *) =
		    (OFData *(*)(id, SEL, OFString *, OFIRI *))
		    [self methodForSelector: selector];

		*data = imp(self, selector, name, IRI);

		if (type != NULL)
			*type = nil;

		return;
	}

	OF_UNRECOGNIZED_SELECTOR
}




- (void)setExtendedAttributeData: (OFData *)data
			 forName: (OFString *)name
		     ofItemAtIRI: (OFIRI *)IRI
{
	[self setExtendedAttributeData: data
			       andType: nil
			       forName: name
			   ofItemAtIRI: IRI];
}





- (void)setExtendedAttributeData: (OFData *)data
			 andType: (id)type
			 forName: (OFString *)name
		     ofItemAtIRI: (OFIRI *)IRI
{
	if (type == nil) {
		/*
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
		SEL selector =
		    @selector(setExtendedAttributeData:forName:ofItemAtIRI:);

		if (class_getMethodImplementation(object_getClass(self),
		    selector) !=
		    class_getMethodImplementation([OFIRIHandler class],
		    selector)) {






			[self setExtendedAttributeData: data
					       forName: name
					   ofItemAtIRI: IRI];
			return;
		}
	}

	OF_UNRECOGNIZED_SELECTOR
}
#if defined(__clang__) || OF_GCC_VERSION >= 406
# pragma GCC diagnostic pop
#endif

- (void)removeExtendedAttributeForName: (OFString *)name
			   ofItemAtIRI: (OFIRI *)IRI
{
	OF_UNRECOGNIZED_SELECTOR
}
@end







>
>
>
>
>
>
|
|
|






<
<
<







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
		SEL selector =
		    @selector(setExtendedAttributeData:forName:ofItemAtIRI:);

		if (class_getMethodImplementation(object_getClass(self),
		    selector) !=
		    class_getMethodImplementation([OFIRIHandler class],
		    selector)) {
			/*
			 * Use -[methodForSelector:] to avoid deprecation
			 * warning.
			 */
			void (*imp)(id, SEL, OFData *, OFString *, OFIRI *) =
			    (void (*)(id, SEL, OFData *, OFString *, OFIRI *))
			    [self methodForSelector: selector];

			imp(self, selector, data, name, IRI);
			return;
		}
	}

	OF_UNRECOGNIZED_SELECTOR
}




- (void)removeExtendedAttributeForName: (OFString *)name
			   ofItemAtIRI: (OFIRI *)IRI
{
	OF_UNRECOGNIZED_SELECTOR
}
@end