gwenhywfar 5.14.1
plugindescr.c File Reference
#include "plugindescr_p.h"
#include "i18n_l.h"
#include <gwenhywfar/buffer.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/directory.h>
#include <gwenhywfar/i18n.h>
Include dependency graph for plugindescr.c:

Go to the source code of this file.

Macros

#define DISABLE_DEBUGLOG

Functions

static int _getLocalizedLongDescrByFormat (const GWEN_PLUGIN_DESCRIPTION *pd, const char *s, const char *lang, GWEN_BUFFER *buf)
static GWEN_XMLNODE_getLocalOrMainPluginNode (GWEN_XMLNODE *pluginDescrNode)
static int _getLongDescrByFormat (const GWEN_PLUGIN_DESCRIPTION *pd, const char *s, GWEN_BUFFER *buf)
GWEN_PLUGIN_DESCRIPTION_pdList2_freeAll_cb (GWEN_PLUGIN_DESCRIPTION *pd, GWEN_UNUSED void *user_data)
static GWEN_PLUGIN_DESCRIPTION_pdList2_freeAll_cb (GWEN_PLUGIN_DESCRIPTION *pd, void *)
static GWEN_PLUGIN_DESCRIPTION_readPluginDescriptionFromFile (const char *folder, const char *fullFileName, const char *pluginType)
GWEN_PLUGIN_DESCRIPTION_LIST2GWEN_LoadPluginDescrs (const char *path)
int GWEN_LoadPluginDescrsByType (const char *folder, const char *pluginType, GWEN_PLUGIN_DESCRIPTION_LIST2 *pdl)
void GWEN_PluginDescription_Attach (GWEN_PLUGIN_DESCRIPTION *pd)
GWEN_PLUGIN_DESCRIPTIONGWEN_PluginDescription_dup (const GWEN_PLUGIN_DESCRIPTION *pd)
void GWEN_PluginDescription_free (GWEN_PLUGIN_DESCRIPTION *pd)
GWEN_PLUGIN_DESCRIPTIONGWEN_PluginDescription_fromXml (GWEN_XMLNODE *node)
const char * GWEN_PluginDescription_GetAuthor (const GWEN_PLUGIN_DESCRIPTION *pd)
const char * GWEN_PluginDescription_GetFileName (const GWEN_PLUGIN_DESCRIPTION *pd)
const char * GWEN_PluginDescription_GetLongDescr (const GWEN_PLUGIN_DESCRIPTION *pd)
int GWEN_PluginDescription_GetLongDescrByFormat (const GWEN_PLUGIN_DESCRIPTION *pd, const char *s, GWEN_BUFFER *buf)
const char * GWEN_PluginDescription_GetName (const GWEN_PLUGIN_DESCRIPTION *pd)
const char * GWEN_PluginDescription_GetPath (const GWEN_PLUGIN_DESCRIPTION *pd)
const char * GWEN_PluginDescription_GetShortDescr (const GWEN_PLUGIN_DESCRIPTION *pd)
const char * GWEN_PluginDescription_GetType (const GWEN_PLUGIN_DESCRIPTION *pd)
const char * GWEN_PluginDescription_GetVersion (const GWEN_PLUGIN_DESCRIPTION *pd)
GWEN_XMLNODEGWEN_PluginDescription_GetXmlNode (const GWEN_PLUGIN_DESCRIPTION *pd)
int GWEN_PluginDescription_IsActive (const GWEN_PLUGIN_DESCRIPTION *pd)
void GWEN_PluginDescription_List2_freeAll (GWEN_PLUGIN_DESCRIPTION_LIST2 *pdl)
GWEN_PLUGIN_DESCRIPTIONGWEN_PluginDescription_new (void)
void GWEN_PluginDescription_SetAuthor (GWEN_PLUGIN_DESCRIPTION *pd, const char *s)
void GWEN_PluginDescription_SetFileName (GWEN_PLUGIN_DESCRIPTION *pd, const char *s)
void GWEN_PluginDescription_SetIsActive (GWEN_PLUGIN_DESCRIPTION *pd, int i)
void GWEN_PluginDescription_SetLongDescr (GWEN_PLUGIN_DESCRIPTION *pd, const char *s)
void GWEN_PluginDescription_SetName (GWEN_PLUGIN_DESCRIPTION *pd, const char *s)
void GWEN_PluginDescription_SetPath (GWEN_PLUGIN_DESCRIPTION *pd, const char *s)
void GWEN_PluginDescription_SetShortDescr (GWEN_PLUGIN_DESCRIPTION *pd, const char *s)
void GWEN_PluginDescription_SetType (GWEN_PLUGIN_DESCRIPTION *pd, const char *s)
void GWEN_PluginDescription_SetVersion (GWEN_PLUGIN_DESCRIPTION *pd, const char *s)

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 29 of file plugindescr.c.

