summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <>2001-03-21 09:13:34 +0000
committerPixel <>2001-03-21 09:13:34 +0000
commit9bf8629e1420fb0bc09103e747f7d9b18aa7f10d (patch)
tree22a20f7d1c9c00db9a8970df40d0a981517d2a96
parent68332dfa57850ceabed4c270638096edf2bc32e7 (diff)
Bug fixes
-rw-r--r--config.h.in189
-rw-r--r--lib/BinHeap.cc9
-rw-r--r--po/PriorityLists.pot133
-rw-r--r--po/cat-id-tbl.c177
-rw-r--r--po/de.po129
-rw-r--r--po/fr.po129
-rw-r--r--src/test.cc12
7 files changed, 403 insertions, 375 deletions
diff --git a/config.h.in b/config.h.in
index ba885e2..40247eb 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,51 +1,5 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if using alloca.c. */
-#undef C_ALLOCA
-
-/* Define to empty if the keyword does not work. */
-#undef const
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-#undef CRAY_STACKSEG_END
-
-/* Define if you have alloca, as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-#undef HAVE_ALLOCA_H
-
-/* Define if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define as __inline if that's what the C compiler calls it. */
-#undef inline
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-#undef off_t
-
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-#undef STACK_DIRECTION
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if your processor stores words with the most significant
- byte first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
+#undef HAVE_LIBINTL_H
/* Define to 1 if NLS is requested. */
#undef ENABLE_NLS
@@ -76,93 +30,150 @@
#endif
#define N_(Text) Text
-/* Define if you have the __argz_count function. */
+
+/* Define if you need to in order for stat and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+#undef CRAY_STACKSEG_END
+
+/* Define if you have the `__argz_count' function. */
#undef HAVE___ARGZ_COUNT
-/* Define if you have the __argz_next function. */
+/* Define if you have the `__argz_next' function. */
#undef HAVE___ARGZ_NEXT
-/* Define if you have the __argz_stringify function. */
+/* Define if you have the `__argz_stringify' function. */
#undef HAVE___ARGZ_STRINGIFY
-/* Define if you have the dcgettext function. */
+/* Define if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+#undef HAVE_ALLOCA_H
+
+/* Define if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
+
+/* Define if you have the `dcgettext' function. */
#undef HAVE_DCGETTEXT
-/* Define if you have the getcwd function. */
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the `getcwd' function. */
#undef HAVE_GETCWD
-/* Define if you have the getpagesize function. */
+/* Define if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
-/* Define if you have the getwd function. */
+/* Define if you have the `getwd' function. */
#undef HAVE_GETWD
-/* Define if you have the munmap function. */
+/* Define if you have the `i' library (-li). */
+#undef HAVE_LIBI
+
+/* Define if you have the `intl' library (-lintl). */
+#undef HAVE_LIBINTL
+
+/* Define if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
+
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define if you have the `munmap' function. */
#undef HAVE_MUNMAP
-/* Define if you have the putenv function. */
+/* Define if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
+
+/* Define if you have the `putenv' function. */
#undef HAVE_PUTENV
-/* Define if you have the setenv function. */
+/* Define if you have the `setenv' function. */
#undef HAVE_SETENV
-/* Define if you have the setlocale function. */
+/* Define if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
-/* Define if you have the stpcpy function. */
+/* Define if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define if you have the `stpcpy' function. */
#undef HAVE_STPCPY
-/* Define if you have the strcasecmp function. */
+/* Define if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
-/* Define if you have the strchr function. */
+/* Define if you have the `strchr' function. */
#undef HAVE_STRCHR
-/* Define if you have the strdup function. */
+/* Define if you have the `strdup' function. */
#undef HAVE_STRDUP
-/* Define if you have the <argz.h> header file. */
-#undef HAVE_ARGZ_H
-
-/* Define if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define if you have the <libintl.h> header file. */
-#undef HAVE_LIBINTL_H
-
-/* Define if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define if you have the <nl_types.h> header file. */
-#undef HAVE_NL_TYPES_H
-
-/* Define if you have the <string.h> header file. */
+/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
-/* Define if you have the <strings.h> header file. */
+/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
-/* Define if you have the <sys/param.h> header file. */
+/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
-/* Define if you have the <unistd.h> header file. */
+/* Define if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define if you have the i library (-li). */
-#undef HAVE_LIBI
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+ if it is not supported. */
+#undef inline
+
+/* Define to `long' if <sys/types.h> does not define. */
+#undef off_t
/* Name of package */
#undef PACKAGE
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
/* Version number of package */
#undef VERSION
/* define if compiled symbols have a leading underscore */
#undef WITH_SYMBOL_UNDERSCORE
+/* Define if your processor stores words with the most significant byte first
+ (like Motorola and SPARC, unlike Intel and VAX). */
+#undef WORDS_BIGENDIAN
diff --git a/lib/BinHeap.cc b/lib/BinHeap.cc
index 450ff4a..b57a31d 100644
--- a/lib/BinHeap.cc
+++ b/lib/BinHeap.cc
@@ -80,6 +80,7 @@ BinHeap::~BinHeap(void)
Key_t BinHeap::ReadKey(Cell C)
{
+ cerr << "Lecture de " << C << endl;
return ((binheap_t *) FP->ReadDatas(C))->Key;
}
@@ -123,6 +124,7 @@ Cell BinHeap::Insert(Key_t IKey, Datas_t const &IDatas)
{
binheap_t newcell = { IKey, IDatas }, *binheap;
int i = Key++;
+ Cell r;
if (!Datas || ((((Key >> GRANUL) + 1) << GRANUL) != (((i >> GRANUL) + 1) << GRANUL))) {
if (!(Datas = realloc(Datas, (((Key >> GRANUL) + 1) << GRANUL) * sizeof(binheap_t)))) {
@@ -135,11 +137,14 @@ Cell BinHeap::Insert(Key_t IKey, Datas_t const &IDatas)
while ((i > 1) && (binheap[FATHER(i) - 1].Key > IKey)) {
binheap[i - 1] = binheap[FATHER(i) - 1];
+ ((CList *) binheap[FATHER(i) - 1].FP)->Datas = &binheap[i - 1];
i = FATHER(i);
}
binheap[i - 1] = newcell;
-
- return (binheap[i - 1].FP = FP->Insert(0, &(binheap[i - 1])));
+
+ r = binheap[i - 1].FP = FP->Insert(0, &(binheap[i - 1]));
+ cerr << "Ajout de " << r << endl;
+ return r;
}
diff --git a/po/PriorityLists.pot b/po/PriorityLists.pot
index 4738ad9..8de0386 100644
--- a/po/PriorityLists.pot
+++ b/po/PriorityLists.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-03-13 00:35+0100\n"
+"POT-Creation-Date: 2001-03-21 10:24+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -30,269 +30,272 @@ msgstr ""
msgid "3 - Sorted chained list"
msgstr ""
-#: src/test.cc:30
+#: src/test.cc:31
msgid "a - Add a key into the priority list"
msgstr ""
-#: src/test.cc:31
+#: src/test.cc:32
msgid "c - Change priority list type"
msgstr ""
-#: src/test.cc:32
+#: src/test.cc:33
msgid "d - Delete a Key from the priority list"
msgstr ""
-#: src/test.cc:33
+#: src/test.cc:34
msgid "e - Extract Min onto the priority list"
msgstr ""
-#: src/test.cc:34
+#: src/test.cc:35
msgid "l - Lower Key onto a key of the priority list"
msgstr ""
-#: src/test.cc:35
+#: src/test.cc:36
msgid "p - Print the current priority list on the screen"
msgstr ""
-#: src/test.cc:36
+#: src/test.cc:37
msgid "r - Remove the whole priority list"
msgstr ""
-#: src/test.cc:37
+#: src/test.cc:38
msgid "t - Test the priority list algorithms"
msgstr ""
-#: src/test.cc:38
+#: src/test.cc:39
msgid "q - Quit"
msgstr ""
-#: src/main.cc:35 src/main.cc:175 src/test.cc:64 src/test.cc:278
+#: src/main.cc:35 src/main.cc:175 src/test.cc:66 src/test.cc:280
msgid "Unknow priority list type: "
msgstr ""
-#: src/test.cc:77
+#: src/test.cc:79
msgid "Creation of a priority list and adding "
msgstr ""
-#: src/test.cc:77
+#: src/test.cc:79
msgid " random entrie(s)..."
msgstr ""
-#: src/test.cc:82
+#: src/test.cc:84
msgid ""
"Ok.\n"
"Deleting the list..."
msgstr ""
-#: src/test.cc:86 src/test.cc:90
+#: src/test.cc:88 src/test.cc:92
msgid "List has "
msgstr ""
-#: src/test.cc:86
+#: src/test.cc:88
msgid " keys. Expecting "
msgstr ""
-#: src/test.cc:87 src/test.cc:91
+#: src/test.cc:89 src/test.cc:93
msgid "List corrupted."
msgstr ""
-#: src/test.cc:90
+#: src/test.cc:92
msgid " keys (real count). Expecting "
msgstr ""
-#: src/test.cc:95 src/test.cc:162
+#: src/test.cc:97 src/test.cc:164
msgid "Incorrect order."
msgstr ""
-#: src/test.cc:110
+#: src/test.cc:101
+msgid "Ok.\n"
+msgstr ""
+
+#: src/test.cc:112
msgid "Size of a PriorityList cell: "
msgstr ""
-#: src/test.cc:111
+#: src/test.cc:113
msgid "Size of a BHeap cell : "
msgstr ""
-#: src/test.cc:112
+#: src/test.cc:114
msgid "Size of a FHeap cell : "
msgstr ""
-#: src/test.cc:113
+#: src/test.cc:115
msgid "Size of a PLList header : "
msgstr ""
-#: src/test.cc:114
+#: src/test.cc:116
msgid "Size of a CList cell : "
msgstr ""
-#: src/test.cc:115
+#: src/test.cc:117
msgid "Size of a SList cell : "
msgstr ""
-#: src/test.cc:116
+#: src/test.cc:118
msgid "Size of a BinHeap header : "
msgstr ""
-#: src/test.cc:117
+#: src/test.cc:119
msgid "Size of a BinHeap cell : "
msgstr ""
-#: src/test.cc:124
+#: src/test.cc:126
msgid "Creating a priority list and adding keys:\n"
msgstr ""
-#: src/test.cc:138 src/test.cc:145 src/test.cc:149 src/test.cc:153
+#: src/test.cc:140 src/test.cc:147 src/test.cc:151 src/test.cc:155
msgid ""
"Ok.\n"
"List browsing...\n"
msgstr ""
-#: src/test.cc:140
+#: src/test.cc:142
msgid ""
"Ok.\n"
"Extract_Min + List browsing...\n"
msgstr ""
-#: src/test.cc:143
+#: src/test.cc:145
msgid ""
"Ok.\n"
"Lower_Key(0) over 59...\n"
msgstr ""
-#: src/test.cc:147
+#: src/test.cc:149
msgid ""
"Ok.\n"
"Delete over 54...\n"
msgstr ""
-#: src/test.cc:151
+#: src/test.cc:153
msgid ""
"Ok.\n"
"Lower_Key(-12) over 30...\n"
msgstr ""
-#: src/test.cc:155
+#: src/test.cc:157
msgid ""
"Ok.\n"
"Extract_Min...\n"
msgstr ""
-#: src/test.cc:157
+#: src/test.cc:159
msgid ""
"Ok.\n"
"Extracting datas...\n"
msgstr ""
-#: src/test.cc:159
+#: src/test.cc:161
msgid "Minimum #"
msgstr ""
-#: src/test.cc:165
+#: src/test.cc:167
msgid ""
"Ok.\n"
"\n"
"All the tests were successfull\n"
msgstr ""
-#: src/test.cc:171
+#: src/test.cc:173
msgid "Usage: testTas [type]\n"
msgstr ""
-#: src/test.cc:182
+#: src/test.cc:184
msgid "Choice: "
msgstr ""
-#: src/test.cc:199
+#: src/test.cc:201
msgid "Incorrect choice, select again\n"
msgstr ""
-#: src/test.cc:215
+#: src/test.cc:217
#, c-format
msgid "%i - Key: %i"
msgstr ""
-#: src/test.cc:217
+#: src/test.cc:219
#, c-format
msgid "%i - Empty slot"
msgstr ""
-#: src/test.cc:224
+#: src/test.cc:226
msgid "n - Don't store"
msgstr ""
-#: src/test.cc:225
+#: src/test.cc:227
msgid "c - Cancel"
msgstr ""
-#: src/test.cc:252
+#: src/test.cc:254
msgid "could not set attributes\n"
msgstr ""
-#: src/main.cc:179 src/test.cc:282
+#: src/main.cc:179 src/test.cc:284
msgid "Extra command: "
msgstr ""
-#: src/test.cc:296
+#: src/test.cc:298
msgid "You are not a terminal, Ok.\n"
msgstr ""
-#: src/test.cc:301
+#: src/test.cc:303
msgid "Unable to open /dev/tty\n"
msgstr ""
-#: src/test.cc:319
+#: src/test.cc:321
msgid "Priority list type: "
msgstr ""
-#: src/test.cc:320
+#: src/test.cc:322
msgid "Please select an action"
msgstr ""
-#: src/test.cc:321
+#: src/test.cc:323
msgid "You have chosen: "
msgstr ""
-#: src/test.cc:325
+#: src/test.cc:327
msgid "Please select a slot to save the cell"
msgstr ""
-#: src/test.cc:335
+#: src/test.cc:337
msgid "Please type in a key to add"
msgstr ""
-#: src/test.cc:349
+#: src/test.cc:351
msgid "Please select a priority list type"
msgstr ""
-#: src/test.cc:356
+#: src/test.cc:361
msgid "Please select a key to delete"
msgstr ""
-#: src/test.cc:362
+#: src/test.cc:367
msgid "Delete result: "
msgstr ""
-#. Extract Min.
-#: src/test.cc:366
+#: src/test.cc:379
msgid "Extract Min result: "
msgstr ""
-#: src/test.cc:370
+#: src/test.cc:383
msgid "Please select a key to lower"
msgstr ""
-#: src/test.cc:376
+#: src/test.cc:389
msgid "Please type in the new key"
msgstr ""
-#: src/test.cc:380
+#: src/test.cc:393
msgid "Lower key result: "
msgstr ""
-#: src/test.cc:380
+#: src/test.cc:393
msgid "True"
msgstr ""
-#: src/test.cc:380
+#: src/test.cc:393
msgid "False"
msgstr ""
@@ -426,11 +429,11 @@ msgid ""
" |\n"
msgstr ""
-#: lib/BinHeap.cc:129
+#: lib/BinHeap.cc:131
msgid "Not enough memory"
msgstr ""
-#: lib/BinHeap.cc:157
+#: lib/BinHeap.cc:162
msgid "negative overflow"
msgstr ""
diff --git a/po/cat-id-tbl.c b/po/cat-id-tbl.c
index df9abe5..3ecc399 100644
--- a/po/cat-id-tbl.c
+++ b/po/cat-id-tbl.c
@@ -32,114 +32,115 @@ Deleting the list...", 18},
{"List corrupted.", 21},
{" keys (real count). Expecting ", 22},
{"Incorrect order.", 23},
- {"Size of a PriorityList cell: ", 24},
- {"Size of a BHeap cell : ", 25},
- {"Size of a FHeap cell : ", 26},
- {"Size of a PLList header : ", 27},
- {"Size of a CList cell : ", 28},
- {"Size of a SList cell : ", 29},
- {"Size of a BinHeap header : ", 30},
- {"Size of a BinHeap cell : ", 31},
- {"Creating a priority list and adding keys:\n", 32},
+ {"Ok.\n", 24},
+ {"Size of a PriorityList cell: ", 25},
+ {"Size of a BHeap cell : ", 26},
+ {"Size of a FHeap cell : ", 27},
+ {"Size of a PLList header : ", 28},
+ {"Size of a CList cell : ", 29},
+ {"Size of a SList cell : ", 30},
+ {"Size of a BinHeap header : ", 31},
+ {"Size of a BinHeap cell : ", 32},
+ {"Creating a priority list and adding keys:\n", 33},
{"\
Ok.\n\
-List browsing...\n", 33},
+List browsing...\n", 34},
{"\
Ok.\n\
-Extract_Min + List browsing...\n", 34},
+Extract_Min + List browsing...\n", 35},
{"\
Ok.\n\
-Lower_Key(0) over 59...\n", 35},
+Lower_Key(0) over 59...\n", 36},
{"\
Ok.\n\
-Delete over 54...\n", 36},
+Delete over 54...\n", 37},
{"\
Ok.\n\
-Lower_Key(-12) over 30...\n", 37},
+Lower_Key(-12) over 30...\n", 38},
{"\
Ok.\n\
-Extract_Min...\n", 38},
+Extract_Min...\n", 39},
{"\
Ok.\n\
-Extracting datas...\n", 39},
- {"Minimum #", 40},
+Extracting datas...\n", 40},
+ {"Minimum #", 41},
{"\
Ok.\n\
\n\
-All the tests were successfull\n", 41},
- {"Usage: testTas [type]\n", 42},
- {"Choice: ", 43},
- {"Incorrect choice, select again\n", 44},
- {"%i - Key: %i", 45},
- {"%i - Empty slot", 46},
- {"n - Don't store", 47},
- {"c - Cancel", 48},
- {"could not set attributes\n", 49},
- {"Extra command: ", 50},
- {"You are not a terminal, Ok.\n", 51},
- {"Unable to open /dev/tty\n", 52},
- {"Priority list type: ", 53},
- {"Please select an action", 54},
- {"You have chosen: ", 55},
- {"Please select a slot to save the cell", 56},
- {"Please type in a key to add", 57},
- {"Please select a priority list type", 58},
- {"Please select a key to delete", 59},
- {"Delete result: ", 60},
- {"Extract Min result: ", 61},
- {"Please select a key to lower", 62},
- {"Please type in the new key", 63},
- {"Lower key result: ", 64},
- {"True", 65},
- {"False", 66},
- {"Error opening file (", 67},
- {"Bad dictionnary structure. See doc/README.en (missing : separator)", 68},
- {"Bad dictionnary structure. See doc/README.en (missing word)", 69},
- {"Bad dictionnary structure. See doc/README.en (missing frequency)", 70},
- {"Error: \"", 71},
- {"\" is not a valid number.", 72},
- {"Huffman [{-f|-i} file] {type}", 73},
- {"Huffman -h", 74},
- {"By Nicolas Noble (nicolas@nobis-crew.org).", 75},
- {"This will encode the input file with the Huffman code", 76},
- {"using the priority list defined by type.", 77},
- {"Type is a number taken from this list:", 78},
- {" 0 : Binary Heap (default)", 79},
- {" 1 : Binomial Heap", 80},
- {" 2 : Fibonacci Heap", 81},
- {" 3 : Sorted chained list", 82},
- {"-f file means that you specify a dictionnary file which is", 83},
- {" structured as described into the README file.", 84},
- {"-i file means that you specify a file to encode. It will", 85},
- {" built a quiet dumb dictionnary.", 86},
- {"By default, a dictionnary will be built from stdin.", 87},
- {"-h prints this help and exit.", 88},
- {"Unknow option: ", 89},
- {"-i and -f options are exclusive", 90},
- {"-i needs a filename", 91},
- {"-f needs a filename", 92},
- {"Internal error.", 93},
- {" * Head cell. (", 94},
- {"Insert: not over Head.", 95},
- {"Insert: No more memory.", 96},
- {"Extract_Min: Priority List is empty.", 97},
+All the tests were successfull\n", 42},
+ {"Usage: testTas [type]\n", 43},
+ {"Choice: ", 44},
+ {"Incorrect choice, select again\n", 45},
+ {"%i - Key: %i", 46},
+ {"%i - Empty slot", 47},
+ {"n - Don't store", 48},
+ {"c - Cancel", 49},
+ {"could not set attributes\n", 50},
+ {"Extra command: ", 51},
+ {"You are not a terminal, Ok.\n", 52},
+ {"Unable to open /dev/tty\n", 53},
+ {"Priority list type: ", 54},
+ {"Please select an action", 55},
+ {"You have chosen: ", 56},
+ {"Please select a slot to save the cell", 57},
+ {"Please type in a key to add", 58},
+ {"Please select a priority list type", 59},
+ {"Please select a key to delete", 60},
+ {"Delete result: ", 61},
+ {"Extract Min result: ", 62},
+ {"Please select a key to lower", 63},
+ {"Please type in the new key", 64},
+ {"Lower key result: ", 65},
+ {"True", 66},
+ {"False", 67},
+ {"Error opening file (", 68},
+ {"Bad dictionnary structure. See doc/README.en (missing : separator)", 69},
+ {"Bad dictionnary structure. See doc/README.en (missing word)", 70},
+ {"Bad dictionnary structure. See doc/README.en (missing frequency)", 71},
+ {"Error: \"", 72},
+ {"\" is not a valid number.", 73},
+ {"Huffman [{-f|-i} file] {type}", 74},
+ {"Huffman -h", 75},
+ {"By Nicolas Noble (nicolas@nobis-crew.org).", 76},
+ {"This will encode the input file with the Huffman code", 77},
+ {"using the priority list defined by type.", 78},
+ {"Type is a number taken from this list:", 79},
+ {" 0 : Binary Heap (default)", 80},
+ {" 1 : Binomial Heap", 81},
+ {" 2 : Fibonacci Heap", 82},
+ {" 3 : Sorted chained list", 83},
+ {"-f file means that you specify a dictionnary file which is", 84},
+ {" structured as described into the README file.", 85},
+ {"-i file means that you specify a file to encode. It will", 86},
+ {" built a quiet dumb dictionnary.", 87},
+ {"By default, a dictionnary will be built from stdin.", 88},
+ {"-h prints this help and exit.", 89},
+ {"Unknow option: ", 90},
+ {"-i and -f options are exclusive", 91},
+ {"-i needs a filename", 92},
+ {"-f needs a filename", 93},
+ {"Internal error.", 94},
+ {" * Head cell. (", 95},
+ {"Insert: not over Head.", 96},
+ {"Insert: No more memory.", 97},
+ {"Extract_Min: Priority List is empty.", 98},
{"\
* Head cell.\n\
- |\n", 98},
- {"Not enough memory", 99},
- {"negative overflow", 100},
+ |\n", 99},
+ {"Not enough memory", 100},
+ {"negative overflow", 101},
{"\
* Head cell\n\
- |\n", 101},
- {"Bitstream length : ", 102},
- {" bits (= ", 103},
- {" bytes)\n", 104},
- {"Real size input : ", 105},
- {"Size squeezed by : ", 106},
- {" percents\n", 107},
- {"Dictionnary size : ", 108},
- {"Total bitstream length : ", 109},
- {"Real gain (4 bytes header) : ", 110},
+ |\n", 102},
+ {"Bitstream length : ", 103},
+ {" bits (= ", 104},
+ {" bytes)\n", 105},
+ {"Real size input : ", 106},
+ {"Size squeezed by : ", 107},
+ {" percents\n", 108},
+ {"Dictionnary size : ", 109},
+ {"Total bitstream length : ", 110},
+ {"Real gain (4 bytes header) : ", 111},
};
-int _msg_tbl_length = 110;
+int _msg_tbl_length = 111;
diff --git a/po/de.po b/po/de.po
index 4738ad9..570b73d 100644
--- a/po/de.po
+++ b/po/de.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-03-13 00:35+0100\n"
+"POT-Creation-Date: 2001-03-21 09:39+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -30,269 +30,272 @@ msgstr ""
msgid "3 - Sorted chained list"
msgstr ""
-#: src/test.cc:30
+#: src/test.cc:31
msgid "a - Add a key into the priority list"
msgstr ""
-#: src/test.cc:31
+#: src/test.cc:32
msgid "c - Change priority list type"
msgstr ""
-#: src/test.cc:32
+#: src/test.cc:33
msgid "d - Delete a Key from the priority list"
msgstr ""
-#: src/test.cc:33
+#: src/test.cc:34
msgid "e - Extract Min onto the priority list"
msgstr ""
-#: src/test.cc:34
+#: src/test.cc:35
msgid "l - Lower Key onto a key of the priority list"
msgstr ""
-#: src/test.cc:35
+#: src/test.cc:36
msgid "p - Print the current priority list on the screen"
msgstr ""
-#: src/test.cc:36
+#: src/test.cc:37
msgid "r - Remove the whole priority list"
msgstr ""
-#: src/test.cc:37
+#: src/test.cc:38
msgid "t - Test the priority list algorithms"
msgstr ""
-#: src/test.cc:38
+#: src/test.cc:39
msgid "q - Quit"
msgstr ""
-#: src/main.cc:35 src/main.cc:175 src/test.cc:64 src/test.cc:278
+#: src/main.cc:35 src/main.cc:175 src/test.cc:66 src/test.cc:280
msgid "Unknow priority list type: "
msgstr ""
-#: src/test.cc:77
+#: src/test.cc:79
msgid "Creation of a priority list and adding "
msgstr ""
-#: src/test.cc:77
+#: src/test.cc:79
msgid " random entrie(s)..."
msgstr ""
-#: src/test.cc:82
+#: src/test.cc:84
msgid ""
"Ok.\n"
"Deleting the list..."
msgstr ""
-#: src/test.cc:86 src/test.cc:90
+#: src/test.cc:88 src/test.cc:92
msgid "List has "
msgstr ""
-#: src/test.cc:86
+#: src/test.cc:88
msgid " keys. Expecting "
msgstr ""
-#: src/test.cc:87 src/test.cc:91
+#: src/test.cc:89 src/test.cc:93
msgid "List corrupted."
msgstr ""
-#: src/test.cc:90
+#: src/test.cc:92
msgid " keys (real count). Expecting "
msgstr ""
-#: src/test.cc:95 src/test.cc:162
+#: src/test.cc:97 src/test.cc:164
msgid "Incorrect order."
msgstr ""
-#: src/test.cc:110
+#: src/test.cc:101
+msgid "Ok.\n"
+msgstr ""
+
+#: src/test.cc:112
msgid "Size of a PriorityList cell: "
msgstr ""
-#: src/test.cc:111
+#: src/test.cc:113
msgid "Size of a BHeap cell : "
msgstr ""
-#: src/test.cc:112
+#: src/test.cc:114
msgid "Size of a FHeap cell : "
msgstr ""
-#: src/test.cc:113
+#: src/test.cc:115
msgid "Size of a PLList header : "
msgstr ""
-#: src/test.cc:114
+#: src/test.cc:116
msgid "Size of a CList cell : "
msgstr ""
-#: src/test.cc:115
+#: src/test.cc:117
msgid "Size of a SList cell : "
msgstr ""
-#: src/test.cc:116
+#: src/test.cc:118
msgid "Size of a BinHeap header : "
msgstr ""
-#: src/test.cc:117
+#: src/test.cc:119
msgid "Size of a BinHeap cell : "
msgstr ""
-#: src/test.cc:124
+#: src/test.cc:126
msgid "Creating a priority list and adding keys:\n"
msgstr ""
-#: src/test.cc:138 src/test.cc:145 src/test.cc:149 src/test.cc:153
+#: src/test.cc:140 src/test.cc:147 src/test.cc:151 src/test.cc:155
msgid ""
"Ok.\n"
"List browsing...\n"
msgstr ""
-#: src/test.cc:140
+#: src/test.cc:142
msgid ""
"Ok.\n"
"Extract_Min + List browsing...\n"
msgstr ""
-#: src/test.cc:143
+#: src/test.cc:145
msgid ""
"Ok.\n"
"Lower_Key(0) over 59...\n"
msgstr ""
-#: src/test.cc:147
+#: src/test.cc:149
msgid ""
"Ok.\n"
"Delete over 54...\n"
msgstr ""
-#: src/test.cc:151
+#: src/test.cc:153
msgid ""
"Ok.\n"
"Lower_Key(-12) over 30...\n"
msgstr ""
-#: src/test.cc:155
+#: src/test.cc:157
msgid ""
"Ok.\n"
"Extract_Min...\n"
msgstr ""
-#: src/test.cc:157
+#: src/test.cc:159
msgid ""
"Ok.\n"
"Extracting datas...\n"
msgstr ""
-#: src/test.cc:159
+#: src/test.cc:161
msgid "Minimum #"
msgstr ""
-#: src/test.cc:165
+#: src/test.cc:167
msgid ""
"Ok.\n"
"\n"
"All the tests were successfull\n"
msgstr ""
-#: src/test.cc:171
+#: src/test.cc:173
msgid "Usage: testTas [type]\n"
msgstr ""
-#: src/test.cc:182
+#: src/test.cc:184
msgid "Choice: "
msgstr ""
-#: src/test.cc:199
+#: src/test.cc:201
msgid "Incorrect choice, select again\n"
msgstr ""
-#: src/test.cc:215
+#: src/test.cc:217
#, c-format
msgid "%i - Key: %i"
msgstr ""
-#: src/test.cc:217
+#: src/test.cc:219
#, c-format
msgid "%i - Empty slot"
msgstr ""
-#: src/test.cc:224
+#: src/test.cc:226
msgid "n - Don't store"
msgstr ""
-#: src/test.cc:225
+#: src/test.cc:227
msgid "c - Cancel"
msgstr ""
-#: src/test.cc:252
+#: src/test.cc:254
msgid "could not set attributes\n"
msgstr ""
-#: src/main.cc:179 src/test.cc:282
+#: src/main.cc:179 src/test.cc:284
msgid "Extra command: "
msgstr ""
-#: src/test.cc:296
+#: src/test.cc:298
msgid "You are not a terminal, Ok.\n"
msgstr ""
-#: src/test.cc:301
+#: src/test.cc:303
msgid "Unable to open /dev/tty\n"
msgstr ""
-#: src/test.cc:319
+#: src/test.cc:321
msgid "Priority list type: "
msgstr ""
-#: src/test.cc:320
+#: src/test.cc:322
msgid "Please select an action"
msgstr ""
-#: src/test.cc:321
+#: src/test.cc:323
msgid "You have chosen: "
msgstr ""
-#: src/test.cc:325
+#: src/test.cc:327
msgid "Please select a slot to save the cell"
msgstr ""
-#: src/test.cc:335
+#: src/test.cc:337
msgid "Please type in a key to add"
msgstr ""
-#: src/test.cc:349
+#: src/test.cc:351
msgid "Please select a priority list type"
msgstr ""
-#: src/test.cc:356
+#: src/test.cc:361
msgid "Please select a key to delete"
msgstr ""
-#: src/test.cc:362
+#: src/test.cc:367
msgid "Delete result: "
msgstr ""
-#. Extract Min.
-#: src/test.cc:366
+#: src/test.cc:379
msgid "Extract Min result: "
msgstr ""
-#: src/test.cc:370
+#: src/test.cc:383
msgid "Please select a key to lower"
msgstr ""
-#: src/test.cc:376
+#: src/test.cc:389
msgid "Please type in the new key"
msgstr ""
-#: src/test.cc:380
+#: src/test.cc:393
msgid "Lower key result: "
msgstr ""
-#: src/test.cc:380
+#: src/test.cc:393
msgid "True"
msgstr ""
-#: src/test.cc:380
+#: src/test.cc:393
msgid "False"
msgstr ""
diff --git a/po/fr.po b/po/fr.po
index f20b27a..b5db38c 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PriorityList-1.0.0\n"
-"POT-Creation-Date: 2001-03-13 00:35+0100\n"
+"POT-Creation-Date: 2001-03-21 09:39+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Nicolas Noble <pixel@nobis-crew.org>\n"
"Language-Team: French <fr@li.org>\n"
@@ -30,55 +30,55 @@ msgstr "2 - Tas de Fibonacci"
msgid "3 - Sorted chained list"
msgstr "3 - Liste chaînée triée"
-#: src/test.cc:30
+#: src/test.cc:31
msgid "a - Add a key into the priority list"
msgstr "a - Ajoute une clef dans la file de priorité"
-#: src/test.cc:31
+#: src/test.cc:32
msgid "c - Change priority list type"
msgstr "c - Change le type de la file de priorité."
-#: src/test.cc:32
+#: src/test.cc:33
msgid "d - Delete a Key from the priority list"
msgstr "d - Supprime une clef de la file de priorité"
-#: src/test.cc:33
+#: src/test.cc:34
msgid "e - Extract Min onto the priority list"
msgstr "e - Extraire Min sur la file de priorité"
-#: src/test.cc:34
+#: src/test.cc:35
msgid "l - Lower Key onto a key of the priority list"
msgstr "l - Diminuer Clef sur une clef de la file de priorité"
-#: src/test.cc:35
+#: src/test.cc:36
msgid "p - Print the current priority list on the screen"
msgstr "p - Afficher la file de priorité à l'écran"
-#: src/test.cc:36
+#: src/test.cc:37
msgid "r - Remove the whole priority list"
msgstr "r - Efface la file de priorité"
-#: src/test.cc:37
+#: src/test.cc:38
msgid "t - Test the priority list algorithms"
msgstr "t - Teste les algorithmes de la file de priorité"
-#: src/test.cc:38
+#: src/test.cc:39
msgid "q - Quit"
msgstr "q - Quitter"
-#: src/main.cc:35 src/main.cc:175 src/test.cc:64 src/test.cc:278
+#: src/main.cc:35 src/main.cc:175 src/test.cc:66 src/test.cc:280
msgid "Unknow priority list type: "
msgstr "File de priorité inconnue: "
-#: src/test.cc:77
+#: src/test.cc:79
msgid "Creation of a priority list and adding "
msgstr "Création d'une liste de priorité et ajout de "
-#: src/test.cc:77
+#: src/test.cc:79
msgid " random entrie(s)..."
msgstr " entrée(s) aléatoires..."
-#: src/test.cc:82
+#: src/test.cc:84
msgid ""
"Ok.\n"
"Deleting the list..."
@@ -86,63 +86,67 @@ msgstr ""
"Ok.\n"
"Effacement de la liste..."
-#: src/test.cc:86 src/test.cc:90
+#: src/test.cc:88 src/test.cc:92
msgid "List has "
msgstr "La liste possède "
-#: src/test.cc:86
+#: src/test.cc:88
msgid " keys. Expecting "
msgstr " clefs alors que nous attendions "
-#: src/test.cc:87 src/test.cc:91
+#: src/test.cc:89 src/test.cc:93
msgid "List corrupted."
msgstr "Liste corrompue."
-#: src/test.cc:90
+#: src/test.cc:92
msgid " keys (real count). Expecting "
msgstr " clefs (compte réel) alors que nous attendions "
-#: src/test.cc:95 src/test.cc:162
+#: src/test.cc:97 src/test.cc:164
msgid "Incorrect order."
msgstr "Ordre incorrect."
-#: src/test.cc:110
+#: src/test.cc:101
+msgid "Ok.\n"
+msgstr ""
+
+#: src/test.cc:112
msgid "Size of a PriorityList cell: "
msgstr "Taille d'une cellule du type PriorityList: "
-#: src/test.cc:111
+#: src/test.cc:113
msgid "Size of a BHeap cell : "
msgstr "Taille d'une cellule du type BHeap : "
-#: src/test.cc:112
+#: src/test.cc:114
msgid "Size of a FHeap cell : "
msgstr "Taille d'une cellule du type FHeap : "
-#: src/test.cc:113
+#: src/test.cc:115
msgid "Size of a PLList header : "
msgstr "Taille d'un entète du type PLList : "
-#: src/test.cc:114
+#: src/test.cc:116
msgid "Size of a CList cell : "
msgstr "Taille d'une cellule du type CList : "
-#: src/test.cc:115
+#: src/test.cc:117
msgid "Size of a SList cell : "
msgstr "Taille d'une cellule du type SList : "
-#: src/test.cc:116
+#: src/test.cc:118
msgid "Size of a BinHeap header : "
msgstr "Taille d'un entête du type BinHeap : "
-#: src/test.cc:117
+#: src/test.cc:119
msgid "Size of a BinHeap cell : "
msgstr "Taille d'une cellule du type BinHeap : "
-#: src/test.cc:124
+#: src/test.cc:126
msgid "Creating a priority list and adding keys:\n"
msgstr "Création d'une liste de priorité et ajout de clefs:\n"
-#: src/test.cc:138 src/test.cc:145 src/test.cc:149 src/test.cc:153
+#: src/test.cc:140 src/test.cc:147 src/test.cc:151 src/test.cc:155
msgid ""
"Ok.\n"
"List browsing...\n"
@@ -150,7 +154,7 @@ msgstr ""
"Ok.\n"
"Exploration de la liste...\n"
-#: src/test.cc:140
+#: src/test.cc:142
msgid ""
"Ok.\n"
"Extract_Min + List browsing...\n"
@@ -158,7 +162,7 @@ msgstr ""
"Ok.\n"
"Extract_Min + Exploration de la liste...\n"
-#: src/test.cc:143
+#: src/test.cc:145
msgid ""
"Ok.\n"
"Lower_Key(0) over 59...\n"
@@ -166,7 +170,7 @@ msgstr ""
"Ok.\n"
"Lower_Key(0) sur 59...\n"
-#: src/test.cc:147
+#: src/test.cc:149
msgid ""
"Ok.\n"
"Delete over 54...\n"
@@ -174,7 +178,7 @@ msgstr ""
"Ok.\n"
"Delete sur 54...\n"
-#: src/test.cc:151
+#: src/test.cc:153
msgid ""
"Ok.\n"
"Lower_Key(-12) over 30...\n"
@@ -182,7 +186,7 @@ msgstr ""
"Ok.\n"
"Lower_Key(-12) sur 30...\n"
-#: src/test.cc:155
+#: src/test.cc:157
msgid ""
"Ok.\n"
"Extract_Min...\n"
@@ -190,7 +194,7 @@ msgstr ""
"Ok.\n"
"Extract_Min...\n"
-#: src/test.cc:157
+#: src/test.cc:159
msgid ""
"Ok.\n"
"Extracting datas...\n"
@@ -198,11 +202,11 @@ msgstr ""
"Ok.\n"
"Extraction des données...\n"
-#: src/test.cc:159
+#: src/test.cc:161
msgid "Minimum #"
msgstr "Minimum #"
-#: src/test.cc:165
+#: src/test.cc:167
msgid ""
"Ok.\n"
"\n"
@@ -212,106 +216,105 @@ msgstr ""
"\n"
"Tous les tests se sont déroulés correctement\n"
-#: src/test.cc:171
+#: src/test.cc:173
msgid "Usage: testTas [type]\n"
msgstr "Usage: testTas [type]\n"
-#: src/test.cc:182
+#: src/test.cc:184
msgid "Choice: "
msgstr "Choix: "
-#: src/test.cc:199
+#: src/test.cc:201
msgid "Incorrect choice, select again\n"
msgstr "Choix incorrect, veuillez recommencer\n"
-#: src/test.cc:215
+#: src/test.cc:217
#, c-format
msgid "%i - Key: %i"
msgstr "%i - Clef: %i"
-#: src/test.cc:217
+#: src/test.cc:219
#, c-format
msgid "%i - Empty slot"
msgstr "%i - Emplacement vide"
-#: src/test.cc:224
+#: src/test.cc:226
msgid "n - Don't store"
msgstr "n - Ne pas stocker"
-#: src/test.cc:225
+#: src/test.cc:227
msgid "c - Cancel"
msgstr "c - Annuler"
-#: src/test.cc:252
+#: src/test.cc:254
msgid "could not set attributes\n"
msgstr "Ne peut définir les attributs\n"
-#: src/main.cc:179 src/test.cc:282
+#: src/main.cc:179 src/test.cc:284
msgid "Extra command: "
msgstr "Commande supplémentaire: "
-#: src/test.cc:296
+#: src/test.cc:298
msgid "You are not a terminal, Ok.\n"
msgstr "Vous n'êtes pas un terminal, tant pis.\n"
-#: src/test.cc:301
+#: src/test.cc:303
msgid "Unable to open /dev/tty\n"
msgstr "Impossible d'ouvrir /dev/tty\n"
-#: src/test.cc:319
+#: src/test.cc:321
msgid "Priority list type: "
msgstr "Type de file de priorité: "
-#: src/test.cc:320
+#: src/test.cc:322
msgid "Please select an action"
msgstr "Veuillez sélectionner une action"
-#: src/test.cc:321
+#: src/test.cc:323
msgid "You have chosen: "
msgstr "Vous avez choisi: "
-#: src/test.cc:325
+#: src/test.cc:327
msgid "Please select a slot to save the cell"
msgstr "Veuillez sélectionner un emplacement pour sauvegarder la cellule"
-#: src/test.cc:335
+#: src/test.cc:337
msgid "Please type in a key to add"
msgstr "Veuillez taper une clef a ajouter"
-#: src/test.cc:349
+#: src/test.cc:351
msgid "Please select a priority list type"
msgstr "Veuillez sélectionner le type de la file de priorité"
-#: src/test.cc:356
+#: src/test.cc:361
msgid "Please select a key to delete"
msgstr "Veuillez sélectionner une clef à supprimer"
-#: src/test.cc:362
+#: src/test.cc:367
msgid "Delete result: "
msgstr "Résultat de l'effacement: "
-#. Extract Min.
-#: src/test.cc:366
+#: src/test.cc:379
msgid "Extract Min result: "
msgstr "Résultat de l'Extraire Min: "
-#: src/test.cc:370
+#: src/test.cc:383
msgid "Please select a key to lower"
msgstr "Veuillez sélctionner une clef à diminuer"
-#: src/test.cc:376
+#: src/test.cc:389
msgid "Please type in the new key"
msgstr "Veuillez entrer la nouvelle clef"
-#: src/test.cc:380
+#: src/test.cc:393
msgid "Lower key result: "
msgstr "Résultat du Diminuer Clef: "
-#: src/test.cc:380
+#: src/test.cc:393
msgid "True"
msgstr "Vrai"
-#: src/test.cc:380
+#: src/test.cc:393
msgid "False"
msgstr "Faux"
diff --git a/src/test.cc b/src/test.cc
index a557b69..fb67d24 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -23,7 +23,8 @@ char *method_names[] = {
N_("0 - Binary Heap"),
N_("1 - Binomial Heap"),
N_("2 - Fibonacci Heap"),
- N_("3 - Sorted chained list")
+ N_("3 - Sorted chained list"),
+ NULL
};
char *menu[] = {
@@ -35,7 +36,8 @@ char *menu[] = {
N_("p - Print the current priority list on the screen"),
N_("r - Remove the whole priority list"),
N_("t - Test the priority list algorithms"),
- N_("q - Quit")
+ N_("q - Quit"),
+ NULL
};
void exception(int e, char *msg)
@@ -96,7 +98,7 @@ void DoCombTest(int method, int number)
}
delete T;
- cerr << "Ok.\n";
+ cerr << _("Ok.\n");
}
void FullTest(int method)
@@ -284,7 +286,7 @@ int main(int argc, char **argv)
}
method = (*argv)[0] - '0';
}
-
+
if (method == -1)
method = 0;
@@ -303,7 +305,7 @@ int main(int argc, char **argv)
}
initterm(input);
-
+
/*
Debut du programme de test.
*/