Numerous updates:

* Add makefile to install data

* Reference text is now formatted

* UTF-8 string processing
This commit is contained in:
David Baer
2015-08-06 14:31:38 -04:00
parent af38b1eafc
commit cfc0ba7e9a
13 changed files with 269 additions and 7 deletions

View File

@@ -1,7 +1,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libxml/tree.h>
#include "sermon.h"
#include "xml.h"
extern int yyparse(Sermon *);
extern FILE* yyin;
@@ -16,6 +18,7 @@ void usage(const char* progname) {
int main(int argc, char* argv[]) {
Sermon sermon;
xmlDocPtr document;
int i = 0, block = 0, normal = 0;
const char* progname = argv[0], *filename = NULL;
while (++i < argc) {
@@ -38,6 +41,7 @@ int main(int argc, char* argv[]) {
yyin = fopen(argv[1], "rt");
}
yyparse(&sermon);
/*
printf("Parsed sermon.\n");
printf("TITLE=%s\n", sermon.sermonTitle ? sermon.sermonTitle : "none");
printf("AUTHOR=%s\n", sermon.sermonAuthor ? sermon.sermonAuthor : "none");
@@ -55,6 +59,13 @@ int main(int argc, char* argv[]) {
printf(" - %s: %s\n", sermon.sermonReferences[i].refId, sermon.sermonReferences[i].refText);
}
printf("\n");
*/
document = sermonToXmlDoc(&sermon);
printXML(document);
xmlFreeDoc(document);
/* clean up, clean up, everybody, everywhere! */
FreeSermon(&sermon);
if (strcmp(filename, "-") != 0) {
fclose(yyin);