job->output_data_allocated = (job->output_data_position + len + 1 + PAGE_ALIGN) & ~PAGE_ALIGN;
job->output_data = realloc(job->output_data, job->output_data_allocated);
if (!job->output_data) {
- (job->common->errorfn) ("memory allocation failure\n");
+ job->common->errorfn("memory allocation failure\n");
graphviz_exit(1);
}
}
if (job->output_filename) {
job->output_file = fopen(job->output_filename, "w");
if (job->output_file == NULL) {
- (job->common->errorfn) ("Could not open \"%s\" for writing : %s\n",
+ job->common->errorfn("Could not open \"%s\" for writing : %s\n",
job->output_filename, strerror(errno));
/* perror(job->output_filename); */
return(1);
crc = crc32(0L, Z_NULL, 0);
if (deflateInit2(z, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK) {
- (job->common->errorfn) ("Error initializing for deflation\n");
+ job->common->errorfn("Error initializing for deflation\n");
return(1);
}
gvwrite_no_z(job, z_file_header, sizeof(z_file_header));
#else
- (job->common->errorfn) ("No libz support.\n");
+ job->common->errorfn("No libz support.\n");
return(1);
#endif
}
dfallocated = (dflen + 1 + PAGE_ALIGN) & ~PAGE_ALIGN;
df = realloc(df, dfallocated);
if (! df) {
- (job->common->errorfn) ("memory allocation failure\n");
+ job->common->errorfn("memory allocation failure\n");
graphviz_exit(1);
}
}
z->avail_out = dfallocated;
int r = deflate(z, Z_NO_FLUSH);
if (r != Z_OK) {
- (job->common->errorfn) ("deflation problem %d\n", r);
+ job->common->errorfn("deflation problem %d\n", r);
graphviz_exit(1);
}
if ((olen = z->next_out - df)) {
ret = gvwrite_no_z(job, df, olen);
if (ret != olen) {
- (job->common->errorfn) ("gvwrite_no_z problem %d\n", ret);
+ job->common->errorfn("gvwrite_no_z problem %d\n", ret);
graphviz_exit(1);
}
}
#else
(void)olen;
- (job->common->errorfn) ("No libz support.\n");
+ job->common->errorfn("No libz support.\n");
graphviz_exit(1);
#endif
}
else { /* uncompressed write */
ret = gvwrite_no_z (job, s, len);
if (ret != len) {
- (job->common->errorfn) ("gvwrite_no_z problem %d\n", len);
+ job->common->errorfn("gvwrite_no_z problem %d\n", len);
graphviz_exit(1);
}
}
z->avail_out = dfallocated;
}
if (ret != Z_STREAM_END) {
- (job->common->errorfn) ("deflation finish problem %d cnt=%d\n", ret, cnt);
+ job->common->errorfn("deflation finish problem %d cnt=%d\n", ret, cnt);
graphviz_exit(1);
}
gvwrite_no_z(job, df, z->next_out - df);
ret = deflateEnd(z);
if (ret != Z_OK) {
- (job->common->errorfn) ("deflation end problem %d\n", ret);
+ job->common->errorfn("deflation end problem %d\n", ret);
graphviz_exit(1);
}
out[0] = (unsigned char)crc;
out[7] = (unsigned char)(z->total_in >> 24);
gvwrite_no_z(job, out, sizeof(out));
#else
- (job->common->errorfn) ("No libz support\n");
+ job->common->errorfn("No libz support\n");
graphviz_exit(1);
#endif
}