From 484b59a68e29f5de9f4ef15a93eb1066e0ca6ebd Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 7 May 2014 02:15:53 +0200 Subject: [PATCH] Code cleanup --- include/System/plugin.h | 10 ++++++---- src/plugin.c | 14 +++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/include/System/plugin.h b/include/System/plugin.h index 2d97b2d..b70d66e 100644 --- a/include/System/plugin.h +++ b/include/System/plugin.h @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2008-2012 Pierre Pronchery */ +/* Copyright (c) 2008-2014 Pierre Pronchery */ /* This file is part of DeforaOS System libSystem */ /* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -18,19 +18,21 @@ #ifndef LIBSYSTEM_PLUGIN_H # define LIBSYSTEM_PLUGIN_H +# include "string.h" + /* Plugin */ typedef void Plugin; /* functions */ -Plugin * plugin_new(char const * libdir, char const * package, - char const * type, char const * name); +Plugin * plugin_new(String const * libdir, String const * package, + String const * type, String const * name); Plugin * plugin_new_self(void); void plugin_delete(Plugin * plugin); /* useful */ -void * plugin_lookup(Plugin * plugin, char const * symbol); +void * plugin_lookup(Plugin * plugin, String const * symbol); #endif /* !LIBSYSTEM_PLUGIN_H */ diff --git a/src/plugin.c b/src/plugin.c index 8b70c10..9501205 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2008-2013 Pierre Pronchery */ +/* Copyright (c) 2008-2014 Pierre Pronchery */ /* This file is part of DeforaOS System libSystem */ /* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -41,11 +41,11 @@ /* prototypes */ -static Plugin * _plugin_open(char const * filename); +static Plugin * _plugin_open(String const * filename); /* functions */ -static Plugin * _plugin_open(char const * filename) +static Plugin * _plugin_open(String const * filename) { #ifdef __WIN32__ if(filename == NULL) @@ -64,12 +64,12 @@ static Plugin * _plugin_open(char const * filename) /* public */ /* functions */ /* plugin_new */ -Plugin * plugin_new(char const * libdir, char const * package, - char const * type, char const * name) +Plugin * plugin_new(String const * libdir, String const * package, + String const * type, String const * name) { Plugin * plugin; size_t len; - char * filename; + String * filename; char const ext[] = PLUGIN_EXTENSION; len = strlen(libdir) + 1 + strlen(package) + 1 + strlen(type) + 1 @@ -107,7 +107,7 @@ void plugin_delete(Plugin * plugin) /* useful */ /* plugin_lookup */ -void * plugin_lookup(Plugin * plugin, char const * symbol) +void * plugin_lookup(Plugin * plugin, String const * symbol) { #ifdef __WIN32__ return GetProcAddress(plugin, symbol);