Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
[privoxy.git] / deanimate.h
1 #ifndef DEANIMATE_H_INCLUDED
2 #define DEANIMATE_H_INCLUDED
3 #define DEANIMATE_H_VERSION "$Id: deanimate.h,v 1.8.2.1 2004/10/03 12:53:32 david__schmidt Exp $"
4 /*********************************************************************
5  *
6  * File        :  $Source: /cvsroot/ijbswa/current/Attic/deanimate.h,v $
7  *
8  * Purpose     :  Declares functions to manipulate binary images on the
9  *                fly.  High-level functions include:
10  *                  - Deanimation of GIF images
11  *                  - Fixup of malformed comment block in JPEG headers
12  *                
13  *                Functions declared include: gif_deanimate, buf_free,
14  *                jpeg_inspect
15  *                
16  *
17  * Copyright   :  Written by and Copyright (C) 2001 - 2004 by the the
18  *                SourceForge Privoxy team. http://www.privoxy.org/
19  *
20  *                Based on ideas from the Image::DeAnim Perl module by
21  *                Ken MacFarlane, <ksm+cpan@universal.dca.net>
22  *
23  *                Based on the Internet Junkbuster originally written
24  *                by and Copyright (C) 1997 Anonymous Coders and 
25  *                Junkbusters Corporation.  http://www.junkbusters.com
26  *
27  *                This program is free software; you can redistribute it 
28  *                and/or modify it under the terms of the GNU General
29  *                Public License as published by the Free Software
30  *                Foundation; either version 2 of the License, or (at
31  *                your option) any later version.
32  *
33  *                This program is distributed in the hope that it will
34  *                be useful, but WITHOUT ANY WARRANTY; without even the
35  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
36  *                PARTICULAR PURPOSE.  See the GNU General Public
37  *                License for more details.
38  *
39  *                The GNU General Public License should be included with
40  *                this file.  If not, you can view it at
41  *                http://www.gnu.org/copyleft/gpl.html
42  *                or write to the Free Software Foundation, Inc., 59
43  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
44  *
45  * Revisions   :
46  *    $Log: deanimate.h,v $
47  *    Revision 1.8.2.1  2004/10/03 12:53:32  david__schmidt
48  *    Add the ability to check jpeg images for invalid
49  *    lengths of comment blocks.  Defensive strategy
50  *    against the exploit:
51  *       Microsoft Security Bulletin MS04-028
52  *       Buffer Overrun in JPEG Processing (GDI+) Could
53  *       Allow Code Execution (833987)
54  *    Enabled with +inspect-jpegs in actions files.
55  *
56  *    Revision 1.8  2002/03/26 22:29:54  swa
57  *    we have a new homepage!
58  *
59  *    Revision 1.7  2002/03/24 13:25:43  swa
60  *    name change related issues
61  *
62  *    Revision 1.6  2002/03/08 17:46:04  jongfoster
63  *    Fixing int/size_t warnings
64  *
65  *    Revision 1.5  2002/03/07 03:46:17  oes
66  *    Fixed compiler warnings
67  *
68  *    Revision 1.4  2001/07/29 18:50:04  jongfoster
69  *    Fixing "extern C" block, and renaming #define _DEANIMATE_H
70  *
71  *    Revision 1.3  2001/07/18 12:29:05  oes
72  *    Updated prototype for gif_deanimate
73  *
74  *    Revision 1.2  2001/07/13 13:46:20  oes
75  *    Introduced GIF deanimation feature
76  *
77  *
78  *********************************************************************/
79 \f
80
81 #ifdef __cplusplus
82 extern "C" {
83 #endif
84
85 /*
86  * A struct that holds a buffer, a read/write offset,
87  * and the buffer's capacity.
88  */
89 struct binbuffer
90 {
91    char *buffer; 
92    size_t offset;   
93    size_t size;    
94 };
95
96 /*
97  * Function prototypes
98  */
99 extern int gif_deanimate(struct binbuffer *src, struct binbuffer *dst, int get_first_image);
100 extern int jpeg_inspect(struct binbuffer *src, struct binbuffer *dst);
101 extern void buf_free(struct binbuffer *buf);
102
103 /* 
104  * Revision control strings from this header and associated .c file
105  */
106 extern const char deanimate_rcs[];
107 extern const char deanimate_h_rcs[];
108
109 #ifdef __cplusplus
110 } /* extern "C" */
111 #endif
112
113 #endif /* ndef DEANIMATE_H_INCLUDED */
114
115 /*
116   Local Variables:
117   tab-width: 3
118   end:
119 */