15 |
|
extern "C" |
16 |
|
{ |
17 |
|
#include <pwd.h> |
18 |
+ |
#include <sys/utsname.h> |
19 |
|
#include <unistd.h> |
20 |
|
} |
21 |
|
|
73 |
|
bool Zoe::debug(false), Zoe::collector(false), Zoe::publisher(false); |
74 |
|
ext::String Zoe::program, Zoe::config("zoe.xml"); |
75 |
|
|
76 |
+ |
ext::String Zoe::generator() |
77 |
+ |
{ |
78 |
+ |
utsname system; |
79 |
+ |
|
80 |
+ |
uname(&system); |
81 |
+ |
|
82 |
+ |
return ext::String("Zoe/0.9 (") + system.sysname + "; http://computers.doug" |
83 |
+ |
+ "lasthrift.net/zoe.xml)"; |
84 |
+ |
} |
85 |
+ |
|
86 |
|
void Zoe::configure() |
87 |
|
{ |
88 |
|
if (debug) cerr << "config = " << config << '\n'; |
173 |
|
api::Uuid::CreateSequential(id); |
174 |
|
|
175 |
|
buddy->setId(id); |
176 |
< |
db->Execute("INSERT INTO buddies (id, buddy) VALUES ('" + |
177 |
< |
lexical_cast<ext::String>(id) + "', '" + ext::String(*buddy) + |
167 |
< |
"')"); |
176 |
> |
db->Execute("INSERT INTO buddies (id, buddy) VALUES ('" + id + "', '" + |
177 |
> |
*buddy + "')"); |
178 |
|
|
179 |
|
buddies_.insert(*buddy); |
180 |
|
} |