You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(65) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(61) |
Feb
(111) |
Mar
(98) |
Apr
(33) |
May
(31) |
Jun
(64) |
Jul
(35) |
Aug
(50) |
Sep
(170) |
Oct
(89) |
Nov
(72) |
Dec
(214) |
2002 |
Jan
(74) |
Feb
(21) |
Mar
(5) |
Apr
(4) |
May
(61) |
Jun
(13) |
Jul
(3) |
Aug
(39) |
Sep
(14) |
Oct
(80) |
Nov
(22) |
Dec
(76) |
2003 |
Jan
(14) |
Feb
(59) |
Mar
(7) |
Apr
(5) |
May
|
Jun
(4) |
Jul
(6) |
Aug
(78) |
Sep
(68) |
Oct
(23) |
Nov
(25) |
Dec
(107) |
2004 |
Jan
(82) |
Feb
(75) |
Mar
(13) |
Apr
(9) |
May
(21) |
Jun
(2) |
Jul
(1) |
Aug
(52) |
Sep
(23) |
Oct
(15) |
Nov
(6) |
Dec
(60) |
2005 |
Jan
(125) |
Feb
(94) |
Mar
(32) |
Apr
(68) |
May
|
Jun
|
Jul
(11) |
Aug
(3) |
Sep
(15) |
Oct
(3) |
Nov
|
Dec
(58) |
2006 |
Jan
(46) |
Feb
(29) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(9) |
Dec
(9) |
2007 |
Jan
(62) |
Feb
(60) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(6) |
Aug
(3) |
Sep
(4) |
Oct
(2) |
Nov
(4) |
Dec
(46) |
2008 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(10) |
Dec
(49) |
2009 |
Jan
(14) |
Feb
(12) |
Mar
(37) |
Apr
(8) |
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(25) |
Oct
(48) |
Nov
(7) |
Dec
(45) |
2010 |
Jan
(15) |
Feb
(14) |
Mar
(7) |
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(28) |
Nov
|
Dec
(44) |
2011 |
Jan
(22) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(70) |
2012 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(128) |
2013 |
Jan
(8) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(2) |
Dec
(150) |
2014 |
Jan
(70) |
Feb
(44) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Sebastian B. <sb...@us...> - 2014-01-19 18:31:45
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22490 Modified Files: index_external.c Log Message: Splitting children directly following the root should work now. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- index_external.c 19 Jan 2014 18:31:24 -0000 1.11 +++ index_external.c 19 Jan 2014 18:31:43 -0000 1.12 @@ -350,22 +350,27 @@ int lchild; /* Read root node, we want to add the new element */ - bnode_read_block(idx, tmp, 0); + bnode_read_block(idx, tmp, idx->root_node); lchild = tmp->lchild; i = 0; - /* Find the separation key whose left child points to the block */ - for (i=0; i<tmp->num_elements && lchild != block; i++); + /* Find the separation key whose left child points to the splitted block */ + for (i=0; i<tmp->num_elements && lchild != block; i++) + lchild = bnode_get_ith_element_of_node(idx, tmp, i)->gchild; - if (i==tmp->num_elements) + if (tmp->num_elements == idx->max_elements_per_node) { fprintf(stderr, "Splitting a non-direct-child of the root node %d is not supported for now!\n", block); exit(1); } - fprintf(stderr, "Splitting the non-root node %d is not supported for now!\n", block); - exit(1); + struct bnode_element *e = bnode_get_ith_element_of_node(idx, tmp, i); + memmove(e + 1, e, (tmp->num_elements - i) * sizeof(struct bnode_element)); + *e = me_copy; + e->gchild = tmp3block; + tmp->num_elements++; + bnode_write_block(idx, tmp, idx->root_node); } } else { |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:31:27
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22459 Modified Files: index_external.c Log Message: Forgot to write out the changed node after splitting it. Fixed. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- index_external.c 19 Jan 2014 18:30:32 -0000 1.10 +++ index_external.c 19 Jan 2014 18:31:24 -0000 1.11 @@ -325,6 +325,8 @@ tmp->num_elements = median - 1; tmp->leaf = 1; bnode_clear_elements(idx, tmp, median); + /* This should be done as late as possible */ + bnode_write_block(idx, tmp, block); /* Second node */ idx->tmp3->num_elements = idx->max_elements_per_node - median; |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:30:34
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22361 Modified Files: index_external.c Log Message: Added debugging method to dump the children of a node. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- index_external.c 19 Jan 2014 18:30:10 -0000 1.9 +++ index_external.c 19 Jan 2014 18:30:32 -0000 1.10 @@ -263,6 +263,20 @@ } /** + * Dump the children of the given nodes. + */ +static void dump_node_children(struct index_external *idx, bnode *node, const char *prefix) +{ + int i; + printf("%s: ", prefix, node->lchild); + for (i=0;i<node->num_elements;i++) + { + printf("%d ",bnode_get_ith_element_of_node(idx, node, i)->gchild); + } + printf("\n"); +} + +/** * Inserts the given string into the bnode tree. * * @param idx |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:30:12
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22313 Modified Files: index_external.c Log Message: Fixed problem that we did not move the right amount of elements in the insert sort phase. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- index_external.c 19 Jan 2014 18:29:38 -0000 1.8 +++ index_external.c 19 Jan 2014 18:30:10 -0000 1.9 @@ -287,7 +287,7 @@ * insert the entry now */ struct bnode_element *e = bnode_get_ith_element_of_node(idx, tmp, i); - memmove(e + 1, e, (idx->max_elements_per_node - tmp->num_elements - 1) * sizeof(struct bnode_element)); + memmove(e + 1, e, (tmp->num_elements - i) * sizeof(struct bnode_element)); /* New element */ e->str_offset = offset; |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:29:40
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22223 Modified Files: index_external.c Log Message: Create a new root now instead of reusing the old as root when the root became full. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- index_external.c 19 Jan 2014 18:29:05 -0000 1.7 +++ index_external.c 19 Jan 2014 18:29:38 -0000 1.8 @@ -201,7 +201,7 @@ int i; bnode *tmp = idx->tmp; int prev_block; - int block = 0; + int block = idx->root_node; do { @@ -250,6 +250,19 @@ } /** + * Clear all elements of the given node begining at start. + * + * @param idx + * @param n + * @param start + */ +static void bnode_clear_elements(struct index_external *idx, bnode *n, int start) +{ + struct bnode_element *e = bnode_get_ith_element_of_node(idx, n, start); + memset(e, (idx->max_elements_per_node - start)*sizeof(struct bnode_element), 0); +} + +/** * Inserts the given string into the bnode tree. * * @param idx @@ -295,26 +308,27 @@ struct bnode_element me_copy = *me; /* First node */ - idx->tmp2->num_elements = median - 1; - idx->tmp2->leaf = 1; - memcpy(bnode_get_ith_element_of_node(idx, idx->tmp2, 0), bnode_get_ith_element_of_node(idx, tmp, 0), idx->tmp2->num_elements * sizeof(struct bnode_element)); - int tmp2block = bnode_add_block(idx, idx->tmp2); + tmp->num_elements = median - 1; + tmp->leaf = 1; + bnode_clear_elements(idx, tmp, median); /* Second node */ - idx->tmp3->num_elements = tmp->num_elements - median; + idx->tmp3->num_elements = idx->max_elements_per_node - median; idx->tmp3->leaf = 1; memcpy(bnode_get_ith_element_of_node(idx, idx->tmp3, 0), bnode_get_ith_element_of_node(idx, tmp, median), idx->tmp3->num_elements * sizeof(struct bnode_element)); + bnode_clear_elements(idx, tmp, idx->tmp3->num_elements); int tmp3block = bnode_add_block(idx, idx->tmp3); - if (block == 0) + if (block == idx->root_node) { /* Create a new root block if the root was getting full */ tmp->num_elements = 1; - tmp->lchild = tmp2block; + tmp->lchild = idx->root_node; tmp->leaf = 0; me_copy.gchild = tmp3block; *bnode_get_ith_element_of_node(idx, tmp, 0) = me_copy; - bnode_write_block(idx, tmp, 0); + bnode_clear_elements(idx, tmp, 1); + idx->root_node = bnode_add_block(idx, tmp); } else { int lchild; |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:29:07
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22171 Modified Files: index_external.c Log Message: Introduced a (still) non-persitent root block field, Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- index_external.c 19 Jan 2014 18:28:47 -0000 1.6 +++ index_external.c 19 Jan 2014 18:29:05 -0000 1.7 @@ -68,6 +68,9 @@ FILE *string_file; FILE *index_file; + /** Identifies the block for the root node. TODO: Make this persistent */ + int root_node; + bnode *tmp; bnode *tmp2; bnode *tmp3; @@ -419,7 +422,7 @@ goto bailout; idx->tmp->leaf = 1; - bnode_add_block(idx, idx->tmp); + idx->root_node = bnode_add_block(idx, idx->tmp); return &idx->index; bailout: |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:28:49
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22125 Modified Files: index_external.c Log Message: Catch another special insert case that is not supported yet. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- index_external.c 19 Jan 2014 18:28:25 -0000 1.5 +++ index_external.c 19 Jan 2014 18:28:47 -0000 1.6 @@ -314,7 +314,24 @@ bnode_write_block(idx, tmp, 0); } else { - fprintf(stderr, "Splitting the non-root node is not supported for now!\n"); + int lchild; + + /* Read root node, we want to add the new element */ + bnode_read_block(idx, tmp, 0); + + lchild = tmp->lchild; + i = 0; + + /* Find the separation key whose left child points to the block */ + for (i=0; i<tmp->num_elements && lchild != block; i++); + + if (i==tmp->num_elements) + { + fprintf(stderr, "Splitting a non-direct-child of the root node %d is not supported for now!\n", block); + exit(1); + } + + fprintf(stderr, "Splitting the non-root node %d is not supported for now!\n", block); exit(1); } } else |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:28:28
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22069 Modified Files: index_external.c Log Message: Refactored code to find a node/key and improved insertions. It is now possible to insert new entries into non-root. However, the second split will not work properly as the it is still assumed that the parent is the root that will contain only one element. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- index_external.c 19 Jan 2014 18:27:43 -0000 1.4 +++ index_external.c 19 Jan 2014 18:28:25 -0000 1.5 @@ -185,6 +185,68 @@ } /** + * Lookup the given text. + * + * @param idx + * @param text + * @param out_block + * @param out_index + * @return + */ +static int bnode_lookup(struct index_external *idx, const char *text, int *out_block, int *out_index) +{ + int i; + bnode *tmp = idx->tmp; + int prev_block; + int block = 0; + + do + { + bnode_read_block(idx, tmp, block); + prev_block = block; + + int lchild = tmp->lchild; + + /* Find the appropriate slot. TODO: Use binary search */ + for (i=0; i < tmp->num_elements; i++) + { + int cmp; + struct bnode_element *e = bnode_get_ith_element_of_node(idx, tmp, i); + char *str = bnode_read_string(idx, e); + if (!str) return 0; + + cmp = strcmp(str, text); + free(str); + + if (!cmp) + { + /* Direct match with a separation key */ + goto out; + } + + /* if str > text then we ascend to lchild (except if we are at a leaf, of course) */ + if (cmp > 0) + break; + + lchild = e->gchild; + } + + if (block == lchild && !tmp->leaf) + { + fprintf(stderr, "Endless loop detected!\n"); + return 0; + } + block = lchild; + } while (!tmp->leaf); + +out: + *out_block = prev_block; + *out_index = i; + + return 1; +} + +/** * Inserts the given string into the bnode tree. * * @param idx @@ -195,27 +257,17 @@ static int bnode_insert_string(struct index_external *idx, int did, int offset, const char *text) { int i; + int block; bnode *tmp = idx->tmp; - bnode_read_block(idx, tmp, 0); + if (!bnode_lookup(idx, text, &block, &i)) + return 0; - /* Find the appropriate slot. TODO: Use binary search */ - for (i=0; i < tmp->num_elements; i++) - { - struct bnode_element *e = bnode_get_ith_element_of_node(idx, tmp, i); - char *str = bnode_read_string(idx, e); - if (!str) return 0; - if (strcmp(str, text) > 0) - { - free(str); - break; - } - free(str); - } + bnode_read_block(idx, tmp, block); if (1) { - /* Recall that we allocate one more entry than it would fit in the block, so we surly can + /* Recall that we allocate in our temps one more entry than it would fit in the block, so we surly can * insert the entry now */ struct bnode_element *e = bnode_get_ith_element_of_node(idx, tmp, i); @@ -251,19 +303,25 @@ memcpy(bnode_get_ith_element_of_node(idx, idx->tmp3, 0), bnode_get_ith_element_of_node(idx, tmp, median), idx->tmp3->num_elements * sizeof(struct bnode_element)); int tmp3block = bnode_add_block(idx, idx->tmp3); - /* Insert separation value into the parent (which is the root for now) */ - tmp->num_elements = 1; - tmp->lchild = tmp2block; - tmp->leaf = 0; - me_copy.gchild = tmp3block; - *bnode_get_ith_element_of_node(idx, tmp, 0) = me_copy; - bnode_write_block(idx, tmp, 0); - - fprintf(stderr,"Splitting is not implemented yet!\n"); - exit(1); - /* Split node and allocate a new bnode */ + if (block == 0) + { + /* Create a new root block if the root was getting full */ + tmp->num_elements = 1; + tmp->lchild = tmp2block; + tmp->leaf = 0; + me_copy.gchild = tmp3block; + *bnode_get_ith_element_of_node(idx, tmp, 0) = me_copy; + bnode_write_block(idx, tmp, 0); + } else + { + fprintf(stderr, "Splitting the non-root node is not supported for now!\n"); + exit(1); + } + } else + { + /* There was enough space in the block, so we simply write it out */ + bnode_write_block(idx, tmp, block); } - bnode_write_block(idx, tmp, 0); return 1; } |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:28:09
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22028/tests Modified Files: index_unittest.c Log Message: Added Zauberlehrling as next document. Index: index_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/index_unittest.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- index_unittest.c 19 Jan 2014 18:27:07 -0000 1.7 +++ index_unittest.c 19 Jan 2014 18:28:07 -0000 1.8 @@ -26,6 +26,106 @@ #include "index_naive.h" #include "index_external.h" +static const char zauberlehrling[] = + "Hat der alte Hexenmeister\n" + "sich doch einmal wegbegeben!\n" + "Und nun sollen seine Geister\n" + "auch nach meinem Willen leben.\n" + "Seine Wort und Werke\n" + "merkt ich und den Brauch,\n" + "und mit Geistesstärke\n" + "tu ich Wunder auch.\n\n" + "Walle! walle\n" + "Manche Strecke,\n" + "daß, zum Zwecke,\n" + "Wasser fließe\n" + "und mit reichem, vollem Schwalle\n" + "zu dem Bade sich ergieße.\n\n" + "Und nun komm, du alter Besen!\n" + "Nimm die schlechten Lumpenhüllen;\n" + "bist schon lange Knecht gewesen:\n" + "nun erfülle meinen Willen!\n" + "Auf zwei Beinen stehe,\n" + "oben sei ein Kopf,\n" + "eile nun und gehe\n" + "mit dem Wassertopf!\n\n" + "Walle! walle\n" + "manche Strecke,\n" + "daß, zum Zwecke,\n" + "Wasser fließe\n" + "und mit reichem, vollem Schwalle\n" + "zu dem Bade sich ergieße.\n\n" + "Seht, er läuft zum Ufer nieder,\n" + "Wahrlich! ist schon an dem Flusse,\n" + "und mit Blitzesschnelle wieder\n" + "ist er hier mit raschem Gusse.\n" + "Schon zum zweiten Male!\n" + "Wie das Becken schwillt!\n" + "Wie sich jede Schale\n" + "voll mit Wasser füllt!\n\n" + "Stehe! stehe!\n" + "denn wir haben\n" + "deiner Gaben\n" + "vollgemessen! -\n" + "Ach, ich merk es! Wehe! wehe!\n" + "Hab ich doch das Wort vergessen!\n\n" + "Ach, das Wort, worauf am Ende\n" + "er das wird, was er gewesen.\n" + "Ach, er läuft und bringt behende!\n" + "Wärst du doch der alte Besen!\n" + "Immer neue Güsse\n" + "bringt er schnell herein,\n" + "Ach! und hundert Flüsse\n" + "stürzen auf mich ein.\n\n" + "Nein, nicht länger\n" + "kann ichs lassen;\n" + "will ihn fassen.\n" + "Das ist Tücke!\n" + "Ach! nun wird mir immer bänger!\n" + "Welche Miene! welche Blicke!\n\n" + "O du Ausgeburt der Hölle!\n" + "Soll das ganze Haus ersaufen?\n" + "Seh ich über jede Schwelle\n" + "doch schon Wasserströme laufen.\n" + "Ein verruchter Besen,\n" + "der nicht hören will!\n" + "Stock, der du gewesen,\n" + "steh doch wieder still!\n\n" + "Willst am Ende\n" + "gar nicht lassen?\n" + "Will dich fassen,\n" + "will dich halten\n" + "und das alte Holz behende\n" + "mit dem scharfen Beile spalten.\n\n" + "Seht da kommt er schleppend wieder!\n" + "Wie ich mich nur auf dich werfe,\n" + "gleich, o Kobold, liegst du nieder;\n" + "krachend trifft die glatte Schärfe.\n" + "Wahrlich, brav getroffen!\n" + "Seht, er ist entzwei!\n" + "Und nun kann ich hoffen,\n" + "und ich atme frei!\n\n" + "Wehe! wehe!\n" + "Beide Teile\n" + "stehn in Eile\n" + "schon als Knechte\n" + "völlig fertig in die Höhe!\n" + "Helft mir, ach! ihr hohen Mächte!\n\n" + "Und sie laufen! Naß und nässer\n" + "wirds im Saal und auf den Stufen.\n" + "Welch entsetzliches Gewässer!\n" + "Herr und Meister! hör mich rufen! -\n" + "Ach, da kommt der Meister!\n" + "Herr, die Not ist groß!\n" + "Die ich rief, die Geister\n" + "werd ich nun nicht los.\n\n" + "\"In die Ecke,\n" + "Besen, Besen!\n" + "Seids gewesen.\n" + "Denn als Geister\n" + "ruft euch nur zu diesem Zwecke,\n" + "erst hervor der alte Meister.\""; + /*******************************************************/ static int test_index_naive_callback_called; @@ -55,6 +155,9 @@ ok = index_put_document(index,12,"This is a short text."); CU_ASSERT(ok != 0); + ok = index_put_document(index,20,zauberlehrling); + CU_ASSERT(ok != 0); + nd = index_find_documents(index,test_index_naive_callback,NULL,1,"very"); CU_ASSERT(nd == 1); |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:27:46
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21965 Modified Files: index_external.c Log Message: Added first splitting of the full root node. Agains, everything is very simple and probably doesn't work yet. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- index_external.c 19 Jan 2014 18:27:25 -0000 1.3 +++ index_external.c 19 Jan 2014 18:27:43 -0000 1.4 @@ -43,14 +43,15 @@ { int str_offset; int str_len; - int child; int did; + int gchild; /* Child containing values that are greater */ }; struct bnode_header { int leaf; int num_elements; /* Number of following bnode_elements */ + int lchild; /* Child containing keys/strings that are all (lexicographical) smaller */ }; typedef struct bnode_header bnode; @@ -68,6 +69,8 @@ FILE *index_file; bnode *tmp; + bnode *tmp2; + bnode *tmp3; }; /** @@ -80,10 +83,10 @@ { struct bnode_header *bnode; - if (!(bnode = malloc(idx->block_size))) + if (!(bnode = malloc(idx->block_size + sizeof(struct bnode_element)))) return NULL; - memset(bnode, 0, idx->block_size); + memset(bnode, 0, idx->block_size + sizeof(struct bnode_element)); return bnode; } @@ -210,8 +213,10 @@ free(str); } - if (tmp->num_elements < idx->max_elements_per_node) + if (1) { + /* Recall that we allocate one more entry than it would fit in the block, so we surly can + * insert the entry now */ struct bnode_element *e = bnode_get_ith_element_of_node(idx, tmp, i); memmove(e + 1, e, (idx->max_elements_per_node - tmp->num_elements - 1) * sizeof(struct bnode_element)); @@ -219,11 +224,41 @@ /* New element */ e->str_offset = offset; e->str_len = strlen(text); - e->child = 0; + e->gchild = 0; e->did = did; tmp->num_elements++; - } else + } + + if (tmp->num_elements == idx->max_elements_per_node) { + /* Now we split the node into two nodes. We keep the median out as we + * insert it as a separation value for the two nodes on the parent. + */ + + int median = tmp->num_elements / 2; + struct bnode_element *me = bnode_get_ith_element_of_node(idx, tmp, median); + struct bnode_element me_copy = *me; + + /* First node */ + idx->tmp2->num_elements = median - 1; + idx->tmp2->leaf = 1; + memcpy(bnode_get_ith_element_of_node(idx, idx->tmp2, 0), bnode_get_ith_element_of_node(idx, tmp, 0), idx->tmp2->num_elements * sizeof(struct bnode_element)); + int tmp2block = bnode_add_block(idx, idx->tmp2); + + /* Second node */ + idx->tmp3->num_elements = tmp->num_elements - median; + idx->tmp3->leaf = 1; + memcpy(bnode_get_ith_element_of_node(idx, idx->tmp3, 0), bnode_get_ith_element_of_node(idx, tmp, median), idx->tmp3->num_elements * sizeof(struct bnode_element)); + int tmp3block = bnode_add_block(idx, idx->tmp3); + + /* Insert separation value into the parent (which is the root for now) */ + tmp->num_elements = 1; + tmp->lchild = tmp2block; + tmp->leaf = 0; + me_copy.gchild = tmp3block; + *bnode_get_ith_element_of_node(idx, tmp, 0) = me_copy; + bnode_write_block(idx, tmp, 0); + fprintf(stderr,"Splitting is not implemented yet!\n"); exit(1); /* Split node and allocate a new bnode */ @@ -263,6 +298,21 @@ } } +void index_external_dispose(struct index *index) +{ + struct document_node *d; + struct index_external *idx; + + idx = (struct index_external*)index; + + if (idx->string_file) fclose(idx->string_file); + if (idx->index_file) fclose(idx->index_file); + if (idx->tmp3) bnode_free(idx, idx->tmp3); + if (idx->tmp2) bnode_free(idx, idx->tmp2); + if (idx->tmp) bnode_free(idx, idx->tmp); + free(idx); +} + struct index *index_external_create(const char *filename) { struct index_external *idx; @@ -277,51 +327,29 @@ idx->max_elements_per_node = (idx->block_size - sizeof(struct bnode_header)) / sizeof(struct bnode_element); if (!(idx->tmp = bnode_create(idx))) - { - free(idx); - return NULL; - } + goto bailout; + + if (!(idx->tmp2 = bnode_create(idx))) + goto bailout; + + if (!(idx->tmp3 = bnode_create(idx))) + goto bailout; sm_snprintf(buf, sizeof(buf), "%s.index", filename); if (!(idx->index_file = fopen(buf, "w+b"))) - { - bnode_free(idx, idx->tmp); - free(idx); - return NULL; - } + goto bailout; sm_snprintf(buf, sizeof(buf), "%s.strings", filename); if (!(idx->string_file = fopen(buf, "w+b"))) - { - fclose(idx->index_file); - bnode_free(idx, idx->tmp); - free(idx); - return NULL; - } - - if (!(bnode_write_block(idx, idx->tmp, 0))) - { - fclose(idx->string_file); - fclose(idx->index_file); - bnode_free(idx, idx->tmp); - free(idx); - return NULL; + goto bailout; - } + idx->tmp->leaf = 1; + bnode_add_block(idx, idx->tmp); return &idx->index; -} - -void index_external_dispose(struct index *index) -{ - struct document_node *d; - struct index_external *idx; - - idx = (struct index_external*)index; - - fclose(idx->index_file); - fclose(idx->string_file); - free(index); +bailout: + index_external_dispose(&idx->index); + return NULL; } int index_external_put_document(struct index *index, int did, const char *text) |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:27:27
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21934 Modified Files: index_external.c Log Message: bnode_add_block() now returns -1 in case of an error. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index_external.c 19 Jan 2014 18:26:48 -0000 1.2 +++ index_external.c 19 Jan 2014 18:27:25 -0000 1.3 @@ -134,12 +134,13 @@ * * @param idx * @param node - * @return + * @return -1 for an error. */ static int bnode_add_block(struct index_external *idx, const bnode *node) { int new_address = idx->number_of_blocks++; - bnode_write_block(idx, node, new_address); + if (!bnode_write_block(idx, node, new_address)) + return -1; return new_address; } |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:27:09
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21885/tests Modified Files: index_unittest.c Log Message: Refactored unit testing to have a core unit test. Index: index_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/index_unittest.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- index_unittest.c 19 Jan 2014 18:26:27 -0000 1.6 +++ index_unittest.c 19 Jan 2014 18:27:07 -0000 1.7 @@ -40,16 +40,13 @@ CU_ASSERT(0); } -/*******************************************************/ - -/* @Test */ -void test_index_naive(void) +static void test_index_for_algorithm(struct index_algorithm *alg, const char *name) { struct index *index; int ok; int nd; - index = index_create(&index_naive,"naive-index.dat"); + index = index_create(alg, name); CU_ASSERT(index != NULL); ok = index_put_document(index,4,"This is a very long text."); @@ -73,29 +70,15 @@ /*******************************************************/ /* @Test */ -void test_index_external(void) +void test_index_naive(void) { - struct index *index; - int ok; - int nd; - - index = index_create(&index_external,"external-index.dat"); - CU_ASSERT(index != NULL); - - ok = index_put_document(index,4,"This is a very long text."); - CU_ASSERT(ok != 0); - - ok = index_put_document(index,12,"This is a short text."); - CU_ASSERT(ok != 0); - - nd = index_find_documents(index,test_index_naive_callback,NULL,1,"very"); - CU_ASSERT(nd == 1); - - ok = index_remove_document(index,4); - CU_ASSERT(ok != 0); + test_index_for_algorithm(&index_naive, "naive-index.dat"); +} - nd = index_find_documents(index,test_index_naive_callback2,NULL,1,"very"); - CU_ASSERT(nd == 0); +/*******************************************************/ - index_dispose(index); +/* @Test */ +void test_index_external(void) +{ + test_index_for_algorithm(&index_external, "external-index.dat"); } |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:26:50
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21838 Modified Files: index_external.c Log Message: Incremental checkin for the external FTS index data structure. The implementation is very simple and not finished (i.e., working). Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- index_external.c 19 Jan 2014 18:26:26 -0000 1.1 +++ index_external.c 19 Jan 2014 18:26:48 -0000 1.2 @@ -20,9 +20,12 @@ * @file index_external.c */ +#include <errno.h> #include <stdlib.h> +#include <stdio.h> #include <string.h> +#include "debug.h" #include "lists.h" #include "index.h" @@ -36,29 +39,274 @@ #include <varargs.h> #endif -struct document_node +struct bnode_element { - struct node node; + int str_offset; + int str_len; + int child; int did; - char *txt; }; +struct bnode_header +{ + int leaf; + int num_elements; /* Number of following bnode_elements */ +}; + +typedef struct bnode_header bnode; + struct index_external { struct index index; struct list document_list; + + int block_size; + int max_elements_per_node; + int number_of_blocks; + + FILE *string_file; + FILE *index_file; + + bnode *tmp; }; +/** + * Create a new node for the given index/btree. + * + * @param idx + * @return + */ +static bnode *bnode_create(struct index_external *idx) +{ + struct bnode_header *bnode; + + if (!(bnode = malloc(idx->block_size))) + return NULL; + + memset(bnode, 0, idx->block_size); + return bnode; +} + +/** + * Free the memory associated to the given bnode. + * + * @param idx + * @param bnode + */ +static void bnode_free(struct index_external *idx, bnode *bnode) +{ + free(bnode); +} + +/** + * Return the i'th element of the given bnode. + * + * @param idx + * @param bnode_header + * @param elem + * @return + */ +static struct bnode_element *bnode_get_ith_element_of_node(struct index_external *idx, bnode *bnode, int i) +{ + return &(((struct bnode_element*)(bnode+1))[i]); +} + +/** + * Writes the given block to the given address. + * + * @param idx + * @param node + * @param address + * @return + */ +static int bnode_write_block(struct index_external *idx, const bnode *node, int address) +{ + unsigned int offset = address * idx->block_size; + if (fseek(idx->index_file, offset, SEEK_SET)) + return 0; + if (fwrite(node, 1, idx->block_size, idx->index_file) != idx->block_size) + return 0; + return 1; +} + +/** + * Adds the given block to the index and return the block number. + * + * @param idx + * @param node + * @return + */ +static int bnode_add_block(struct index_external *idx, const bnode *node) +{ + int new_address = idx->number_of_blocks++; + bnode_write_block(idx, node, new_address); + return new_address; +} + +/** + * Reads the given block for the given address to the given node. + * + * @param idx + * @param node + * @param address + * @return + */ +static int bnode_read_block(struct index_external *idx, bnode *node, int address) +{ + size_t rc; + unsigned int offset = address * idx->block_size; + if (fseek(idx->index_file, offset, SEEK_SET)) + return 0; + rc = fread(node, 1, idx->block_size, idx->index_file); + return 1; +} + +/** + * Reads the entire string for the given element, + * + * @param idx + * @param element + * @return the string which must be freed with free() when no longer in use. + */ +static char *bnode_read_string(struct index_external *idx, struct bnode_element *element) +{ + char *str; + + fseek(idx->string_file, element->str_offset, SEEK_SET); + if (!(str = malloc(element->str_len + 1))) + return 0; + if (fread(str, 1, element->str_len, idx->string_file) != element->str_len) + return 0; + return str; +} + +/** + * Inserts the given string into the bnode tree. + * + * @param idx + * @param did + * @param txt + * @return + */ +static int bnode_insert_string(struct index_external *idx, int did, int offset, const char *text) +{ + int i; + bnode *tmp = idx->tmp; + + bnode_read_block(idx, tmp, 0); + + /* Find the appropriate slot. TODO: Use binary search */ + for (i=0; i < tmp->num_elements; i++) + { + struct bnode_element *e = bnode_get_ith_element_of_node(idx, tmp, i); + char *str = bnode_read_string(idx, e); + if (!str) return 0; + if (strcmp(str, text) > 0) + { + free(str); + break; + } + free(str); + } + + if (tmp->num_elements < idx->max_elements_per_node) + { + struct bnode_element *e = bnode_get_ith_element_of_node(idx, tmp, i); + + memmove(e + 1, e, (idx->max_elements_per_node - tmp->num_elements - 1) * sizeof(struct bnode_element)); + + /* New element */ + e->str_offset = offset; + e->str_len = strlen(text); + e->child = 0; + e->did = did; + tmp->num_elements++; + } else + { + fprintf(stderr,"Splitting is not implemented yet!\n"); + exit(1); + /* Split node and allocate a new bnode */ + } + bnode_write_block(idx, tmp, 0); + + return 1; +} + +/** + * Tries to find the given string. + * + * @param idx + * @param text + * @return + */ +static int bnode_find_string(struct index_external *idx, const char *text, int (*callback)(int did, void *userdata), void *userdata) +{ + int i; + bnode *tmp = idx->tmp; + int text_len = strlen(text); + + bnode_read_block(idx, tmp, 0); + + /* Find the appropriate slot. TODO: Use binary search */ + for (i=0; i < tmp->num_elements; i++) + { + struct bnode_element *e = bnode_get_ith_element_of_node(idx, tmp, i); + if (text_len > tmp->num_elements) + continue; + char *str = bnode_read_string(idx, e); + if (!str) return 0; + if (!strncmp(str, text, text_len)) + { + callback(e->did, userdata); + } + } +} struct index *index_external_create(const char *filename) { struct index_external *idx; + char buf[380]; if (!(idx = (struct index_external*)malloc(sizeof(*idx)))) return NULL; memset(idx,0,sizeof(*idx)); list_init(&idx->document_list); + idx->block_size = 16384; + idx->max_elements_per_node = (idx->block_size - sizeof(struct bnode_header)) / sizeof(struct bnode_element); + + if (!(idx->tmp = bnode_create(idx))) + { + free(idx); + return NULL; + } + + sm_snprintf(buf, sizeof(buf), "%s.index", filename); + if (!(idx->index_file = fopen(buf, "w+b"))) + { + bnode_free(idx, idx->tmp); + free(idx); + return NULL; + } + + sm_snprintf(buf, sizeof(buf), "%s.strings", filename); + if (!(idx->string_file = fopen(buf, "w+b"))) + { + fclose(idx->index_file); + bnode_free(idx, idx->tmp); + free(idx); + return NULL; + } + + if (!(bnode_write_block(idx, idx->tmp, 0))) + { + fclose(idx->string_file); + fclose(idx->index_file); + bnode_free(idx, idx->tmp); + free(idx); + return NULL; + + } return &idx->index; } @@ -70,100 +318,61 @@ idx = (struct index_external*)index; - while ((d = (struct document_node *)list_remove_tail(&idx->document_list))) - { - free(d->txt); - free(d); - } - + fclose(idx->index_file); + fclose(idx->string_file); free(index); } int index_external_put_document(struct index *index, int did, const char *text) { - struct document_node *d; struct index_external *idx; + int i; + int l = strlen(text); idx = (struct index_external*)index; - if (!(d = (struct document_node*)malloc(sizeof(*d)))) - return 0; - memset(d,0,sizeof(*d)); + /* Determine position and write text */ + long offset = ftell(idx->string_file); + fputs(text, idx->string_file); - d->did = did; - if (!(d->txt = strdup(text))) + for (i=0; i < l; i++) { - free(d); - return 0; + if (!(bnode_insert_string((struct index_external*)index, did, offset + i, text + i))) + return 0; } - list_insert_tail(&idx->document_list,&d->node); return 1; } int index_external_remove_document(struct index *index, int did) { - struct document_node *d; - struct index_external *idx; - int removed = 0; - - idx = (struct index_external*)index; - - d = (struct document_node*)list_first(&idx->document_list); - while (d) - { - struct document_node *n = (struct document_node*)node_next(&d->node); - - if (d->did == did) - { - removed = 1; - node_remove(&d->node); - free(d->txt); - free(d); - } - - d = n; - } - return removed; + return 0; } int index_external_find_documents(struct index *index, int (*callback)(int did, void *userdata), void *userdata, int num_substrings, va_list substrings) { - struct document_node *d; - struct index_external *idx; - int nd = 0; int i; + int nd = 0; + struct index_external *idx; + va_list substrings_copy; idx = (struct index_external*)index; - nd = 0; - - d = (struct document_node*)list_first(&idx->document_list); - while (d) - { - int take = 1; - va_list substrings_copy; - - va_copy(substrings_copy,substrings); - for (i=0;i<num_substrings;i++) - { - if (!strstr(d->txt,va_arg(substrings_copy,char *))) - { - take = 0; - break; - } - } - - va_end(substrings_copy); + va_copy(substrings_copy,substrings); - if (take) - { - callback(d->did,userdata); - nd++; - } - d = (struct document_node*)node_next(&d->node); + for (i=0;i<num_substrings;i++) + { + bnode_find_string(idx, va_arg(substrings_copy, char *), callback, userdata); +// bnode_insert_string( +// if (!strstr(d->txt,va_arg(substrings_copy,char *))) +// { +// take = 0; +// break; +// } } + va_end(substrings_copy); + return nd; } |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:26:29
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21797 Modified Files: common-sources.mk Added Files: index_external.c index_external.h Log Message: Duplicated index_naive implementation as index_external. --- NEW FILE: index_external.h --- /** * index_external.h - an external memory-based string index implementation for SimpleMail. * Copyright (C) 2012 Sebastian Bauer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SM__INDEX_EXTERNAL_H #define SM__INDEX_EXTERNAL_H extern struct index_algorithm index_external; #endif --- NEW FILE: index_external.c --- /** * index_external.c - a external string index implementation for SimpleMail. * Copyright (C) 2012 Sebastian Bauer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @file index_external.c */ #include <stdlib.h> #include <string.h> #include "lists.h" #include "index.h" #include "index_private.h" #include "index_external.h" /* Get va_vopy() with pre-C99 compilers */ #ifdef __SASC #define va_copy(dest,src) ((dest) = (src)) #elif defined(__GNUC__) && (__GNUC__ < 3) #include <varargs.h> #endif struct document_node { struct node node; int did; char *txt; }; struct index_external { struct index index; struct list document_list; }; struct index *index_external_create(const char *filename) { struct index_external *idx; if (!(idx = (struct index_external*)malloc(sizeof(*idx)))) return NULL; memset(idx,0,sizeof(*idx)); list_init(&idx->document_list); return &idx->index; } void index_external_dispose(struct index *index) { struct document_node *d; struct index_external *idx; idx = (struct index_external*)index; while ((d = (struct document_node *)list_remove_tail(&idx->document_list))) { free(d->txt); free(d); } free(index); } int index_external_put_document(struct index *index, int did, const char *text) { struct document_node *d; struct index_external *idx; idx = (struct index_external*)index; if (!(d = (struct document_node*)malloc(sizeof(*d)))) return 0; memset(d,0,sizeof(*d)); d->did = did; if (!(d->txt = strdup(text))) { free(d); return 0; } list_insert_tail(&idx->document_list,&d->node); return 1; } int index_external_remove_document(struct index *index, int did) { struct document_node *d; struct index_external *idx; int removed = 0; idx = (struct index_external*)index; d = (struct document_node*)list_first(&idx->document_list); while (d) { struct document_node *n = (struct document_node*)node_next(&d->node); if (d->did == did) { removed = 1; node_remove(&d->node); free(d->txt); free(d); } d = n; } return removed; } int index_external_find_documents(struct index *index, int (*callback)(int did, void *userdata), void *userdata, int num_substrings, va_list substrings) { struct document_node *d; struct index_external *idx; int nd = 0; int i; idx = (struct index_external*)index; nd = 0; d = (struct document_node*)list_first(&idx->document_list); while (d) { int take = 1; va_list substrings_copy; va_copy(substrings_copy,substrings); for (i=0;i<num_substrings;i++) { if (!strstr(d->txt,va_arg(substrings_copy,char *))) { take = 0; break; } } va_end(substrings_copy); if (take) { callback(d->did,userdata); nd++; } d = (struct document_node*)node_next(&d->node); } return nd; } /*****************************************************/ struct index_algorithm index_external = { index_external_create, index_external_dispose, index_external_put_document, index_external_remove_document, index_external_find_documents }; Index: common-sources.mk =================================================================== RCS file: /cvsroot/simplemail/simplemail/common-sources.mk,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- common-sources.mk 18 Dec 2012 09:52:41 -0000 1.5 +++ common-sources.mk 19 Jan 2014 18:26:26 -0000 1.6 @@ -20,6 +20,7 @@ imap.c \ index.c \ index_naive.c \ + index_external.c \ lists.c \ mail.c \ mbox.c \ |
From: Sebastian B. <sb...@us...> - 2013-12-26 18:37:32
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18185/tests Modified Files: imap2_unittest.c Log Message: Use realpath only to get the current directory. Before, an entry within the current directory was used, which however, didn't need to exist. Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- imap2_unittest.c 24 Dec 2013 09:32:10 -0000 1.20 +++ imap2_unittest.c 26 Dec 2013 18:37:28 -0000 1.21 @@ -168,15 +168,19 @@ struct account *ac; struct folder *f; - char *imap_profile; + char *imap_profile_path; + char *pwd; debug_init(); debug_set_level(25); - imap_profile = realpath("imap-profile", NULL); - CU_ASSERT(imap_profile != NULL); + pwd = realpath(".", NULL); + CU_ASSERT(pwd != NULL); - config_set_user_profile_directory(imap_profile); + imap_profile_path = mycombinepath(pwd, "imap-profile"); + CU_ASSERT(imap_profile_path != NULL); + + config_set_user_profile_directory(imap_profile_path); CU_ASSERT(codesets_init() != 0); @@ -227,7 +231,8 @@ progmon_deinit(); codesets_cleanup(); - free(imap_profile); + free(imap_profile_path); + free(pwd); } /*************************************************************/ |
From: Sebastian B. <sb...@us...> - 2013-12-26 15:29:47
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6657 Modified Files: configuration.c Log Message: Changed order. Index: configuration.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/configuration.c,v retrieving revision 1.101 retrieving revision 1.102 diff -u -d -r1.101 -r1.102 --- configuration.c 2 Jan 2011 11:31:10 -0000 1.101 +++ configuration.c 26 Dec 2013 15:29:45 -0000 1.102 @@ -101,12 +101,13 @@ if (profile_directory) user.directory = mystrdup(profile_directory); else user.directory = mystrdup(SM_DIR); + SM_DEBUGF(10,("profile_directory=%s\n",user.directory?user.directory:"Not set")); + if (!user.directory) return 0; if (!(user.folder_directory = mycombinepath(user.directory,".folders"))) return 0; - SM_DEBUGF(10,("profile_directory=%s\n",user.directory)); SM_DEBUGF(10,("folder_directory=%s\n",user.folder_directory)); list_init(&user.config.account_list); |
From: Sebastian B. <sb...@us...> - 2013-12-24 18:00:19
|
Update of /cvsroot/simplemail/simplemail/homepage/xml In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv2668/xml Modified Files: news.xml Log Message: Updated news Index: news.xml =================================================================== RCS file: /cvsroot/simplemail/simplemail/homepage/xml/news.xml,v retrieving revision 1.74 retrieving revision 1.75 diff -u -d -r1.74 -r1.75 --- news.xml 24 Dec 2012 06:53:22 -0000 1.74 +++ news.xml 24 Dec 2013 18:00:16 -0000 1.75 @@ -2,6 +2,31 @@ <news> + <entry date="2013/12/24"> + <text lang="en"> + A new version of SimpleMail has been released! Version 0.40 comes with following changes: + <list> + <item>Improved unit test framework (non-user visible)</item> + <item>Stability improvements of the IMAP client</item> + <item>Fixed several memory leaks</item> + </list> + + The SimpleMail Team wishes you all a merry Christmas and a happy new year 2013! + </text> + + <text lang="de"> + Eine neue Version von SimpleMail wurde veröffentlicht. Version 0.40 kommt mit folgenden Änderungen: + + <list> + <item>Verbessertes Test-Framework</item> + <item>Stabiliere IMAP-Unterstützung</item> + <item>Einige Speicherlecks entfernt</item> + </list> + + Das SimpleMail Team wünscht allen fröhliche Weihnachten und einen guten Rutsch ins neue Jahr! + </text> + </entry> + <entry date="2012/12/24"> <text lang="en"> A new version of SimpleMail has been released! Version 0.39 comes with following changes: |
From: Sebastian B. <sb...@us...> - 2013-12-24 14:13:33
|
Update of /cvsroot/simplemail/simplemail/homepage In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21050 Modified Files: downloads.php Log Message: Updated version info. Index: downloads.php =================================================================== RCS file: /cvsroot/simplemail/simplemail/homepage/downloads.php,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- downloads.php 24 Dec 2012 06:53:32 -0000 1.45 +++ downloads.php 24 Dec 2013 14:13:30 -0000 1.46 @@ -1,7 +1,7 @@ <?php -$version = "0.39"; -$date = "2012/12/24"; +$version = "0.40"; +$date = "2013/12/24"; $morphversion = "0.38"; $morphdate = "2012/01/11"; |
From: Sebastian B. <sb...@us...> - 2013-12-24 10:34:03
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5221 Modified Files: imap.c Log Message: Declare variables at the top of the function header. Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- imap.c 24 Dec 2013 09:34:20 -0000 1.91 +++ imap.c 24 Dec 2013 10:34:00 -0000 1.92 @@ -577,10 +577,10 @@ int num_of_remote_mails = 0; int success = 0; struct remote_mail *remote_mail_array = NULL; + struct remote_mailbox *rm; SM_ENTER; - struct remote_mailbox *rm; if (!(rm = imap_select_mailbox(conn,path,writemode))) { SM_RETURN(NULL,"%p"); |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:35:15
|
Update of /cvsroot/simplemail/simplemail/amiga-mui In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1917/amiga-mui Modified Files: gui_main.c mainwnd.c Log Message: Bumped revision to 40 and described latest changes. Index: gui_main.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/amiga-mui/gui_main.c,v retrieving revision 1.124 retrieving revision 1.125 diff -u -d -r1.124 -r1.125 --- gui_main.c 2 Jan 2013 18:07:39 -0000 1.124 +++ gui_main.c 24 Dec 2013 09:35:13 -0000 1.125 @@ -283,7 +283,7 @@ App = ApplicationObject, MUIA_Application_Title, "SimpleMail", MUIA_Application_Version, VERSTAG, - MUIA_Application_Copyright, "Copyright (c) 2000-2012 by Sebastian Bauer & Hynek Schlawack", + MUIA_Application_Copyright, "Copyright (c) 2000-2013 by Sebastian Bauer & Hynek Schlawack", MUIA_Application_Author, "Sebastian Bauer & Hynek Schlawack", MUIA_Application_Description, "A mailer.", MUIA_Application_Base, "SIMPLEMAIL", Index: mainwnd.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/amiga-mui/mainwnd.c,v retrieving revision 1.202 retrieving revision 1.203 diff -u -d -r1.202 -r1.203 --- mainwnd.c 23 Dec 2012 20:19:14 -0000 1.202 +++ mainwnd.c 24 Dec 2013 09:35:13 -0000 1.203 @@ -231,7 +231,7 @@ MUI_Request(App, NULL, 0, _("SimpleMail - About"), _("*Ok"), - "SimpleMail version %ld.%ld (%s)\n\n%s 2000-2012\nHynek Schlawack %s Sebastian Bauer\n%s.%s", + "SimpleMail version %ld.%ld (%s)\n\n%s 2000-2013\nHynek Schlawack %s Sebastian Bauer\n%s.%s", VERSION,REVISION,SIMPLEMAIL_DATE,_("Copyright (c)"),_("and"),_("Released under the terms of the GNU Public License"),buf); } |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:34:53
|
Update of /cvsroot/simplemail/simplemail/doc/amiga In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1781/doc/amiga Modified Files: history.txt Log Message: Described latest changes. Index: history.txt =================================================================== RCS file: /cvsroot/simplemail/simplemail/doc/amiga/history.txt,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- history.txt 24 Dec 2012 06:53:22 -0000 1.62 +++ history.txt 24 Dec 2013 09:34:51 -0000 1.63 @@ -1,3 +1,8 @@ +Version 0.40 (26th beta) - released on 2013/12/24 + - Improved unit test framework + - Stability improvements of the IMAP client + - Fixed several memory leaks + Version 0.39 (25th beta) - released on 2012/12/24 - Filter rules may be created now from attributes common in multiple mails - Supports ATTACHMENT/K/M argument for both the command line and |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:34:37
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1751/gtk Modified Files: subthreads.c Log Message: Use g_rec_mutex rather than g_static_rec_mutexes. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- subthreads.c 24 Dec 2013 09:28:53 -0000 1.60 +++ subthreads.c 24 Dec 2013 09:34:35 -0000 1.61 @@ -695,7 +695,7 @@ struct semaphore_s { - GStaticRecMutex mutex; + GRecMutex mutex; }; semaphore_t thread_create_semaphore(void) @@ -703,27 +703,28 @@ semaphore_t sem = malloc(sizeof(struct semaphore_s)); if (sem) { - g_static_rec_mutex_init(&sem->mutex); + g_rec_mutex_init(&sem->mutex); } return sem; } void thread_dispose_semaphore(semaphore_t sem) { + g_rec_mutex_clear(&sem->mutex); free(sem); } void thread_lock_semaphore(semaphore_t sem) { - g_static_rec_mutex_lock(&sem->mutex); + g_rec_mutex_lock(&sem->mutex); } int thread_attempt_lock_semaphore(semaphore_t sem) { - return g_static_rec_mutex_trylock(&sem->mutex); + return g_rec_mutex_trylock(&sem->mutex); } void thread_unlock_semaphore(semaphore_t sem) { - g_static_rec_mutex_unlock(&sem->mutex); + g_rec_mutex_unlock(&sem->mutex); } |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:34:22
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1731 Modified Files: imap.c Log Message: Fixed more memory leaks. Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- imap.c 24 Dec 2013 09:34:04 -0000 1.90 +++ imap.c 24 Dec 2013 09:34:20 -0000 1.91 @@ -437,7 +437,15 @@ */ static void imap_free_remote_mailbox(struct remote_mailbox *rm) { + int i; + if (!rm) return; + + if (rm->remote_mail_array) + { + for (i=0; i < rm->num_of_remote_mail; i++) + free(rm->remote_mail_array[i].headers); + } free(rm->remote_mail_array); free(rm); } @@ -693,6 +701,9 @@ if (uid < max_uid) needs_to_be_sorted = 1; else max_uid = uid; + } else + { + free(headers); } } } |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:34:07
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1708 Modified Files: imap.c Log Message: Added malloc() success check. Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- imap.c 24 Dec 2013 09:33:49 -0000 1.89 +++ imap.c 24 Dec 2013 09:34:04 -0000 1.90 @@ -667,16 +667,18 @@ { int pos = 0; - headers = malloc(todownload+1); - headers[todownload]=0; - - while (todownload) + if ((headers = malloc(todownload+1))) { - int dl; - dl = tcp_read(conn,headers + pos,todownload); - if (dl == -1 || !dl) break; - todownload -= dl; - pos += dl; + headers[todownload]=0; + + while (todownload) + { + int dl; + dl = tcp_read(conn,headers + pos,todownload); + if (dl == -1 || !dl) break; + todownload -= dl; + pos += dl; + } } } } |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:33:51
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1662 Modified Files: imap.c Log Message: Fixed memory leaks. Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- imap.c 24 Dec 2013 09:33:34 -0000 1.88 +++ imap.c 24 Dec 2013 09:33:49 -0000 1.89 @@ -1541,6 +1541,10 @@ { thread_wait(NULL,NULL,0); + imap_free(imap_server); + free(imap_folder); + free(imap_local_path); + if (imap_connection) { tcp_disconnect(imap_connection); @@ -2047,6 +2051,8 @@ rc = 1; } else { + imap_free(server); + free(imap_folder); imap_folder = folder; |