• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:raw +full:- +full:output

1 /* fitblk.c: example of fitting compressed output to a specified size
2 Not copyrighted -- provided to the public domain
8 Use fixed-size, stack-allocated raw buffers
18 nearly the requested output block size. The first pass generates
19 enough deflate blocks to produce output to fill the requested
20 output size plus a specified excess amount (see the EXCESS define
39 before filling the requested output size, then that compressed
76 unsigned char raw[RAWLEN]; in partcompress() local
80 def->avail_in = fread(raw, 1, RAWLEN, in); in partcompress()
83 def->next_in = raw; in partcompress()
88 } while (def->avail_out != 0 && flush == Z_NO_FLUSH); in partcompress()
92 /* recompress from inf's input to def's output; the input for inf and
93 the output for def are set in those structures before calling;
99 unsigned char raw[RAWLEN]; in recompress() local
104 inf->avail_out = RAWLEN; in recompress()
105 inf->next_out = raw; in recompress()
113 def->avail_in = RAWLEN - inf->avail_out; in recompress()
114 def->next_in = raw; in recompress()
115 if (inf->avail_out != 0) in recompress()
119 } while (ret != Z_STREAM_END && def->avail_out != 0); in recompress()
126 /* compress from stdin to fixed-size block on stdout */
130 unsigned size; /* requested fixed output block size */ in main()
136 /* get requested output size */ in main()
138 quit("need one argument: size of output block"); in main()
155 /* compress from stdin until output full, or no more input */ in main()
162 /* if it all fit, then size was undersubscribed -- done! */ in main()
165 have = size + EXCESS - def.avail_out; in main()
167 quit("error writing output"); in main()
175 size - have, size); in main()
179 /* it didn't all fit -- set up for recompression */ in main()
208 inf.avail_in = size - MARGIN; /* assure stream will complete */ in main()
217 /* done -- write block to stdout */ in main()
218 have = size - def.avail_out; in main()
220 quit("error writing output"); in main()
231 size - have, size, def.total_in); in main()