Gammu internals
1.38.0
|
Data Structures | |
struct | GSM_DateTime |
struct | GSM_DeltaTime |
Functions | |
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) |
char * | DayOfWeek (unsigned int year, unsigned int month, unsigned int day) |
void | GSM_GetCurrentDateTime (GSM_DateTime *Date) |
time_t | Fill_Time_T (GSM_DateTime DT) |
int | GSM_GetLocalTimezoneOffset (void) |
void | Fill_GSM_DateTime (GSM_DateTime *Date, time_t timet) |
void | GSM_DateTimeFromTimestamp (GSM_DateTime *Date, const char *str) |
void | GSM_DateTimeToTimestamp (GSM_DateTime *Date, char *str) |
char * | OSDateTime (GSM_DateTime dt, gboolean TimeZone) |
char * | OSDate (GSM_DateTime dt) |
gboolean | CheckDate (GSM_DateTime *date) |
gboolean | CheckTime (GSM_DateTime *date) |
Date and time handling.
gboolean CheckDate | ( | GSM_DateTime * | date | ) |
Checks whether date is valid. This does not check time, see CheckTime for this.
date | Structure where to check date. |
Definition at line 349 of file misc.c.
References GSM_DateTime::Day, GSM_DateTime::Month, and GSM_DateTime::Year.
Referenced by GSM_DecodeSMSDateTime(), N71_65_DecodePhonebook(), ReadVCALDateTime(), and RecalcDateTime().
gboolean CheckTime | ( | GSM_DateTime * | date | ) |
Checks whether time is valid. This does not check date, see CheckDate for this.
date | Structure where to check time. |
Definition at line 363 of file misc.c.
References GSM_DateTime::Hour, GSM_DateTime::Minute, and GSM_DateTime::Second.
Referenced by GSM_DecodeSMSDateTime(), ReadVCALDateTime(), and RecalcDateTime().
char* DayOfWeek | ( | unsigned int | year, |
unsigned int | month, | ||
unsigned int | day | ||
) |
Returns string for current day of week.
year | Year. |
month | Month. |
day | Day. |
Return textual representation of day of week;
Definition at line 129 of file misc.c.
References GetDayOfWeek().
Referenced by dbg_vprintf().
void Fill_GSM_DateTime | ( | GSM_DateTime * | Date, |
time_t | timet | ||
) |
Converts time_t to gammu GSM_DateTime structure.
Date | Storage for date. |
timet | Input date. |
Definition at line 170 of file misc.c.
References GSM_DateTime::Day, GSM_GetLocalTimezoneOffset(), GSM_DateTime::Hour, GSM_DateTime::Minute, GSM_DateTime::Month, GSM_DateTime::Second, GSM_DateTime::Timezone, and GSM_DateTime::Year.
Referenced by DUMMY_GetFolderListing(), DUMMY_GetNextFileFolder(), GetTimeDifference(), GSM_AddTime(), GSM_DateTimeFromTimestamp(), GSM_DecodeMMSFileToMultiPart(), GSM_GetCurrentDateTime(), GSM_ReadFile(), and ReadVCALDateTime().
time_t Fill_Time_T | ( | GSM_DateTime | DT | ) |
Converts GSM_DateTime to time_t.
DT | Input timestamp. |
Definition at line 189 of file misc.c.
References GSM_DateTime::Day, dbgprintf, GSM_DateTime::Hour, GSM_DateTime::Minute, GSM_DateTime::Month, OSDate(), GSM_DateTime::Second, and GSM_DateTime::Year.
Referenced by GetTimeDifference(), GSM_DateTimeToTimestamp(), GSM_SetCalendarRecurranceRepeat(), NOKIA_EncodeDateTime(), and ReadVCALDateTime().
int GetDayOfWeek | ( | unsigned int | year, |
unsigned int | month, | ||
unsigned int | day | ||
) |
Return day of week index.
Definition at line 117 of file misc.c.
References RecalcDate().
Referenced by DayOfWeek(), GSM_DecodeVCAL_RRULE(), GSM_GetCalendarRecurranceRepeat(), GSM_SetCalendarRecurranceRepeat(), and OSDate().
int GetDayOfYear | ( | unsigned int | year, |
unsigned int | month, | ||
unsigned int | day | ||
) |
Return day of year index.
Definition at line 93 of file misc.c.
References RecalcDate().
Referenced by GSM_DecodeVCAL_RRULE().
int GetWeekOfMonth | ( | unsigned int | year, |
unsigned int | month, | ||
unsigned int | day | ||
) |
Return day of week index.
Definition at line 105 of file misc.c.
References RecalcDate().
Referenced by GSM_DecodeVCAL_RRULE().
void GSM_DateTimeFromTimestamp | ( | GSM_DateTime * | Date, |
const char * | str | ||
) |
Converts string (seconds since epoch) to gammu GSM_DateTime structure.
Date | Storage for date. |
str | Input date. |
Definition at line 162 of file misc.c.
References Fill_GSM_DateTime().
void GSM_DateTimeToTimestamp | ( | GSM_DateTime * | Date, |
char * | str | ||
) |
Converts gammu GSM_DateTime structure to string (seconds since epoch).
Date | Date. |
str | Strorage for string. |
Definition at line 155 of file misc.c.
References Fill_Time_T().
void GSM_GetCurrentDateTime | ( | GSM_DateTime * | Date | ) |
Returns current timestamp.
Date | Storage for date time structure. |
Definition at line 184 of file misc.c.
References Fill_GSM_DateTime().
Referenced by dbg_vprintf(), DUMMY_GetAlarm(), DUMMY_GetDateTime(), GSM_EncodeEMSMultiPartSMS(), GSM_InitConnection_Log(), GSM_IsCalendarNoteFromThePast(), GSM_MakeMultiPartSMS(), GSM_MakeSMSIDFromTime(), GSM_ReadDevice(), GSM_SetDefaultSMSData(), and NOKIA_EncodeDateTime().
int GSM_GetLocalTimezoneOffset | ( | void | ) |
Returns the local timezone offset in seconds. For example 7200 for CEST.
Definition at line 146 of file misc.c.
Referenced by Fill_GSM_DateTime().
char* OSDate | ( | GSM_DateTime | dt | ) |
Converts date from timestamp to string according to OS settings.
dt | Input timestamp. |
Definition at line 305 of file misc.c.
References GSM_DateTime::Day, GetDayOfWeek(), GSM_DateTime::Hour, GSM_DateTime::Minute, GSM_DateTime::Month, GSM_DateTime::Second, and GSM_DateTime::Year.
Referenced by Fill_Time_T(), GSM_EncodeSMSDateTime(), GSM_ReadFile(), and ReadVCALDate().
char* OSDateTime | ( | GSM_DateTime | dt, |
gboolean | TimeZone | ||
) |
Converts timestamp to string according to OS settings.
dt | Input timestamp. |
TimeZone | Whether to include time zone. |
Definition at line 264 of file misc.c.
References GSM_DateTime::Day, GSM_DateTime::Hour, GSM_DateTime::Minute, GSM_DateTime::Month, RecalcDateTime(), GSM_DateTime::Second, GSM_DateTime::Timezone, and GSM_DateTime::Year.
Referenced by GSM_DecodeMMSFileToMultiPart(), and GSM_DecodeSMSDateTime().