Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "wip"

This reverts commit 0e8d33e10e4d1649827865b3aec4bb5231666f88.

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@28883 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information...
commit af8cb2a400e9caacea314b8db33d32c1b4dadd82 1 parent 6d3222e
alcoheca authored
Showing with 540 additions and 16,726 deletions.
  1. +1 −4 Makefile.in
  2. 0  addons/{cn.1ting.scraper → com.1ting.scraper}/1ting.xml
  3. 0  addons/{cn.1ting.scraper → com.1ting.scraper}/default.tbn
  4. 0  addons/{cn.1ting.scraper → com.1ting.scraper}/description.xml
  5. +0 −17 addons/org.xbmc.addons.dxspectrum/addon.xml
  6. +0 −15 addons/org.xbmc.addons.glspectrum/addon.xml
  7. BIN  addons/org.xbmc.addons.glspectrum/opengl_spectrum.vis
  8. BIN  addons/org.xbmc.addons.waveform/Waveform.vis
  9. +0 −256 addons/org.xbmc.core.vfs/core.c
  10. +0 −128 addons/org.xbmc.core.vfs/core.h
  11. +0 −15 addons/org.xbmc.core.vfs/plugin.xml
  12. +0 −27 addons/org.xbmc.core.vfs/vfsprovider.xsd
  13. +0 −1  configure.in
  14. +0 −1  language/English/strings.xml
  15. +2 −2 xbmc/FileSystem/FactoryDirectory.cpp
  16. +1 −0  xbmc/GUIWindowAddonBrowser.cpp
  17. +7 −19 xbmc/addons/Addon.cpp
  18. +506 −118 xbmc/addons/AddonManager.cpp
  19. +4 −22 xbmc/addons/AddonManager.h
  20. +0 −1  xbmc/addons/IAddon.h
  21. +0 −118 xbmc/lib/cpluff-0.1.3/config.h
  22. +0 −9 xbmc/lib/cpluff-0.1.3/examples/cpfile/cpfile
  23. +0 −1,504 xbmc/lib/cpluff-0.1.3/libcpluff/cpluff.h
  24. +0 −200 xbmc/lib/cpluff-0.1.3/libcpluff/cpluffdef.h
  25. +0 −1,256 xbmc/lib/cpluff-0.1.3/libcpluff/docsrc/Doxyfile-impl
  26. +0 −1,256 xbmc/lib/cpluff-0.1.3/libcpluff/docsrc/Doxyfile-ref
  27. +0 −1,241 xbmc/lib/cpluff-0.1.3/libcpluff/pcontrol.c
  28. +0 −1,190 xbmc/lib/cpluff-0.1.3/libcpluff/ploader.c
  29. +0 −8,906 xbmc/lib/cpluff-0.1.3/libtool
  30. +0 −403 xbmc/lib/cpluff-0.1.3/po/Makefile.in
  31. +0 −16 xbmc/lib/cpluff-0.1.3/po/POTFILES
  32. +0 −1  xbmc/lib/cpluff-0.1.3/stamp-h1
  33. +19 −0 xbmc/visualizations/Goom/net.sf.goom.vis/description.xml
