ObjFW  Check-in [45f8195351]

Overview
Comment:Rename +[pluginFromFile:] to +[pluginWithPath:]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 45f8195351abaeb49089624f972a4bb71e2273cb81e4e9f59a76d3a08ca4d43f
User & Date: js on 2021-04-04 13:25:06
Other Links: manifest | tags
Context
2021-04-04
18:46
Change -[contentsOfURLAtPath:] to return URLs check-in: 9135c5fcb8 user: js tags: trunk
13:25
Rename +[pluginFromFile:] to +[pluginWithPath:] check-in: 45f8195351 user: js tags: trunk
2021-03-30
21:06
Rename OFProcess to OFSubprocess check-in: 79548b3c29 user: js tags: trunk
Changes

Modified src/OFPlugin.h from [ac829978a7] to [6278a1d5c2].

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

/**
 * @brief Loads a plugin from a file.
 *
 * @param path Path to the plugin file. The suffix is appended automatically.
 * @return The loaded plugin
 */
+ (OF_KINDOF(OFPlugin *))pluginFromFile: (OFString *)path;
@end

#ifdef __cplusplus
extern "C" {
#endif
extern of_plugin_handle_t of_dlopen(OFString *path, int flags);
extern void *of_dlsym(of_plugin_handle_t handle, const char *symbol);







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

/**
 * @brief Loads a plugin from a file.
 *
 * @param path Path to the plugin file. The suffix is appended automatically.
 * @return The loaded plugin
 */
+ (OF_KINDOF(OFPlugin *))pluginWithPath: (OFString *)path;
@end

#ifdef __cplusplus
extern "C" {
#endif
extern of_plugin_handle_t of_dlopen(OFString *path, int flags);
extern void *of_dlsym(of_plugin_handle_t handle, const char *symbol);

Modified src/OFPlugin.m from [12a642d8b0] to [8802d6d561].

77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
				  encoding: [OFLocale encoding]];
#else
	return nil;
#endif
}

@implementation OFPlugin
+ (id)pluginFromFile: (OFString *)path
{
	void *pool = objc_autoreleasePoolPush();
	of_plugin_handle_t handle;
	init_plugin_t initPlugin;
	OFPlugin *plugin;

#if defined(OF_MACOS)







|







77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
				  encoding: [OFLocale encoding]];
#else
	return nil;
#endif
}

@implementation OFPlugin
+ (id)pluginWithPath: (OFString *)path
{
	void *pool = objc_autoreleasePoolPush();
	of_plugin_handle_t handle;
	init_plugin_t initPlugin;
	OFPlugin *plugin;

#if defined(OF_MACOS)

Modified tests/OFPluginTests.m from [5d4c7a32e2] to [79f8663f0b].

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

@implementation TestsAppDelegate (OFPluginTests)
- (void)pluginTests
{
	void *pool = objc_autoreleasePoolPush();
	TestPlugin *plugin;

	TEST(@"+[pluginFromFile:]",
	    (plugin = [OFPlugin pluginFromFile: PLUGIN_PATH]))

	TEST(@"TestPlugin's -[test:]", [plugin test: 1234] == 2468)

	objc_autoreleasePoolPop(pool);
}
@end







|
|






29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

@implementation TestsAppDelegate (OFPluginTests)
- (void)pluginTests
{
	void *pool = objc_autoreleasePoolPush();
	TestPlugin *plugin;

	TEST(@"+[pluginWithPath:]",
	    (plugin = [OFPlugin pluginWithPath: PLUGIN_PATH]))

	TEST(@"TestPlugin's -[test:]", [plugin test: 1234] == 2468)

	objc_autoreleasePoolPop(pool);
}
@end