blueZync

Synchronize Bluetooth phone with Thunderbird

Develpers' detailed documentation for the mozilla-sync plugin for OpenSync. A part of blueZync.

mozilla-config.cpp File Reference


Detailed Description

Functions to to extract Plugin configuration into configuration for mozilla-sync.

#include <string.h>
#include <glib.h>
#include "mozilla-sync-utils.h"
#include "mozilla-config.h"

Include dependency graph for mozilla-config.cpp:


Defines

#define THUNDERBIRD_DEFAULT_CONFIG_SUBDIR   ".mozilla-thunderbird"

Functions

static gboolean find_default_profile_directory (char **szFoundProfileDirectory, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
gboolean mozilla_config_check (MozillaConfig *pMozillaConfig, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
gboolean mozilla_config_extract (OSyncPluginConfig *pOSyncPluginConfig, MozillaConfig *pMozillaConfig, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
static gboolean try_find_profile_directory (char **szFoundProfileDirectory, const char *szTrySubDir, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))

Define Documentation

#define THUNDERBIRD_DEFAULT_CONFIG_SUBDIR   ".mozilla-thunderbird"

Default subdirectory where we expect to find profiles

Referenced by find_default_profile_directory().


Function Documentation

static gboolean find_default_profile_directory ( char **  szFoundProfileDirectory,
char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
) [static]

Try to find default profile directory

Makes XML attribute: "profile-directory" optional, for those that have something else than the default.

Contributed by Patrick Ammann

Parameters:
szFoundProfileDirectory The profile directory found (if returns TRUE)
pSzError Pointer to string, into which we shall write an error message if we return false
pLogFunction Function used to log information text
Returns:
TRUE if default profile directory found; FALSE otherwise

References LOG, THUNDERBIRD_DEFAULT_CONFIG_SUBDIR, and try_find_profile_directory().

Referenced by mozilla_config_extract().

Here is the call graph for this function:

gboolean mozilla_config_check ( MozillaConfig pMozillaConfig,
char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Very brief check of the validity of a mozilla-sync configuration

Basically, just check that files and directories are really there

Parameters:
pMozillaConfig The configuration we shall check
pSzError Pointer to string, into which we shall write an error message if we return false
pLogFunction Function used to log information text
Returns:
TRUE on success; FALSE on error

References ERROR, GFREE, LOG, _MozillaConfig::szAddressbookFile, and _MozillaConfig::szProfileDirectory.

Referenced by main(), and mozilla_sync_initialize().

gboolean mozilla_config_extract ( OSyncPluginConfig *  pOSyncPluginConfig,
MozillaConfig pMozillaConfig,
char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Extract information from Plugin Configuration into configuration for mozilla-sync

Parameters:
pOSyncPluginConfig The Plugin Configuration from OpenSync
pMozillaConfig The mozilla-sync configuration we shall fill out
pSzError Pointer to string, into which we shall write an error message if we return false
pLogFunction Function used to log information text
Returns:
TRUE on success; FALSE on error

References ERROR, find_default_profile_directory(), LOG, _MozillaConfig::szAddressbookFile, _MozillaConfig::szCalendarId, _MozillaConfig::szProfileDirectory, and _MozillaConfig::thunderbirdAddressbook.

Referenced by mozilla_sync_initialize().

Here is the call graph for this function:

static gboolean try_find_profile_directory ( char **  szFoundProfileDirectory,
const char *  szTrySubDir,
char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
) [static]

Try to find default profile directory in given subdirectory

Makes XML attribute: "profile-directory" optional, for those that have something else than the default.

Contributed by Patrick Ammann

Parameters:
szFoundProfileDirectory The profile directory found (if returns TRUE)
szTrySubDir Name of subdirectory (under user's home) where profiles are sought
pSzError Pointer to string, into which we shall write an error message if we return false
pLogFunction Function used to log information text
Returns:
TRUE if default profile directory found; FALSE otherwise

Referenced by find_default_profile_directory().