Overview
Comment: | Don't use forwarding for OFPlugin.
This is faster and we don't rely on forwarding which is broken in |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
179174571e60bbee1be7b2366a3ed425 |
User & Date: | js on 2009-04-19 17:06:46 |
Other Links: | manifest | tags |
Context
2009-04-19
| ||
17:37 | Remove forwarding methods. See long commit message for details. check-in: 57fb5578cc user: js tags: trunk | |
17:06 | Don't use forwarding for OFPlugin. check-in: 179174571e user: js tags: trunk | |
2009-04-17
| ||
16:45 | Add - hash for OFNumber. check-in: cd9bd80792 user: js tags: trunk | |
Changes
Modified src/OFPlugin.h from [c1caa01830] to [3326b854c7].
︙ | ︙ | |||
13 14 15 16 17 18 19 | /** * The OFPlugin class provides a system for loading plugins at runtime. */ @interface OFPlugin: OFObject { void *handle; | < < < < < < < < < | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | /** * The OFPlugin class provides a system for loading plugins at runtime. */ @interface OFPlugin: OFObject { void *handle; } /** * Loads an OFPlugin from a file. * * \param path Path to the OFPlugin file. The suffix is appended automatically. * \return A new autoreleased OFPlugin */ + pluginFromFile: (const char*)path; @end |
Modified src/OFPlugin.m from [bfb6a3d936] to [ee4d5662a9].
︙ | ︙ | |||
17 18 19 20 21 22 23 | #import "OFPlugin.h" #import "OFExceptions.h" @implementation OFPlugin + pluginFromFile: (const char*)path { | < < < < < > | > | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #import "OFPlugin.h" #import "OFExceptions.h" @implementation OFPlugin + pluginFromFile: (const char*)path { char *file; size_t pathlen, suffixlen; void *handle; OFPlugin *(*init_plugin)(); OFPlugin *plugin; Class c; if ((self = [super init])) { pathlen = strlen(path); suffixlen = strlen(PLUGIN_SUFFIX); if ((file = malloc(pathlen + suffixlen + 1)) == NULL) { |
︙ | ︙ | |||
59 60 61 62 63 64 65 66 67 68 69 70 71 72 | (plugin = init_plugin()) == nil) { dlclose(handle); c = [self class]; [super free]; @throw [OFInitializationFailedException newWithClass: c]; } } return self; } - free { | > > > < < < < < < < < < < < < < < < < < < < < < | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | (plugin = init_plugin()) == nil) { dlclose(handle); c = [self class]; [super free]; @throw [OFInitializationFailedException newWithClass: c]; } plugin->handle = handle; return plugin; } return self; } - free { dlclose(handle); return [super free]; } @end |
Modified tests/OFPlugin/OFPlugin.m from [0bbeec06e6] to [0f4331146f].
︙ | ︙ | |||
13 14 15 16 17 18 19 | #import "OFPlugin.h" #import "TestPlugin/TestPlugin.h" int main() { | | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #import "OFPlugin.h" #import "TestPlugin/TestPlugin.h" int main() { TestPlugin *plugin; plugin = [OFPlugin pluginFromFile: "TestPlugin/TestPlugin"]; [plugin test]; return 0; } |
Modified tests/OFPlugin/TestPlugin/TestPlugin.h from [464f9220e6] to [f72593c636].
1 2 3 4 5 6 7 8 9 10 11 | /* * Copyright (c) 2008 - 2009 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of libobjfw. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ | | | < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | /* * Copyright (c) 2008 - 2009 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of libobjfw. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ #import "OFPlugin.h" @interface TestPlugin: OFPlugin - (void)test; @end |