Gammu internals
1.38.0
|
Go to the source code of this file.
Typedefs | |
typedef int | wchar_t |
typedef int | wint_t |
Enumerations | |
enum | GSM_NumberType { NUMBER_UNKNOWN_NUMBERING_PLAN_ISDN = 0x81, NUMBER_INTERNATIONAL_NUMBERING_PLAN_ISDN = 0x91, NUMBER_ALPHANUMERIC_NUMBERING_PLAN_UNKNOWN = 0xD0 } |
Functions | |
gboolean | myiswspace (unsigned const char *src) |
void | ReverseUnicodeString (unsigned char *String) |
void | DecodeUnicodeSpecialNOKIAChars (unsigned char *dest, const unsigned char *src, size_t len) |
void | EncodeUnicodeSpecialNOKIAChars (unsigned char *dest, const unsigned char *src, size_t len) |
unsigned char * | EncodeUnicodeSpecialChars (unsigned char *dest, const unsigned char *buffer) |
unsigned char * | DecodeUnicodeSpecialChars (unsigned char *dest, const unsigned char *buffer) |
unsigned char | EncodeWithBCDAlphabet (int value) |
int | DecodeWithBCDAlphabet (unsigned char value) |
void | DecodeBCD (unsigned char *dest, const unsigned char *src, size_t len) |
void | EncodeBCD (unsigned char *dest, const unsigned char *src, size_t len, gboolean fill) |
void | DecodeUTF7 (unsigned char *dest, const unsigned char *src, size_t len) |
void | DecodeISO88591 (unsigned char *dest, const char *src, size_t len) |
void | DecodeISO88591QuotedPrintable (unsigned char *dest, const unsigned char *src, size_t len) |
void | DecodeXMLUTF8 (unsigned char *dest, const char *src, size_t len) |
void | EncodeBASE64 (const unsigned char *Input, char *Output, const size_t Length) |
int | DecodeBASE64 (const char *Input, unsigned char *Output, const size_t Length) |
void | EncodeDefault (unsigned char *dest, const unsigned char *src, size_t *len, gboolean UseExtensions, unsigned char *ExtraAlphabet) |
void | DecodeDefault (unsigned char *dest, const unsigned char *src, size_t len, gboolean UseExtensions, unsigned char *ExtraAlphabet) |
void | FindDefaultAlphabetLen (const unsigned char *src, size_t *srclen, size_t *smslen, size_t maxlen) |
int | GSM_PackSevenBitsToEight (size_t offset, const unsigned char *input, unsigned char *output, size_t length) |
int | GSM_UnpackEightBitsToSeven (size_t offset, size_t in_length, size_t out_length, const unsigned char *input, unsigned char *output) |
GSM_Error | GSM_UnpackSemiOctetNumber (GSM_Debug_Info *di, unsigned char *retval, const unsigned char *Number, size_t *pos, size_t bufferlength, gboolean semioctet) |
int | GSM_PackSemiOctetNumber (const unsigned char *Number, unsigned char *Output, gboolean semioctet) |
void | BufferAlign (unsigned char *Destination, size_t *CurrentBit) |
void | BufferAlignNumber (size_t *CurrentBit) |
void | AddBuffer (unsigned char *Destination, size_t *CurrentBit, unsigned char *Source, size_t BitsToProcess) |
void | AddBufferByte (unsigned char *Destination, size_t *CurrentBit, unsigned char Source, size_t BitsToProcess) |
void | GetBuffer (unsigned char *Source, size_t *CurrentBit, unsigned char *Destination, size_t BitsToProcess) |
void | GetBufferInt (unsigned char *Source, size_t *CurrentBit, int *integer, size_t BitsToProcess) |
void | GetBufferI (unsigned char *Source, size_t *CurrentBit, int *result, size_t BitsToProcess) |
int | GetBit (unsigned char *Buffer, size_t BitNum) |
int | SetBit (unsigned char *Buffer, size_t BitNum) |
int | ClearBit (unsigned char *Buffer, size_t BitNum) |
void | StringToDouble (char *text, double *d) |
GSM_Error | GSM_GetVCSLine (char **OutBuffer, char *Buffer, size_t *Pos, size_t MaxLen, gboolean MergeLines) |
GSM_Error | MyGetLine (char *Buffer, size_t *Pos, char *OutBuffer, size_t MaxLen, size_t MaxOutLen, gboolean MergeLines) |
char * | EncodeSpecialChars (char *dest, const char *buffer) |
char * | DecodeSpecialChars (char *dest, const char *buffer) |
enum GSM_NumberType |
Enum to handle types of phones numbers like specified in GSM 03.40 section 9.1.2.5
Definition at line 81 of file coding.h.
void AddBuffer | ( | unsigned char * | Destination, |
size_t * | CurrentBit, | ||
unsigned char * | Source, | ||
size_t | BitsToProcess | ||
) |
Definition at line 1286 of file coding.c.
References ClearBit(), GetBit(), and SetBit().
Referenced by AddBufferByte(), and GSM_EncodeNokiaRTTLRingtone().
void AddBufferByte | ( | unsigned char * | Destination, |
size_t * | CurrentBit, | ||
unsigned char | Source, | ||
size_t | BitsToProcess | ||
) |
Definition at line 1303 of file coding.c.
References AddBuffer().
Referenced by GSM_EncodeNokiaRTTLRingtone().
void BufferAlign | ( | unsigned char * | Destination, |
size_t * | CurrentBit | ||
) |
Definition at line 1263 of file coding.c.
References ClearBit().
Referenced by GSM_EncodeNokiaRTTLRingtone().
void BufferAlignNumber | ( | size_t * | CurrentBit | ) |
Definition at line 1275 of file coding.c.
Referenced by GSM_DecodeNokiaRTTLRingtone(), and GSM_EncodeNokiaRTTLRingtone().
int ClearBit | ( | unsigned char * | Buffer, |
size_t | BitNum | ||
) |
Definition at line 1258 of file coding.c.
Referenced by AddBuffer(), BufferAlign(), GetBuffer(), and GSM_ClearPointBitmap().
int DecodeBASE64 | ( | const char * | Input, |
unsigned char * | Output, | ||
const size_t | Length | ||
) |
Definition at line 2149 of file coding.c.
References DecodeBASE64Block(), and FALSE.
Referenced by DecodeUTF7(), and GSM_DecodeVCARD().
void DecodeBCD | ( | unsigned char * | dest, |
const unsigned char * | src, | ||
size_t | len | ||
) |
Definition at line 328 of file coding.c.
Referenced by GSM_UnpackSemiOctetNumber(), and NOKIA_DecodeNetworkCode().
void DecodeDefault | ( | unsigned char * | dest, |
const unsigned char * | src, | ||
size_t | len, | ||
gboolean | UseExtensions, | ||
unsigned char * | ExtraAlphabet | ||
) |
Definition at line 498 of file coding.c.
References DumpMessageText(), GSM_DefaultAlphabetCharsExtension, GSM_DefaultAlphabetUnicode, GSM_global_debug, and UnicodeLength().
Referenced by GSM_DecodePDUFrame(), GSM_DecodeSMSFrameText(), and GSM_EncodeMultiPartSMS().
void DecodeISO88591 | ( | unsigned char * | dest, |
const char * | src, | ||
size_t | len | ||
) |
void DecodeISO88591QuotedPrintable | ( | unsigned char * | dest, |
const unsigned char * | src, | ||
size_t | len | ||
) |
Definition at line 1889 of file coding.c.
References DecodeWithHexBinAlphabet().
Referenced by ReadVCALText().
char* DecodeSpecialChars | ( | char * | dest, |
const char * | buffer | ||
) |
unsigned char* DecodeUnicodeSpecialChars | ( | unsigned char * | dest, |
const unsigned char * | buffer | ||
) |
void DecodeUnicodeSpecialNOKIAChars | ( | unsigned char * | dest, |
const unsigned char * | src, | ||
size_t | len | ||
) |
Definition at line 1401 of file coding.c.
Referenced by GSM_DecodeNokiaRTTLRingtone(), GSM_DecodePDUFrame(), and GSM_DecodeSMSFrameText().
void DecodeUTF7 | ( | unsigned char * | dest, |
const unsigned char * | src, | ||
size_t | len | ||
) |
Definition at line 2051 of file coding.c.
References DecodeBASE64(), and EncodeWithUnicodeAlphabet().
Referenced by ReadVCALText().
int DecodeWithBCDAlphabet | ( | unsigned char | value | ) |
Definition at line 323 of file coding.c.
Referenced by GSM_DecodeSMSDateTime().
void DecodeXMLUTF8 | ( | unsigned char * | dest, |
const char * | src, | ||
size_t | len | ||
) |
Decodes UTF-8 text with XML entities to Unicode.
Definition at line 1966 of file coding.c.
References dbgprintf, DecodeUTF8(), and EncodeWithUTF8Alphabet().
void EncodeBASE64 | ( | const unsigned char * | Input, |
char * | Output, | ||
const size_t | Length | ||
) |
Definition at line 2118 of file coding.c.
References EncodeBASE64Block().
Referenced by VC_StoreBase64().
void EncodeBCD | ( | unsigned char * | dest, |
const unsigned char * | src, | ||
size_t | len, | ||
gboolean | fill | ||
) |
Definition at line 342 of file coding.c.
Referenced by GSM_PackSemiOctetNumber(), and NOKIA_EncodeNetworkCode().
void EncodeDefault | ( | unsigned char * | dest, |
const unsigned char * | src, | ||
size_t * | len, | ||
gboolean | UseExtensions, | ||
unsigned char * | ExtraAlphabet | ||
) |
Definition at line 831 of file coding.c.
References ConvertTable, DumpMessageText(), FALSE, GSM_DefaultAlphabetCharsExtension, GSM_DefaultAlphabetUnicode, GSM_global_debug, and TRUE.
Referenced by GSM_EncodeAlcatelMultiPartSMS(), GSM_EncodeMultiPartSMS(), and GSM_EncodeSMSFrameText().
char* EncodeSpecialChars | ( | char * | dest, |
const char * | buffer | ||
) |
unsigned char* EncodeUnicodeSpecialChars | ( | unsigned char * | dest, |
const unsigned char * | buffer | ||
) |
void EncodeUnicodeSpecialNOKIAChars | ( | unsigned char * | dest, |
const unsigned char * | src, | ||
size_t | len | ||
) |
Definition at line 1367 of file coding.c.
Referenced by GSM_EncodeNokiaRTTLRingtone(), and GSM_EncodeSMSFrameText().
unsigned char EncodeWithBCDAlphabet | ( | int | value | ) |
Definition at line 315 of file coding.c.
Referenced by GSM_EncodeSMSDateTime().
void FindDefaultAlphabetLen | ( | const unsigned char * | src, |
size_t * | srclen, | ||
size_t * | smslen, | ||
size_t | maxlen | ||
) |
Definition at line 914 of file coding.c.
References FALSE, GSM_DefaultAlphabetCharsExtension, and TRUE.
Referenced by GSM_AddSMS_Text_UDH(), GSM_EncodeMultiPartSMS(), and GSM_Find_Free_Used_SMS2().
int GetBit | ( | unsigned char * | Buffer, |
size_t | BitNum | ||
) |
Definition at line 1248 of file coding.c.
Referenced by AddBuffer(), GetBuffer(), GetBufferI(), GetBufferInt(), and GSM_IsPointBitmap().
void GetBuffer | ( | unsigned char * | Source, |
size_t * | CurrentBit, | ||
unsigned char * | Destination, | ||
size_t | BitsToProcess | ||
) |
Definition at line 1311 of file coding.c.
References ClearBit(), GetBit(), and SetBit().
Referenced by GSM_DecodeNokiaRTTLRingtone().
void GetBufferI | ( | unsigned char * | Source, |
size_t * | CurrentBit, | ||
int * | result, | ||
size_t | BitsToProcess | ||
) |
void GetBufferInt | ( | unsigned char * | Source, |
size_t * | CurrentBit, | ||
int * | integer, | ||
size_t | BitsToProcess | ||
) |
Definition at line 1329 of file coding.c.
References GetBit().
Referenced by GSM_DecodeNokiaRTTLRingtone().
GSM_Error GSM_GetVCSLine | ( | char ** | OutBuffer, |
char * | Buffer, | ||
size_t * | Pos, | ||
size_t | MaxLen, | ||
gboolean | MergeLines | ||
) |
Gets VCS line from buffer.
MergeLines | Determine whether merge lines as vCard style continuation or quoted printable continutaion. |
Buffer | Data source to parse. |
Pos | Current position in data. |
OutBuffer | Pointer to buffer pointer, which will be allocated. |
MaxLen | Maximal length of data to process. |
Definition at line 1656 of file coding.c.
References ERR_MOREMEMORY, ERR_NONE, FALSE, and TRUE.
Referenced by GSM_DecodeVCARD().
int GSM_PackSemiOctetNumber | ( | const unsigned char * | Number, |
unsigned char * | Output, | ||
gboolean | semioctet | ||
) |
Packing some phone numbers (SMSC, SMS destination and others)
See GSM 03.40 9.1.1: 1 byte - length of number given in semioctets or bytes (when given in bytes, includes one byte for byte with number format). Returned by function (set semioctet to TRUE, if want result in semioctets). 1 byte - format of number (see GSM_NumberType in coding.h). Returned in unsigned char *Output. n bytes - 2n or 2n-1 semioctets with number. Returned in unsigned char *Output.
1 semioctet = 4 bits = half of byte
First byte is used for saving type of number. See GSM 03.40 section 9.1.2.5
Definition at line 1125 of file coding.c.
References DecodeUnicode(), EncodeBCD(), GSM_PackSevenBitsToEight(), NUMBER_ALPHANUMERIC_NUMBERING_PLAN_UNKNOWN, NUMBER_INTERNATIONAL_NUMBERING_PLAN_ISDN, NUMBER_UNKNOWN_NUMBERING_PLAN_ISDN, TRUE, and UnicodeLength().
Referenced by GSM_EncodeSMSFrame(), and NOKIA_EncodeDateTime().
int GSM_PackSevenBitsToEight | ( | size_t | offset, |
const unsigned char * | input, | ||
unsigned char * | output, | ||
size_t | length | ||
) |
Definition at line 993 of file coding.c.
Referenced by GSM_EncodeAlcatelMultiPartSMS(), GSM_EncodeMultiPartSMS(), GSM_EncodeSMSFrameText(), and GSM_PackSemiOctetNumber().
int GSM_UnpackEightBitsToSeven | ( | size_t | offset, |
size_t | in_length, | ||
size_t | out_length, | ||
const unsigned char * | input, | ||
unsigned char * | output | ||
) |
Definition at line 953 of file coding.c.
References ByteMask.
Referenced by GSM_DecodePDUFrame(), GSM_DecodeSMSFrameText(), and GSM_UnpackSemiOctetNumber().
GSM_Error GSM_UnpackSemiOctetNumber | ( | GSM_Debug_Info * | di, |
unsigned char * | retval, | ||
const unsigned char * | Number, | ||
size_t * | pos, | ||
size_t | bufferlength, | ||
gboolean | semioctet | ||
) |
Definition at line 1028 of file coding.c.
References DecodeBCD(), EncodeUnicode(), ERR_NONE, ERR_UNKNOWN, GSM_MAX_NUMBER_LENGTH, GSM_UnpackEightBitsToSeven(), NUMBER_ALPHANUMERIC_NUMBERING_PLAN_UNKNOWN, NUMBER_INTERNATIONAL_NUMBERING_PLAN_ISDN, and smfprintf().
Referenced by GSM_DecodePDUFrame(), GSM_DecodeSMSFrame(), and NOKIA_EncodeDateTime().
GSM_Error MyGetLine | ( | char * | Buffer, |
size_t * | Pos, | ||
char * | OutBuffer, | ||
size_t | MaxLen, | ||
size_t | MaxOutLen, | ||
gboolean | MergeLines | ||
) |
Gets line from buffer.
MergeLines | Determine whether merge lines as vCard style continuation or quoted printable continutaion. |
Buffer | Data source to parse. |
Pos | Current position in data. |
OutBuffer | Buffer where line will be written. |
MaxLen | Maximal length of data to process. |
MaxOutLen | Size of output buffer. |
Definition at line 1580 of file coding.c.
References ERR_MOREMEMORY, ERR_NONE, FALSE, and TRUE.
Referenced by GSM_DecodeVCALENDAR_VTODO(), GSM_DecodeVNOTE(), and GSM_JADFindLine().
gboolean myiswspace | ( | unsigned const char * | src | ) |
Definition at line 1470 of file coding.c.
References DecodeWithUnicodeAlphabet(), FALSE, and TRUE.
Referenced by INI_ReadFile().
void ReverseUnicodeString | ( | unsigned char * | String | ) |
int SetBit | ( | unsigned char * | Buffer, |
size_t | BitNum | ||
) |
Definition at line 1253 of file coding.c.
Referenced by AddBuffer(), GetBuffer(), and GSM_SetPointBitmap().
void StringToDouble | ( | char * | text, |
double * | d | ||
) |