incremental update to make sure the massive modifications exist on
[platform/upstream/libvorbis.git] / lib / res0.c
1 /********************************************************************
2  *                                                                  *
3  * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE.  *
4  * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5  * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE.    *
6  * PLEASE READ THESE TERMS DISTRIBUTING.                            *
7  *                                                                  *
8  * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-2000             *
9  * by Monty <monty@xiph.org> and The XIPHOPHORUS Company            *
10  * http://www.xiph.org/                                             *
11  *                                                                  *
12  ********************************************************************
13
14  function: residue backend 0 implementation
15  last mod: $Id: res0.c,v 1.1 2000/01/20 04:43:04 xiphmont Exp $
16
17  ********************************************************************/
18
19 #include <stdlib.h>
20 #include <string.h>
21 #include "vorbis/codec.h"
22 #include "bitwise.h"
23 #include "registry.h"
24 #include "res0.h"
25
26 /* unfinished as of 20000118 */
27 extern _vi_info_res *_vorbis_res0_dup(_vi_info_res *source){
28   vorbis_info_res0 *d=malloc(sizeof(vorbis_info_res0));
29   memcpy(d,source,sizeof(vorbis_info_res0));
30   d->books=malloc(sizeof(int)*d->stages);
31   memcpy(d->books,((vorbis_info_res0 *)source)->books,
32          sizeof(int)*d->stages);
33   return(d); 
34 }
35
36 extern void _vorbis_res0_free(_vi_info_res *i){
37   vorbis_info_res0 *d=(vorbis_info_res0 *)i;
38   if(d){
39     if(d->books)free(d->books);
40     memset(d,0,sizeof(vorbis_info_res0));
41     free(d);
42   }
43 }
44
45 /* not yet */
46 extern void _vorbis_res0_pack(oggpack_buffer *opb, _vi_info_res *vi){
47 }
48
49 extern _vi_info_res *_vorbis_res0_unpack(vorbis_info *vi,
50                                          oggpack_buffer *opb){
51   vorbis_info_res0 d;
52   memset(&d,0,sizeof(d));
53   return(_vorbis_res0_dup(&d));
54 }