First version, development moved to 5110-connected machine
[gnokii.git] / include / gsm-api.h
index 0ab7718..10cb4b0 100644 (file)
 #include "gsm-ringtones.h"
 #include "gsm-wap.h"
 
+#ifndef UCLINUX
+
 /* Undefined functions in fbus/mbus files */
 extern GSM_Error Unimplemented(void);
 #define UNIMPLEMENTED (void *) Unimplemented
 extern GSM_Error NotSupported(void);
 #define NOTSUPPORTED (void *) NotSupported
 
+#endif /* UCLINUX */
+
 /* Define the structure used to hold pointers to the various API functions.
    This is in effect the master list of functions provided by the gnokii API.
    Modules containing the model specific code each contain one of these
@@ -288,160 +292,178 @@ extern GSM_Information *GSM_Info;
 extern GSM_Functions *GSM;
 extern GSM_Protocol *Protocol;
 
-GSM_PhonebookEntry *CurrentPhonebookEntry;
-GSM_Error          CurrentPhonebookError;
+extern GSM_PhonebookEntry *CurrentPhonebookEntry;
+extern GSM_Error          CurrentPhonebookError;
 
-GSM_SpeedDial      *CurrentSpeedDialEntry;
-GSM_Error          CurrentSpeedDialError;
+#ifndef UCLINUX
+extern GSM_SpeedDial      *CurrentSpeedDialEntry;
+extern GSM_Error          CurrentSpeedDialError;
+#endif /* UCLINUX */
 
-unsigned char      Current_IMEI[GSM_MAX_IMEI_LENGTH];
-unsigned char      Current_Revision[GSM_MAX_REVISION_LENGTH];
-unsigned char      Current_Model[GSM_MAX_MODEL_LENGTH];
+extern unsigned char      Current_IMEI[GSM_MAX_IMEI_LENGTH];
+extern unsigned char      Current_Revision[GSM_MAX_REVISION_LENGTH];
+extern unsigned char      Current_Model[GSM_MAX_MODEL_LENGTH];
 
-GSM_SMSMessage     *CurrentSMSMessage;
-GSM_Error          CurrentSMSMessageError;
-int                CurrentSMSPointer;
+#ifndef UCLINUX
+extern GSM_SMSMessage     *CurrentSMSMessage;
+extern GSM_Error          CurrentSMSMessageError;
+extern int                CurrentSMSPointer;
 
-GSM_SMSFolders      *CurrentSMSFolders;
-GSM_Error          CurrentSMSFoldersError;
-int                CurrentSMSFoldersCount;
+extern GSM_SMSFolders      *CurrentSMSFolders;
+extern GSM_Error          CurrentSMSFoldersError;
+extern int                CurrentSMSFoldersCount;
 
-GSM_OneSMSFolder   CurrentSMSFolder;
-GSM_Error          CurrentSMSFolderError;
-int                CurrentSMSFolderID;
+extern GSM_OneSMSFolder   CurrentSMSFolder;
+extern GSM_Error          CurrentSMSFolderError;
+extern int                CurrentSMSFolderID;
+#endif /* UCLINUX */
 
-GSM_MemoryStatus   *CurrentMemoryStatus;
-GSM_Error          CurrentMemoryStatusError;
+extern GSM_MemoryStatus   *CurrentMemoryStatus;
+extern GSM_Error          CurrentMemoryStatusError;
 
-GSM_NetworkInfo    *CurrentNetworkInfo;
-GSM_Error          CurrentNetworkInfoError;
+#ifndef UCLINUX
+extern GSM_NetworkInfo    *CurrentNetworkInfo;
+extern GSM_Error          CurrentNetworkInfoError;
 
-GSM_SMSStatus      *CurrentSMSStatus;
-GSM_Error          CurrentSMSStatusError;
+extern GSM_SMSStatus      *CurrentSMSStatus;
+extern GSM_Error          CurrentSMSStatusError;
 
-GSM_MessageCenter  *CurrentMessageCenter;
-GSM_Error          CurrentMessageCenterError;
+extern GSM_MessageCenter  *CurrentMessageCenter;
+extern GSM_Error          CurrentMessageCenterError;
 
-int                *CurrentSecurityCodeStatus;
-GSM_Error          CurrentSecurityCodeError;
-GSM_SecurityCode   *CurrentSecurityCode;
+extern int                *CurrentSecurityCodeStatus;
+extern GSM_Error          CurrentSecurityCodeError;
+extern GSM_SecurityCode   *CurrentSecurityCode;
 
-GSM_DateTime       *CurrentDateTime;
-GSM_Error          CurrentDateTimeError;
+extern GSM_DateTime       *CurrentDateTime;
+extern GSM_Error          CurrentDateTimeError;
 
