zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
bookutil.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <errno.h>
#include "bookutil.h"

Go to the source code of this file.

Functions

int _best (codebook *book, float *a, int step)
 
void build_tree_from_lengths (int vals, long *hist, long *lengths)
 
void build_tree_from_lengths0 (int vals, long *hist, long *lengths)
 
codebookcodebook_load (char *filename)
 
char * find_seek_to (FILE *in, char *s)
 
char * get_line (FILE *in)
 
int get_line_value (FILE *in, float *value)
 
int get_next_ivalue (FILE *in, long *ivalue)
 
int get_next_value (FILE *in, float *value)
 
int get_vector (codebook *b, FILE *in, int start, int n, float *a)
 
void reset_next_value (void)
 
char * setup_line (FILE *in)
 
void spinnit (char *s, int n)
 
void write_codebook (FILE *out, char *name, const static_codebook *c)
 

Variables

static int lbufsize =0
 
static char * linebuffer =NULL
 
static float sequence_base =0.f
 
static int v_sofar =0
 
static char * value_line_buff =NULL
 

Function Documentation

int _best ( codebook book,
float *  a,
int  step 
)
void build_tree_from_lengths ( int  vals,
long *  hist,
long *  lengths 
)

Definition at line 338 of file bookutil.c.

References _ogg_malloc, free, i, j, memcpy, and spinnit().

Referenced by build_tree_from_lengths0(), and main().

void build_tree_from_lengths0 ( int  vals,
long *  hist,
long *  lengths 
)

Definition at line 407 of file bookutil.c.

References _ogg_calloc, build_tree_from_lengths(), free, and i.

Referenced by main().

char* find_seek_to ( FILE *  in,
char *  s 
)

Definition at line 216 of file bookutil.c.

References get_line(), and NULL.

Referenced by codebook_load().

char* get_line ( FILE *  in)

Definition at line 85 of file bookutil.c.

References _ogg_malloc, _ogg_realloc, EOF, lbufsize, linebuffer, and NULL.

Referenced by codebook_load(), find_seek_to(), get_next_value(), main(), and setup_line().

int get_line_value ( FILE *  in,
float *  value 
)

Definition at line 131 of file bookutil.c.

References NULL, and value_line_buff.

Referenced by get_next_value(), get_vector(), and getval().

int get_next_ivalue ( FILE *  in,
long *  ivalue 
)

Definition at line 159 of file bookutil.c.

References get_next_value(), and ret.

Referenced by codebook_load(), and main().

int get_next_value ( FILE *  in,
float *  value 
)

Definition at line 148 of file bookutil.c.

References get_line(), get_line_value(), and value_line_buff.

Referenced by get_next_ivalue(), get_vector(), and getval().

int get_vector ( codebook b,
FILE *  in,
int  start,
int  n,
float *  a 
)
void reset_next_value ( void  )

Definition at line 168 of file bookutil.c.

References NULL, sequence_base, v_sofar, and value_line_buff.

Referenced by codebook_load(), get_vector(), getval(), main(), and setup_line().

char* setup_line ( FILE *  in)

Definition at line 174 of file bookutil.c.

References get_line(), reset_next_value(), and value_line_buff.

Referenced by main().

void spinnit ( char *  s,
int  n 
)

Variable Documentation

int lbufsize =0
static

Definition at line 84 of file bookutil.c.

Referenced by get_line().

char* linebuffer =NULL
static

Definition at line 83 of file bookutil.c.

Referenced by get_line().

float sequence_base =0.f
static

Definition at line 166 of file bookutil.c.

Referenced by get_vector(), and reset_next_value().

int v_sofar =0
static

Definition at line 167 of file bookutil.c.

Referenced by get_vector(), and reset_next_value().

char* value_line_buff =NULL
static

Definition at line 129 of file bookutil.c.

Referenced by get_line_value(), get_next_value(), reset_next_value(), and setup_line().