Function Documentation

◆ _getLocalizedLongDescrByFormat()

int _getLocalizedLongDescrByFormat ( const GWEN_PLUGIN_DESCRIPTION * pd,
const char * s,
const char * lang,
GWEN_BUFFER * buf )
static

Definition at line 368 of file plugindescr.c.

References DBG_INFO, fmt, GWEN_ERROR_GENERIC, GWEN_LOGDOMAIN, GWEN_XML_FLAGS_TOLERANT_ENDTAGS, GWEN_XMLNode_FindFirstTag(), GWEN_XMLNode_FindNextTag(), GWEN_XMLNode_GetProperty(), and GWEN_XMLNode_toBuffer().

Referenced by GWEN_PluginDescription_GetLongDescrByFormat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _getLocalOrMainPluginNode()

GWEN_XMLNODE * _getLocalOrMainPluginNode ( GWEN_XMLNODE * pluginDescrNode)
static

Definition at line 622 of file plugindescr.c.

References DBG_DEBUG, GWEN_I18N_GetCurrentLocaleList(), GWEN_LOGDOMAIN, GWEN_StringList_FirstEntry(), GWEN_StringListEntry_Data(), GWEN_StringListEntry_Next(), GWEN_XMLNode_FindFirstTag(), and NULL.

Referenced by _pdList2_freeAll_cb(), and _readPluginDescriptionFromFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _getLongDescrByFormat()

int _getLongDescrByFormat ( const GWEN_PLUGIN_DESCRIPTION * pd,
const char * s,
GWEN_BUFFER * buf )
static

Definition at line 338 of file plugindescr.c.

References DBG_INFO, GWEN_ERROR_GENERIC, GWEN_LOGDOMAIN, GWEN_XML_FLAGS_TOLERANT_ENDTAGS, GWEN_XMLNode_FindFirstTag(), GWEN_XMLNode_FindNextTag(), GWEN_XMLNode_GetProperty(), and GWEN_XMLNode_toBuffer().

Referenced by _pdList2_freeAll_cb(), and GWEN_PluginDescription_GetLongDescrByFormat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _pdList2_freeAll_cb() [1/2]

GWEN_PLUGIN_DESCRIPTION * _pdList2_freeAll_cb ( GWEN_PLUGIN_DESCRIPTION * pd,
GWEN_UNUSED void * user_data )

Definition at line 200 of file plugindescr.c.

References GWEN_PluginDescription_free(), and GWEN_UNUSED.

Here is the call graph for this function:

◆ _pdList2_freeAll_cb() [2/2]

GWEN_PLUGIN_DESCRIPTION * _pdList2_freeAll_cb ( GWEN_PLUGIN_DESCRIPTION * pd,
void *  )
static

References _getLocalOrMainPluginNode(), _getLongDescrByFormat(), _pdList2_freeAll_cb(), and _readPluginDescriptionFromFile().

Referenced by _pdList2_freeAll_cb(), and GWEN_PluginDescription_List2_freeAll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _readPluginDescriptionFromFile()

◆ GWEN_LoadPluginDescrs()

GWEN_PLUGIN_DESCRIPTION_LIST2 * GWEN_LoadPluginDescrs ( const char * path)

◆ GWEN_LoadPluginDescrsByType()

int GWEN_LoadPluginDescrsByType ( const char * path,
const char * type,
GWEN_PLUGIN_DESCRIPTION_LIST2 * pdl )

Loads a list of plugins descriptions. When parsing the description files entries for the current language will be selected. The current language can be set via GWEN_I18N_SetLocale.

Parameters
pathfolder to search for XML files
typeplugin type (property "type" of tag "plugin")
pdlplugin descriptions list2 to load descriptions to

Definition at line 500 of file plugindescr.c.

