Overview
Comment: | Remove stuff forgotten after moving code in OFPlugin. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
066bf9c8c3c9043aadc5a2ada2910cd7 |
User & Date: | js on 2009-04-19 20:29:58 |
Other Links: | manifest | tags |
Context
2009-04-19
| ||
20:34 | Use isa instead of [self class]. check-in: 139591afe1 user: js tags: trunk | |
20:29 | Remove stuff forgotten after moving code in OFPlugin. check-in: 066bf9c8c3 user: js tags: trunk | |
20:22 | Remove useless definitions. check-in: a756d3f511 user: js tags: trunk | |
Changes
Modified src/OFPlugin.m from [ee4d5662a9] to [b72d21c5c5].
︙ | ︙ | |||
22 23 24 25 26 27 28 | + pluginFromFile: (const char*)path { char *file; size_t pathlen, suffixlen; void *handle; OFPlugin *(*init_plugin)(); OFPlugin *plugin; | < < < | < < | < < | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | + pluginFromFile: (const char*)path { char *file; size_t pathlen, suffixlen; void *handle; OFPlugin *(*init_plugin)(); OFPlugin *plugin; if ((self = [super init])) { pathlen = strlen(path); suffixlen = strlen(PLUGIN_SUFFIX); if ((file = malloc(pathlen + suffixlen + 1)) == NULL) { @throw [OFNoMemException newWithClass: self andSize: pathlen + suffixlen + 1]; } memcpy(file, path, pathlen); memcpy(file + pathlen, PLUGIN_SUFFIX, suffixlen); file[pathlen + suffixlen] = 0; if ((handle = dlopen(file, RTLD_NOW)) == NULL) { free(file); @throw [OFInitializationFailedException newWithClass: self]; } free(file); if ((init_plugin = dlsym(handle, "init_plugin")) == NULL || (plugin = init_plugin()) == nil) { dlclose(handle); @throw [OFInitializationFailedException newWithClass: self]; } plugin->handle = handle; return plugin; } return self; |
︙ | ︙ |