bfile_heuristics.c

changeset 21
91e0890464b0
parent 20
43725438ac50
child 22
4508da679ffb
--- a/bfile_heuristics.c	Thu Oct 20 14:13:56 2011 +0200
+++ b/bfile_heuristics.c	Thu Oct 20 15:21:53 2011 +0200
@@ -5,18 +5,23 @@
  *      Author: Mike
  */
 
-
 #include "bfile_heuristics.h"
 
-bfile_heuristics *new_bfile_heuristics(int level) {
-   bfile_heuristics *ret = malloc(sizeof(bfile_heuristics));
-   ret->level = level;
-   memset(ret->ccount, 0, sizeof(int)*256);
-   return ret;
+bfile_heuristics_t *new_bfile_heuristics_t() {
+  bfile_heuristics_t *ret = malloc(sizeof(bfile_heuristics_t));
+  ret->level = BFILE_MEDIUM_ACCURACY;
+  /* TODO: check why this fails */
+  /* ret->ccount = calloc(256, sizeof(int)); */
+  return ret;
 }
 
-bool bfile_check(bfile_heuristics *def, int next_char) {
-   bool ret = false;
-   
-   return ret;
+void destroy_bfile_heuristics_t(bfile_heuristics_t *def) {
+  free(def->ccount);
+  free(def);
 }
+
+bool bfile_check(bfile_heuristics_t *def, int next_char) {
+  bool ret = false;
+
+  return ret;
+}

mercurial