-GSM_Error          CurrentResetPhoneSettingsError;
+extern GSM_Error          CurrentResetPhoneSettingsError;
 
-GSM_DateTime       *CurrentAlarm;
-GSM_Error          CurrentAlarmError;
+extern GSM_DateTime       *CurrentAlarm;
+extern GSM_Error          CurrentAlarmError;
 
-GSM_CalendarNote   *CurrentCalendarNote;
-GSM_Error          CurrentCalendarNoteError;
+extern GSM_CalendarNote   *CurrentCalendarNote;
+extern GSM_Error          CurrentCalendarNoteError;
 
-GSM_NotesInfo      CurrentCalendarNotesInfo,*CurrentCalendarNotesInfo2;
-GSM_Error          CurrentCalendarNotesInfoError;
+extern GSM_NotesInfo      CurrentCalendarNotesInfo,*CurrentCalendarNotesInfo2;
+extern GSM_Error          CurrentCalendarNotesInfoError;
 
-int                *CurrentFirstCalendarFreePos;
-GSM_Error          CurrentFirstCalendarFreePosError;
+extern GSM_Error          CurrentSetDateTimeError;
+extern GSM_Error          CurrentSetAlarmError;
 
-GSM_Error          CurrentSetDateTimeError;
-GSM_Error          CurrentSetAlarmError;
+extern int                *CurrentFirstCalendarFreePos;
+extern GSM_Error          CurrentFirstCalendarFreePosError;
+#endif /* UCLINUX */
 
-GSM_Error          CurrentEnableExtendedCommandsError;
+extern GSM_Error          CurrentEnableExtendedCommandsError;
 
-int                CurrentRFLevel,
+extern int                CurrentRFLevel,
                    CurrentBatteryLevel,
                    CurrentPowerSource;
 
-int                CurrentDisplayStatus;
-GSM_Error          CurrentDisplayStatusError;
+#ifndef UCLINUX
+extern int                CurrentDisplayStatus;
+extern GSM_Error          CurrentDisplayStatusError;
 
-char               *CurrentNetmonitor;
-GSM_Error          CurrentNetmonitorError;
+extern char               *CurrentNetmonitor;
+extern GSM_Error          CurrentNetmonitorError;
 
-GSM_Bitmap         *CurrentGetBitmap;
-GSM_Error          CurrentGetBitmapError;
+extern GSM_Bitmap         *CurrentGetBitmap;
+extern GSM_Error          CurrentGetBitmapError;
 
-GSM_Error          CurrentSetBitmapError;
+extern GSM_Error          CurrentSetBitmapError;
 
-GSM_Error          CurrentSendDTMFError;
+extern GSM_Error          CurrentSendDTMFError;
 
-GSM_Profile        *CurrentProfile;
-GSM_Error          CurrentProfileError;
+extern GSM_Profile        *CurrentProfile;
+extern GSM_Error          CurrentProfileError;
 
-GSM_Error          CurrentDisplayOutputError;
+extern GSM_Error          CurrentDisplayOutputError;
 
-GSM_CBMessage      *CurrentCBMessage;
-GSM_Error          CurrentCBError;
+extern GSM_CBMessage      *CurrentCBMessage;
+extern GSM_Error          CurrentCBError;
 
-int                CurrentPressKeyEvent;
-GSM_Error          CurrentPressKeyError;
+extern int                CurrentPressKeyEvent;
+extern GSM_Error          CurrentPressKeyError;
 
-GSM_Error          CurrentPlayToneError;
+extern GSM_Error          CurrentPlayToneError;
+#endif /* UCLINUX */
 
-GSM_Error          CurrentDialVoiceError;
+extern GSM_Error          CurrentDialVoiceError;
 
-GSM_Error          CurrentGetOperatorNameError;
-GSM_Network        *CurrentGetOperatorNameNetwork;
-GSM_Error          CurrentSetOperatorNameError;
+#ifndef UCLINUX
+extern GSM_Error          CurrentGetOperatorNameError;
+extern GSM_Network        *CurrentGetOperatorNameNetwork;
+extern GSM_Error          CurrentSetOperatorNameError;
+#endif /* UCLINUX */
 
-GSM_Error          CurrentGetIMEIError;
+extern GSM_Error          CurrentGetIMEIError;
 
-GSM_Error          CurrentGetHWError;
+extern GSM_Error          CurrentGetHWError;
 
-unsigned char      CurrentPPS[4];
-GSM_Error          CurrentProductProfileSettingsError;
+#ifndef UCLINUX
+extern unsigned char      CurrentPPS[4];
+extern GSM_Error          CurrentProductProfileSettingsError;
 
