summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2008-03-18 11:24:44 +0000
committerdeva <deva>2008-03-18 11:24:44 +0000
commit589fd5ffdeaae87410c31c497083e609e7ae1f53 (patch)
treec8c7eada1049e3ed256248200ec1e76345276e2e
parenta860976a62d206a1de5aa46f624bcac0036f47c2 (diff)
Added journal commit code.
-rw-r--r--server/AUTHORS5
-rw-r--r--server/etc/pracrod.conf3
-rw-r--r--server/src/Makefile.am2
-rw-r--r--server/src/macro_parser.cc7
-rw-r--r--server/src/server.cc13
5 files changed, 24 insertions, 6 deletions
diff --git a/server/AUTHORS b/server/AUTHORS
index fffb7ba..d3d20c2 100644
--- a/server/AUTHORS
+++ b/server/AUTHORS
@@ -2,4 +2,7 @@ Main developer:
Bent Bisballe Nyeng (deva@aasimon.org)
Base64 code:
- Peter Skaarup (piparum@piparum.dk) \ No newline at end of file
+ Peter Skaarup (piparum@piparum.dk)
+
+Qt Client:
+ Lars Bisballe Jensen (elsenator@gmail.com) \ No newline at end of file
diff --git a/server/etc/pracrod.conf b/server/etc/pracrod.conf
index ddf1856..c29eb1d 100644
--- a/server/etc/pracrod.conf
+++ b/server/etc/pracrod.conf
@@ -1 +1,4 @@
port = 12345;
+
+journal_commit_addr = "localhost";
+journal_commit_port = 4321;
diff --git a/server/src/Makefile.am b/server/src/Makefile.am
index 672b8e7..f145250 100644
--- a/server/src/Makefile.am
+++ b/server/src/Makefile.am
@@ -11,6 +11,7 @@ pracrod_SOURCES = \
database.cc \
configuration.cc \
exception.cc \
+ journal_commit.cc \
log.cc \
macro_parser.cc \
resumeparser.cc \
@@ -26,6 +27,7 @@ EXTRA_DIST = \
database.h \
debug.h \
exception.h \
+ journal_commit.h \
log.h \
macro.h \
macro_parser.h \
diff --git a/server/src/macro_parser.cc b/server/src/macro_parser.cc
index aeeb84f..7fc9609 100644
--- a/server/src/macro_parser.cc
+++ b/server/src/macro_parser.cc
@@ -70,6 +70,13 @@ static void start_hndl(void *p, const char *el, const char **attr)
// Do something reasonable with them...
+ if(name == "macro") {
+ printf("Macro %s %s\n", attributes["name"].c_str(), attributes["resume"].c_str());
+ parser->macro->name = attributes["name"];
+ parser->macro->format = attributes["resume"];
+ // return;
+ }
+
if(name == "include") {
Macro inc;
diff --git a/server/src/server.cc b/server/src/server.cc
index 815f0db..756539f 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -50,6 +50,8 @@
#include "tostring.h"
#include <time.h>
+#include "journal_commit.h"
+
static void send_macro_widget(Widget &widget, TCPSocket &socket, std::string tabs)
{
socket.write(tabs + "<" + widget.type);
@@ -113,14 +115,15 @@ static void connection(TCPSocket &socket)
Macro macro;
parse_macro(commit.macro, macro);
- //parse_macro("example", macro);
-
- macro.format = "Det koster 50$$\\n\\tLinse: ${linse}D\\n"
- "\\y${combo}\\\\\\nHævelse: ${radio}\\n\\n${spl_note}";
std::string resume = resume_parser(macro.format.c_str(), commit);
- printf("%s\n", resume.c_str());
+ std::string journal_commit_addr = config()->lookup("journal_commit_addr");
+ int journal_commit_port = config()->lookup("journal_commit_port");
+
+ journal_commit(transaction.cpr.c_str(), transaction.user.c_str(),
+ journal_commit_addr.c_str(), journal_commit_port,
+ resume.c_str(), resume.length());
i++;
}