-\r
#include "XMLTree.h"\r
-\r
+#include <cstring>\r
// functions to convert tag positions to the corresponding tree node and viceversa. \r
// These are implemented in order to be able to change the tree and Tags representations, \r
// without affecting the code so much.\r
setbit(par_aux,npar,OP); // marks a new opening parenthesis for the tree root\r
npar++;\r
\r
- tags_aux = (TagType *)malloc(sizeof(TagType));\r
+ tags_aux = (TagType *) malloc(sizeof(TagType));\r
if (!tags_aux) {\r
fprintf(stderr, "Error: not enough memory\n");\r
return NULLT;\r
fprintf(stderr, "Error: not enough memory\n");\r
return NULLT; \r
}\r
+\r
setbit(par_aux,npar,OP); // marks a new opening parenthesis\r
\r
// transforms the tagname into a tag identifier. If the tag is new, we insert\r
TagName[i] = (unsigned char *)malloc(sizeof(unsigned char)*(strlen((const char *)tagname)+1));\r
strcpy((char *)TagName[i], (const char *)tagname);\r
} \r
- \r
- tags_aux = (TagType *)realloc(tags_aux, sizeof(TagType)*(npar + 1));\r
-\r
+ tags_aux = (TagType *) realloc(tags_aux, sizeof(TagType)*(npar + 1));\r
if (!tags_aux) {\r
fprintf(stderr, "Error: not enough memory\n");\r
return NULLT;\r
/** GetText(d): returns the text corresponding to document with\r
* id d. */\r
uchar* GetText(DocID d) {\r
- Text->GetText(d);\r
+ return Text->GetText(d);\r
}\r
\r
/** Save: saves XML tree data structure to file. */\r
-FLAGS = -O9 -I./libcds/includes/\r
+FLAGS = -O3 -I./libcds/includes/\r
\r
OBJECTS=libcds/lib/libcds.a\r
-OBJECTS_TC= TextCollection/BitRank.o TextCollection/dynFMI.o TextCollection/rbtree.o TextCollection/Tools.o TextCollection/bittree.o TextCollection/handle.o TextCollection/testTextCollection.o TextCollection/CSA.o TextCollection/pos.o TextCollection/TextCollection.o\r
+OBJECTS_TC= TextCollection/BitRank.o TextCollection/dynFMI.o TextCollection/rbtree.o TextCollection/Tools.o TextCollection/bittree.o TextCollection/handle.o TextCollection/CSA.o TextCollection/pos.o TextCollection/TextCollection.o\r
\r
\r
all: libcds text_collection XMLTree\r