References _readPluginDescriptionFromFile(), DBG_INFO, GWEN_Buffer_AppendString(), GWEN_Buffer_Crop(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_new(), GWEN_Buffer_SetPos(), GWEN_DIR_SEPARATOR_S, GWEN_Directory_GetFileEntries(), GWEN_LOGDOMAIN, GWEN_PluginDescription_GetName(), GWEN_PluginDescription_List2_PushBack(), GWEN_StringList_Count(), GWEN_StringList_FirstEntry(), GWEN_StringList_free(), GWEN_StringList_new(), GWEN_StringListEntry_Data(), and GWEN_StringListEntry_Next().

Referenced by _loadPluginDescrs(), and GWEN_LoadPluginDescrs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_PluginDescription_Attach()

void GWEN_PluginDescription_Attach ( GWEN_PLUGIN_DESCRIPTION * pd)

Definition at line 142 of file plugindescr.c.

Referenced by _combinedPluginDescrList(), and GWEN_PluginManager_GetPluginDescr().

Here is the caller graph for this function:

◆ GWEN_PluginDescription_dup()

GWEN_PLUGIN_DESCRIPTION * GWEN_PluginDescription_dup ( const GWEN_PLUGIN_DESCRIPTION * pd)

Definition at line 151 of file plugindescr.c.

References DBG_MEM_INC, GWEN_LIST_INIT, GWEN_NEW_OBJECT, and GWEN_XMLNode_dup().

Referenced by _getPluginDescrsFromPluginList(), and GWEN_Crypt_Token_PluginManager_GetPluginDescrs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_PluginDescription_free()

void GWEN_PluginDescription_free ( GWEN_PLUGIN_DESCRIPTION * pd)

Definition at line 115 of file plugindescr.c.

References DBG_MEM_DEC, GWEN_FREE_OBJECT, GWEN_LIST_FINI, and GWEN_XMLNode_free().

Referenced by _pdList2_freeAll_cb(), GWEN_Plugin_free(), GWEN_Plugin_SetPluginDescription(), and GWEN_PluginDescription_fromXml().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_PluginDescription_fromXml()

GWEN_PLUGIN_DESCRIPTION * GWEN_PluginDescription_fromXml ( GWEN_XMLNODE * node)

Definition at line 68 of file plugindescr.c.

References DBG_ERROR, DBG_NOTICE, GWEN_LOGDOMAIN, GWEN_PluginDescription_free(), GWEN_PluginDescription_new(), GWEN_XMLNode_dup(), GWEN_XMLNode_GetCharValue(), GWEN_XMLNode_GetProperty(), and NULL.

Referenced by _readPluginDescriptionFromFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_PluginDescription_GetAuthor()

const char * GWEN_PluginDescription_GetAuthor ( const GWEN_PLUGIN_DESCRIPTION * pd)

Definition at line 287 of file plugindescr.c.

◆ GWEN_PluginDescription_GetFileName()

const char * GWEN_PluginDescription_GetFileName ( const GWEN_PLUGIN_DESCRIPTION * pd)

Definition at line 440 of file plugindescr.c.

◆ GWEN_PluginDescription_GetLongDescr()

const char * GWEN_PluginDescription_GetLongDescr ( const GWEN_PLUGIN_DESCRIPTION * pd)

Definition at line 321 of file plugindescr.c.

References GWEN_I18N_Translate().

Here is the call graph for this function:

◆ GWEN_PluginDescription_GetLongDescrByFormat()

int GWEN_PluginDescription_GetLongDescrByFormat ( const GWEN_PLUGIN_DESCRIPTION * pd,
const char * s,
GWEN_BUFFER * buf )

Seeks for a long description with the given format and the currently selected locale and appends it to the data in the given buffer.

The DESCR tag of the plugin description is expected to contain sub tags named TEXT with the property "FORMAT" describing the format and "LANG" containing the language of the element.

Currently supported format is "html".

Returns
0 if ok, !=0 on error
Parameters
pdplugin description
sname of the format (e.g. html)
bufbuffer to append the description to

Definition at line 402 of file plugindescr.c.

References _getLocalizedLongDescrByFormat(), _getLongDescrByFormat(), DBG_INFO, DBG_NOTICE, GWEN_I18N_GetCurrentLocaleList(), GWEN_LOGDOMAIN, GWEN_StringList_FirstEntry(), GWEN_StringListEntry_Data(), and GWEN_StringListEntry_Next().

Here is the call graph for this function:

◆ GWEN_PluginDescription_GetName()

const char * GWEN_PluginDescription_GetName ( const GWEN_PLUGIN_DESCRIPTION * pd)

Definition at line 236 of file plugindescr.c.

Referenced by _combinedPluginDescrList(), _findPluginDescrByNameInList2(), GWEN_Crypt_Token_PluginManager_CheckToken(), and GWEN_LoadPluginDescrsByType().

Here is the caller graph for this function:

◆ GWEN_PluginDescription_GetPath()

const char * GWEN_PluginDescription_GetPath ( const GWEN_PLUGIN_DESCRIPTION * pd)

Definition at line 216 of file plugindescr.c.

◆ GWEN_PluginDescription_GetShortDescr()

const char * GWEN_PluginDescription_GetShortDescr ( const GWEN_PLUGIN_DESCRIPTION * pd)

Definition at line 270 of file plugindescr.c.

References GWEN_I18N_Translate().

Here is the call graph for this function:

◆ GWEN_PluginDescription_GetType()

const char * GWEN_PluginDescription_GetType ( const GWEN_PLUGIN_DESCRIPTION * pd)

Definition at line 253 of file plugindescr.c.

◆ GWEN_PluginDescription_GetVersion()

const char * GWEN_PluginDescription_GetVersion ( const GWEN_PLUGIN_DESCRIPTION * pd)

Definition at line 304 of file plugindescr.c.

◆ GWEN_PluginDescription_GetXmlNode()

GWEN_XMLNODE * GWEN_PluginDescription_GetXmlNode ( const GWEN_PLUGIN_DESCRIPTION * pd)

Returns the XML node this description consists of (the "plugin" node). It may contain additional information used by programs. This function does not relinquish ownership of the returned pointer, so you MUST NOT free it. As soon as the description itself is destroyed this XML node will be, too. So you have to call GWEN_XMLNode_dup() if you want the XML node to survive the description.

Definition at line 460 of file plugindescr.c.

Referenced by GWEN_Crypt_Token_PluginManager_CheckToken(), and GWEN_Crypt_Token_PluginManager_GetPluginDescrs().

Here is the caller graph for this function:

◆ GWEN_PluginDescription_IsActive()

int GWEN_PluginDescription_IsActive ( const GWEN_PLUGIN_DESCRIPTION * pd)

Definition at line 484 of file plugindescr.c.

◆ GWEN_PluginDescription_List2_freeAll()

void GWEN_PluginDescription_List2_freeAll ( GWEN_PLUGIN_DESCRIPTION_LIST2 * pdl)

◆ GWEN_PluginDescription_new()

GWEN_PLUGIN_DESCRIPTION * GWEN_PluginDescription_new ( void )

Definition at line 55 of file plugindescr.c.

References DBG_MEM_INC, GWEN_LIST_INIT, GWEN_NEW_OBJECT, and GWEN_PluginDescription_new().

Referenced by _createPluginFromLibloader(), GWEN_PluginDescription_fromXml(), GWEN_PluginDescription_new(), and GWEN_PluginManager_AddPlugin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_PluginDescription_SetAuthor()

void GWEN_PluginDescription_SetAuthor ( GWEN_PLUGIN_DESCRIPTION * pd,
const char * s )

Definition at line 295 of file plugindescr.c.

References NULL.

◆ GWEN_PluginDescription_SetFileName()

void GWEN_PluginDescription_SetFileName ( GWEN_PLUGIN_DESCRIPTION * pd,
const char * s )

Definition at line 448 of file plugindescr.c.

Referenced by _readPluginDescriptionFromFile().

Here is the caller graph for this function:

◆ GWEN_PluginDescription_SetIsActive()

void GWEN_PluginDescription_SetIsActive ( GWEN_PLUGIN_DESCRIPTION * pd,
int i )

Definition at line 492 of file plugindescr.c.

◆ GWEN_PluginDescription_SetLongDescr()

void GWEN_PluginDescription_SetLongDescr ( GWEN_PLUGIN_DESCRIPTION * pd,
const char * s )

Definition at line 329 of file plugindescr.c.

References NULL.

◆ GWEN_PluginDescription_SetName()

void GWEN_PluginDescription_SetName ( GWEN_PLUGIN_DESCRIPTION * pd,
const char * s )

Definition at line 244 of file plugindescr.c.

References NULL.

Referenced by _createPluginFromLibloader(), and GWEN_PluginManager_AddPlugin().

Here is the caller graph for this function:

◆ GWEN_PluginDescription_SetPath()

void GWEN_PluginDescription_SetPath ( GWEN_PLUGIN_DESCRIPTION * pd,
const char * s )

Definition at line 224 of file plugindescr.c.

Referenced by _readPluginDescriptionFromFile().

Here is the caller graph for this function:

◆ GWEN_PluginDescription_SetShortDescr()

void GWEN_PluginDescription_SetShortDescr ( GWEN_PLUGIN_DESCRIPTION * pd,
const char * s )

Definition at line 278 of file plugindescr.c.

References NULL.

◆ GWEN_PluginDescription_SetType()

void GWEN_PluginDescription_SetType ( GWEN_PLUGIN_DESCRIPTION * pd,
const char * s )

Definition at line 261 of file plugindescr.c.

References NULL.

Referenced by _createPluginFromLibloader(), and GWEN_PluginManager_AddPlugin().

Here is the caller graph for this function:

◆ GWEN_PluginDescription_SetVersion()

void GWEN_PluginDescription_SetVersion ( GWEN_PLUGIN_DESCRIPTION * pd,
const char * s )

Definition at line 312 of file plugindescr.c.

References NULL.