View
5 Makefile.in
@@ -90,7 +90,6 @@ endif
LIB_DIRS=\
xbmc/lib/cximage-6.0 \
- xbmc/lib/libcpluff \
xbmc/lib/libexif \
xbmc/lib/libhdhomerun \
xbmc/lib/libid3tag \
@@ -360,11 +359,9 @@ ifeq ($(or $(findstring powerpc,$(ARCH)),$(findstring x86_64-linux,$(ARCH))),)
endif
imagelib: dllloader
$(MAKE) -C xbmc/lib/cximage-6.0
-libcpluff: dllloader
- $(MAKE) -C xbmc/lib/libcpluff
codecs: papcodecs dvdpcodecs
-libs: libcpluff libhdhomerun libid3tag imagelib libexif python
+libs: libhdhomerun libid3tag imagelib libexif python
externals: codecs libs python visualizations screensavers
xcode_depends: \
View
0  addons/cn.1ting.scraper/1ting.xml → addons/com.1ting.scraper/1ting.xml
File renamed without changes
View
0  addons/cn.1ting.scraper/default.tbn → addons/com.1ting.scraper/default.tbn
File renamed without changes
View
0  addons/cn.1ting.scraper/description.xml → addons/com.1ting.scraper/description.xml
File renamed without changes
View
17 addons/org.xbmc.addons.dxspectrum/addon.xml
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addoninfo>
- <id>vis.dxspectrum</id>
- <type>visualization</type>
- <title>DirectX Spectrum</title>
- <librarywin32>Spectrum_win32dx.vis</librarywin32>
- <version>1.0.0</version>
- <platforms>
- <platform>windows</platform>
- </platforms>
- <minversion>
- <xbmc>28000</xbmc>
- </minversion>
- <summary>DirectX Visualization</summary>
- <description>Visualisation showing a rotating 3D Spectrum Analyzer</description>
- <author>TEAMXBMC</author>
-</addoninfo>
View
15 addons/org.xbmc.addons.glspectrum/addon.xml
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<addon
- id="org.xbmc.addons.glspectrum"
- version="1.0.0"
- name="OpenGL Spectrum"
- summary="Visualisation showing a rotating 3D Spectrum Analyzer"
- provider-name="TEAMXBMC">
- <requires>
- <import addon="org.xbmc.core" version="28000"/>
- </requires>
- <extension
- point="org.xbmc.player.viz"
- name="OpenGL Spectrum"
- visualization="glspectrum"/>
-</addon>
View
BIN  addons/org.xbmc.addons.glspectrum/opengl_spectrum.vis
Binary file not shown
View
BIN  addons/org.xbmc.addons.waveform/Waveform.vis
Binary file not shown
View
256 addons/org.xbmc.core.vfs/core.c
@@ -1,256 +0,0 @@
-/*
-* Copyright (C) 2010 Team XBMC
-* http://www.xbmc.org
-*
-* 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, 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 XBMC; see the file COPYING. If not, write to
-* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-* http://www.gnu.org/copyleft/gpl.html
-*
-*/
-
-#include "core.h"
-
-/* ------------------------------------------------------------------------
- * Data types
- * ----------------------------------------------------------------------*/
-
-
-/** Type for xbmc_vfs_ops structure */
-typedef struct xbmc_vfs_ops *vfsprovider_t;
-
-/** Plug-in instance data */
-struct plugin_data_t {
-
- /** The plug-in context */
- cp_context_t *ctx;
-
- /** Number of registered providers */
- int num_providers;
-
- /** An array of registered file system providers */
- registered_vfsprovider_t *providers;
-};
-
-typedef struct plugin_data_t plugin_data_t;
-
-/** Registered vfs addon info */
-struct registered_vfsprovider_t {
- const char *protocol;
- xbmc_vfs_ops *ops;
-};
-
-
-/* ------------------------------------------------------------------------
- * Internal functions
- * ----------------------------------------------------------------------*/
-
-/**
- * A run function for the core plug-in. In this case this function acts as
- * the application main function so there is no need for us to split the
- * execution into small steps. Rather, we execute the whole main loop at
- * once to make it simpler.
- */
-static int run(void *d) {
- plugin_data_t *data = d;
- char **argv;
- int argc;
- int i;
-
- // Go through all files listed as command arguments
- for (i = 1; argv[i] != NULL; i++) {
- int j;
- int classified = 0;
-
- // Print file name
- printf("%s: ", argv[i]);
-
- // Try providers in order of descending priority
- for (j = 0; !classified && j < data->num_providers; j++) {
- vfsprovider_t *cl
- = data->providers[j].provider;
-
- classified = cl->direxists(cl->data, argv[i]);
- }
-
- // Check if unknown file
- if (!classified) {
- fputs("unknown file type\n", stdout);
- }
- }
-
- // All done
- return 0;
-}
-
-/**
- * Creates a new plug-in instance.
- */
-static void *create(cp_context_t *ctx) {
- plugin_data_t *data = malloc(sizeof(plugin_data_t));
- if (data != NULL) {
- data->ctx = ctx;
- data->num_providers = 0;
- data->providers = NULL;
- } else {
- cp_log(ctx, CP_LOG_ERROR,
- "Insufficient memory for plug-in data.");
- }
- return data;
-}
-
-/**
- * Initializes and starts the plug-in.
- */
-static int start(void *d) {
- plugin_data_t *data = d;
- cp_extension_t **pr_exts;
- int num_pr_exts;
- cp_status_t status;
- int i;
-
- // Obtain list of registered file system providers
- pr_exts = cp_get_extensions_info(
- data->ctx,
- "org.xbmc.vfs.providers",
- &status,
- &num_pr_exts
- );
- if (pr_exts == NULL) {
-
- // An error occurred and framework logged it
- return status;
- }
-
- // Allocate memory for vfsprovider information, if any
- if (num_pr_exts > 0) {
- data->providers = malloc(
- num_pr_exts * sizeof(registered_vfsprovider_t)
- );
- if (data->providers == NULL) {
- // Memory allocation failed
- cp_log(data->ctx, CP_LOG_ERROR,
- "Insufficient memory for providers list.");
- return CP_ERR_RESOURCE;
- }
- }
-
- /* Resolve providers functions. This will implicitly start
- * plug-ins providing the file systems. */
- for (i = 0; i < num_pr_exts; i++) {
- const char *str;
- vfsprovider_t *pr;
-
- // Resolve provider data pointer
- str = cp_lookup_cfg_value(
- pr_exts[i]->configuration, "@provider");
- if (str == NULL) {
-
- // Provider symbol name is missing
- cp_log(data->ctx, CP_LOG_ERROR,
- "Ignoring vfsprovider without symbol name.");
- continue;
- }
- pr = cp_resolve_symbol(
- data->ctx,
- pr_exts[i]->plugin->identifier,
- str,
- NULL
- );
- if (pr == NULL) {
-
- // Could not resolve provider symbol
- cp_log(data->ctx, CP_LOG_ERROR,
- "Ignoring provider which could not be resolved.");
- continue;
- }
-
- // Get the protocol supported
- str = cp_lookup_cfg_value(
- pr_exts[i]->configuration, "@protocol"
- );
- if (str == NULL) {
-
- // provider is missing mandatory protocol
- cp_log(data->ctx, CP_LOG_ERROR,
- "Ignoring provider without protocol.");
- continue;
-
- // Add provider to the list of registered providers
- data->providers[data->num_providers].protocol = str;
- data->providers[data->num_providers].provider = pr;
- data->num_providers++;
- }
- }
-
- // Release extension information
- cp_release_info(data->ctx, pr_exts);
-
- // Register run function to do the real work
- cp_run_function(data->ctx, run);
-
- if (data->num_providers) {
- cp_log(data->ctx, CP_LOG_DEBUG,
- "VFS: NO providers %i");
- } else {
- cp_log(data->ctx, CP_LOG_DEBUG,
- "VFS: some providers %i");
- }
-
- // Successfully started
- return CP_OK;
-}
-
-/**
- * Releases resources from other plug-ins.
- */
-static void stop(void *d) {
- plugin_data_t *data = d;
- int i;
-
- if (data->providers != NULL) {
- for (i = 0; i < data->num_providers; i++) {
- cp_release_symbol(
- data->ctx, data->providers[i].provider
- );
- }
-
- // Free local data
- free(data->providers);
- data->providers = NULL;
- data->num_providers = 0;
- }
-}
-
-/**
- * Destroys a plug-in instance.
- */
-static void destroy(void *d) {
- free(d);
-}
-
-
-/* ------------------------------------------------------------------------
- * Exported runtime information
- * ----------------------------------------------------------------------*/
-
-/**
- * Plug-in runtime information for the framework. The name of this symbol
- * is stored in the plug-in descriptor.
- */
-CP_EXPORT cp_plugin_runtime_t xbmc_vfs_providers_core_funcs = {
- create,
- start,
- stop,
- destroy
-};
View
128 addons/org.xbmc.core.vfs/core.h
@@ -1,128 +0,0 @@
-/*
-* Copyright (C) 2010 Team XBMC
-* http://www.xbmc.org
-*
-* 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, 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 XBMC; see the file COPYING. If not, write to
-* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-* http://www.gnu.org/copyleft/gpl.html
-*
-*/
-
-#ifndef VFSPROVIDER_H
-#define VFSPROVIDER_H
-
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/statvfs.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** Function to add an entry in a readdir() operation
- *
- * @param buf the buffer passed to the readdir() operation
- * @param name the file name of the directory entry
- * @param stat file attributes, can be NULL
- * @param off offset of the next entry or zero
- * @return 1 if buffer is full, zero otherwise
- */
-typedef int (*xbmc_vfs_fill_dir_t) (void *buf, const char *name,
- const struct stat *stbuf, off_t off);
-
-/**
- * VFS operations:
- *
- */
-struct xbmc_vfs_operations {
-
- /** Provider specific runtime data */
- void *data;
-
- /** Get file attributes */
- int (*stat) (const char *, struct stat *);
-
- /** Create a directory */
- int (*mkdir) (const char *, mode_t);
-
- /** Remove a directory */
- int (*rmdir) (const char *);
-
- /** Rename a file */
- int (*rename) (const char *, const char *);
-
- /** Change the size of a file */
- int (*truncate) (const char *, off_t);
-
- /** File open operation */
- int (*open) (const char *, struct fuse_file_info *);
-
- /** Read data from an open file */
- int (*read) (const char *, char *, size_t, off_t,
- struct fuse_file_info *);
-
- /** Check file access permissions */
- int (*access) (const char *, int);
-
- /** Write data to an open file */
- int (*write) (const char *, const char *, size_t, off_t,
- struct fuse_file_info *);
-
- /** Create and open a file */
- int (*create) (const char *, mode_t, struct fuse_file_info *);
-
- /** Change the size of an open file */
- int (*ftruncate) (const char *, off_t, struct fuse_file_info *);
-
- /** Get attributes from an open file */
- int (*fgetattr) (const char *, struct stat *, struct fuse_file_info *);
-
- /** Get file system statistics */
- int (*statfs) (const char *, struct statvfs *);
-
- /** Possibly flush cached data */
- int (*flush) (const char *, struct fuse_file_info *);
-
- /** Release an open file */
- int (*release) (const char *, struct fuse_file_info *);
-
- /** Synchronize file contents */
- int (*fsync) (const char *, int, struct fuse_file_info *);
-
- /** Set extended attributes */
- int (*setxattr) (const char *, const char *, const char *, size_t, int);
-
- /** Get extended attributes */
- int (*getxattr) (const char *, const char *, char *, size_t);
-
- /** List extended attributes */
- int (*listxattr) (const char *, char *, size_t);
-
- /** Remove extended attributes */
- int (*removexattr) (const char *, const char *);
-
- /** Open directory */
- int (*opendir) (const char *, struct fuse_file_info *);
-
- /** Read directory */
- int (*readdir) (const char *, void *, fuse_fill_dir_t, off_t,
- struct fuse_file_info *);
-
- /** Release directory */
- int (*releasedir) (const char *, struct fuse_file_info *);
-
-};
-
-#endif /*VFSPRIVIDER_H*/
View
15 addons/org.xbmc.core.vfs/plugin.xml
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<plugin
- id="org.xbmc.core.vfs"
- version="0.1"
- name="Core logic for vfsprovider"
- provider-name="TEAMXBMC">
- <requires>
- <c-pluff version="0.1"/>
- </requires>
- <runtime library="libxbmcvfs" funcs="xbmc_vfs_core_funcs"/>
- <extension-point
- id="provider"
- name="File system provider"
- schema="vfsprovider.xsd"/>
-</plugin>
View
27 addons/org.xbmc.core.vfs/vfsprovider.xsd
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd">
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:element name="extension">
- <xs:complexType>
- <xs:attribute name="point" type="xs:string" use="required"/>
- <xs:attribute name="id" type="simpleIdentifier"/>
- <xs:attribute name="name" type="xs:string"/>
-
- <!--
- * The provider is the name of a symbol pointing to
- * vfsprovider_t strucutre. Protocol determines the order
- * the file classifiers are tried. Cached states whether XBMC
- * should cache the file access.
- -->
- <xs:attribute name="provider" type="xs:string" use="required"/>
- <xs:attribute name="protocol" type="xs:string" use="required"/>
- <xs:attribute name="cached" type="xs:boolean" use="required"/>
-
- </xs:complexType>
- </xs:element>
- <xs:simpleType name="simpleIdentifier">
- <xs:restriction base="xs:string">
- <xs:pattern value="[^.]+"/>
- </xs:restriction>
- </xs:simpleType>
-</xs:schema>
View
1  configure.in
@@ -1032,7 +1032,6 @@ OUTPUT_FILES="Makefile \
guilib/Makefile \
guilib/common/Makefile \
xbmc/lib/libass/xbmc/Makefile \
- xbmc/lib/libcpluff/Makefile \
xbmc/lib/libXBMS/Makefile \
xbmc/lib/libRTV/Makefile \
xbmc/lib/libexif/Makefile \
View
1  language/English/strings.xml
@@ -2112,7 +2112,6 @@
<string id="24008">Screensaver</string>
<string id="24009">Script</string>
<string id="24010">Visualization</string>
- <string id="24011">File system</string>
<string id="24020">Configure Add-on</string>
<string id="24021">Disable Add-on</string>
View
4 xbmc/FileSystem/FactoryDirectory.cpp
@@ -34,7 +34,6 @@
#include "MusicDatabaseDirectory.h"
#include "MusicSearchDirectory.h"
#include "VideoDatabaseDirectory.h"
-#include "AddonDirectory.h"
#include "AddonsDirectory.h"
#include "ShoutcastDirectory.h"
#include "LastFMDirectory.h"
@@ -193,6 +192,7 @@ IDirectory* CFactoryDirectory::Create(const CStdString& strPath)
#endif
}
- return CAddonDirectory::GetDirectory(strProtocol);
+ CLog::Log(LOGWARNING, "CFactoryDirectory::Create - Unsupported protocol %s", strProtocol.c_str());
+ return NULL;
}
View
1  xbmc/GUIWindowAddonBrowser.cpp
@@ -168,6 +168,7 @@ void CGUIWindowAddonBrowser::Update()
pItem->SetProperty("Addon.Name", addon->Name());
pItem->SetProperty("Addon.Version", addon->Version().Print());
pItem->SetProperty("Addon.Summary", addon->Summary());
+ pItem->SetProperty("Addon.Description", addon->Description());
pItem->SetProperty("Addon.Creator", addon->Author());
pItem->SetProperty("Addon.Disclaimer", addon->Disclaimer());
pItem->SetProperty("Addon.Rating", addon->Stars());
View
26 xbmc/addons/Addon.cpp
@@ -103,51 +103,39 @@ const CStdString TranslateType(const ADDON::TYPE &type, bool pretty/*=false*/)
{
if (pretty)
return g_localizeStrings.Get(24007);
- return "org.xbmc.library.scraper";
+ return "scraper";
}
case ADDON::ADDON_SCRAPER_LIBRARY:
{
- return "org.xbmc.library.scraper.include";
+ return "scraper-library";
}
case ADDON::ADDON_SCREENSAVER:
{
if (pretty)
return g_localizeStrings.Get(24008);
- return "org.xbmc.ui.screensaver";
+ return "screensaver";
}
case ADDON::ADDON_VIZ:
{
if (pretty)
return g_localizeStrings.Get(24010);
- return "org.xbmc.player.viz";
+ return "visualization";
}
case ADDON::ADDON_VIZ_LIBRARY:
{
- return "org.xbmc.player.viz.presetpack";
+ return "visualization-library";
}
case ADDON::ADDON_PLUGIN:
{
if (pretty)
return g_localizeStrings.Get(24005);
- return "org.xbmc.library.plugin";
+ return "plugin";
}
case ADDON::ADDON_SCRIPT:
{
if (pretty)
return g_localizeStrings.Get(24009);
- return "org.xbmc.ui.applets";
- }
- case ADDON::ADDON_SKIN:
- {
- if (pretty)
- return g_localizeStrings.Get(24009);
- return "org.xbmc.ui.skin";
- }
- case ADDON::ADDON_VFSDLL:
- {
- if (pretty)
- return g_localizeStrings.Get(24011);
- return "org.xbmc.core.vfs.provider";
+ return "script";
}
default:
{
View
624 xbmc/addons/AddonManager.cpp
@@ -27,8 +27,6 @@
#include "Settings.h"
#include "GUISettings.h"
#include "DownloadQueueManager.h"
-//#include "AdvancedSettings.h"
-#include "DllLibCPluff.h"
#include "log.h"
#ifdef HAS_VISUALISATION
@@ -43,6 +41,7 @@
#include "Scraper.h"
//#endif
+
namespace ADDON
{
@@ -51,7 +50,6 @@ namespace ADDON
* CAddonMgr
*
*/
-int cp_to_clog(cp_log_severity_t lvl);
CAddonMgr* CAddonMgr::m_pInstance = NULL;
std::map<TYPE, IAddonMgrCallback*> CAddonMgr::m_managers;
@@ -62,8 +60,6 @@ CAddonMgr::CAddonMgr()
CAddonMgr::~CAddonMgr()
{
- if(m_cpluff)
- m_cpluff->destroy();
}
CAddonMgr* CAddonMgr::Get()
@@ -71,49 +67,10 @@ CAddonMgr* CAddonMgr::Get()
if (!m_pInstance)
{
m_pInstance = new CAddonMgr();
- m_pInstance->OnInit();
}
return m_pInstance;
}
-void CAddonMgr::OnInit()
-{
- m_cpluff = new DllLibCPluff;
- m_cpluff->Load();
-
- if (!m_cpluff->IsLoaded())
- assert(false);
-
- cp_status_t status;
- setlocale(LC_ALL, ""); //FIXME where should this be handled?
- cp_log_severity_t log;
- if (g_advancedSettings.m_logLevel >= LOG_LEVEL_DEBUG_SAMBA)
- log = CP_LOG_DEBUG;
- else if (g_advancedSettings.m_logLevel >= LOG_LEVEL_DEBUG)
- log = CP_LOG_INFO;
- else
- log = CP_LOG_WARNING;
-
- m_cpluff->set_fatal_error_handler(cp_fatalErrorHandler);
- status = m_cpluff->init();
- if (status != CP_OK)
- {
- CLog::Log(LOGERROR, "ADDONS: Fatal Error, cp_init() returned status: %i", status);
- assert(false);
- }
-
- //TODO could separate addons into different contexts
- // would allow partial unloading of addon framework
- m_cp_context = m_cpluff->create_context(&status);
- assert(m_cp_context);
-
- status = m_cpluff->register_pcollection(m_cp_context, "/home/alasdair/code/git-xbmc/addons");
- assert(status == CP_OK);
- status = m_cpluff->register_logger(m_cp_context, cp_logger, &CAddonMgr::m_pInstance, CP_LOG_INFO);
- assert(status == CP_OK);
- status = m_cpluff->scan_plugins(m_cp_context, 0);
-}
-
IAddonMgrCallback* CAddonMgr::GetCallbackForType(TYPE type)
{
if (m_managers.find(type) == m_managers.end())
@@ -140,8 +97,14 @@ void CAddonMgr::UnregisterAddonMgrCallback(TYPE type)
bool CAddonMgr::HasAddons(const TYPE &type, const CONTENT_TYPE &content/*= CONTENT_NONE*/, bool enabledOnly/*= true*/)
{
- if (type == ADDON_VFSDLL)
- return true;
+ if (m_addons.empty())
+ {
+ VECADDONS add;
+ GetAllAddons(add,false);
+ }
+
+ if (content == CONTENT_NONE)
+ return (m_addons.find(type) != m_addons.end());
VECADDONS addons;
return GetAddons(type, addons, content, enabledOnly);
@@ -174,7 +137,18 @@ void CAddonMgr::OnFileComplete(TICKET aTicket, CStdString& aFilePath, INT aByteR
bool CAddonMgr::GetAllAddons(VECADDONS &addons, bool enabledOnly/*= true*/)
{
- return true;
+ VECADDONS temp;
+ if (CAddonMgr::Get()->GetAddons(ADDON_PLUGIN, temp, CONTENT_NONE, enabledOnly))
+ addons.insert(addons.end(), temp.begin(), temp.end());
+ if (CAddonMgr::Get()->GetAddons(ADDON_SCRAPER, temp, CONTENT_NONE, enabledOnly))
+ addons.insert(addons.end(), temp.begin(), temp.end());
+ if (CAddonMgr::Get()->GetAddons(ADDON_SCREENSAVER, temp, CONTENT_NONE, enabledOnly))
+ addons.insert(addons.end(), temp.begin(), temp.end());
+ if (CAddonMgr::Get()->GetAddons(ADDON_SCRIPT, temp, CONTENT_NONE, enabledOnly))
+ addons.insert(addons.end(), temp.begin(), temp.end());
+ if (CAddonMgr::Get()->GetAddons(ADDON_VIZ, temp, CONTENT_NONE, enabledOnly))
+ addons.insert(addons.end(), temp.begin(), temp.end());
+ return !addons.empty();
}
bool CAddonMgr::GetAddons(const TYPE &type, VECADDONS &addons, const CONTENT_TYPE &content/*= CONTENT_NONE*/, bool enabledOnly/*= true*/)
@@ -185,12 +159,26 @@ bool CAddonMgr::GetAddons(const TYPE &type, VECADDONS &addons, const CONTENT_TYP
if(!m_lastDirScan.IsValid() || (m_lastDirScan + span) < CDateTime::GetCurrentDateTime())
{
m_lastDirScan = CDateTime::GetCurrentDateTime();
- cp_status_t status = m_cpluff->scan_plugins(m_cp_context, 0);
- if (status != CP_OK)
- CLog::Log(LOGERROR, "ADDON: CPluff scan_plugins() failed");
+ LoadAddonsXML();
}
- return GetExtensions(type, addons, content);
+ addons.clear();
+ if (m_addons.find(type) != m_addons.end())
+ {
+ IVECADDONS itr = m_addons[type].begin();
+ while (itr != m_addons[type].end())
+ { // filter out what we're not looking for
+ if ((enabledOnly && (*itr)->Disabled())
+ || (content != CONTENT_NONE && !(*itr)->Supports(content)))
+ {
+ ++itr;
+ continue;
+ }
+ addons.push_back(*itr);
+ ++itr;
+ }
+ }
+ return !addons.empty();
}
bool CAddonMgr::GetAddon(const CStdString &str, AddonPtr &addon, const TYPE &type/*=ADDON_UNKNOWN*/, bool enabledOnly/*= true*/)
@@ -293,6 +281,9 @@ bool CAddonMgr::LoadAddonsXML()
if (!LoadAddonsXML(props))
return false;
+ // refresh addon dirs if neccesary/forced
+ FindAddons();
+
// now enable accordingly
VECADDONPROPS::const_iterator itr = props.begin();
while (itr != props.end())
@@ -319,6 +310,470 @@ bool CAddonMgr::LoadAddonsXML()
return true;
}
+void CAddonMgr::FindAddons()
+{
+ // parse the user & system dirs for addons of the requested type
+ CFileItemList items;
+ if (!CSpecialProtocol::XBMCIsHome())
+ CDirectory::GetDirectory("special://home/addons", items);
+ CDirectory::GetDirectory("special://xbmc/addons", items);
+
+ // store any addons with unresolved deps, then recheck at the end
+ VECADDONS unresolved;
+
+ // for all folders found
+ for (int i = 0; i < items.Size(); ++i)
+ {
+ CFileItemPtr item = items[i];
+
+ if(!item->m_bIsFolder)
+ continue;
+
+ // read description.xml and populate the addon
+ AddonPtr addon;
+ if (!AddonFromInfoXML(item->m_strPath, addon))
+ continue;
+
+ // refuse to store addons with missing library
+ CStdString library(CUtil::AddFileToFolder(addon->Path(), addon->LibName()));
+ if (!CFile::Exists(library))
+ {
+ CLog::Log(LOGDEBUG, "ADDON: Missing library file %s, bypassing package", library.c_str());
+ continue;
+ }
+
+ // check for/cache icon thumbnail
+ //TODO cache one thumb per addon id instead
+ CFileItem item2(CUtil::AddFileToFolder(addon->Path(), addon->LibName()), false);
+ item2.SetCachedProgramThumb();
+ if (!item2.HasThumbnail())
+ item2.SetUserProgramThumb();
+ if (!item2.HasThumbnail())
+ item2.SetThumbnailImage(addon->Icon());
+ if (item2.HasThumbnail())
+ {
+ XFILE::CFile::Cache(item2.GetThumbnailImage(),item->GetCachedProgramThumb());
+ }
+
+ if (!DependenciesMet(addon))
+ {
+ unresolved.push_back(addon);
+ continue;
+ }
+ else
+ { // everything ok, add to available addons if new
+ if (UpdateIfKnown(addon))
+ continue;
+ else
+ {
+ m_addons[addon->Type()].push_back(addon);
+ m_idMap.insert(std::make_pair(addon->ID(), addon));
+ }
+ }
+ }
+
+ for (unsigned i = 0; i < unresolved.size(); i++)
+ {
+ AddonPtr& addon = unresolved[i];
+ if (DependenciesMet(addon))
+ {
+ if (!UpdateIfKnown(addon))
+ {
+ m_addons[addon->Type()].push_back(addon);
+ m_idMap.insert(std::make_pair(addon->ID(), addon));
+ }
+ }
+ }
+// CLog::Log(LOGINFO, "ADDON: Found %"PRIuS" addons", m_addons.find(type) == m_addons.end() ? 0: m_addons[type].size(), TranslateType(type).c_str());
+}
+
+bool CAddonMgr::UpdateIfKnown(AddonPtr &addon)
+{
+ if (m_addons.find(addon->Type()) != m_addons.end())
+ {
+ for (unsigned i = 0; i < m_addons[addon->Type()].size(); i++)
+ {
+ if (m_addons[addon->Type()][i]->ID() == addon->ID())
+ {
+ //TODO inform any manager first, and request removal
+ //TODO choose most recent version if varying
+ m_addons[addon->Type()][i] = addon;
+ CStdString id = addon->ID();
+ m_idMap.erase(id);
+ m_idMap.insert(std::make_pair(addon->ID(), addon));
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+bool CAddonMgr::DependenciesMet(AddonPtr &addon)
+{
+ // As remote repos are not functioning,
+ // this will fail if a dependency is not found locally
+ if (!addon)
+ return false;
+
+ ADDONDEPS deps = addon->GetDeps();
+ ADDONDEPS::iterator itr = deps.begin();
+ while (itr != deps.end())
+ {
+ CStdString id;
+ id = (*itr).first;
+ AddonVersion min = (*itr).second.first;
+ AddonVersion max = (*itr).second.second;
+ if (m_idMap.count(id))
+ {
+ AddonPtr dep = m_idMap[id];
+ // we're guaranteed to have at least max OR min here
+ if (!min.str.IsEmpty() && !max.str.IsEmpty())
+ return (dep->Version() >= min && dep->Version() <= max);
+ else if (!min.str.IsEmpty())
+ return (dep->Version() >= min);
+ else
+ return (dep->Version() <= max);
+ }
+ for (unsigned i=0; i < m_remoteAddons.size(); i++)
+ {
+ if (m_remoteAddons[i].id == id)
+ {
+ if(m_remoteAddons[i].version >= min && m_remoteAddons[i].version <= max)
+ {
+ //TODO line up download
+ return false;
+ }
+ }
+ }
+ itr++;
+ }
+ return deps.empty();
+}
+
+bool CAddonMgr::AddonFromInfoXML(const CStdString &path, AddonPtr &addon)
+{
+ // First check that we can load description.xml
+ CStdString strPath(CUtil::AddFileToFolder(path, ADDON_METAFILE));
+ if(!CFile::Exists(strPath))
+ return false;
+
+ TiXmlDocument xmlDoc;
+ if (!xmlDoc.LoadFile(strPath))
+ {
+ CLog::Log(LOGERROR, "Unable to load: %s, Line %d\n%s", strPath.c_str(), xmlDoc.ErrorRow(), xmlDoc.ErrorDesc());
+ return false;
+ }
+
+ TiXmlElement *element = xmlDoc.RootElement();
+ if (!element || strcmpi(element->Value(), "addoninfo") != 0)
+ {
+ CLog::Log(LOGERROR, "ADDON: Error loading %s: cannot find <addon> root element", strPath.c_str());
+ return false;
+ }
+
+ /* Steps required to meet package requirements
+ * 1. id exists and is valid
+ * 2. type exists and is valid
+ * 3. version exists
+ * 4. a license is specified
+ * 5. operating system matches ours
+ * 6. summary exists
+ * 7. for scrapers & plugins, support at least one type of content
+ *
+ * NOTE: addon dependencies are handled in ::FindAddons()
+ */
+
+ /* Validate id */
+ CStdString id;
+ element = NULL;
+ element = xmlDoc.RootElement()->FirstChildElement("id");
+ if (!element)
+ {
+ CLog::Log(LOGERROR, "ADDON: %s missing <id> element, ignoring", strPath.c_str());
+ return false;
+ }
+ id = element->GetText();
+ //FIXME since we no longer required uuids, should we bother validating anything?
+ if (id.IsEmpty())
+ {
+ CLog::Log(LOGERROR, "ADDON: %s has invalid <id> element, ignoring", strPath.c_str());
+ return false;
+ }
+
+ /* Validate type */
+ TYPE type;
+ element = NULL;
+ element = xmlDoc.RootElement()->FirstChildElement("type");
+ if (!element)
+ {
+ CLog::Log(LOGERROR, "ADDON: %s missing <id> element, ignoring", strPath.c_str());
+ return false;
+ }
+ type = TranslateType(element->GetText());
+ if (type == ADDON_UNKNOWN)
+ {
+ CLog::Log(LOGERROR, "ADDON: %s has invalid type identifier: '%d'", strPath.c_str(), type);
+ return false;
+ }
+
+ /* Retrieve Name */
+ CStdString name;
+ element = NULL;
+ element = xmlDoc.RootElement()->FirstChildElement("title");
+ if (!element)
+ {
+ CLog::Log(LOGERROR, "ADDON: %s missing <title> element, ignoring", strPath.c_str());
+ return false;
+ }
+ name = element->GetText();
+
+ /* Retrieve version */
+ CStdString version;
+ element = NULL;
+ element = xmlDoc.RootElement()->FirstChildElement("version");
+ if (!element)
+ {
+ CLog::Log(LOGERROR, "ADDON: %s missing <version> element, ignoring", strPath.c_str());
+ return false;
+ }
+ /* Validate version */
+ version = element->GetText();
+ CRegExp versionRE;
+ versionRE.RegComp(ADDON_VERSION_RE.c_str());
+ if (versionRE.RegFind(version.c_str()) != 0)
+ {
+ CLog::Log(LOGERROR, "ADDON: %s has invalid <version> element, ignoring", strPath.c_str());
+ return false;
+ }
+
+ /* Path, ID & Version are valid */
+ AddonProps addonProps(id, type, version);
+ addonProps.name = name;
+ addonProps.path = path;
+ addonProps.icon = CUtil::AddFileToFolder(path, "default.tbn");
+
+ /* Retrieve license */
+ element = NULL;
+ element = xmlDoc.RootElement()->FirstChildElement("license");
+/* if (!element)
+ {
+ CLog::Log(LOGERROR, "ADDON: %s missing <license> element, ignoring", strPath.c_str());
+ return false;
+ }
+ addonProps.license = element->GetText();*/
+
+ /* Retrieve platforms which this addon supports */
+ CStdString platform;
+ element = NULL;
+ element = xmlDoc.RootElement()->FirstChildElement("platforms")->FirstChildElement("platform");
+ if (!element)
+ {
+ CLog::Log(LOGERROR, "ADDON: %s missing <platforms> element, ignoring", strPath.c_str());
+ return false;
+ }
+
+ bool all(false);
+ std::set<CStdString> platforms;
+ do
+ {
+ CStdString platform = element->GetText();
+ if (platform == "all")
+ {
+ all = true;
+ break;
+ }
+ platforms.insert(platform);
+ element = element->NextSiblingElement("platform");
+ } while (element != NULL);
+
+ if (!all)
+ {
+#if defined(_LINUX) && !defined(__APPLE__)
+ if (!platforms.count("linux"))
+ {
+ CLog::Log(LOGNOTICE, "ADDON: %s is not supported under Linux, ignoring", strPath.c_str());
+ return false;
+ }
+#elif defined(_WIN32)
+ if (!platforms.count("windows"))
+ {
+ CLog::Log(LOGNOTICE, "ADDON: %s is not supported under Windows, ignoring", strPath.c_str());
+ return false;
+ }
+#elif defined(__APPLE__)
+ if (!platforms.count("osx"))
+ {
+ CLog::Log(LOGNOTICE, "ADDON: %s is not supported under OSX, ignoring", strPath.c_str());
+ return false;
+ }
+#elif defined(_XBOX)
+ if (!platforms.count("xbox"))
+ {
+ CLog::Log(LOGNOTICE, "ADDON: %s is not supported under XBOX, ignoring", strPath.c_str());
+ return false;
+ }
+#endif
+ }
+
+ /* Retrieve summary */
+ CStdString summary;
+ element = NULL;
+ element = xmlDoc.RootElement()->FirstChildElement("summary");
+ if (!element)
+ {
+ CLog::Log(LOGERROR, "ADDON: %s missing <summary> element, ignoring", strPath.c_str());
+ return false;
+ }
+ addonProps.summary = element->GetText();
+
+ if (addonProps.type == ADDON_SCRAPER || addonProps.type == ADDON_PLUGIN)
+ {
+ /* Retrieve content types that this addon supports */
+ CStdString platform;
+ element = NULL;
+ if (xmlDoc.RootElement()->FirstChildElement("supportedcontent"))
+ {
+ element = xmlDoc.RootElement()->FirstChildElement("supportedcontent")->FirstChildElement("content");
+ }
+ if (!element)
+ {
+ CLog::Log(LOGERROR, "ADDON: %s missing <supportedcontent> element, ignoring", strPath.c_str());
+ return false;
+ }
+
+ std::set<CONTENT_TYPE> contents;
+ do
+ {
+ CONTENT_TYPE content = TranslateContent(element->GetText());
+ if (content != CONTENT_NONE)
+ {
+ contents.insert(content);
+ }
+ element = element->NextSiblingElement("content");
+ } while (element != NULL);
+
+ if (contents.empty())
+ {
+ CLog::Log(LOGERROR, "ADDON: %s %s supports no available content-types, ignoring", TranslateType(addonProps.type).c_str(), addonProps.name.c_str());
+ return false;
+ }
+ else
+ {
+ addonProps.contents = contents;
+ }
+ }
+
+ /*** Beginning of optional fields ***/
+ /* Retrieve description */
+ element = NULL;
+ element = xmlDoc.RootElement()->FirstChildElement("description");
+ if (element)
+ addonProps.description = element->GetText();
+
+ /* Retrieve author */
+ element = NULL;
+ element = xmlDoc.RootElement()->FirstChildElement("author");
+ if (element)
+ addonProps.author = element->GetText();
+
+ /* Retrieve disclaimer */
+ element = NULL;
+ element = xmlDoc.RootElement()->FirstChildElement("disclaimer");
+ if (element)
+ addonProps.disclaimer = element->GetText();
+
+ /* Retrieve library file name */
+ // will be replaced with default library name if unspecified
+ element = NULL;
+ element = xmlDoc.RootElement()->FirstChildElement("library");
+ if (element)
+ addonProps.libname = element->GetText();
+
+ //TODO move this to addon specific class, if it's needed at all..
+#ifdef _WIN32
+ /* Retrieve WIN32 library file name in case it is present
+ * This is required for no overwrite to the fixed WIN32 add-on's
+ * during compile time
+ */
+ element = NULL;
+ element = xmlDoc.RootElement()->FirstChildElement("librarywin32");
+ if (element) // If it is found overwrite standard library name
+ addonProps.libname = element->GetText();
+#endif
+
+ /* Retrieve dependencies that this addon requires */
+ std::map<CStdString, std::pair<const AddonVersion, const AddonVersion> > deps;
+ element = NULL;
+ element = xmlDoc.RootElement()->FirstChildElement("dependencies");
+ if (element)
+ {
+ element = element->FirstChildElement("dependency");
+ if (!element)
+ CLog::Log(LOGDEBUG, "ADDON: %s missing at least one <dependency> element, will ignore this dependency", strPath.c_str());
+ else
+ {
+ do
+ {
+ CStdString min = element->Attribute("minversion");
+ CStdString max = element->Attribute("maxversion");
+ CStdString id = element->GetText();
+ if (!id || (!min && ! max))
+ {
+ CLog::Log(LOGDEBUG, "ADDON: %s malformed <dependency> element, will ignore this dependency", strPath.c_str());
+ continue;
+ }
+ deps.insert(std::make_pair(id, std::make_pair(AddonVersion(min), AddonVersion(max))));
+ element = element->NextSiblingElement("dependency");
+ } while (element != NULL);
+ addonProps.dependencies = deps;
+ }
+ }
+
+ /*** end of optional fields ***/
+
+ /* Create an addon object and store in a shared_ptr */
+ addon.reset();
+ switch (type)
+ {
+ case ADDON_PLUGIN:
+ case ADDON_SCRIPT:
+ {
+ AddonPtr temp(new CAddon(addonProps));
+ addon = temp;
+ break;
+ }
+ case ADDON_SCRAPER:
+ {
+ AddonPtr temp(new CScraper(addonProps));
+ addon = temp;
+ break;
+ }
+ case ADDON_VIZ:
+ {
+ AddonPtr temp(new CVisualisation(addonProps));
+ addon = temp;
+ break;
+ }
+ case ADDON_SCREENSAVER:
+ {
+ AddonPtr temp(new CScreenSaver(addonProps));
+ addon = temp;
+ break;
+ }
+ case ADDON_SCRAPER_LIBRARY:
+ case ADDON_VIZ_LIBRARY:
+ {
+ AddonPtr temp(new CAddonLibrary(addonProps));
+ addon = temp;
+ break;
+ }
+ default:
+ return false;
+ }
+
+ return true;
+}
+
CStdString CAddonMgr::GetAddonsXMLFile() const
{
CStdString folder;
@@ -450,72 +905,5 @@ bool CAddonMgr::GetAddon(const TYPE &type, const TiXmlNode *node, VECADDONPROPS
return false;
}
-/*
- * libcpluff interaction
- */
-
-void CAddonMgr::CPluffFatalError(const char *msg)
-{
- CLog::Log(LOGERROR, "ADDONS: CPluffFatalError(%s)", msg);
-}
-
-int cp_to_clog(cp_log_severity_t lvl)
-{
- if( lvl == CP_LOG_DEBUG )
- return 0;
- else if (lvl == CP_LOG_INFO)
- return 1;
- else if (lvl == CP_LOG_WARNING)
- return 3;
- else
- return 4;
-}
-cp_log_severity_t clog_to_cp(int lvl)
-{
- if (lvl >= 4)
- return CP_LOG_ERROR;
- else if (lvl == 3)
- return CP_LOG_WARNING;
- else if (lvl >= 1)
- return CP_LOG_INFO;
- else
- return CP_LOG_DEBUG;
-}
-
-
-void CAddonMgr::CPluffLog(cp_log_severity_t level, const char *msg, const char *apid, void *user_data)
-{
- if(!apid)
- CLog::Log(LOGDEBUG, "ADDON: '%s'", msg);
- else
- CLog::Log(LOGDEBUG, "ADDON: '%s' reports '%s'", apid, msg);
-}
-
-bool CAddonMgr::GetExtensions(const TYPE &type, VECADDONS &addons, const CONTENT_TYPE &content)
-{
- cp_status_t status;
- int num;
- CStdString ext_point(TranslateType(type));
- cp_extension_t **exts = m_cpluff->get_extensions_info(m_cp_context, ext_point.c_str(), &status, &num);
- for(int i=0; i <num; i++)
- {
- CStdString id(exts[i]->plugin->identifier);
- CStdString version(exts[i]->plugin->version);
- AddonProps props(id, type, version);
- props.name = CStdString(exts[i]->name);
- props.summary = CStdString(exts[i]->plugin->summary);
- props.path = CStdString(exts[i]->plugin->plugin_path);
- props.icon = props.path + "/default.tbn"; //TODO store icons per ID
- addons.push_back(AddonFactory(type, props));
- }
- m_cpluff->release_info(m_cp_context, exts);
- return addons.size();
-}
-
-AddonPtr AddonFactory(const AddonProps &props)
-{
- return AddonPtr(new T(props));
-}
-
} /* namespace ADDON */
View
26 xbmc/addons/AddonManager.h
@@ -28,13 +28,6 @@
#include <vector>
#include <map>
-// libcpluff
-class DllLibCPluff;
-extern "C"
-{
-#include "../lib/cpluff-0.1.3/libcpluff/cpluff.h"
-}
-
namespace ADDON
{
typedef std::vector<AddonPtr> VECADDONS;
@@ -98,22 +91,12 @@ namespace ADDON
void UpdateRepos();
bool ParseRepoXML(const CStdString &path);
+ void FindAddons();
bool LoadAddonsXML();
bool SaveAddonsXML();
-
- // libcpluff
- bool GetExtensions(const TYPE &type, VECADDONS &addons, const CONTENT_TYPE &content);
- void CPluffFatalError(const char *msg);
- void CPluffLog(cp_log_severity_t level, const char *msg, const char *apid, void *user_data);
- cp_context_t *m_cp_context;
- DllLibCPluff *m_cpluff;
- // libcpluff callbacks
- static void cp_fatalErrorHandler(const char *msg) {
- CAddonMgr::Get()->CPluffFatalError(msg);
- }
- static void cp_logger(cp_log_severity_t level, const char *msg, const char *apid, void *user_data) {
- CAddonMgr::Get()->CPluffLog(level, msg, apid, user_data);
- }
+ bool AddonFromInfoXML(const CStdString &path, AddonPtr &addon);
+ bool DependenciesMet(AddonPtr &addon);
+ bool UpdateIfKnown(AddonPtr &addon);
/* addons.xml */
CStdString GetAddonsXMLFile() const;
@@ -124,7 +107,6 @@ namespace ADDON
bool GetAddon(const TYPE &type, const TiXmlNode *node, VECADDONPROPS &addon);
CAddonMgr();
- void OnInit();
static CAddonMgr* m_pInstance;
static std::map<TYPE, IAddonMgrCallback*> m_managers;
MAPADDONS m_addons;
View
1  xbmc/addons/IAddon.h
@@ -53,7 +53,6 @@ namespace ADDON
ADDON_SCRAPER,
ADDON_SCREENSAVER,
ADDON_PLUGIN,
- ADDON_VFSDLL,
ADDON_VIZ_LIBRARY, // add noninstallable after this and installable before
ADDON_SCRAPER_LIBRARY
} TYPE;
View
118 xbmc/lib/cpluff-0.1.3/config.h
@@ -1,118 +0,0 @@
-/* config.h. Generated from config.h.in by configure. */
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-/* The earliest ABI compatible version or undefined */
-#define CP_ABI_COMPATIBILITY "0.1"
-
-/* File name separator character */
-#define CP_FNAMESEP_CHAR '/'
-
-/* File name separator string */
-#define CP_FNAMESEP_STR "/"
-
-/* Shared library extension */
-#define CP_SHREXT ".so"
-
-/* Multi-threading support type */
-#define CP_THREADS "Posix"
-
-/* Define to use GNU Libtool libltdl */
-/* #undef DLOPEN_LIBTOOL */
-
-/* Define to use Posix dlopen */
-#define DLOPEN_POSIX /**/
-
-/* Define to 1 if translation of program messages to the user's native
- language is requested. */
-#define ENABLE_NLS 1
-
-/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
- CoreFoundation framework. */
-/* #undef HAVE_CFLOCALECOPYCURRENT */
-
-/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
- the CoreFoundation framework. */
-/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
-
-/* Define if the GNU dcgettext() function is already present or preinstalled.
- */
-#define HAVE_DCGETTEXT 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define if the GNU gettext() function is already present or preinstalled. */
-#define HAVE_GETTEXT 1
-
-/* Define if you have the iconv() function. */
-/* #undef HAVE_ICONV */
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the `lstat' function. */
-#define HAVE_LSTAT 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the `stat' function. */
-#define HAVE_STAT 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
-#define LT_OBJDIR ".libs/"
-
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-/* #undef NO_MINUS_C_MINUS_O */
-
-/* Name of package */
-#define PACKAGE "cpluff"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "johannes.lehtinen@iki.fi"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "C-Pluff"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "C-Pluff 0.1.3"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "cpluff"
-
-/* Define to the home page for this package. */
-#define PACKAGE_URL ""
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.1.3"
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Version number of package */
-#define VERSION "0.1.3"
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
View
9 xbmc/lib/cpluff-0.1.3/examples/cpfile/cpfile
@@ -1,9 +0,0 @@
-#! /bin/sh
-
-# Copyright 2007 Johannes Lehtinen
-# This script is free software; Johannes Lehtinen gives unlimited
-# permission to copy, distribute and modify it.
-
-prefix="/usr/local"
-exec_prefix="${prefix}"
-exec "${exec_prefix}/bin/cpluff-loader" -c "${exec_prefix}/lib/cpfile/plugins" -s org.c-pluff.examples.cpfile.core "$@"
View
1,504 xbmc/lib/cpluff-0.1.3/libcpluff/cpluff.h
@@ -1,1504 +0,0 @@
-/*-------------------------------------------------------------------------
- * C-Pluff, a plug-in framework for C
- * Copyright 2007 Johannes Lehtinen
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *-----------------------------------------------------------------------*/
-
-/** @file
- * C-Pluff C API header file.
- * The elements declared here constitute the C-Pluff C API. To use the
- * API include this file and link the main program and plug-in runtime
- * libraries with the C-Pluff C library. In addition to local declarations,
- * this file also includes cpluffdef.h header file for defines common to C
- * and C++ API.
- */
-
-#ifndef CPLUFF_H_
-#define CPLUFF_H_
-
-/**
- * @defgroup cDefines Defines
- * Preprocessor defines.
- */
-
-#include "cpluffdef.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /*__cplusplus*/
-
-
-/* ------------------------------------------------------------------------
- * Defines
- * ----------------------------------------------------------------------*/
-
-/**
- * @def CP_C_API
- * @ingroup cDefines
- *
- * Marks a symbol declaration to be part of the C-Pluff C API.
- * This macro declares the symbol to be imported from the C-Pluff library.
- */
-
-#ifndef CP_C_API
-#define CP_C_API CP_IMPORT
-#endif
-
-
-/**
- * @defgroup cScanFlags Flags for plug-in scanning
- * @ingroup cDefines
- *
- * These constants can be orred together for the flags
- * parameter of ::cp_scan_plugins.
- */
-/*@{*/
-
-/**
- * This flag enables upgrades of installed plug-ins by unloading
- * the old version and installing the new version.
- */
-#define CP_SP_UPGRADE 0x01
-
-/**
- * This flag causes all plug-ins to be stopped before any
- * plug-ins are to be upgraded.
- */
-#define CP_SP_STOP_ALL_ON_UPGRADE 0x02
-
-/**
- * This flag causes all plug-ins to be stopped before any
- * plugins are to be installed (also if new version is to be installed
- * as part of an upgrade).
- */
-#define CP_SP_STOP_ALL_ON_INSTALL 0x04
-
-/**
- * Setting this flag causes the currently active plug-ins to be restarted
- * after all changes to the plug-ins have been made (if they were stopped).
- */
-#define CP_SP_RESTART_ACTIVE 0x08
-
-/*@}*/
-
-
-/* ------------------------------------------------------------------------
- * Data types
- * ----------------------------------------------------------------------*/
-
-/**
- * @defgroup cEnums Enumerations
- * Constant value enumerations.
- */
-
-/**
- * @defgroup cTypedefs Typedefs
- * Typedefs of various kind.
- */
-
-/**
- * @defgroup cStructs Data structures
- * Data structure definitions.
- */
-
-
-/* Enumerations */
-
-/**
- * @ingroup cEnums
- *
- * An enumeration of status codes returned by API functions.
- * Most of the interface functions return a status code. The returned
- * status code either indicates successful completion of the operation
- * or some specific kind of error. Some functions do not return a status
- * code because they never fail.
- */
-enum cp_status_t {
-
- /**
- * Operation was performed successfully (equals to zero).
- * @showinitializer
- */
- CP_OK = 0,
-
- /** Not enough memory or other operating system resources available */
- CP_ERR_RESOURCE,
-
- /** The specified object is unknown to the framework */
- CP_ERR_UNKNOWN,
-
- /** An I/O error occurred */
- CP_ERR_IO,
-
- /** Malformed plug-in descriptor was encountered when loading a plug-in */
- CP_ERR_MALFORMED,
-
- /** Plug-in or symbol conflicts with another plug-in or symbol. */
- CP_ERR_CONFLICT,
-
- /** Plug-in dependencies could not be satisfied. */
- CP_ERR_DEPENDENCY,
-
- /** Plug-in runtime signaled an error. */
- CP_ERR_RUNTIME
-
-};
-
-/**
- * @ingroup cEnums
- * An enumeration of possible plug-in states. Plug-in states are controlled
- * by @ref cFuncsPlugin "plug-in management functions". Plug-in states can be
- * observed by @ref cp_register_plistener "registering" a
- * @ref cp_plugin_listener_func_t "plug-in listener function"
- * or by calling ::cp_get_plugin_state.
- *
- * @sa cp_plugin_listener_t
- * @sa cp_get_plugin_state
- */
-enum cp_plugin_state_t {
-
- /**
- * Plug-in is not installed. No plug-in information has been
- * loaded.
- */
- CP_PLUGIN_UNINSTALLED,
-
- /**
- * Plug-in is installed. At this stage the plug-in information has
- * been loaded but its dependencies to other plug-ins has not yet
- * been resolved. The plug-in runtime has not been loaded yet.
- * The extension points and extensions provided by the plug-in
- * have been registered.
- */
- CP_PLUGIN_INSTALLED,
-
- /**
- * Plug-in dependencies have been resolved. At this stage it has
- * been verified that the dependencies of the plug-in are satisfied
- * and the plug-in runtime has been loaded but it is not active
- * (it has not been started or it has been stopped).
- * Plug-in is resolved when a dependent plug-in is being
- * resolved or before the plug-in is started. Plug-in is put
- * back to installed stage if its dependencies are being
- * uninstalled.
- */
- CP_PLUGIN_RESOLVED,
-
- /**
- * Plug-in is starting. The plug-in has been resolved and the start
- * function (if any) of the plug-in runtime is about to be called.
- * A plug-in is started when explicitly requested by the main
- * program or when a dependent plug-in is about to be started or when
- * a dynamic symbol defined by the plug-in is being resolved. This state
- * is omitted and the state changes directly from resolved to active
- * if the plug-in runtime does not define a start function.
- */
- CP_PLUGIN_STARTING,
-
- /**
- * Plug-in is stopping. The stop function (if any) of the plug-in
- * runtime is about to be called. A plug-in is stopped if the start
- * function fails or when stopping is explicitly
- * requested by the main program or when its dependencies are being
- * stopped. This state is omitted and the state changes directly from
- * active to resolved if the plug-in runtime does not define a stop
- * function.
- */
- CP_PLUGIN_STOPPING,
-
- /**
- * Plug-in has been successfully started and it has not yet been
- * stopped.
- */
- CP_PLUGIN_ACTIVE
-
-};
-
-/**
- * @ingroup cEnums
- * An enumeration of possible message severities for framework logging. These
- * constants are used when passing a log message to a
- * @ref cp_logger_func_t "logger function" and when
- * @ref cp_register_logger "registering" a logger function.
- */
-enum cp_log_severity_t {
-
- /** Used for detailed debug messages */
- CP_LOG_DEBUG,
-
- /** Used for informational messages such as plug-in state changes */
- CP_LOG_INFO,
-
- /** Used for messages warning about possible problems */
- CP_LOG_WARNING,
-
- /** Used for messages reporting errors */
- CP_LOG_ERROR
-
-};
-
-/*@}*/
-
-
-/* Typedefs */
-
-/**
- * @defgroup cTypedefsOpaque Opaque types
- * @ingroup cTypedefs
- * Opaque data type definitions.
- */
-/*@{*/
-
-/**
- * A plug-in context represents the co-operation environment of a set of
- * plug-ins from the perspective of a particular participating plug-in or
- * the perspective of the main program. It is used as an opaque handle to
- * the shared resources but the framework also uses the context to identify
- * the plug-in or the main program invoking framework functions. Therefore
- * a plug-in should not generally expose its context instance to other
- * plug-ins or the main program and neither should the main program
- * expose its context instance to plug-ins. The main program creates
- * plug-in contexts using ::cp_create_context and plug-ins receive their
- * plug-in contexts via @ref cp_plugin_runtime_t::create.
- */
-typedef struct cp_context_t cp_context_t;
-
-/*@}*/
-
- /**
- * @defgroup cTypedefsShorthand Shorthand type names
- * @ingroup cTypedefs
- * Shorthand type names for structs and enumerations.
- */
-/*@{*/
-
-/** A type for cp_plugin_info_t structure. */
-typedef struct cp_plugin_info_t cp_plugin_info_t;
-
-/** A type for cp_plugin_import_t structure. */
-typedef struct cp_plugin_import_t cp_plugin_import_t;
-
-/** A type for cp_ext_point_t structure. */
-typedef struct cp_ext_point_t cp_ext_point_t;
-
-/** A type for cp_extension_t structure. */
-typedef struct cp_extension_t cp_extension_t;
-
-/** A type for cp_cfg_element_t structure. */
-typedef struct cp_cfg_element_t cp_cfg_element_t;
-
-/** A type for cp_plugin_runtime_t structure. */
-typedef struct cp_plugin_runtime_t cp_plugin_runtime_t;
-
-/** A type for cp_status_t enumeration. */
-typedef enum cp_status_t cp_status_t;
-
-/** A type for cp_plugin_state_t enumeration. */
-typedef enum cp_plugin_state_t cp_plugin_state_t;
-
-/** A type for cp_log_severity_t enumeration. */
-typedef enum cp_log_severity_t cp_log_severity_t;
-
-/*@}*/
-
-/**
- * @defgroup cTypedefsFuncs Callback function types
- * @ingroup cTypedefs
- * Typedefs for client supplied callback functions.
- */
-/*@{*/
-
-/**
- * A listener function called synchronously after a plugin state change.
- * The function should return promptly.
- * @ref cFuncsInit "Library initialization",
- * @ref cFuncsContext "plug-in context management",
- * @ref cFuncsPlugin "plug-in management",
- * listener registration (::cp_register_plistener and ::cp_unregister_plistener)
- * and @ref cFuncsSymbols "dynamic symbol" functions must not be called from
- * within a plug-in listener invocation. Listener functions are registered
- * using ::cp_register_plistener.
- *
- * @param plugin_id the plug-in identifier
- * @param old_state the old plug-in state
- * @param new_state the new plug-in state
- * @param user_data the user data pointer supplied at listener registration
- */
-typedef void (*cp_plugin_listener_func_t)(const char *plugin_id, cp_plugin_state_t old_state, cp_plugin_state_t new_state, void *user_data);
-
-/**
- * A logger function called to log selected plug-in framework messages. The
- * messages may be localized. Plug-in framework API functions must not
- * be called from within a logger function invocation. In a multi-threaded
- * environment logger function invocations are serialized by the framework.
- * Logger functions are registered using ::cp_register_logger.
- *
- * @param severity the severity of the message
- * @param msg the message to be logged, possibly localized
- * @param apid the identifier of the activating plug-in or NULL for the main program
- * @param user_data the user data pointer given when the logger was registered
- */
-typedef void (*cp_logger_func_t)(cp_log_severity_t severity, const char *msg, const char *apid, void *user_data);
-
-/**
- * A fatal error handler for handling unrecoverable errors. If the error
- * handler returns then the framework aborts the program. Plug-in framework
- * API functions must not be called from within a fatal error handler
- * invocation. The fatal error handler function is set using
- * ::cp_set_fatal_error_handler.
- *
- * @param msg the possibly localized error message
- */
-typedef void (*cp_fatal_error_func_t)(const char *msg);
-
-/**
- * A run function registered by a plug-in to perform work.
- * The run function should perform a finite chunk of work and it should
- * return a non-zero value if there is more work to be done. Run functions
- * are registered using ::cp_run_function and the usage is discussed in
- * more detail in the @ref cFuncsPluginExec "serial execution" section.
- *
- * @param plugin_data the plug-in instance data pointer
- * @return non-zero if there is more work to be done or zero if finished
- */
-typedef int (*cp_run_func_t)(void *plugin_data);
-
-/*@}*/
-
-
-/* Data structures */
-
-/**
- * @ingroup cStructs
- * Plug-in information structure captures information about a plug-in. This
- * information can be loaded from a plug-in descriptor using
- * ::cp_load_plugin_descriptor. Information about installed plug-ins can
- * be obtained using ::cp_get_plugin_info and ::cp_get_plugins_info. This
- * structure corresponds to the @a plugin element in a plug-in descriptor.
- */
-struct cp_plugin_info_t {
-
- /**
- * The obligatory unique identifier of the plugin. A recommended way
- * to generate identifiers is to use domain name service (DNS) prefixes
- * (for example, org.cpluff.ExamplePlugin) to avoid naming conflicts. This
- * corresponds to the @a id attribute of the @a plugin element in a plug-in
- * descriptor.
- */
- char *identifier;
-
- /**
- * A mandatory summary of the addon's features.
- * This corresponds to the @a summary attribute of the @a plugin element in
- * a plug-in descriptor.
- */
- char *summary;
-
- /**
- * An optional plug-in name. NULL if not available. The plug-in name is
- * intended only for display purposes and the value can be localized.
- * This corresponds to the @a name attribute of the @a plugin element in
- * a plug-in descriptor.
- */
- char *name;
-
- /**
- * An optional release version string. NULL if not available. This
- * corresponds to the @a version attribute of the @a plugin element in
- * a plug-in descriptor.
- */
- char *version;
-
- /**
- * An optional provider name. NULL if not available. This is the name of
- * the author or the organization providing the plug-in. The
- * provider name is intended only for display purposes and the value can
- * be localized. This corresponds to the @a provider-name attribute of the
- * @a plugin element in a plug-in descriptor.
- */
- char *provider_name;
-
- /**
- * Path of the plugin directory or NULL if not known. This is the
- * (absolute or relative) path to the plug-in directory containing
- * plug-in data and the plug-in runtime library. The value corresponds
- * to the path specified to ::cp_load_plugin_descriptor when loading
- * the plug-in.
- */
- char *plugin_path;
-
- /**
- * Optional ABI compatibility information. NULL if not available.
- * This is the earliest version of the plug-in interface the current
- * interface is backwards compatible with when it comes to the application
- * binary interface (ABI) of the plug-in. That is, plug-in clients compiled against
- * any plug-in interface version from @a abi_bw_compatibility to
- * @ref version (inclusive) can use the current version of the plug-in
- * binary. This describes binary or runtime compatibility.
- * The value corresponds to the @a abi-compatibility
- * attribute of the @a backwards-compatibility element in a plug-in descriptor.
- */
- char *abi_bw_compatibility;
-
- /**
- * Optional API compatibility information. NULL if not available.
- * This is the earliest version of the plug-in interface the current
- * interface is backwards compatible with when it comes to the
- * application programming interface (API) of the plug-in. That is,
- * plug-in clients written for any plug-in interface version from
- * @a api_bw_compatibility to @ref version (inclusive) can be compiled
- * against the current version of the plug-in API. This describes
- * source or build time compatibility. The value corresponds to the
- * @a api-compatibility attribute of the @a backwards-compatibility
- * element in a plug-in descriptor.
- */
- char *api_bw_compatibility;
-
- /**
- * Optional C-Pluff version requirement. NULL if not available.
- * This is the version of the C-Pluff implementation the plug-in was
- * compiled against. It is used to determine the compatibility of
- * the plug-in runtime and the linked in C-Pluff implementation. Any
- * C-Pluff version that is backwards compatible on binary level with the
- * specified version fulfills the requirement.
- */
- char *req_cpluff_version;
-
- /** Number of import entries in the @ref imports array. */
- unsigned int num_imports;
-
- /**
- * An array of @ref num_imports import entries. These correspond to
- * @a import elements in a plug-in descriptor.
- */
- cp_plugin_import_t *imports;
-
- /**
- * The base name of the plug-in runtime library, or NULL if none.
- * A platform specific prefix (for example, "lib") and an extension
- * (for example, ".dll" or ".so") may be added to the base name.
- * This corresponds to the @a library attribute of the
- * @a runtime element in a plug-in descriptor.
- */
- char *runtime_lib_name;
-
- /**
- * The symbol pointing to the plug-in runtime function information or
- * NULL if none. The symbol with this name should point to an instance of
- * @ref cp_plugin_runtime_t structure. This corresponds to the
- * @a funcs attribute of the @a runtime element in a plug-in descriptor.
- */
- char *runtime_funcs_symbol;
-
- /** Number of extension points in @ref ext_points array. */
- unsigned int num_ext_points;
-
- /**
- * An array of @ref num_ext_points extension points provided by this
- * plug-in. These correspond to @a extension-point elements in a
- * plug-in descriptor.
- */
- cp_ext_point_t *ext_points;
-
- /** Number of extensions in @ref extensions array. */
- unsigned int num_extensions;
-
- /**
- * An array of @ref num_extensions extensions provided by this
- * plug-in. These correspond to @a extension elements in a plug-in
- * descriptor.
- */
- cp_extension_t *extensions;
-
-};
-
-/**
- * @ingroup cStructs
- * Information about plug-in import. Plug-in import structures are
- * contained in @ref cp_plugin_info_t::imports.
- */
-struct cp_plugin_import_t {
-
- /**
- * The identifier of the imported plug-in. This corresponds to the
- * @a plugin attribute of the @a import element in a plug-in descriptor.
- */
- char *plugin_id;
-
- /**
- * An optional version requirement. NULL if no version requirement.
- * This is the version of the imported plug-in the importing plug-in was
- * compiled against. Any version of the imported plug-in that is
- * backwards compatible with this version fulfills the requirement.
- * This corresponds to the @a if-version attribute of the @a import
- * element in a plug-in descriptor.
- */
- char *version;
-
- /**
- * Is this import optional. 1 for optional and 0 for mandatory import.
- * An optional import causes the imported plug-in to be started if it is
- * available but does not stop the importing plug-in from starting if the
- * imported plug-in is not available. If the imported plug-in is available
- * but the API version conflicts with the API version requirement then the
- * importing plug-in fails to start. This corresponds to the @a optional
- * attribute of the @a import element in a plug-in descriptor.
- */
- int optional;
-};
-
-/**
- * @ingroup cStructs
- * Extension point structure captures information about an extension
- * point. Extension point structures are contained in
- * @ref cp_plugin_info_t::ext_points.
- */
-struct cp_ext_point_t {
-
- /**
- * A pointer to plug-in information containing this extension point.
- * This reverse pointer is provided to make it easy to get information
- * about the plug-in which is hosting a particular extension point.
- */
- cp_plugin_info_t *plugin;
-
- /**
- * The local identifier uniquely identifying the extension point within the
- * host plug-in. This corresponds to the @name id attribute of an
- * @a extension-point element in a plug-in descriptor.
- */
- char *local_id;
-
- /**
- * The unique identifier of the extension point. This is automatically
- * constructed by concatenating the identifier of the host plug-in and
- * the local identifier of the extension point.
- */
- char *identifier;
-
- /**
- * An optional extension point name. NULL if not available. The extension
- * point name is intended for display purposes only and the value can be
- * localized. This corresponds to the @a name attribute of
- * an @a extension-point element in a plug-in descriptor.
- */
- char *name;
-
- /**
- * An optional path to the extension schema definition.
- * NULL if not available. The path is relative to the plug-in directory.
- * This corresponds to the @a schema attribute
- * of an @a extension-point element in a plug-in descriptor.
- */
- char *schema_path;
-};
-
-/**
- * @ingroup cStructs
- * Extension structure captures information about an extension. Extension
- * structures are contained in @ref cp_plugin_info_t::extensions.
- */
-struct cp_extension_t {
-
- /**
- * A pointer to plug-in information containing this extension.
- * This reverse pointer is provided to make it easy to get information
- * about the plug-in which is hosting a particular extension.
- */
- cp_plugin_info_t *plugin;
-
- /**
- * The unique identifier of the extension point this extension is
- * attached to. This corresponds to the @a point attribute of an
- * @a extension element in a plug-in descriptor.
- */
- char *ext_point_id;
-
- /**
- * An optional local identifier uniquely identifying the extension within
- * the host plug-in. NULL if not available. This corresponds to the
- * @a id attribute of an @a extension element in a plug-in descriptor.
- */
- char *local_id;
-
- /**
- * An optional unique identifier of the extension. NULL if not available.
- * This is automatically constructed by concatenating the identifier
- * of the host plug-in and the local identifier of the extension.
- */
- char *identifier;
-
- /**
- * An optional extension name. NULL if not available. The extension name
- * is intended for display purposes only and the value can be localized.
- * This corresponds to the @a name attribute
- * of an @a extension element in a plug-in descriptor.
- **/
- char *name;
-
- /**
- * Extension configuration starting with the extension element.
- * This includes extension configuration information as a tree of
- * configuration elements. These correspond to the @a extension
- * element and its contents in a plug-in descriptor.
- */
- cp_cfg_element_t *configuration;
-};
-
-/**
- * @ingroup cStructs
- * A configuration element contains configuration information for an
- * extension. Utility functions ::cp_lookup_cfg_element and
- * ::cp_lookup_cfg_value can be used for traversing the tree of
- * configuration elements. Pointer to the root configuration element is
- * stored at @ref cp_extension_t::configuration and others are contained as
- * @ref cp_cfg_element_t::children "children" of parent elements.
- */
-struct cp_cfg_element_t {
-
- /**
- * The name of the configuration element. This corresponds to the name of
- * the element in a plug-in descriptor.
- */
- char *name;
-
- /** Number of attribute name, value pairs in the @ref atts array. */
- unsigned int num_atts;
-
- /**
- * An array of pointers to alternating attribute names and values.
- * Attribute values can be localized.
- */
- char **atts;
-
- /**
- * An optional value of this configuration element. NULL if not available.
- * The value can be localized. This corresponds to the
- * text contents of the element in a plug-in descriptor.
- */
- char *value;
-
- /** A pointer to the parent element or NULL if this is a root element. */
- cp_cfg_element_t *parent;
-
- /** The index of this element among its siblings (0-based). */
- unsigned int index;
-
- /** Number of children in the @ref children array. */
- unsigned int num_children;
-
- /**
- * An array of @ref num_children childrens of this element. These
- * correspond to child elements in a plug-in descriptor.
- */
- cp_cfg_element_t *children;
-};
-
-/**
- * @ingroup cStructs
- * Container for plug-in runtime information. A plug-in runtime defines a
- * static instance of this structure to pass information to the plug-in
- * framework. The plug-in framework then uses the information
- * to create and control plug-in instances. The symbol pointing
- * to the runtime information instance is named by the @a funcs
- * attribute of the @a runtime element in a plug-in descriptor.
- *
- * The following graph displays how these functions are used to control the
- * state of the plug-in instance.
- *
- * @dot
- * digraph lifecycle {
- * rankdir=LR;
- * node [shape=ellipse, fontname=Helvetica, fontsize=10];
- * edge [fontname=Helvetica, fontsize=10];
- * none [label="no instance"];
- * inactive [label="inactive"];
- * active [label="active"];
- * none -> inactive [label="create", URL="\ref create"];
- * inactive -> active [label="start", URL="\ref start"];
- * active -> inactive [label="stop", URL="\ref stop"];
- * inactive -> none [label="destroy", URL="\ref destroy"];
- * }
- * @enddot
- */
-struct cp_plugin_runtime_t {
-
- /**
- * An initialization function called to create a new plug-in
- * runtime instance. The initialization function initializes and
- * returns an opaque plug-in instance data pointer which is then
- * passed on to other control functions. This data pointer should
- * be used to access plug-in instance specific data. For example,
- * the context reference must be stored as part of plug-in instance
- * data if the plug-in runtime needs it. On failure, the function
- * must return NULL.
- *
- * C-pluff API functions must not be called from within a create
- * function invocation and symbols from imported plug-ins must not be
- * used because they may not available yet.
- *
- * @param ctx the plug-in context of the new plug-in instance
- * @return an opaque pointer to plug-in instance data or NULL on failure
- */
- void *(*create)(cp_context_t *ctx);
-
- /**
- * A start function called to start a plug-in instance.
- * The start function must return zero (CP_OK) on success and non-zero
- * on failure. If the start fails then the stop function (if any) is
- * called to clean up plug-in state. @ref cFuncsInit "Library initialization",
- * @ref cFuncsContext "plug-in context management" and
- * @ref cFuncsPlugin "plug-in management" functions must not be
- * called from within a start function invocation. The start function
- * pointer can be NULL if the plug-in runtime does not have a start
- * function.
- *
- * The start function implementation should set up plug-in and return
- * promptly. If there is further work to be done then a plug-in can
- * start a thread or register a run function using ::cp_run_function.
- * Symbols from imported plug-ins are guaranteed to be available for
- * the start function.
- *
- * @param data an opaque pointer to plug-in instance data
- * @return non-zero on success, or zero on failure
- */
- int (*start)(void *data);
-
- /**
- * A stop function called to stop a plugin instance.
- * This function must cease all plug-in runtime activities.
- * @ref cFuncsInit "Library initialization",
- * @ref cFuncsContext "plug-in context management",
- * @ref cFuncsPlugin "plug-in management"
- * functions, ::cp_run_function and ::cp_resolve_symbol must not be called
- * from within a stop function invocation. The stop function pointer can
- * be NULL if the plug-in runtime does not have a stop function.
- * It is guaranteed that no run functions registered by the plug-in are
- * called simultaneously or after the call to the stop function.
- *
- * The stop function should release any external resources hold by
- * the plug-in. Dynamically resolved symbols are automatically released
- * and dynamically defined symbols and registered run functions are
- * automatically unregistered after the call to stop function.
- * Resolved external symbols are still available for the stop function
- * and symbols provided by the plug-in should remain available
- * after the call to stop function (although functionality might be
- * limited). Final cleanup can be safely done in the destroy function.
- *
- * @param data an opaque pointer to plug-in instance data
- */
- void (*stop)(void *data);
-
- /**
- * A destroy function called to destroy a plug-in instance.
- * This function should release any plug-in instance data.
- * The plug-in is stopped before this function is called.
- * C-Pluff API functions must not be called from within a destroy
- * function invocation and symbols from imported plug-ins must not be
- * used because they may not be available anymore. Correspondingly,
- * it is guaranteed that the symbols provided by the plug-in are not
- * used by other plug-ins when destroy function has been called.
- *
- * @param data an opaque pointer to plug-in instance data
- */
- void (*destroy)(void *data);
-
-};
-
-/*@}*/
-
-
-/* ------------------------------------------------------------------------
- * Function declarations
- * ----------------------------------------------------------------------*/
-
-/**
- * @defgroup cFuncs Functions