/*
This file is part of GNUnet
- (C) 2002-2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2002-2013 GNUnet e.V.
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
+ GNUnet is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License,
+ or (at your option) any later version.
GNUnet is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ Affero General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ SPDX-License-Identifier: AGPL3.0-or-later
*/
/**
#include <ltdl.h>
#include "gnunet_util_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-plugin", __VA_ARGS__)
/**
* Linked list of active plugins.
*/
static int initialized;
-
/**
* Libtool search path before we started.
*/
return;
}
opath = lt_dlgetsearchpath ();
- if (opath != NULL)
+ if (NULL != opath)
old_dlsearchpath = GNUNET_strdup (opath);
path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBDIR);
- if (path != NULL)
+ if (NULL != path)
{
- if (opath != NULL)
+ if (NULL != opath)
{
GNUNET_asprintf (&cpath, "%s:%s", opath, path);
lt_dlsetsearchpath (cpath);
plugin_fini ()
{
lt_dlsetsearchpath (old_dlsearchpath);
- if (old_dlsearchpath != NULL)
+ if (NULL != old_dlsearchpath)
{
GNUNET_free (old_dlsearchpath);
old_dlsearchpath = NULL;
* @return NULL if the symbol was not found
*/
static GNUNET_PLUGIN_Callback
-resolve_function (struct PluginList *plug, const char *name)
+resolve_function (struct PluginList *plug,
+ const char *name)
{
char *initName;
void *mptr;
- GNUNET_asprintf (&initName, "_%s_%s", plug->name, name);
+ GNUNET_asprintf (&initName,
+ "_%s_%s",
+ plug->name,
+ name);
mptr = lt_dlsym (plug->handle, &initName[1]);
if (NULL == mptr)
mptr = lt_dlsym (plug->handle, initName);