1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
#include "move_into_libpisock.h"
void new_Address(struct Address *a) {
int i;
/* Initialise attributes custom to this type of object */
for (i=0;i<5;i++) {
a->phoneLabel[i] = 0;
}
for (i=0;i<19;i++) {
a->entry[i] = NULL;
}
a->showPhone = 0;
}
void new_Contact(struct Contact *a) {
int i;
time_t now;
/* Initialise attributes custom to this type of object */
for (i=0;i<7;i++) {
a->phoneLabel[i] = 0;
}
for (i=0;i<3;i++) {
a->addressLabel[i] = 0;
}
for (i=0;i<2;i++) {
a->IMLabel[i] = 0;
}
for (i=0;i<NUM_CONTACT_ENTRIES;i++) {
a->entry[i] = NULL;
}
a->showPhone = 0;
a->birthdayFlag = 0;
a->reminder = -1;
for (i=0;i<MAX_CONTACT_BLOBS;i++) {
a->blob[i] = NULL;
}
a->picture = NULL;
time( &now );
a->birthday = *localtime( &now );
}
void new_ToDo(struct ToDo *a) {
time_t now;
/* Initialise attributes custom to this type of object */
a->description = NULL;
a->note = NULL;
a->priority = 3;
a->complete = 0;
a->indefinite = 1;
time( &now );
a->due = *localtime( &now );
}
void new_Memo(struct Memo *a) {
a->text = NULL;
}
void new_Appointment(struct Appointment *a) {
int i = 0;
a->description = NULL;
a->note = NULL;
a->exceptions = 0;
a->exception = NULL;
a->event = 0;
a->alarm = 0;
a->advance = 0;
a->advanceUnits = 0;
a->repeatForever = 0;
a->repeatFrequency = 0;
a->repeatDay = 0;
for (i = 0; i < 7; i++) {
a->repeatDays[i] = 0;
}
a->repeatWeekstart = 0;
a->exceptions = 0;
a->begin.tm_hour = 0;
a->begin.tm_min = 0;
a->begin.tm_sec = 0;
a->begin.tm_year = 2000;
a->begin.tm_mon = 0;
a->begin.tm_mday = 0;
a->begin.tm_isdst = -1;
a->end.tm_hour = 0;
a->end.tm_min = 0;
a->end.tm_sec = 0;
a->end.tm_year = 2000;
a->end.tm_mon = 0;
a->end.tm_mday = 0;
a->end.tm_isdst = -1;
}
|