/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* camel-provider.c: provider framework */ /* * * Authors: * Bertrand Guiheneuf <bertrand@helixcode.com> * Dan Winship <danw@helixcode.com> * Jeffrey Stedfast <fejj@helixcode.com> * * Copyright 1999, 2000 Helix Code, Inc. (http://www.helixcode.com) * * This program 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 2 of the * License, or (at your option) any later version. * * This program 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. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /* FIXME: Shouldn't we add a version number to providers ? */ #include "config.h" #include "camel-provider.h" #include "camel-exception.h" #include "hash-table-utils.h" #include <dirent.h> #include <errno.h> #include <stdio.h> #include <string.h> #include <gmodule.h> char *camel_provider_type_name[CAMEL_NUM_PROVIDER_TYPES] = { "store", "transport" }; /** * camel_provider_init: * * Initialize the Camel provider system by reading in the .urls * files in the provider directory and creating a hash table mapping * URLs to module names. * * A .urls file has the same initial prefix as the shared library it * correspond to, and consists of a series of lines containing the URL * protocols that that library handles. * * Return value: a hash table mapping URLs to module names **/ GHashTable * camel_provider_init (void) { GHashTable *providers; DIR *dir; struct dirent *d; char *p, *name, buf[80]; FILE *f; providers = g_hash_table_new (g_strcase_hash, g_strcase_equal); dir = opendir (CAMEL_PROVIDERDIR); if (!dir) { g_error ("Could not open camel provider directory: %s", g_strerror (errno)); return NULL; } while ((d = readdir (dir))) { p = strchr (d->d_name, '.'); if (!p || strcmp (p, ".urls") != 0) continue; name = g_strdup_printf ("%s/%s", CAMEL_PROVIDERDIR, d->d_name); f = fopen (name, "r"); if (!f) { g_warning ("Could not read provider info file %s: %s", name, g_strerror (errno)); g_free (name); continue; } p = strrchr (name, '.'); strcpy (p, ".so"); while ((fgets (buf, sizeof (buf), f))) { buf[sizeof (buf) - 1] = '\0'; p = strchr (buf, '\n'); if (p) *p = '\0'; g_hash_table_insert (providers, g_strdup (buf), name); } fclose (f); } closedir (dir); return providers; } /** * camel_provider_load: * @session: the current session * @path: the path to a shared library * @ex: a CamelException * * Loads the provider at @path, and calls its initialization function, * passing @session as an argument. The provider should then register * itself with @session. **/ void camel_provider_load (CamelSession *session, const char *path, CamelException *ex) { GModule *module; CamelProvider *(*camel_provider_module_init) (); if (!g_module_supported ()) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "Could not load %s: Module loading " "not supported on this system.", path); return; } module = g_module_open (path, 0); if (!module) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "Could not load %s: %s", path, g_module_error ()); return; } if (!g_module_symbol (module, "camel_provider_module_init", (gpointer *)&camel_provider_module_init)) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "Could not load %s: No initialization " "routine in module.", path); g_module_close (module); return; } camel_provider_module_init (session); } '>dependabot/npm_and_yarn/devel/electron6/files/serve-10.1.2</option> <option value='gnome-3.22'>gnome-3.22</option> <option value='gnome-3.24'>gnome-3.24</option> <option value='gnome-3.26'>gnome-3.26</option> <option value='gnome-3.28' selected='selected'>gnome-3.28</option> <option value='gnome-3.32'>gnome-3.32</option> <option value='gnome-3.36'>gnome-3.36</option> <option value='gstreamer'>gstreamer</option> <option value='gstreamer-1.16'>gstreamer-1.16</option> <option value='gstreamer0.10-removal'>gstreamer0.10-removal</option> <option value='main'>main</option> <option value='master'>master</option> <option value='mate-1.16'>mate-1.16</option> <option value='mate-1.18'>mate-1.18</option> <option value='mate-1.20'>mate-1.20</option> <option value='mate-1.22'>mate-1.22</option> </select> <input type='submit' value='switch'/></form></td></tr> <tr><td class='sub'>FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)</td><td class='sub right'></td></tr></table> <table class='tabs'><tr><td> <a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/about/?h=gnome-3.28'>about</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/?h=gnome-3.28'>summary</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/refs/?h=gnome-3.28&id=163196a95d05e5269150c069bf5ebf6f605aad74'>refs</a><a class='active' href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/www/pear-HTTP_Server?h=gnome-3.28'>log</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/tree/www/pear-HTTP_Server?h=gnome-3.28&id=163196a95d05e5269150c069bf5ebf6f605aad74'>tree</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/www/pear-HTTP_Server?h=gnome-3.28&id=163196a95d05e5269150c069bf5ebf6f605aad74'>commit</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/diff/www/pear-HTTP_Server?h=gnome-3.28&id=163196a95d05e5269150c069bf5ebf6f605aad74'>diff</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/stats/www/pear-HTTP_Server?h=gnome-3.28'>stats</a></td><td class='form'><form class='right' method='get' action='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/www/pear-HTTP_Server'> <input type='hidden' name='h' value='gnome-3.28'/><input type='hidden' name='id' value='163196a95d05e5269150c069bf5ebf6f605aad74'/><select name='qt'> <option value='grep'>log msg</option> <option value='author'>author</option> <option value='committer'>committer</option> <option value='range'>range</option> </select> <input class='txt' type='search' size='10' name='q' value=''/> <input type='submit' value='search'/> </form> </td></tr></table> <div class='path'>path: <a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/?h=gnome-3.28&id=163196a95d05e5269150c069bf5ebf6f605aad74'>root</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/www?h=gnome-3.28&id=163196a95d05e5269150c069bf5ebf6f605aad74'>www</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/www/pear-HTTP_Server?h=gnome-3.28&id=163196a95d05e5269150c069bf5ebf6f605aad74'>pear-HTTP_Server</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th></th><th class='left'>Commit message (<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/www/pear-HTTP_Server?h=gnome-3.28&id=163196a95d05e5269150c069bf5ebf6f605aad74&showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Age</th><th class='left'>Files</th><th class='left'>Lines</th></tr> <tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/www/pear-HTTP_Server?h=gnome-3.28&id=7314eb1508e72e87447e3a471148576e8f70ea76'>Update distinfo and unbreak this port</a></td><td>sunpoet</td><td><span title='2017-06-11 15:46:59 +0800'>2017-06-11</span></td><td>2</td><td><span class='deletions'>-3</span>/<span class='insertions'>+4</span></td></tr> <tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/www/pear-HTTP_Server?h=gnome-3.28&id=9a1f93326ea5cb736890d3a36d0ddbd289436ee9'>- Update maintainer address</a></td><td>joneum</td><td><span title='2017-05-16 21:37:51 +0800'>2017-05-16</span></td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+1</span></td></tr> <tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/www/pear-HTTP_Server?h=gnome-3.28&id=764dac69de41fddbc7ac2bde4a524e605967e400'>- Update WWW: pear.php.net uses https://</a></td><td>sunpoet</td><td><span title='2016-12-13 23:05:06 +0800'>2016-12-13</span></td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+1</span></td></tr> <tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/www/pear-HTTP_Server?h=gnome-3.28&id=bc0b60e1c9f17a36b1cb726c07f13b0d16b1b883'>Pass maintainership of PEAR ports to the submitter</a></td><td>jbeich</td><td><span title='2016-11-04 15:50:45 +0800'>2016-11-04</span></td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+1</span></td></tr> <tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/www/pear-HTTP_Server?h=gnome-3.28&id=5a69f222b13b3c594d5b334d833493336bc49392'>Reset miwi@'s ports, he stepped down from the Ports Team.</a></td><td>rene</td><td><span title='2016-07-26 04:01:02 +0800'>2016-07-26</span></td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+1</span></td></tr> <tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/www/pear-HTTP_Server?h=gnome-3.28&id=6126a9c5a826afdbe6ebfd5bf6d02c6e2be2a700'>Remove ${PORTSDIR}/ from dependencies, categories v, w, x, y, and z.</a></td><td>mat</td><td><span title='2016-04-01 22:33:55 +0800'>2016-04-01</span></td><td>1</td><td><span class='deletions'>-4</span>/<span class='insertions'>+4</span></td></tr> <tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/www/pear-HTTP_Server?h=gnome-3.28&id=871be174caf5f1a486337e9218249dfa516991f1'>- Take Maintainership</a></td><td>miwi</td><td><span title='2015-11-26 20:04:00 +0800'>2015-11-26</span></td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+1</span></td></tr>