blueZync

Synchronize Bluetooth phone with Thunderbird

Develpers' detailed documentation for the Thunderbird Extension for synchronizing a bluetooth phone with Thunderbird/Lightning/Sunbird.
A part of blueZync.

BZLib.h File Reference


Detailed Description

Library of utilities for xpcom library.


Classes

class  signalException
 exception which we throw when a signal is caught More...

Defines

#define BZ_CATCH
#define BZ_OSYNC_LOG(m)
#define BZ_SIGNAL
#define BZ_TRY
#define LOCK   g_static_mutex_lock(&myMutex);
#define LOG(level, message...)
#define UNLOCK   g_static_mutex_unlock(&myMutex);

Functions

void signalHandler (int sig, siginfo_t *info, void *context)

Define Documentation

#define BZ_CATCH

Default catch block

#define BZ_OSYNC_LOG (  ) 

#define BZ_SIGNAL

Value:

{ \
        struct sigaction new_action; \
        new_action.sa_handler = NULL; \
        new_action.sa_sigaction = signalHandler; \
        sigemptyset (&new_action.sa_mask); \
        new_action.sa_flags = SA_SIGINFO; \
        sigaction(SIGFPE, &new_action, NULL); \
        sigaction(SIGSEGV, &new_action, NULL); }
Define signal handlers to cath stray signals
Todo:
First time xpcom method is run, this works. Second time around tbird crashes

#define BZ_TRY

Value:

try { \
                try  \
Start of try block

#define LOCK   g_static_mutex_lock(&myMutex);

lock myMutex

#define LOG ( level,
message...   ) 

Value:

if (level<=myLogLevel) {\
                printf("%s(%d)%s: ", basename(__FILE__), __LINE__, __func__);\
                printf(message);\
                printf("\n"); \
                fflush(stdout); \
                BZ_OSYNC_LOG(message); }
log message

#define UNLOCK   g_static_mutex_unlock(&myMutex);

unlock myMutex


Function Documentation

void signalHandler ( int  sig,
siginfo_t *  info,
void *  context 
)

signalHandler simply throws as signalException with a nice message