Commit 2cbeac74 authored by ROOL's avatar ROOL 🤖
Browse files

This commit was manufactured by cvs2git to create tag 'dellis_autobuild_BaseSW'.

Sprout from zlib 1999-05-19 11:31:27 UTC Kevin Bracey <kbracey@gitlab.riscosopen.org> 'Imported zlib-1.1.3'
Cherrypick from master 1999-05-19 11:40:55 UTC Kevin Bracey <kbracey@gitlab.riscosopen.org> 'zlib 1.1.3 merged in from vendor branch.':
    !MkClean,fd7
    !MkExport,fd7
    !MkLibs,fd7
    Makefile
    Utils/ReadMe
    Utils/c/zdeflate
    VersionNum
    h/zconf
    h/zutil
parent 8cf1d5ac
| Copyright 1998 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine clean
| Copyright 1998 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
Echo Exporting zlib from <Obey$Dir> ...
wimpslot -min 1608k
time
amu_machine export_hdrs
amu_machine export_libs
time
| Copyright 1998 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine all THROWBACK=-throwback
c/** gitlab-language=c linguist-language=c linguist-detectable=true
**/c/** gitlab-language=c linguist-language=c linguist-detectable=true
h/** gitlab-language=c linguist-language=c linguist-detectable=true
# Copyright 1998 Acorn Computers Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile for zlib
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 30-Mar-98 KJB Created.
#
#
# Paths
#
EXP_HDR = <export$dir>
LIBDIR = <Lib$Dir>
ZLIBDIR = ${LIBDIR}.zlib
#
# Generic options:
#
MKDIR = cdir
AS = objasm
CP = copy
CC = cc
CM = cmhg
RM = remove
LD = link
LB = libfile
TOUCH = create
WIPE = -wipe
CCFLAGS = -c -depend !Depend ${INCLUDES} ${DFLAGS} ${THROWBACK}
ASFLAGS = -depend !Depend -Stamp -quit
CPFLAGS = ~cfr~v
LBFLAGS = -c
WFLAGS = ~CFR~V
#
# Libraries
#
CLIB = CLIB:o.stubs
RLIB = RISCOSLIB:o.risc_oslib
RSTUBS = RISCOSLIB:o.rstubs
ROMSTUBS = RISCOSLIB:o.romstubs
ROMCSTUBS = RISCOSLIB:o.romcstubs
ABSSYM = RISC_OSLib:o.AbsSym
#
# Include files
#
INCLUDES =
DFLAGS = -DRISCOS
#
# Program specific options:
#
COMPONENT = zlib
COMPONENTZ = zlibzm
TARGET = ${COMPONENT}
TARGETZ = ${COMPONENTZ}
SOURCE =
EXPORTS =
OBJS = \
o.adler32 \
o.compress \
o.crc32 \
o.gzio \
o.uncompr \
o.deflate \
o.trees \
o.zutil \
o.inflate \
o.infblock \
o.inftrees \
o.infcodes \
o.infutil \
o.inffast
OBJSZ = \
oz.adler32 \
oz.compress \
oz.crc32 \
oz.gzio \
oz.uncompr \
oz.deflate \
oz.trees \
oz.zutil \
oz.inflate \
oz.infblock \
oz.inftrees \
oz.infcodes \
oz.infutil \
oz.inffast
HDRS = zlib.h zconf.h
LIBS = ${TARGET} ${TARGETZ}
#
# Rule patterns
#
.SUFFIXES: .o .oz .od .c .h .s
.c.o:; ${CC} ${CCFLAGS} -ff -o $@ $<
.c.oz:; ${CC} ${CCFLAGS} -ff -zM -o $@ $<
.s.o:; ${AS} ${ASFLAGS} -o $@ $<
.cmhg.o:; ${CM} ${CMFLAGS} -o $@ $<
.cmhg.h:; ${CM} ${CMFLAGS} -d $@ $<
#
# build the library:
#
all: ${LIBS}
#
# RISC OS ROM build rules:
#
rom: ${TARGET}
@echo ${COMPONENT}: rom module built
export: export_${PHASE}
install_rom: ${TARGET}
@echo ${COMPONENT}: rom module installed
clean:
${WIPE} o ${WFLAGS}
${WIPE} oz ${WFLAGS}
${RM} ${COMPONENT}
${RM} ${COMPONENTZ}
@echo ${COMPONENT}: cleaned
export_hdrs: ${HDRS} dirs
${CP} h.zlib ${ZLIBDIR}.h.* ${CPFLAGS}
${CP} h.zconf ${ZLIBDIR}.h.* ${CPFLAGS}
@echo ${COMPONENT}: export complete (hdrs)
export_libs: ${LIBS} dirs
${CP} ${TARGET} ${ZLIBDIR}.o.* ${CPFLAGS}
${CP} ${TARGETZ} ${ZLIBDIR}.o.* ${CPFLAGS}
@echo ${COMPONENT}: export complete (libs)
o.local_dirs:
${MKDIR} o
${MKDIR} oz
${TOUCH} o.local_dirs
dirs:
${MKDIR} ${LIBDIR}
${MKDIR} ${ZLIBDIR}
${MKDIR} ${ZLIBDIR}.h
${MKDIR} ${ZLIBDIR}.o
links:
./mklinks
echo Made links
#
# Final link
#
${TARGET}: ${OBJS} o.local_dirs
${LB} ${LBFLAGS} -o ${COMPONENT} ${OBJS}
${TARGETZ}: ${OBJSZ} o.local_dirs
${LB} ${LBFLAGS} -o ${COMPONENTZ} ${OBJSZ}
# Dynamic dependencies:
The zdeflate utility creates a compressed file using the zlib stream
interface. Syntax:
zdeflate <infile> <outfile>
To build, bung through CC linking to stubs and zlib only.
--
Andrew Hodgkinson, Senior Software Engineer
Acorn Computers Ltd. Tel: +44 (0) 1223 725247
Acorn House, 645 Newmarket Road Fax: +44 (0) 1223 725347
Cambridge, CB5 8PB, United Kingdom WWW: http://www.acorn.co.uk/
\ No newline at end of file
/* Copyright 1998 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*************************************************/
/* File : zdeflate.c */
/* */
/* Purpose: Compress a file with the zlib stream */
/* interface. Info on zlib is at: */
/* */
/* http://www.cdrom.com/pub/infozip/zlib/ */
/* */
/* Author: A.D.Hodgkinson, K.J.Bracey */
/* */
/* History: 30/09/1998: Lovingly hand crafted. */
/*************************************************/
#include <stdlib.h>
#include <stdio.h>
#include "zlib/zlib.h"
/* Local definitions */
#define InBuf_Size 8192
#define OutBuf_Size 8192
/* Static function prototypes */
static void exit_with_error(int err, FILE * in, FILE * out);
/*************************************************/
/* main() */
/* */
/* Compress a given file in a streaming fashion */
/* using zlib with the maximum compression */
/* settings. */
/* */
/* Command line syntax: */
/* */
/* zdeflate <infile> <outfile> */
/*************************************************/
int main(int argc, char * argv[])
{
z_stream stream;
FILE * infile;
FILE * outfile;
static Byte inbuf [InBuf_Size];
static Byte outbuf [OutBuf_Size];
int error;
long int insize, outsize;
size_t read, written;
/* Check we have enough arguments */
if (argc != 3)
{
fprintf(stderr, "Syntax: zdeflate <infile> <outfile>\n");
exit(EXIT_FAILURE);
}
/* Open the files */
infile = fopen(argv[1], "rb");
if (!infile)
{
perror(argv[1]);
exit(EXIT_FAILURE);
}
outfile = fopen(argv[2], "wb");
if (!outfile)
{
perror(argv[2]);
exit(EXIT_FAILURE);
}
/* Set up basic stream info */
stream.zalloc = Z_NULL;
stream.zfree = Z_NULL;
stream.opaque = Z_NULL;
/* Initialise the deflate engine */
error = deflateInit(&stream, Z_BEST_COMPRESSION);
if (error) exit_with_error(error, infile, outfile);
/* Main deflate loop */
do
{
/* Read a chunk */
read = fread(inbuf,
sizeof(Byte),
sizeof(inbuf) / sizeof(Byte),
infile);
printf(".");
stream.next_in = inbuf;
stream.avail_in = (uInt) (read * sizeof(Byte));
/* Compressor loop */
do
{
stream.next_out = outbuf;
stream.avail_out = (uInt) sizeof(outbuf);
/* If we've read nothing, we're at the end of the input stream so */
/* start telling deflate to finish up with Z_FINISH rather than */
/* Z_NO_FLUSH */
error = deflate(&stream, read ? Z_NO_FLUSH : Z_FINISH);
if (error && error != Z_STREAM_END) exit_with_error(error, infile, outfile);
/* Write out the compressed data */
written = fwrite(outbuf,
sizeof(Byte),
(sizeof(outbuf) / sizeof(Byte)) - stream.avail_out,
outfile);
}
while (stream.avail_in > 0 && !error);
}
while (error != Z_STREAM_END);
/* Close the output files and exit */
insize = ftell(infile);
outsize = ftell(outfile);
fclose(infile);
fclose(outfile);
printf("\n\nFinished.\n\n"
"Input: %ld bytes\n"
"Output: %ld bytes\n"
"Shrunk to: %d%% of original\n",
insize,
outsize,
(int) ((100L * outsize) / insize));
exit(EXIT_SUCCESS);
}
/*************************************************/
/* exit_with_error() */
/* */
/* Print an error message quoting a given error */
/* number to stderr, close the given input and */
/* output file handles and exit with */
/* EXIT_FAILURE. */
/* */
/* Parameters: Integer error number to report; */
/* */
/* Pointer to a FILE struct for the */
/* input file; */
/* */
/* Pointer to a FILE struct for the */
/* output file. */
/* */
/* Assumes: The FILE pointers may be NULL. */
/*************************************************/
static void exit_with_error(int err, FILE * in, FILE * out)
{
fprintf(stderr, "\nError code %d received from deflate engine\n", err);
if (in) fclose(in);
if (out) fclose(out);
exit(EXIT_FAILURE);
}
/* (1.13)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 1.13
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 19 May 1999
#define Module_MajorVersion "1.13"
#define Module_Version 113
#define Module_MinorVersion ""
#define Module_Date "19 May 1999"
#define Module_FullVersion "1.13"
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-1998 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
......@@ -249,31 +249,4 @@ typedef uLong FAR uLongf;
# define z_off_t long
#endif
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
# pragma map(deflateInit_,"DEIN")
# pragma map(deflateInit2_,"DEIN2")
# pragma map(deflateEnd,"DEEND")
# pragma map(inflateInit_,"ININ")
# pragma map(inflateInit2_,"ININ2")
# pragma map(inflateEnd,"INEND")
# pragma map(inflateSync,"INSY")
# pragma map(inflateSetDictionary,"INSEDI")
# pragma map(inflate_blocks,"INBL")
# pragma map(inflate_blocks_new,"INBLNE")
# pragma map(inflate_blocks_free,"INBLFR")
# pragma map(inflate_blocks_reset,"INBLRE")
# pragma map(inflate_codes_free,"INCOFR")
# pragma map(inflate_codes,"INCO")
# pragma map(inflate_fast,"INFA")
# pragma map(inflate_flush,"INFLU")
# pragma map(inflate_mask,"INMA")
# pragma map(inflate_set_dictionary,"INSEDI2")
# pragma map(inflate_copyright,"INCOPY")
# pragma map(inflate_trees_bits,"INTRBI")
# pragma map(inflate_trees_dynamic,"INTRDY")
# pragma map(inflate_trees_fixed,"INTRFI")
# pragma map(inflate_trees_free,"INTRFR")
#endif
#endif /* _ZCONF_H */
......@@ -133,8 +133,10 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
# define fdopen(fd,mode) NULL /* No fdopen() */
#endif
#if (defined(_MSC_VER) && (_MSC_VER > 600))
# define fdopen(fd,type) _fdopen(fd,type)
#ifdef _MSC_VER
# if _MSC_VER > 600
# define fdopen(fd,type) _fdopen(fd,type)
# endif
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment