blueZync

Synchronize Bluetooth phone with Thunderbird

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

mozilla-sync-utils.h File Reference


Detailed Description

Utilities for mozilla-sync (Headers).

This graph shows which files directly or indirectly include this file:


Defines

#define ERROR(message...)
#define FREE(p)   { if (p) free(p); }
#define GFREE(p)   { if (p) g_free(p); }
#define LOG(level, message...)   pLogFunction(level, false, basename(__FILE__), __LINE__, __func__, message);
#define LOG_SENSITIVE(level, message...)   pLogFunction(level, true, basename(__FILE__), __LINE__, __func__, message);
#define MOZ_ERROR_CHECK(rv, str)
#define MOZ_ERROR_CHECK_FALSE(rv, str)
#define NULL_ERROR_CHECK(ptr, str)
#define RC_ERROR_CHECK(rc, str...)
#define SQL_ERROR_CHECK_FALSE(PCONN, MESSAGE...)
#define SQL_ERROR_CHECK_NOROWSOK_FALSE(PCONN, MESSAGE...)

Define Documentation

#define ERROR ( message...   ) 

Value:

{ \
        char *__szMsg=g_strdup_printf(message); \
        *pSzError=g_strdup_printf("%s(%d)%s: %s", basename(__FILE__), __LINE__, __func__, __szMsg); return FALSE; }
Create error message in the pSzError passed, and return

Referenced by ThunderbirdAddressbook::DeleteCard(), MozillaCalendar::EventFirst(), MozillaCalendar::EventNext(), MozillaCalendar::Init(), ThunderbirdAddressbook::ModifyCardFromXML(), mozilla_config_check(), mozilla_config_extract(), and ThunderbirdCard::UpdateFromXML().

#define FREE (  )     { if (p) free(p); }

#define LOG_SENSITIVE ( level,
message...   )     pLogFunction(level, true, basename(__FILE__), __LINE__, __func__, message);

#define MOZ_ERROR_CHECK ( rv,
str   ) 

Value:

{ if (NS_FAILED(rv)) \
                { *pSzError=g_strdup_printf( \
                        "%s(%d)%s: [%s] returned [0x0%x]", basename(__FILE__), __LINE__, __func__, str, rv ); return NULL; } }
Check if mozilla returned an error code. If so, create error message in the pSzError passed, and return NULL

Referenced by ThunderbirdAddressbook::Close(), ThunderbirdCard::GetHash(), ThunderbirdCard::GetKey(), ThunderbirdCard::GetLongName(), ThunderbirdCard::GetXML(), mozilla_log_info(), mozilla_shutdown(), and mozilla_startup().

#define MOZ_ERROR_CHECK_FALSE ( rv,
str   ) 

Value:

{ if (NS_FAILED(rv)) \
                { *pSzError=g_strdup_printf( \
                        "%s(%d)%s: [%s] returned [0x0%x]", basename(__FILE__), __LINE__, __func__, str, rv ); return FALSE; } }
Check if mozilla returned an error code. If so, create error message in the pSzError passed, and return FALSE

Referenced by ThunderbirdAddressbook::AddCard(), ThunderbirdAddressbook::CardFirst(), ThunderbirdAddressbook::CardNext(), ThunderbirdCard::CreateFromXML(), ThunderbirdAddressbook::DeleteCard(), MozillaCalendar::DeleteEvent(), EventAdd(), MozillaCalendar::EventFirst(), EventICS(), EventModify(), MozillaCalendar::EventNext(), ThunderbirdAddressbook::Init(), MozillaCalendar::Init(), ThunderbirdAddressbook::LogInfo(), MozillaCalendar::LogInfo(), ThunderbirdAddressbook::ModifyCardFromXML(), and ThunderbirdCard::UpdateFromXML().

#define NULL_ERROR_CHECK ( ptr,
str   ) 

Value:

{ if (!ptr) \
                { *pSzError=g_strdup_printf( \
                        "%s(%d)%s: %s", basename(__FILE__), __LINE__, __func__, str); return NULL; } }
Check if pointer is NULL. If so, create error message in the pSzError passed, and return NULL

Referenced by ThunderbirdCard::GetXML().

#define RC_ERROR_CHECK ( rc,
str...   ) 

Value:

{ if (rc<0) \
                {       char *__szMsg=g_strdup_printf(str); \
                        *pSzError=g_strdup_printf( \
                        "%s(%d): %s", __func__, __LINE__, __szMsg); return NULL; } }
Check if RC is less than zero. If so, create error message in the pSzError passed, and return NULL

Referenced by ThunderbirdCard::GetXML().

#define SQL_ERROR_CHECK_FALSE ( PCONN,
MESSAGE...   ) 

Referenced by EventAdd(), EventICS(), and EventModify().

#define SQL_ERROR_CHECK_NOROWSOK_FALSE ( PCONN,
MESSAGE...   ) 

Value:

{ \
        char *__szMsg=g_strdup_printf(MESSAGE); \
        PRInt32 __lastError; \
        PCONN->GetLastError(&__lastError); \
        if ( (__lastError!=0) && (__lastError!=100) ) { \
                nsEmbedCString __acsError; \
                pConn->GetLastErrorString(__acsError); \
                *pSzError=g_strdup_printf("%s(%d)%s: SQL error in [%s] %d: %s", basename(__FILE__), __LINE__, __func__, __szMsg, __lastError, __acsError.get());\
                return FALSE; }  \
};

Referenced by EventModify().