aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2013-08-12 19:02:31 +0200
committerLars Magne Ingebrigtsen2013-08-12 19:02:31 +0200
commit7699d09ec6f13ec0b864e82a8c59e56037628539 (patch)
treefa5d8707c5d41a71b16642e2dbf35010fd009092 /src
parent1d238bc75ac833eb28a72f24cc1acd79ec5999d7 (diff)
downloademacs-7699d09ec6f13ec0b864e82a8c59e56037628539.tar.gz
emacs-7699d09ec6f13ec0b864e82a8c59e56037628539.zip
Rename `zlib-decompress-gzipped-region' to `zlib-decompress-region'.
Also support zlib-format compression.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/decompress.c13
2 files changed, 12 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index cf851d5bec0..88e1fdc4e66 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12013-08-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * decompress.c (Fzlib_decompress_region): Support zlib
4 decompression, too, and rename.
5
12013-08-12 Paul Eggert <eggert@cs.ucla.edu> 62013-08-12 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 Minor zlib configuration tweaks. 8 Minor zlib configuration tweaks.
diff --git a/src/decompress.c b/src/decompress.c
index 4e4e3a9c7dc..b3ad4f7676a 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -119,10 +119,10 @@ DEFUN ("zlib-available-p", Fzlib_available_p, Szlib_available_p, 0, 0, 0,
119#endif 119#endif
120} 120}
121 121
122DEFUN ("zlib-decompress-gzipped-region", Fzlib_decompress_gzipped_region, 122DEFUN ("zlib-decompress-region", Fzlib_decompress_region,
123 Szlib_decompress_gzipped_region, 123 Szlib_decompress_region,
124 2, 2, 0, 124 2, 2, 0,
125 doc: /* Decompress a gzip-compressed region. 125 doc: /* Decompress a gzip- or zlib-compressed region.
126Replace the text in the region by the decompressed data. 126Replace the text in the region by the decompressed data.
127On failure, return nil and leave the data in place. 127On failure, return nil and leave the data in place.
128This function can be called only in unibyte buffers. */) 128This function can be called only in unibyte buffers. */)
@@ -151,8 +151,9 @@ This function can be called only in unibyte buffers. */)
151 stream.avail_in = 0; 151 stream.avail_in = 0;
152 stream.next_in = Z_NULL; 152 stream.next_in = Z_NULL;
153 153
154 /* This magic number apparently means "this is gzip". */ 154 /* The magic number 32 apparently means "autodect both the gzip and
155 if (fn_inflateInit2 (&stream, 16 + MAX_WBITS) != Z_OK) 155 zlib formats" according to zlib.h. */
156 if (fn_inflateInit2 (&stream, MAX_WBITS + 32) != Z_OK)
156 return Qnil; 157 return Qnil;
157 158
158 unwind_data.start = iend; 159 unwind_data.start = iend;
@@ -210,7 +211,7 @@ void
210syms_of_decompress (void) 211syms_of_decompress (void)
211{ 212{
212 DEFSYM (Qzlib_dll, "zlib"); 213 DEFSYM (Qzlib_dll, "zlib");
213 defsubr (&Szlib_decompress_gzipped_region); 214 defsubr (&Szlib_decompress_region);
214 defsubr (&Szlib_available_p); 215 defsubr (&Szlib_available_p);
215} 216}
216 217