Lines Matching defs:newch
32 * uncompress(method, old, n, newch) - uncompress old into new,
578 uncompressgzipped(const unsigned char *old, unsigned char **newch,
613 return uncompresszlib(old, newch, bytes_max, n, 0);
615 return makeerror(newch, n, "File too short");
619 uncompresszlib(const unsigned char *old, unsigned char **newch,
628 z.next_out = *newch;
651 (*newch)[*n] = '\0';
655 return makeerror(newch, n, "%s", z.msg ? z.msg : zError(rc));
661 uncompressbzlib(const unsigned char *old, unsigned char **newch,
675 bz.next_out = RCAST(char *, *newch);
692 (*newch)[*n] = '\0';
696 return makeerror(newch, n, "bunzip error %d", rc);
702 uncompressxzlib(const unsigned char *old, unsigned char **newch,
716 xz.next_out = RCAST(uint8_t *, *newch);
730 (*newch)[*n] = '\0';
734 return makeerror(newch, n, "unxz error %d", rc);
740 uncompresszstd(const unsigned char *old, unsigned char **newch,
750 return makeerror(newch, n, "No ZSTD decompression stream, %s",
761 out.dst = RCAST(void *, *newch);
774 (*newch)[*n] = '\0';
779 return makeerror(newch, n, "zstd error %d", ZSTD_getErrorCode(rc));
785 uncompresslzlib(const unsigned char *old, unsigned char **newch,
795 bufp = *newch;
800 return makeerror(newch, n, "unable to allocate LZ_Decoder");
842 return makeerror(newch, n, "lzlib error: %s", LZ_strerror(err));
848 uncompresslrzip(const unsigned char *old, unsigned char **newch,
858 res = makeerror(newch, n, "unable to create an lrzip decoder");
864 res = makeerror(newch, n, "unable to construct input file");
868 res = makeerror(newch, n, "unable to add input file");
871 *newch = calloc(*n = 2 * bytes_max, 1);
872 if (*newch == NULL) {
873 res = makeerror(newch, n, "unable to allocate output buffer");
876 out = fmemopen(*newch, *n, "w");
878 free(*newch);
879 res = makeerror(newch, n, "unable to allocate output file");
884 free(*newch);
885 res = makeerror(newch, n, "unable to decompress file");
1125 const unsigned char *old, unsigned char **newch, size_t* n)
1140 *newch = CAST(unsigned char *, malloc(bytes_max + 1));
1141 if (*newch == NULL)
1142 return makeerror(newch, n, "No buffer, %s", strerror(errno));
1146 return makeerror(newch, n,
1149 return (*decompress)(old, newch, bytes_max, n, 1);
1177 return makeerror(newch, n, "Cannot create pipe, %s",
1194 return makeerror(newch, n, "Cannot posix_spawn `%s', %s",
1203 return makeerror(newch, n, "Cannot vfork, %s",
1230 rv = makeerror(newch, n, "Write to child failed, %s",
1239 r = sread(fdp[STDOUT_FILENO][0], *newch, bytes_max, 0);
1257 if ((re = sread(fdp[STDERR_FILENO][0], *newch, bytes_max, 0)) > 0) {
1258 DPRINTF("Got stuff from stderr %s\n", *newch);
1260 r = filter_error(*newch, r);
1265 rv = makeerror(newch, n, "Read stderr failed, %s",
1271 (*newch)[*n] = '\0';
1280 rv = makeerror(newch, n, "Wait failed, %s", strerror(errno));
1298 DPRINTF("Returning %p n=%" SIZE_T_FORMAT "u rv=%d\n", *newch, *n, rv);