Gammu internals  1.38.0
gsmcal.c File Reference
#include <string.h>
#include <time.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <gammu-calendar.h>
#include <gammu-unicode.h>
#include "../misc/misc.h"
#include "../debug.h"
#include "gsmmisc.h"
#include "gsmcal.h"
#include "../misc/coding/coding.h"
#include "../../helper/string.h"
Include dependency graph for gsmcal.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE
 
#define NEXT_NOSPACE(terminate)
 
#define NEXT_NONUMBER(terminate)
 
#define NEXT_CHAR(terminate)
 
#define NEXT_CHAR_NOERR(terminate)
 
#define GET_DOW(type, terminate)
 
#define GET_NUMBER(type, terminate)
 
#define GET_FREQUENCY(terminate)   GET_NUMBER(CAL_REPEAT_FREQUENCY, terminate);
 

Functions

void GSM_SetCalendarRecurranceRepeat (GSM_Debug_Info *di, unsigned char *rec, unsigned char *endday, GSM_CalendarEntry *entry)
 
void GSM_GetCalendarRecurranceRepeat (GSM_Debug_Info *di, unsigned char *rec, unsigned char *endday, GSM_CalendarEntry *entry)
 
gboolean GSM_IsCalendarNoteFromThePast (GSM_CalendarEntry *note)
 
void GSM_CalendarFindDefaultTextTimeAlarmPhone (GSM_CalendarEntry *entry, int *Text, int *Time, int *Alarm, int *Phone, int *EndTime, int *Location)
 
GSM_DateTime VCALTimeDiff (GSM_DateTime *Alarm, GSM_DateTime *Time)
 
GSM_Error GSM_Translate_Category_From_VCal (const char *string, GSM_CalendarNoteType *Type)
 
GSM_Error GSM_Translate_Category_To_VCal (char *string, const GSM_CalendarNoteType Type)
 
GSM_Error GSM_EncodeVCAL_RRULE (char *Buffer, const size_t buff_len, size_t *Length, GSM_CalendarEntry *note, int TimePos UNUSED, GSM_VCalendarVersion Version)
 
void GSM_Calendar_AdjustDate (GSM_CalendarEntry *note, GSM_DeltaTime *delta)
 
void GSM_ToDo_AdjustDate (GSM_ToDoEntry *note, GSM_DeltaTime *delta)
 
GSM_Error GSM_EncodeVCALENDAR (char *Buffer, const size_t buff_len, size_t *Length, GSM_CalendarEntry *note, const gboolean header, const GSM_VCalendarVersion Version)
 
void GSM_ToDoFindDefaultTextTimeAlarmCompleted (GSM_ToDoEntry *entry, int *Text, int *Alarm, int *Completed, int *EndTime, int *Phone)
 
GSM_Error GSM_EncodeVTODO (char *Buffer, const size_t buff_len, size_t *Length, const GSM_ToDoEntry *note, const gboolean header, const GSM_VToDoVersion Version)
 
GSM_DeltaTime ReadVCALTriggerTime (unsigned char *Buffer)
 
int GSM_Make_VCAL_Lines (unsigned char *Buffer, int *lBuffer)
 
GSM_Error GSM_DecodeVCAL_DOW (const char *Buffer, int *Output)
 
GSM_Error GSM_DecodeVCAL_RRULE (GSM_Debug_Info *di, const char *Buffer, GSM_CalendarEntry *Calendar, int TimePos)
 
GSM_Error GSM_DecodeVCALENDAR_VTODO (GSM_Debug_Info *di, char *Buffer, size_t *Pos, GSM_CalendarEntry *Calendar, GSM_ToDoEntry *ToDo, GSM_VCalendarVersion CalVer, GSM_VToDoVersion ToDoVer)
 
GSM_Error GSM_DecodeVNOTE (char *Buffer, size_t *Pos, GSM_NoteEntry *Note)
 
GSM_Error GSM_EncodeVNTFile (char *Buffer, const size_t buff_len, size_t *Length, GSM_NoteEntry *Note)
 

Detailed Description

Author
Michal Čihař micha.nosp@m.l@ci.nosp@m.har.c.nosp@m.om
Marcin Wiacek
Date
2002-2007

Definition in file gsmcal.c.

Macro Definition Documentation

§ GET_DOW

#define GET_DOW (   type,
  terminate 
)
Value:
Calendar->Entries[Calendar->EntriesNum].EntryType = type; \
Calendar->Entries[Calendar->EntriesNum].AddError = ERR_NONE; \
if (GSM_DecodeVCAL_DOW(pos, &(Calendar->Entries[Calendar->EntriesNum].Number)) != ERR_NONE) return ERR_UNKNOWN; \
Calendar->EntriesNum++; \
NEXT_CHAR(1); \
NEXT_CHAR_NOERR(terminate);
GSM_Error GSM_DecodeVCAL_DOW(const char *Buffer, int *Output)
Definition: gsmcal.c:1261
#define NEXT_CHAR(terminate)
#define NEXT_CHAR_NOERR(terminate)

Referenced by GSM_DecodeVCAL_RRULE().

§ GET_FREQUENCY

#define GET_FREQUENCY (   terminate)    GET_NUMBER(CAL_REPEAT_FREQUENCY, terminate);

Referenced by GSM_DecodeVCAL_RRULE().

§ GET_NUMBER

#define GET_NUMBER (   type,
  terminate 
)
Value:
Calendar->Entries[Calendar->EntriesNum].AddError = ERR_NONE; \
Calendar->Entries[Calendar->EntriesNum].EntryType = type; \
Calendar->Entries[Calendar->EntriesNum].Number = atoi(pos); \
Calendar->EntriesNum++; \
NEXT_NONUMBER(terminate);

Referenced by GSM_DecodeVCAL_RRULE().

§ NEXT_CHAR

#define NEXT_CHAR (   terminate)
Value:
if (*pos) pos++; \
if (terminate && *pos == 0) return ERR_UNKNOWN;

Referenced by GSM_DecodeVCAL_RRULE().

§ NEXT_CHAR_NOERR

#define NEXT_CHAR_NOERR (   terminate)
Value:
if (*pos) pos++; \
if (terminate && *pos == 0) return ERR_NONE;

§ NEXT_NONUMBER

#define NEXT_NONUMBER (   terminate)
Value:
while (isdigit((int)*pos) && *pos) pos++; \
if (terminate && *pos == 0) return ERR_NONE;

§ NEXT_NOSPACE

#define NEXT_NOSPACE (   terminate)
Value:
while (isspace((int)*pos) && *pos) pos++; \
if (terminate && *pos == 0) return ERR_NONE;

Referenced by GSM_DecodeVCAL_RRULE().