blueZync

Synchronize Bluetooth phone with Thunderbird

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

mozilla-xpcom.cpp File Reference


Detailed Description

Functions for hooking up to XPCOM.

Todo:
Check which ADDREF's are missing

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <limits.h>
#include <dlfcn.h>
#include <link.h>
#include "mozilla-headers.h"
#include <nsILocalFile.h>
#include <nsIServiceManager.h>
#include <nsIComponentRegistrar.h>
#include <nsIDirectoryService.h>
#include <nsDirectoryServiceDefs.h>
#include <nsISimpleEnumerator.h>
#include <nsISupportsPrimitives.h>
#include <nsIEventQueueService.h>
#include <nsIXULAppInfo.h>
#include <nsIExtensionManager.h>
#include "nsProfileDirServiceProvider.h"
#include "mozilla-sync-utils.h"
#include "mozilla-xpcom.h"

Include dependency graph for mozilla-xpcom.cpp:


Functions

gboolean mozilla_getversion (void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
gboolean mozilla_log_info (char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Print a bit of info on XPCOM in the log.
gboolean mozilla_shutdown (char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Finalize the use of XPCOM.
gboolean mozilla_startup (const char *szProfileDirectory, gboolean *pWasStarted, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Initialize the use of XPCOM.
gboolean visitor (gpointer key, gpointer value, gpointer data)
 Visitor for GTree g_tree_foreach.

Function Documentation

gboolean mozilla_getversion ( void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction  ) 

References LOG.

Referenced by mozilla_startup().

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

Print a bit of info on XPCOM in the log.

Parameters:
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 LOG, MOZ_ERROR_CHECK, and visitor().

Referenced by main().

Here is the call graph for this function:

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

Finalize the use of XPCOM.

Parameters:
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 LOG, and MOZ_ERROR_CHECK.

Referenced by main(), and mozilla_sync_disconnect().

gboolean mozilla_startup ( const char *  szProfileDirectory,
gboolean *  pWasStarted,
char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Initialize the use of XPCOM.

Parameters:
szProfileDirectory Path to the users profile directory
pWasStarted Set to true, if XPCOM was already started. If so, remember NOT to call mozilla_shutdown
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 LOG, MOZ_ERROR_CHECK, mozilla_getversion(), NS_NewProfileDirServiceProvider(), and nsProfileDirServiceProvider::Register().

Referenced by main(), and mozilla_sync_connect().

Here is the call graph for this function:

gboolean visitor ( gpointer  key,
gpointer  value,
gpointer  data 
)

Visitor for GTree g_tree_foreach.

Called from mozilla_log_info

Parameters:
key (char*)
value NULL
data pLogFunction: Function used to log information text
Returns:
FALSE

References LOG.

Referenced by mozilla_log_info().