-char               CurrentIncomingCall[20];
+extern char               CurrentIncomingCall[20];
 
-GSM_Error          CurrentBinRingtoneError;
-GSM_BinRingtone    *CurrentGetBinRingtone;
+extern GSM_Error          CurrentBinRingtoneError;
+extern GSM_BinRingtone    *CurrentGetBinRingtone;
 
-GSM_Error          CurrentRingtoneError; 
+extern GSM_Error          CurrentRingtoneError; 
+#endif /* UCLINUX */
 
-GSM_Error          CurrentMagicError;
+extern GSM_Error          CurrentMagicError;
 
-GSM_Error          CurrentSimlockInfoError;
-GSM_AllSimlocks    *CurrentSimLock;
+#ifndef UCLINUX
+extern GSM_Error          CurrentSimlockInfoError;
+extern GSM_AllSimlocks    *CurrentSimLock;
 
-GSM_Error          CurrentGetWAPBookmarkError;
-GSM_Error          CurrentSetWAPBookmarkError;
-GSM_WAPBookmark    *WAPBookmark;
+extern GSM_Error          CurrentGetWAPBookmarkError;
+extern GSM_Error          CurrentSetWAPBookmarkError;
+extern GSM_WAPBookmark    *WAPBookmark;
 
-GSM_Error          CurrentGetWAPSettingsError;
-GSM_WAPSettings    *WAPSettings;
+extern GSM_Error          CurrentGetWAPSettingsError;
+extern GSM_WAPSettings    *WAPSettings;
 
-GSM_Error          CurrentCallDivertError;
-GSM_CallDivert    *CurrentCallDivert;
+extern GSM_Error          CurrentCallDivertError;
+extern GSM_CallDivert    *CurrentCallDivert;
 
-char              *CurrentManufacturer;
+extern char              *CurrentManufacturer;
+#endif /* UCLINUX */
 
 /* This is the connection type used in gnokii. */
-GSM_ConnectionType CurrentConnectionType;
+extern GSM_ConnectionType CurrentConnectionType;
 
 /* Pointer to a callback function used to return changes to a calls status */
 /* This saves unreliable polling */
-void (*CurrentCallPassup)(char c);
+extern void (*CurrentCallPassup)(char c);
 
 /* Pointer to callback function in user code to be called when RLP frames
    are received. */
-void (*CurrentRLP_RXCallback)(RLP_F96Frame *frame);
+extern void (*CurrentRLP_RXCallback)(RLP_F96Frame *frame);
 
 /* Used to disconnect the call */
-u8 CurrentCallSequenceNumber;
+extern u8 CurrentCallSequenceNumber;
 
-bool CurrentLinkOK;
+extern bool CurrentLinkOK;
 
-bool CurrentRequestTerminate;
+extern bool CurrentRequestTerminate;
 
-bool CurrentDisableKeepAlive;
+#ifndef UCLINUX
+extern bool CurrentDisableKeepAlive;
+#endif /* UCLINUX */
 
 /* Prototype for the functions actually provided by gsm-api.c. */
 
-GSM_Error GSM_Initialise(char *model, char *device, char *initlength, GSM_ConnectionType connection, void (*rlp_callback)(RLP_F96Frame *frame), char* SynchronizeTime);
+extern GSM_Error GSM_Initialise(char *model, char *device, char *initlength, GSM_ConnectionType connection, void (*rlp_callback)(RLP_F96Frame *frame), char* SynchronizeTime);
 
-bool CheckModel (GSM_Information InfoToCheck, char *model, GSM_ConnectionType connection);
+#ifndef UCLINUX
+extern bool CheckModel (GSM_Information InfoToCheck, char *model, GSM_ConnectionType connection);
+#endif /* UCLINUX */
 
-char *GetMygnokiiVersion();
+extern char *GetMygnokiiVersion();
 
 typedef enum {
   F_CAL61=0,/*Calendar in 6110 style - 4 types,...*/
@@ -510,10 +532,15 @@ typedef struct {
 } OnePhoneModel;
 
 extern char *GetModelName ();
-int GetModelFeature (featnum_index num);
+extern int GetModelFeature (featnum_index num);
 
+#ifndef UCLINUX
 extern bool AppendLog(u8 *buffer, int length,bool format);
 extern bool AppendLogText(u8 *buffer,bool format);
+#else /* UCLINUX */
+#define AppendLog(buffer,length,format)
+#define AppendLogText(buffer,format)
+#endif /* UCLINUX */
 
 typedef struct {
   int                SIMPhonebookUsed;