ObjFW  Check-in [e53bf9f3fc]

Overview
Comment:Add void to parameter list.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e53bf9f3fc5cbd49f874ce3cba8699ea1f93fdd588b017fe3f60f3016f4551be
User & Date: js on 2012-02-27 22:59:07
Other Links: manifest | tags
Context
2012-02-27
23:16
Fix a missing $ in objfw-compile. check-in: a85f714779 user: js tags: trunk
22:59
Add void to parameter list. check-in: e53bf9f3fc user: js tags: trunk
22:11
Add -[OFObject isMemberOfClass:] and -[OFObject isProxy]. check-in: 8830166fe8 user: js tags: trunk
Changes

Modified src/OFPlugin.m from [c9d1104dc0] to [9c61bbf5f1].

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

@implementation OFPlugin
+ pluginFromFile: (OFString*)path
{
	OFAutoreleasePool *pool;
	OFMutableString *file;
	of_plugin_handle_t handle;
	OFPlugin *(*initPlugin)();
	OFPlugin *plugin;

	pool = [[OFAutoreleasePool alloc] init];
	file = [OFMutableString stringWithString: path];
	[file appendString: @PLUGIN_SUFFIX];

	if ((handle = dlopen([file cStringWithEncoding:
	    OF_STRING_ENCODING_NATIVE], RTLD_LAZY)) == NULL)
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];

	[pool release];

	initPlugin = (OFPlugin*(*)())dlsym(handle, "init_plugin");
	if (initPlugin == NULL || (plugin = initPlugin()) == nil) {
		dlclose(handle);
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];
	}

	plugin->handle = handle;







|













|







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

@implementation OFPlugin
+ pluginFromFile: (OFString*)path
{
	OFAutoreleasePool *pool;
	OFMutableString *file;
	of_plugin_handle_t handle;
	OFPlugin *(*initPlugin)(void);
	OFPlugin *plugin;

	pool = [[OFAutoreleasePool alloc] init];
	file = [OFMutableString stringWithString: path];
	[file appendString: @PLUGIN_SUFFIX];

	if ((handle = dlopen([file cStringWithEncoding:
	    OF_STRING_ENCODING_NATIVE], RTLD_LAZY)) == NULL)
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];

	[pool release];

	initPlugin = (OFPlugin*(*)(void))dlsym(handle, "init_plugin");
	if (initPlugin == NULL || (plugin = initPlugin()) == nil) {
		dlclose(handle);
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];
	}

	plugin->handle = handle;

Modified tests/plugin/TestPlugin.m from [ca0bf4c99b] to [282259c2a8].

22
23
24
25
26
27
28
29
30
31
32
- (int)test: (int)num
{
	return num * 2;
}
@end

id
init_plugin()
{
	return [[[TestPlugin alloc] init] autorelease];
}







|



22
23
24
25
26
27
28
29
30
31
32
- (int)test: (int)num
{
	return num * 2;
}
@end

id
init_plugin(void)
{
	return [[[TestPlugin alloc] init] autorelease];
}