Gammu internals
1.38.0
|
#include <stdio.h>
#include <time.h>
#include <gammu-config.h>
#include <gammu-types.h>
#include <gammu-datetime.h>
#include <gammu-misc.h>
#include <gammu-debug.h>
Go to the source code of this file.
Data Structures | |
struct | GSM_CutLines |
Macros | |
#define | GAMMU_URL "<http://www.gammu.org>" |
#define | BACKUP_MAIN_HEADER "; This file format was designed for Gammu and is compatible with Gammu+" |
#define | BACKUP_INFO_HEADER "; See " GAMMU_URL " for more info" |
#define | socket_invalid (-1) |
Typedefs | |
typedef int | socket_type |
Functions | |
void | SplitLines (const char *message, const size_t messagesize, GSM_CutLines *lines, const char *whitespaces, const size_t spaceslen, const char *quotes, const size_t quoteslen, const gboolean eot) |
const char * | GetLineString (const char *message, GSM_CutLines *lines, int start) |
int | GetLineLength (const char *message, const GSM_CutLines *lines, int start) |
void | InitLines (GSM_CutLines *lines) |
void | FreeLines (GSM_CutLines *lines) |
void | CopyLineString (char *dest, const char *src, const GSM_CutLines *lines, int start) |
void | GetTimeDifference (unsigned long diff, GSM_DateTime *DT, gboolean Plus, int multi) |
GSM_DateTime | GSM_AddTime (GSM_DateTime DT, GSM_DeltaTime delta) |
int | GetDayOfYear (unsigned int year, unsigned int month, unsigned int day) |
int | GetWeekOfMonth (unsigned int year, unsigned int month, unsigned int day) |
int | GetDayOfWeek (unsigned int year, unsigned int month, unsigned int day) |
void | StripSpaces (char *buff) |
#define BACKUP_INFO_HEADER "; See " GAMMU_URL " for more info" |
#define BACKUP_MAIN_HEADER "; This file format was designed for Gammu and is compatible with Gammu+" |
typedef int socket_type |
void CopyLineString | ( | char * | dest, |
const char * | src, | ||
const GSM_CutLines * | lines, | ||
int | start | ||
) |
Copies line to variable.
Definition at line 522 of file misc.c.
References GetLineLength(), and GetLineStringPos().
void FreeLines | ( | GSM_CutLines * | lines | ) |
Frees line cut structure.
Definition at line 392 of file misc.c.
References GSM_CutLines::allocated, GSM_CutLines::numbers, and GSM_CutLines::retval.
Referenced by NOKIA_EncodeDateTime().
int GetLineLength | ( | const char * | message, |
const GSM_CutLines * | lines, | ||
int | start | ||
) |
Returns line length.
message | Parsed message. |
lines | Parsed lines information. |
start | Which line we want. |
const char* GetLineString | ( | const char * | message, |
GSM_CutLines * | lines, | ||
int | start | ||
) |
Returns pointer to static buffer containing line.
message | Parsed message. |
lines | Parsed lines information. |
start | Which line we want. |
Definition at line 492 of file misc.c.
References dbgprintf, GetLineLength(), GetLineStringPos(), and GSM_CutLines::retval.
Referenced by NOKIA_EncodeDateTime().
void GetTimeDifference | ( | unsigned long | diff, |
GSM_DateTime * | DT, | ||
gboolean | Plus, | ||
int | multi | ||
) |
Definition at line 247 of file misc.c.
References GSM_DateTime::Day, dbgprintf, Fill_GSM_DateTime(), Fill_Time_T(), GSM_DateTime::Hour, GSM_DateTime::Minute, GSM_DateTime::Month, GSM_DateTime::Second, and GSM_DateTime::Year.
Referenced by GSM_GetCalendarRecurranceRepeat(), and NOKIA_EncodeDateTime().
GSM_DateTime GSM_AddTime | ( | GSM_DateTime | DT, |
GSM_DeltaTime | delta | ||
) |
Definition at line 223 of file misc.c.
References GSM_DateTime::Day, GSM_DeltaTime::Day, Fill_GSM_DateTime(), GSM_DateTime::Hour, GSM_DeltaTime::Hour, GSM_DateTime::Minute, GSM_DeltaTime::Minute, GSM_DateTime::Month, GSM_DateTime::Second, GSM_DeltaTime::Second, and GSM_DateTime::Year.
Referenced by GSM_Calendar_AdjustDate(), GSM_DecodeVCALENDAR_VTODO(), and GSM_ToDo_AdjustDate().
void InitLines | ( | GSM_CutLines * | lines | ) |
Initializes line cut structure.
Definition at line 385 of file misc.c.
References GSM_CutLines::allocated, GSM_CutLines::numbers, and GSM_CutLines::retval.
Referenced by NOKIA_EncodeDateTime().
void SplitLines | ( | const char * | message, |
const size_t | messagesize, | ||
GSM_CutLines * | lines, | ||
const char * | whitespaces, | ||
const size_t | spaceslen, | ||
const char * | quotes, | ||
const size_t | quoteslen, | ||
const gboolean | eot | ||
) |
Calculates string cut points to split it to lines.
Definition at line 401 of file misc.c.
References GSM_CutLines::allocated, FALSE, GSM_CutLines::numbers, and TRUE.
Referenced by NOKIA_EncodeDateTime().
void StripSpaces | ( | char * | buff | ) |
Strips spaces from string.
[in,out] | buff | String where to strip buffers. |
Definition at line 713 of file misc.c.
Referenced by GSM_InitConnection_Log().