mozilla-sync-utils.h File Reference
Detailed Description
Utilities for mozilla-sync (Headers).
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; }
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 | ( | 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); |
Log a message using the pLogFunction
passed
Referenced by addCapabilityEvent(), ThunderbirdAddressbook::CardFirst(), ThunderbirdCard::CreateFromXML(), ThunderbirdAddressbook::DeleteCard(), MozillaCalendar::DeleteEvent(), EventAdd(), EventICS(), EventModify(), find_default_profile_directory(), ThunderbirdCard::GetKey(), ThunderbirdAddressbook::Init(), MozillaCalendar::Init(), ThunderbirdAddressbook::LogInfo(), MozillaCalendar::LogInfo(), ThunderbirdAddressbook::ModifyCardFromXML(), mozilla_config_check(), mozilla_config_extract(), mozilla_getversion(), mozilla_log_info(), mozilla_shutdown(), mozilla_startup(), mozilla_sync_commit_calendar_change(), mozilla_sync_commit_change(), mozilla_sync_connect(), mozilla_sync_disconnect(), mozilla_sync_discover(), mozilla_sync_done(), mozilla_sync_get_changes(), mozilla_sync_initialize(), mozilla_sync_report_addressbook_changes_to_hash(), mozilla_sync_report_calendar_changes_to_hash(), NS_NewProfileDirServiceProvider(), nsProfileDirServiceProvider::Register(), ThunderbirdCard::UpdateFromXML(), and visitor().
#define LOG_SENSITIVE | ( | level, | |||
message... | ) | pLogFunction(level, true, basename(__FILE__), __LINE__, __func__, message); |
Log a sensitive (private) message using the pLogFunction
passed
Referenced by EventModify(), mozilla_sync_commit_addressbook_change(), mozilla_sync_commit_calendar_change(), mozilla_sync_commit_change(), mozilla_sync_report_addressbook_changes_to_hash(), mozilla_sync_report_calendar_changes_to_hash(), and ThunderbirdCard::UpdateFromXML().
#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; } }
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; } }
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; } }
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; } }
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().