#define DAY_RECORD_DATE 9 #define APP_RECORD_TITLE 41 #define APP_RECORD_INFO 301 #define CAL_OK 1 #define CAL_ERROR 0 #define CAL_CREATE 1 #define CAL_CHECK 0 #define CAL_READ "r+" #define CAL_WRITE "w" #define DAY_COMPARE_EQUAL 0 #define DAY_COMPARE_BEFORE -1 #define DAY_COMPARE_AFTER 1 #define MAX_PARTICIPANTS 10 typedef struct dayApp *dayAppP; typedef struct appList *appListP; typedef struct calList *calListP; struct participant { char alias[40]; }; struct dayApp { int start; int end; char title[APP_RECORD_TITLE]; char info[APP_RECORD_INFO]; int status; int participants_count; struct participant participants[MAX_PARTICIPANTS]; }; struct appList { struct dayApp app; appListP next; appListP previous; calListP day_rec; }; struct dayStruct { long date; int app_counter; }; struct calList { struct dayStruct day_struct; appListP app_list; calListP previous; calListP next; }; /* AOPcalDb exported functions. */ extern int apiDbInitilizeDb(char *file_name); extern int apiDbInsertAppointment(dayAppP rec, int year, int month, int day); extern dayAppP apiDbGetDateAppointments(int year, int month, int day, int *counter); extern dayAppP apiDbGetAppointment(int year, int month, int day, int start_time); extern int apiDbDeleteAppointment(int year, int month, int day, int start_time); extern int apiDbUpdateAppointment(int year, int month, int day, int start_time, dayAppP rec);