forked from sirdude/gurbalib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemail.c
71 lines (58 loc) · 1.1 KB
/
email.c
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
/* This file is used by the email_d to pass email to an object */
string to, from, subject, date;
string *lines;
static void restore_me(string myfile) {
console_msg("Calling restore_object on : " + myfile + "\n");
unguarded("restore_object", myfile);
}
static void save_me(string myfile) {
console_msg("Calling save_me on : " + myfile + "\n");
unguarded("save_object", myfile);
}
int is_email(string name) {
if (!date) {
return 0;
} else {
return 1;
}
}
int set_to(string who) {
if (USER_D->user_exists(who)) {
to = who;
return 1;
}
return 0;
}
string query_to(void) {
return to;
}
int set_from(string who) {
if (USER_D->user_exists(who)) {
from = who;
return 1;
}
return 0;
}
string query_from(void) {
return from;
}
int set_subject(string what) {
subject = what;
return 1;
}
string query_subject(void) {
return subject;
}
string query_date(void) {
return date;
}
int set_date(void) {
date = ctime(time());
return 1;
}
int set_lines(string *data) {
lines = data;
}
string *query_lines(void) {
return lines;
}