bfile_heuristics.c

changeset 21
91e0890464b0
parent 20
43725438ac50
child 22
4508da679ffb
     1.1 --- a/bfile_heuristics.c	Thu Oct 20 14:13:56 2011 +0200
     1.2 +++ b/bfile_heuristics.c	Thu Oct 20 15:21:53 2011 +0200
     1.3 @@ -5,18 +5,23 @@
     1.4   *      Author: Mike
     1.5   */
     1.6  
     1.7 -
     1.8  #include "bfile_heuristics.h"
     1.9  
    1.10 -bfile_heuristics *new_bfile_heuristics(int level) {
    1.11 -   bfile_heuristics *ret = malloc(sizeof(bfile_heuristics));
    1.12 -   ret->level = level;
    1.13 -   memset(ret->ccount, 0, sizeof(int)*256);
    1.14 -   return ret;
    1.15 +bfile_heuristics_t *new_bfile_heuristics_t() {
    1.16 +  bfile_heuristics_t *ret = malloc(sizeof(bfile_heuristics_t));
    1.17 +  ret->level = BFILE_MEDIUM_ACCURACY;
    1.18 +  /* TODO: check why this fails */
    1.19 +  /* ret->ccount = calloc(256, sizeof(int)); */
    1.20 +  return ret;
    1.21  }
    1.22  
    1.23 -bool bfile_check(bfile_heuristics *def, int next_char) {
    1.24 -   bool ret = false;
    1.25 -   
    1.26 -   return ret;
    1.27 +void destroy_bfile_heuristics_t(bfile_heuristics_t *def) {
    1.28 +  free(def->ccount);
    1.29 +  free(def);
    1.30  }
    1.31 +
    1.32 +bool bfile_check(bfile_heuristics_t *def, int next_char) {
    1.33 +  bool ret = false;
    1.34 +
    1.35 +  return ret;
    1.36 +}

mercurial