Artifact c9f7beee375588d1a6900c6db5ccc07965510dc460abbeb72c25e43dd91b1378:
- File
src/OFPlugin.h
— part of check-in
[2fcf5a3052]
at
2021-04-29 23:24:22
on branch trunk
— Clean up struct and enum typedefs
With TYPEDEF_HIDES_STRUCT set, Doxygen properly handles anonymous
structs and enums that are typedef'd. (user: js, size: 1647) [annotate] [blame] [check-ins using]
/* * Copyright (c) 2008-2021 Jonathan Schleifer <js@nil.im> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" @class OFString; #ifndef OF_WINDOWS # include <dlfcn.h> typedef void *OFPluginHandle; typedef enum { OFDLOpenFlagLazy = RTLD_LAZY, OFDLOpenFlagNow = RTLD_NOW } OFDLOpenFlags; #else # include <windows.h> typedef HMODULE OFPluginHandle; typedef enum { OFDLOpenFlagLazy = 0, OFDLOpenFlagNow = 0 } OFDLOpenFlags; #endif OF_ASSUME_NONNULL_BEGIN /** * @class OFPlugin OFPlugin.h ObjFW/OFPlugin.h * * @brief Provides a system for loading plugins at runtime. */ @interface OFPlugin: OFObject { OFPluginHandle _pluginHandle; OF_RESERVE_IVARS(OFPlugin, 4) } /** * @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 OFPluginHandle OFDLOpen(OFString *path, OFDLOpenFlags flags); extern void *OFDLSym(OFPluginHandle handle, const char *symbol); extern OFString *_Nullable OFDLError(void); extern void OFDLClose(OFPluginHandle handle); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END