source: gsdl/trunk/trunk/mg/src/images/model.h@ 16583

Last change on this file since 16583 was 16583, checked in by davidb, 16 years ago

Undoing change commited in r16582

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1/**************************************************************************
2 *
3 * model.h -- Part pf PPM data compression
4 * Copyright (C) 1987 Alistair Moffat
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *
20 * $Id: model.h 16583 2008-07-29 10:20:36Z davidb $
21 *
22 **************************************************************************/
23
24#define defaultkbytes 896
25#define minkbytes 56
26#define maxkbytes ((65536/1024)*sizeof(eventnode))
27
28#ifndef increment
29#define increment 8
30#endif
31#ifndef halveat
32#define halveat 64
33#endif
34#define maxtotalcnt (increment*halveat)
35
36typedef int boolean;
37#define false 0
38#define true 1
39
40typedef short event;
41typedef unsigned short point;
42
43typedef struct
44 {
45 short totalcnt;
46 short notfound;
47 point list; /* list storing the event records */
48 }
49eventset;
50
51typedef struct
52 {
53 event eventnum;
54 short count;
55 point next, prev;
56 eventset foll;
57 }
58eventnode, *eventptr;
59
60#define memsize (kbytes*1024)
61#define maxnodes (memsize/sizeof(eventnode))
62/* #define charsetsize 256 -- MAHE */
63#define nchars (charsetsize+1)
64
65extern int charsetsize; /* -- MAHE */
66
67extern eventptr E;
68extern long kbytes;
69extern point numnodes, nfreenodes;
70extern boolean excluded[]; /* -- MAHE */
71
72#define ENULL (E)
73
74typedef unsigned u;
75#define p32(p) (E+p)
76#define p16(p) (p-E)
77
78/* in ppm.c */
79void write_model ();
80void encodestring ();
81void decodestring ();
82void encodefile ();
83void decodefile ();
84
85/* in lstevent.c */
86void write_method ();
87eventnode *encode_event_noex ();
88eventnode *decode_event_noex ();
89eventnode *encode_event ();
90eventnode *decode_event ();
91/* eventnode *addevent(); */
92eventnode *newnode ();
Note: See TracBrowser for help on using the repository browser.