*** empty log message ***

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
1999-10-24 15:57:35 +00:00
parent ace03f87d6
commit e6ebb51430
42 changed files with 663 additions and 4402 deletions

View File

@@ -190,13 +190,12 @@ void* wxChoice::DoGetItemClientData( int n ) const
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
{
DoSetClientData(n, clientData);
DoSetItemClientData(n, clientData);
}
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
{
// TODO: return (wxClientData *)DoGetClientData(n);
return NULL;
return (wxClientData *)DoGetItemClientData(n);
}
// ----------------------------------------------------------------------------

View File

@@ -31,6 +31,8 @@
#include "wx/log.h"
#include "wx/dataobj.h"
#include "wx/mstream.h"
#include "wx/image.h"
#define INCL_DOS
#include <os2.h>
@@ -47,11 +49,8 @@
// wxDataFormat
// ----------------------------------------------------------------------------
wxDataFormat::wxDataFormat(
wxDataFormatId vType
)
wxDataFormat::wxDataFormat()
{
PrepareFormats();
m_vType = wxDF_INVALID;
m_vFormat = 0;
}
@@ -184,7 +183,7 @@ bool wxDataObject::IsSupportedFormat(
else
{
wxDataFormat* pFormats = new wxDataFormat[nFormatCount];
GetAllFormats( rFormats
GetAllFormats( pFormats
,vDir
);
@@ -192,11 +191,11 @@ bool wxDataObject::IsSupportedFormat(
for (n = 0; n < nFormatCount; n++)
{
if (rFormats[n] == rFormat)
if (pFormats[n] == rFormat)
break;
}
delete [] rFormats;
delete [] pFormats;
// found?
return n < nFormatCount;
@@ -215,11 +214,11 @@ bool wxFileDataObject::GetDataHere(
for (size_t i = 0; i < m_filenames.GetCount(); i++)
{
filenames += m_filenames[i];
filenames += (wxChar)0;
sFilenames += m_filenames[i];
sFilenames += (wxChar)0;
}
memcpy(pBuf, filenames.mbc_str(), filenames.Len() + 1);
memcpy(pBuf, sFilenames.mbc_str(), sFilenames.Len() + 1);
return TRUE;
}
@@ -336,12 +335,13 @@ void wxBitmapDataObject::DoConvertToPng()
wxPNGHandler vHandler;
wxCountingOutputStream vCount;
vHandler.SaveFile(&rImage, vCount);
vHandler.SaveFile(&vImage, vCount);
m_pngSize = vCount.GetSize() + 100; // sometimes the size seems to vary ???
m_pngData = malloc(m_pngSize);
wxMemoryOutputStream mstream((char*) m_pngData, m_pngSize);
wxMemoryOutputStream vMstream((char*) m_pngData, m_pngSize);
vHandler.SaveFile(&vImage, vMstream );
}

View File

@@ -13,10 +13,12 @@
#pragma implementation "dnd.h"
#endif
#include "wx/dnd.h"
#define INCL_PM
#include <os2.h>
#include "wx/window.h"
#include "wx/app.h"
#include "wx/gdicmn.h"
#include "wx/dnd.h"
// ----------------------------------------------------------------------------
// global

View File

@@ -683,7 +683,7 @@ wxPoint wxFrame::GetClientAreaOrigin() const
return pt;
}
void wxFrame::ScreenToClient(int *x, int *y) const
void wxFrame::DoScreenToClient(int *x, int *y) const
{
wxWindow::ScreenToClient(x, y);
@@ -695,7 +695,7 @@ void wxFrame::ScreenToClient(int *x, int *y) const
*y -= pt.y;
}
void wxFrame::ClientToScreen(int *x, int *y) const
void wxFrame::DoClientToScreen(int *x, int *y) const
{
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
@@ -704,7 +704,7 @@ void wxFrame::ClientToScreen(int *x, int *y) const
*x += pt1.x;
*y += pt1.y;
wxWindow::ClientToScreen(x, y);
wxWindow::DoClientToScreen(x, y);
}
#if wxUSE_TOOLBAR

View File

@@ -46,7 +46,7 @@
#define ZYZGS_3D 0x8000L /* control will be 3D */
/* public function prototypes */
BOOL _Optlink gaugeInit(HINSTANCE hInstance);
// BOOL _Optlink gaugeInit(HINSTANCE hInstance);
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
@@ -64,8 +64,11 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id,
if ( !wxGaugeOS2Initialised )
{
//TODO:
/*
if (!gaugeInit((HINSTANCE) wxGetInstance()))
wxFatalError("Cannot initalize Gauge library");
*/
wxGaugeOS2Initialised = TRUE;
}

View File

@@ -1,192 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: imaglist.cpp
// Purpose: wxImageList. You may wish to use the generic version.
// Author: David Webster
// Modified by:
// Created: 10/09/99
// RCS-ID: $Id$
// Copyright: (c) David Webster
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
#include <stdio.h>
#include "wx/setup.h"
#include "wx/window.h"
#include "wx/icon.h"
#include "wx/dc.h"
#include "wx/string.h"
#endif
#include "wx/log.h"
#include "wx/intl.h"
#include "wx/os2/imaglist.h"
#include "wx/os2/private.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxImageList, wxObject)
#endif
wxImageList::wxImageList()
{
m_hImageList = 0;
}
wxImageList::~wxImageList()
{
if ( m_hImageList )
return;
// TODO: ImageList_Destroy((HIMAGELIST) m_hImageList);
m_hImageList = 0;
}
// Attributes
////////////////////////////////////////////////////////////////////////////
// Returns the number of images in the image list.
int wxImageList::GetImageCount() const
{
// TODO:: return ImageList_GetImageCount((HIMAGELIST) m_hImageList);
return 0;
}
// Operations
////////////////////////////////////////////////////////////////////////////
// Creates an image list
bool wxImageList::Create(int width, int height, bool mask, int initial)
{
UINT flags = 0;
// if ( mask )
// TODO flags |= ILC_MASK;
// Grow by 1, I guess this is reasonable behaviour most of the time
// m_hImageList = (WXHIMAGELIST) ImageList_Create(width, height, flags, initial, 1);
return (m_hImageList != 0);
}
// Adds a bitmap, and optionally a mask bitmap.
// Note that wxImageList creates new bitmaps, so you may delete
// 'bitmap' and 'mask'.
int wxImageList::Add(const wxBitmap& bitmap, const wxBitmap& mask)
{
HBITMAP hBitmap1 = (HBITMAP) bitmap.GetHBITMAP();
HBITMAP hBitmap2 = 0;
if ( mask.Ok() )
hBitmap2 = (HBITMAP) mask.GetHBITMAP();
int index; // = ImageList_Add((HIMAGELIST) GetHIMAGELIST(), hBitmap1, hBitmap2);
if ( index == -1 )
{
wxLogError(wxT("Couldn't add an image to the image list."));
}
return index;
}
// Adds a bitmap, using the specified colour to create the mask bitmap
// Note that wxImageList creates new bitmaps, so you may delete
// 'bitmap'.
int wxImageList::Add(const wxBitmap& bitmap, const wxColour& maskColour)
{
HBITMAP hBitmap1 = (HBITMAP) bitmap.GetHBITMAP();
//TODO:
// COLORREF colorRef = PALETTERGB(maskColour.Red(), maskColour.Green(), maskColour.Blue());
// return ImageList_AddMasked((HIMAGELIST) GetHIMAGELIST(), hBitmap1, colorRef);
return 0;
}
// Adds a bitmap and mask from an icon.
int wxImageList::Add(const wxIcon& icon)
{
HICON hIcon = (HICON) icon.GetHICON();
// TODO: return ImageList_AddIcon((HIMAGELIST) GetHIMAGELIST(), hIcon);
return 0;
}
// Replaces a bitmap, optionally passing a mask bitmap.
// Note that wxImageList creates new bitmaps, so you may delete
// 'bitmap' and 'mask'.
bool wxImageList::Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask)
{
HBITMAP hBitmap1 = (HBITMAP) bitmap.GetHBITMAP();
HBITMAP hBitmap2 = 0;
if ( mask.Ok() )
hBitmap2 = (HBITMAP) mask.GetHBITMAP();
// TODO: return (ImageList_Replace((HIMAGELIST) GetHIMAGELIST(), index, hBitmap1, hBitmap2) != 0);
return TRUE;
}
// Replaces a bitmap and mask from an icon.
bool wxImageList::Replace(int index, const wxIcon& icon)
{
HICON hIcon = (HICON) icon.GetHICON();
// TODO: return (ImageList_ReplaceIcon((HIMAGELIST) GetHIMAGELIST(), index, hIcon) != 0);
return FALSE;
}
// Removes the image at the given index.
bool wxImageList::Remove(int index)
{
// TODO return (ImageList_Remove((HIMAGELIST) GetHIMAGELIST(), index) != 0);
return FALSE;
}
bool wxImageList::RemoveAll(void)
{
// TODO: Is this correct?
while ( GetImageCount() > 0 )
{
Remove(0);
}
return TRUE;
}
// Draws the given image on a dc at the specified position.
// If 'solidBackground' is TRUE, Draw sets the image list background
// colour to the background colour of the wxDC, to speed up
// drawing by eliminating masked drawing where possible.
bool wxImageList::Draw(int index, wxDC& dc, int x, int y,
int flags, bool solidBackground)
{
HDC hDC = (HDC) dc.GetHDC();
if ( !hDC )
return FALSE;
if ( solidBackground )
{
wxBrush *brush = & dc.GetBackground();
if ( brush && brush->Ok())
{
wxColour col(brush->GetColour());
// ImageList_SetBkColor((HIMAGELIST) GetHIMAGELIST(),
// PALETTERGB(col.Red(), col.Green(), col.Blue()));
}
// else
// ImageList_SetBkColor((HIMAGELIST) GetHIMAGELIST(),
// CLR_NONE);
}
// else
// ImageList_SetBkColor((HIMAGELIST) GetHIMAGELIST(),
// CLR_NONE);
UINT style = 0;
/*
if ( flags & wxIMAGELIST_DRAW_NORMAL )
style |= ILD_NORMAL;
if ( flags & wxIMAGELIST_DRAW_TRANSPARENT )
style |= ILD_TRANSPARENT;
if ( flags & wxIMAGELIST_DRAW_SELECTED )
style |= ILD_SELECTED;
if ( flags & wxIMAGELIST_DRAW_FOCUSED )
style |= ILD_FOCUS;
return (ImageList_Draw((HIMAGELIST) GetHIMAGELIST(), index, hDC,
x, y, style) != 0);
*/
return TRUE;
}

View File

@@ -701,7 +701,7 @@ WXHBRUSH wxListBox::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
backgroundBrush->RealizeResource();
return (WXHBRUSH) backgroundBrush->GetResourceHandle();
*/
reutrn (WXBRUSH)0;
return (WXHBRUSH)0;
}
// ----------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

View File

@@ -24,6 +24,7 @@ DUMMYOBJ=$D\dummydll.obj
LIBTARGET=$(WXLIB)
COMTEMPTGT1=$(WXDIR)\lib\wxcom1.lib
COMTEMPTGT2=$(WXDIR)\lib\wxcom2.lib
COMTEMPTGT3=$(WXDIR)\lib\wxcom3.lib
GENTEMPTGT=$(WXDIR)\lib\wxgen.lib
NONESTEMPTGT=$(WXDIR)\lib\wxnones.lib
OS2TEMPTGT1=$(WXDIR)\lib\wxos21.lib
@@ -81,11 +82,25 @@ $(CPPFLAGS) /Fo$@ /Tp $<
<<
GENERICOBJS= \
..\generic\$D\busyinfo.obj \
..\generic\$D\caret.obj \
..\generic\$D\choicdgg.obj \
..\generic\$D\colrdlgg.obj \
..\generic\$D\dcpsg.obj \
..\generic\$D\grid.obj \
..\generic\$D\gridg.obj \
..\generic\$D\helpext.obj \
..\generic\$D\helphtml.obj \
..\generic\$D\helpwxht.obj \
..\generic\$D\helpxlp.obj \
..\generic\$D\imaglist.obj \
..\generic\$D\laywin.obj \
..\generic\$D\listctrl.obj \
..\generic\$D\logg.obj \
..\generic\$D\numdlgg.obj \
..\generic\$D\panelg.obj \
..\generic\$D\printps.obj \
..\generic\$D\prntdlgg.obj \
..\generic\$D\progdlgg.obj \
..\generic\$D\prop.obj \
..\generic\$D\propform.obj \
@@ -96,20 +111,31 @@ GENERICOBJS= \
..\generic\$D\statusbr.obj \
..\generic\$D\tabg.obj \
..\generic\$D\textdlgg.obj \
..\generic\$D\tipdlg.obj \
..\generic\$D\busyinfo.obj
..\generic\$D\treectrl.obj \
..\generic\$D\tipdlg.obj
# ..\generic\$D\imaglist.obj \
# ..\generic\$D\treectrl.obj \
# ..\generic\$D\listctrl.obj \
# ..\generic\$D\notebook.obj \
GENLIBOBJS= \
busyinfo.obj \
caret.obj \
choicdgg.obj \
colrdlgg.obj \
dcpsg.obj \
grid.obj \
gridg.obj \
helpext.obj \
helphtml.obj \
helpwxht.obj \
helpxlp.obj \
imaglist.obj \
laywin.obj \
listctrl.obj \
logg.obj \
numdlgg.obj \
panelg.obj \
printps.obj \
prntdlgg.obj \
progdlgg.obj \
prop.obj \
propform.obj \
@@ -120,17 +146,13 @@ GENLIBOBJS= \
statusbr.obj \
tabg.obj \
textdlgg.obj \
tipdlg.obj \
busyinfo.obj
treectrl.obj \
tipdlg.obj
# These are generic things that don't need to be compiled on PM,
# but sometimes it's useful to do so for testing purposes.
NONESSENTIALOBJS= \
..\generic\$D\printps.obj \
..\generic\$D\prntdlgg.obj \
..\generic\$D\msgdlgg.obj \
..\generic\$D\helpxlp.obj \
..\generic\$D\colrdlgg.obj \
..\generic\$D\fontdlgg.obj
COMMONOBJS = \
@@ -274,14 +296,14 @@ COMLIBOBJS1 = \
imagpcx.obj \
imagpng.obj \
imagpnm.obj \
intl.obj \
intl.obj
COMLIBOBJS2 = \
ipcbase.obj \
layout.obj \
lboxcmn.obj \
list.obj \
log.obj
COMLIBOBJS2 = \
log.obj \
longlong.obj \
matrix.obj \
memory.obj \
@@ -319,7 +341,9 @@ COMLIBOBJS2 = \
utilscmn.obj \
valgen.obj \
validate.obj \
valtext.obj \
valtext.obj
COMLIBOBJS3 = \
variant.obj \
wfstream.obj \
wincmn.obj \
@@ -363,11 +387,9 @@ OS2OBJS = \
..\os2\$D\gsocket.obj \
..\os2\$D\helpwin.obj \
..\os2\$D\icon.obj \
..\os2\$D\imaglist.obj \
..\os2\$D\iniconf.obj \
..\os2\$D\joystick.obj \
..\os2\$D\listbox.obj \
..\os2\$D\listctrl.obj \
..\os2\$D\main.obj \
..\os2\$D\mdi.obj \
..\os2\$D\menu.obj \
@@ -392,8 +414,8 @@ OS2OBJS = \
..\os2\$D\spinctrl.obj \
..\os2\$D\statbmp.obj \
..\os2\$D\statbox.obj \
..\os2\$D\statline.obj \
..\os2\$D\stattext.obj \
..\os2\$D\statbrpm.obj \
..\os2\$D\tabctrl.obj \
..\os2\$D\taskbar.obj \
..\os2\$D\textctrl.obj \
@@ -401,7 +423,6 @@ OS2OBJS = \
..\os2\$D\timer.obj \
..\os2\$D\toolbar.obj \
..\os2\$D\tooltip.obj \
..\os2\$D\treectrl.obj \
..\os2\$D\utils.obj \
..\os2\$D\utilsexc.obj \
..\os2\$D\wave.obj \
@@ -473,6 +494,7 @@ OS2LIBOBJS2 = \
statbmp.obj \
statbox.obj \
stattext.obj \
statline.obj \
statbrpm.obj \
tabctrl.obj \
taskbar.obj \
@@ -540,7 +562,7 @@ $(COMLIBOBJS1):
copy ..\common\$D\cmndata.obj
copy ..\common\$D\config.obj
copy ..\common\$D\ctrlcmn.obj
copy ..\common\$D\ctrlsub.obj
copy ..\common\$D\ctrlsub.obj
copy ..\common\$D\date.obj
copy ..\common\$D\datstrm.obj
copy ..\common\$D\db.obj
@@ -578,66 +600,82 @@ $(COMLIBOBJS1):
copy ..\common\$D\imagpng.obj
copy ..\common\$D\imagpnm.obj
copy ..\common\$D\intl.obj
$(COMLIBOBJS2):
copy ..\common\$D\ipcbase.obj
copy ..\common\$D\layout.obj
copy ..\common\$D\lboxcmn.obj
copy ..\common\$D\list.obj
copy ..\common\$D\log.obj
copy ..\common\$D\longlong.obj
copy ..\common\$D\matrix.obj
copy ..\common\$D\memory.obj
copy ..\common\$D\mimetype.obj
copy ..\common\$D\module.obj
copy ..\common\$D\mstream.obj
copy ..\common\$D\object.obj
copy ..\common\$D\objstrm.obj
copy ..\common\$D\odbc.obj
copy ..\common\$D\paper.obj
copy ..\common\$D\prntbase.obj
copy ..\common\$D\process.obj
copy ..\common\$D\protocol.obj
copy ..\common\$D\resource.obj
copy ..\common\$D\sckaddr.obj
copy ..\common\$D\sckfile.obj
copy ..\common\$D\sckipc.obj
copy ..\common\$D\sckstrm.obj
copy ..\common\$D\serbase.obj
copy ..\common\$D\sizer.obj
copy ..\common\$D\socket.obj
copy ..\common\$D\strconv.obj
copy ..\common\$D\stream.obj
copy ..\common\$D\string.obj
copy ..\common\$D\tbarbase.obj
copy ..\common\$D\tbarsmpl.obj
copy ..\common\$D\textcmn.obj
copy ..\common\$D\textfile.obj
copy ..\common\$D\time.obj
copy ..\common\$D\timercmn.obj
copy ..\common\$D\tokenzr.obj
copy ..\common\$D\txtstrm.obj
copy ..\common\$D\unzip.obj
copy ..\common\$D\url.obj
copy ..\common\$D\utilscmn.obj
copy ..\common\$D\valgen.obj
copy ..\common\$D\validate.obj
copy ..\common\$D\valtext.obj
copy ..\common\$D\variant.obj
$(COMLIBOBJS2):
copy ..\common\$D\longlong.obj \
copy ..\common\$D\matrix.obj \
copy ..\common\$D\memory.obj \
copy ..\common\$D\mimetype.obj \
copy ..\common\$D\module.obj \
copy ..\common\$D\mstream.obj \
copy ..\common\$D\object.obj \
copy ..\common\$D\objstrm.obj \
copy ..\common\$D\odbc.obj \
copy ..\common\$D\paper.obj \
copy ..\common\$D\prntbase.obj \
copy ..\common\$D\process.obj \
copy ..\common\$D\protocol.obj \
copy ..\common\$D\resource.obj \
copy ..\common\$D\sckaddr.obj \
copy ..\common\$D\sckfile.obj \
copy ..\common\$D\sckipc.obj \
copy ..\common\$D\sckstrm.obj \
copy ..\common\$D\serbase.obj \
copy ..\common\$D\sizer.obj \
copy ..\common\$D\socket.obj \
copy ..\common\$D\strconv.obj \
copy ..\common\$D\stream.obj \
copy ..\common\$D\string.obj \
copy ..\common\$D\tbarbase.obj \
copy ..\common\$D\tbarsmpl.obj \
copy ..\common\$D\textcmn.obj \
copy ..\common\$D\textfile.obj \
copy ..\common\$D\time.obj \
copy ..\common\$D\timercmn.obj \
copy ..\common\$D\tokenzr.obj \
copy ..\common\$D\txtstrm.obj \
copy ..\common\$D\unzip.obj \
copy ..\common\$D\url.obj \
copy ..\common\$D\utilscmn.obj \
copy ..\common\$D\valgen.obj \
copy ..\common\$D\validate.obj \
copy ..\common\$D\valtext.obj \
copy ..\common\$D\variant.obj \
copy ..\common\$D\wfstream.obj \
copy ..\common\$D\wincmn.obj \
copy ..\common\$D\wxchar.obj \
copy ..\common\$D\wxexpr.obj \
copy ..\common\$D\y_tab.obj \
copy ..\common\$D\zipstrm.obj \
$(COMLIBOBJS3):
copy ..\common\$D\wfstream.obj
copy ..\common\$D\wincmn.obj
copy ..\common\$D\wxchar.obj
copy ..\common\$D\wxexpr.obj
copy ..\common\$D\y_tab.obj
copy ..\common\$D\zipstrm.obj
copy ..\common\$D\zstream.obj
$(GENLIBOBJS):
copy ..\generic\$D\busyinfo.obj
copy ..\generic\$D\caret.obj
copy ..\generic\$D\choicdgg.obj
copy ..\generic\$D\colrdlgg.obj
copy ..\generic\$D\dcpsg.obj
copy ..\generic\$D\grid.obj
copy ..\generic\$D\gridg.obj
copy ..\generic\$D\helpext.obj
copy ..\generic\$D\helphtml.obj
copy ..\generic\$D\helpwxht.obj
copy ..\generic\$D\helpxlp.obj
copy ..\generic\$D\imaglist.obj
copy ..\generic\$D\laywin.obj
copy ..\generic\$D\listctrl.obj
copy ..\generic\$D\logg.obj
copy ..\generic\$D\numdlgg.obj
copy ..\generic\$D\panelg.obj
copy ..\generic\$D\printps.obj
copy ..\generic\$D\prntdlgg.obj
copy ..\generic\$D\progdlgg.obj
copy ..\generic\$D\prop.obj
copy ..\generic\$D\propform.obj
@@ -648,8 +686,8 @@ $(GENLIBOBJS):
copy ..\generic\$D\statusbr.obj
copy ..\generic\$D\tabg.obj
copy ..\generic\$D\textdlgg.obj
copy ..\generic\$D\treectrl.obj
copy ..\generic\$D\tipdlg.obj
copy ..\generic\$D\busyinfo.obj
$(OS2LIBOBJS1):
copy ..\os2\$D\accel.obj
@@ -667,6 +705,7 @@ $(OS2LIBOBJS1):
copy ..\os2\$D\control.obj
copy ..\os2\$D\cursor.obj
copy ..\os2\$D\data.obj
copy ..\os2\$D\dataobj.obj
copy ..\os2\$D\dc.obj
copy ..\os2\$D\dcclient.obj
copy ..\os2\$D\dcmemory.obj
@@ -696,9 +735,9 @@ $(OS2LIBOBJS1):
copy ..\os2\$D\metafile.obj
copy ..\os2\$D\minifram.obj
copy ..\os2\$D\msgdlg.obj
copy ..\os2\$D\nativdlg.obj
$(OS2LIBOBJS2):
copy ..\os2\$D\nativdlg.obj
copy ..\os2\$D\notebook.obj
copy ..\os2\$D\ownerdrw.obj
copy ..\os2\$D\palette.obj
@@ -715,6 +754,7 @@ $(OS2LIBOBJS2):
copy ..\os2\$D\spinctrl.obj
copy ..\os2\$D\statbmp.obj
copy ..\os2\$D\statbox.obj
copy ..\os2\$D\statline.obj
copy ..\os2\$D\stattext.obj
copy ..\os2\$D\statbrpm.obj
copy ..\os2\$D\tabctrl.obj
@@ -779,6 +819,13 @@ $(WXDIR)\lib\wxcom2.lib: $(COMLIBOBJS2)
$**;
<<
$(WXDIR)\lib\wxcom3.lib: $(COMLIBOBJS3)
touch $(WXDIR)\lib\wxcom3.lib
del $(WXDIR)\lib\wxcom3.lib
ilib $(LIBFLAGS) $@ @<<
$**;
<<
$(WXDIR)\lib\wxgen.lib: $(GENLIBOBJS)
touch $(WXDIR)\lib\wxgen.lib
del $(WXDIR)\lib\wxgen.lib
@@ -812,6 +859,7 @@ $(WXDIR)\lib\wx.lib: \
$D\dummy.obj \
$(COMTEMPTGT1) \
$(COMTEMPTGT2) \
$(COMTEMPTGT3) \
$(GENTEMPTGT) \
$(NONESTEMPTGT) \
$(OS2TEMPTGT1) \
@@ -824,6 +872,7 @@ $(WXDIR)\lib\wx.lib: \
<<
del $(COMTEMPTGT1)
del $(COMTEMPTGT2)
del $(COMTEMPTGT3)
del $(GENTEMPTGT)
del $(NONESTEMPTGT)
del $(OS2TEMPTGT1)
@@ -847,11 +896,9 @@ $(WXDIR)\lib\wx200.dll: $(OBJECTS) $(WXDIR)\lib\wx210.lib
!endif
$D\dummy.obj: dummy.$(SRCSUFF) $(WXDIR)\include\wx\wx.h $(WXDIR)\include\wx\os2\setup.h
@echo $<
icc $(CPPFLAGS) $(MAKEPRECOMP) /Fo$D\dummy.obj /Tp dummy.cpp
$D\dummydll.obj: dummydll.$(SRCSUFF) $(WXDIR)\include\wx\wx.h $(WXDIR)\include\wx\os2\setup.h
@echo $<
icc @<<
$(CPPFLAGS) $(MAKEPRECOMP) /Fo$D\dummydll.obj /c /Tp dummydll.cpp
<<
@@ -862,13 +909,11 @@ $(WXDIR)\include\wx\os2\setup.h: $(WXDIR)\include\wx\os2\setup0.h
copy "$(WXDIR)"\include\wx\os2\setup0.h "$(WXDIR)"\include\wx\os2\setup.h
..\common\$D\extended.obj: ..\common\extended.c
@echo $<
icc @<<
$(CPPFLAGS2) /Fo$@ $(COMMDIR)\extended.c
<<
..\common\$D\y_tab.obj: ..\common\y_tab.c ..\common\lex_yy.c
@echo $<
icc @<<
$(CPPFLAGS2) /DUSE_DEFINE /DYY_USE_PROTOS /Fo$@ ..\common\y_tab.c
<<
@@ -882,7 +927,6 @@ $(CPPFLAGS2) /DUSE_DEFINE /DYY_USE_PROTOS /Fo$@ ..\common\y_tab.c
$(OBJECTS): $(WXDIR)/include/wx/setup.h
..\common\$D\unzip.obj: ..\common\unzip.c
@echo $<
icc @<<
$(CPPFLAGS2) /Fo$@ $(COMMDIR)\unzip.c
<<

View File

@@ -140,6 +140,11 @@ bool wxPen::FreeResource(bool force)
else return FALSE;
}
bool wxPen::IsFree() const
{
return (M_PENDATA && M_PENDATA->m_hPen == 0);
}
void wxPen::Unshare()
{
// Don't change shared data

File diff suppressed because it is too large Load Diff

View File

@@ -70,13 +70,13 @@ bool wxGetHostName(
unsigned long ulBuffer;
unsigned long* pulTotalAvail;
NetBios32GetInfo( (const unsigned char*)zServer
,(const unsigned char*)zComputer
,ulLevel
,zBuffer
,ulBuffer
,pulTotalAvail
);
NetBiosGetInfo( (const unsigned char*)zServer
,(const unsigned char*)zComputer
,ulLevel
,zBuffer
,ulBuffer
,pulTotalAvail
);
strcpy(zBuf, zServer);
#else
wxChar* zSysname;

View File

@@ -8,29 +8,29 @@
*
* Y2K compliance in libpng:
* =========================
*
*
* January 13, 1999
*
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
*
* This is your unofficial assurance that libpng from version 0.81 and
* upward are Y2K compliant. It is my belief that earlier versions were
* also Y2K compliant.
*
*
* Libpng only has three year fields. One is a 2-byte unsigned integer
* that will hold years up to 65535. The other two hold the date in text
* format, and will hold years up to 9999.
*
*
* The integer is
* "png_uint_16 year" in png_time_struct.
*
*
* The strings are
* "png_charp time_buffer" in png_struct and
* "near_time_buffer", which is a local character string in png.c.
*
*
* There are seven time-related functions:
* png.c: png_convert_to_rfc_1123() in png.c
* png.c: png_convert_to_rfc_1123() in png.c
* (formerly png_convert_to_rfc_1152() in error)
* png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c
* png_convert_from_time_t() in pngwrite.c
@@ -38,8 +38,8 @@
* png_handle_tIME() in pngrutil.c, called in pngread.c
* png_set_tIME() in pngset.c
* png_write_tIME() in pngwutil.c, called in pngwrite.c
*
* All handle dates properly in a Y2K environment. The
*
* All handle dates properly in a Y2K environment. The
* png_convert_from_time_t() function calls gmtime() to convert from system
* clock time, which returns (year - 1900), which we properly convert to
* the full 4-digit year. There is a possibility that applications using
@@ -49,17 +49,17 @@
* is not under our control. The libpng documentation has always stated
* that it works with 4-digit years, and the APIs have been documented as
* such.
*
*
* The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned
* integer to hold the year, and can hold years as large as 65535.
*
*
*
*
* Glenn Randers-Pehrson
* libpng maintainer
* PNG Development Group
*
*
* Note about libpng version numbers:
*
*
* Due to various miscommunications, unforeseen code incompatibilities
* and occasional factors outside the authors' control, version numbering
* on the library has not always been consistent and straightforward.

View File

@@ -39,8 +39,13 @@ png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
read_data function and use it at run time with png_set_read_fn(), rather
than changing the library. */
#ifndef USE_FAR_KEYWORD
#ifdef __VISAGECPP__
static void _Optlink
png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
#else
static void
png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
#endif
{
png_size_t check;

View File

@@ -39,8 +39,13 @@ png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
write_data function and use it at run time with png_set_write_fn(), rather
than changing the library. */
#ifndef USE_FAR_KEYWORD
#ifdef __VISAGECPP__
static void _Optlink
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
#else
static void
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
#endif
{
png_uint_32 check;
@@ -59,8 +64,13 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
#define NEAR_BUF_SIZE 1024
#define MIN(a,b) (a <= b ? a : b)
#ifdef __VISAGECPP__
static void _Optlink
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
#else
static void
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
#endif
{
png_uint_32 check;
png_byte *near_data; /* Needs to be "png_byte *" instead of "png_bytep" */
@@ -114,8 +124,13 @@ png_flush(png_structp png_ptr)
}
#if !defined(PNG_NO_STDIO)
#ifdef __VISAGECPP__
static void _Optlink
png_default_flush(png_structp png_ptr)
#else
static void
png_default_flush(png_structp png_ptr)
#endif
{
FILE *io_ptr;
io_ptr = (FILE *)CVT_PTR((png_ptr->io_ptr));

View File

@@ -1,6 +1,6 @@
/* adler32.c -- compute the Adler-32 checksum of a data stream
* Copyright (C) 1995-1998 Mark Adler
* 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$ */
@@ -18,10 +18,14 @@
#define DO16(buf) DO8(buf,0); DO8(buf,8);
/* ========================================================================= */
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
uLong ZEXPORT adler32 (uLong adler, const Bytef* buf, uInt len)
#else
uLong ZEXPORT adler32(adler, buf, len)
uLong adler;
const Bytef *buf;
uInt len;
#endif
{
unsigned long s1 = adler & 0xffff;
unsigned long s2 = (adler >> 16) & 0xffff;

View File

@@ -1,6 +1,6 @@
/* compress.c -- compress a memory buffer
* 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$ */
@@ -18,12 +18,16 @@
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT compress2 (Bytef* dest, uLongf* destLen, const Bytef* source, uLong sourceLen, int level)
#else
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
int level;
#endif
{
z_stream stream;
int err;
@@ -58,11 +62,15 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
/* ===========================================================================
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT compress (Bytef* dest, uLongf* destLen, const Bytef* source, uLong sourceLen)
#else
int ZEXPORT compress (dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
#endif
{
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
}

View File

@@ -1,6 +1,6 @@
/* crc32.c -- compute the CRC-32 of a data stream
* Copyright (C) 1995-1998 Mark Adler
* 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$ */
@@ -51,7 +51,7 @@ local void make_crc_table()
poly = 0L;
for (n = 0; n < sizeof(p)/sizeof(Byte); n++)
poly |= 1L << (31 - p[n]);
for (n = 0; n < 256; n++)
{
c = (uLong)n;
@@ -139,10 +139,14 @@ const uLongf * ZEXPORT get_crc_table()
#define DO8(buf) DO4(buf); DO4(buf);
/* ========================================================================= */
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
uLong ZEXPORT crc32(uLong crc, const Bytef* buf, uInt len)
#else
uLong ZEXPORT crc32(crc, buf, len)
uLong crc;
const Bytef *buf;
uInt len;
#endif
{
if (buf == Z_NULL) return 0L;
#ifdef DYNAMIC_CRC_TABLE

View File

@@ -1,6 +1,6 @@
/* deflate.c -- compress data using the deflation algorithm
* 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
*/
/*
@@ -187,11 +187,15 @@ struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
/* ========================================================================= */
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT deflateInit_(z_streamp strm, int level, const char* version, int stream_size)
#else
int ZEXPORT deflateInit_(strm, level, version, stream_size)
z_streamp strm;
int level;
const char *version;
int stream_size;
#endif
{
return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
Z_DEFAULT_STRATEGY, version, stream_size);
@@ -199,6 +203,10 @@ int ZEXPORT deflateInit_(strm, level, version, stream_size)
}
/* ========================================================================= */
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, int windowBits,
int memLevel, int strategy, const char* version, int stream_size)
#else
int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
version, stream_size)
z_streamp strm;
@@ -209,6 +217,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
int strategy;
const char *version;
int stream_size;
#endif
{
deflate_state *s;
int noheader = 0;
@@ -288,10 +297,14 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
}
/* ========================================================================= */
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT deflateSetDictionary (z_streamp strm, const Bytef* dictionary, uInt dictLength)
#else
int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
z_streamp strm;
const Bytef *dictionary;
uInt dictLength;
#endif
{
deflate_state *s;
uInt length = dictLength;
@@ -329,11 +342,15 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
}
/* ========================================================================= */
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT deflateReset (z_streamp strm)
#else
int ZEXPORT deflateReset (strm)
z_streamp strm;
#endif
{
deflate_state *s;
if (strm == Z_NULL || strm->state == Z_NULL ||
strm->zalloc == Z_NULL || strm->zfree == Z_NULL) return Z_STREAM_ERROR;
@@ -359,10 +376,14 @@ int ZEXPORT deflateReset (strm)
}
/* ========================================================================= */
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT deflateParams(z_streamp strm, int level, int strategy)
#else
int ZEXPORT deflateParams(strm, level, strategy)
z_streamp strm;
int level;
int strategy;
#endif
{
deflate_state *s;
compress_func func;
@@ -399,13 +420,17 @@ int ZEXPORT deflateParams(strm, level, strategy)
* IN assertion: the stream state is correct and there is enough room in
* pending_buf.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void putShortMSB (deflate_state* s, uInt b)
#else
local void putShortMSB (s, b)
deflate_state *s;
uInt b;
#endif
{
put_byte(s, (Byte)(b >> 8));
put_byte(s, (Byte)(b & 0xff));
}
}
/* =========================================================================
* Flush as much pending output as possible. All deflate() output goes
@@ -413,8 +438,12 @@ local void putShortMSB (s, b)
* to avoid allocating a large strm->next_out buffer and copying into it.
* (See also read_buf()).
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void flush_pending(z_streamp strm)
#else
local void flush_pending(strm)
z_streamp strm;
#endif
{
unsigned len = strm->state->pending;
@@ -433,9 +462,13 @@ local void flush_pending(strm)
}
/* ========================================================================= */
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT deflate (z_streamp strm, int flush)
#else
int ZEXPORT deflate (strm, flush)
z_streamp strm;
int flush;
#endif
{
int old_flush; /* value of flush param for previous deflate call */
deflate_state *s;
@@ -567,8 +600,12 @@ int ZEXPORT deflate (strm, flush)
}
/* ========================================================================= */
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT deflateEnd (z_streamp strm)
#else
int ZEXPORT deflateEnd (strm)
z_streamp strm;
#endif
{
int status;
@@ -597,9 +634,13 @@ int ZEXPORT deflateEnd (strm)
* To simplify the source, this is not supported for 16-bit MSDOS (which
* doesn't have enough memory anyway to duplicate compression states).
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT deflateCopy (z_streamp dest, z_streamp source)
#else
int ZEXPORT deflateCopy (dest, source)
z_streamp dest;
z_streamp source;
#endif
{
#ifdef MAXSEG_64K
return Z_STREAM_ERROR;
@@ -657,10 +698,14 @@ int ZEXPORT deflateCopy (dest, source)
* allocating a large strm->next_in buffer and copying from it.
* (See also flush_pending()).
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local int read_buf(z_streamp strm, Bytef* buf, unsigned size)
#else
local int read_buf(strm, buf, size)
z_streamp strm;
Bytef *buf;
unsigned size;
#endif
{
unsigned len = strm->avail_in;
@@ -682,8 +727,12 @@ local int read_buf(strm, buf, size)
/* ===========================================================================
* Initialize the "longest match" routines for a new zlib stream
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void lm_init (deflate_state* s)
#else
local void lm_init (s)
deflate_state *s;
#endif
{
s->window_size = (ulg)2L*s->w_size;
@@ -721,9 +770,13 @@ local void lm_init (s)
* match.S. The code will be functionally equivalent.
*/
#ifndef FASTEST
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local uInt longest_match(deflate_state* s, IPos cur_match)
#else
local uInt longest_match(s, cur_match)
deflate_state *s;
IPos cur_match; /* current match */
#endif
{
unsigned chain_length = s->max_chain_length;/* max hash chain length */
register Bytef *scan = s->window + s->strstart; /* current string */
@@ -863,9 +916,13 @@ local uInt longest_match(s, cur_match)
/* ---------------------------------------------------------------------------
* Optimized version for level == 1 only
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local uInt longest_match(deflate_state* s, IPos cur_match)
#else
local uInt longest_match(s, cur_match)
deflate_state *s;
IPos cur_match; /* current match */
#endif
{
register Bytef *scan = s->window + s->strstart; /* current string */
register Bytef *match; /* matched string */
@@ -922,10 +979,14 @@ local uInt longest_match(s, cur_match)
/* ===========================================================================
* Check that the match at match_start is indeed a match.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void check_match(deflate_state* s, IPos start, IPos match, int length)
#else
local void check_match(s, start, match, length)
deflate_state *s;
IPos start, match;
int length;
#endif
{
/* check that the match is indeed a match */
if (zmemcmp(s->window + match,
@@ -956,8 +1017,12 @@ local void check_match(s, start, match, length)
* performed for at least two bytes (required for the zip translate_eol
* option -- not supported here).
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void fill_window(deflate_state* s)
#else
local void fill_window(s)
deflate_state *s;
#endif
{
register unsigned n, m;
register Posf *p;
@@ -1076,9 +1141,13 @@ local void fill_window(s)
* NOTE: this function should be optimized to avoid extra copying from
* window to pending_buf.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local block_state deflate_stored(deflate_state* s, int flush)
#else
local block_state deflate_stored(s, flush)
deflate_state *s;
int flush;
#endif
{
/* Stored blocks are limited to 0xffff bytes, pending_buf is limited
* to pending_buf_size, and each stored block has a 5 byte header:
@@ -1134,9 +1203,13 @@ local block_state deflate_stored(s, flush)
* new strings in the dictionary only for unmatched strings or for short
* matches. It is used only for the fast compression options.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local block_state deflate_fast(deflate_state* s, int flush)
#else
local block_state deflate_fast(s, flush)
deflate_state *s;
int flush;
#endif
{
IPos hash_head = NIL; /* head of the hash chain */
int bflush; /* set if current block must be flushed */
@@ -1197,7 +1270,7 @@ local block_state deflate_fast(s, flush)
* always MIN_MATCH bytes ahead.
*/
} while (--s->match_length != 0);
s->strstart++;
s->strstart++;
} else
#endif
{
@@ -1217,7 +1290,7 @@ local block_state deflate_fast(s, flush)
Tracevv((stderr,"%c", s->window[s->strstart]));
_tr_tally_lit (s, s->window[s->strstart], bflush);
s->lookahead--;
s->strstart++;
s->strstart++;
}
if (bflush) FLUSH_BLOCK(s, 0);
}
@@ -1230,9 +1303,13 @@ local block_state deflate_fast(s, flush)
* evaluation for matches: a match is finally adopted only if there is
* no better match at the next window position.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local block_state deflate_slow(deflate_state* s, int flush)
#else
local block_state deflate_slow(s, flush)
deflate_state *s;
int flush;
#endif
{
IPos hash_head = NIL; /* head of hash chain */
int bflush; /* set if current block must be flushed */

View File

@@ -70,10 +70,14 @@ local uLong getLong OF((gz_stream *s));
can be checked to distinguish the two cases (if errno is zero, the
zlib error is Z_MEM_ERROR).
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local gzFile gz_open (const char* path, const char* mode, int fd)
#else
local gzFile gz_open (path, mode, fd)
const char *path;
const char *mode;
int fd;
#endif
{
int err;
int level = Z_DEFAULT_COMPRESSION; /* compression level */
@@ -122,7 +126,7 @@ local gzFile gz_open (path, mode, fd)
}
} while (*p++ && m != fmode + sizeof(fmode));
if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL;
if (s->mode == 'w') {
#ifdef NO_DEFLATE
err = Z_STREAM_ERROR;
@@ -173,16 +177,20 @@ local gzFile gz_open (path, mode, fd)
check_header(s); /* skip the .gz header */
s->startpos = (ftell(s->file) - s->stream.avail_in);
}
return (gzFile)s;
}
/* ===========================================================================
Opens a gzip (.gz) file for reading or writing.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
gzFile ZEXPORT gzopen (const char* path, const char* mode)
#else
gzFile ZEXPORT gzopen (path, mode)
const char *path;
const char *mode;
#endif
{
return gz_open (path, mode, -1);
}
@@ -191,9 +199,13 @@ gzFile ZEXPORT gzopen (path, mode)
Associate a gzFile with the file descriptor fd. fd is not dup'ed here
to mimic the behavio(u)r of fdopen.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
gzFile ZEXPORT gzdopen (int fd, const char* mode)
#else
gzFile ZEXPORT gzdopen (fd, mode)
int fd;
const char *mode;
#endif
{
char name[20];
@@ -206,10 +218,14 @@ gzFile ZEXPORT gzdopen (fd, mode)
/* ===========================================================================
* Update the compression level and strategy
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT gzsetparams (gzFile file, int level, int strategy)
#else
int ZEXPORT gzsetparams (file, level, strategy)
gzFile file;
int level;
int strategy;
#endif
{
gz_stream *s = (gz_stream*)file;
@@ -233,8 +249,12 @@ int ZEXPORT gzsetparams (file, level, strategy)
for end of file.
IN assertion: the stream s has been sucessfully opened for reading.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local int get_byte(gz_stream* s)
#else
local int get_byte(s)
gz_stream *s;
#endif
{
if (s->z_eof) return EOF;
if (s->stream.avail_in == 0) {
@@ -260,8 +280,12 @@ local int get_byte(s)
s->stream.avail_in is zero for the first time, but may be non-zero
for concatenated .gz files.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void check_header(gz_stream* s)
#else
local void check_header(s)
gz_stream *s;
#endif
{
int method; /* method byte */
int flags; /* flags byte */
@@ -313,8 +337,12 @@ local void check_header(s)
* Cleanup then free the given gz_stream. Return a zlib error code.
Try freeing in the reverse order of allocations.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local int destroy (gz_stream* s)
#else
local int destroy (s)
gz_stream *s;
#endif
{
int err = Z_OK;
@@ -352,10 +380,14 @@ local int destroy (s)
Reads the given number of uncompressed bytes from the compressed file.
gzread returns the number of bytes actually read (0 for end of file).
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT gzread (gzFile file, voidp buf, unsigned len)
#else
int ZEXPORT gzread (file, buf, len)
gzFile file;
voidp buf;
unsigned len;
#endif
{
gz_stream *s = (gz_stream*)file;
Bytef *start = (Bytef*)buf; /* starting point for crc computation */
@@ -442,8 +474,12 @@ int ZEXPORT gzread (file, buf, len)
Reads one byte from the compressed file. gzgetc returns this byte
or -1 in case of end of file or error.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT gzgetc(gzFile file)
#else
int ZEXPORT gzgetc(file)
gzFile file;
#endif
{
unsigned char c;
@@ -460,10 +496,14 @@ int ZEXPORT gzgetc(file)
The current implementation is not optimized at all.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
char* ZEXPORT gzgets(gzFile file, char* buf, int len)
#else
char * ZEXPORT gzgets(file, buf, len)
gzFile file;
char *buf;
int len;
#endif
{
char *b = buf;
if (buf == Z_NULL || len <= 0) return Z_NULL;
@@ -479,10 +519,14 @@ char * ZEXPORT gzgets(file, buf, len)
Writes the given number of uncompressed bytes into the compressed file.
gzwrite returns the number of bytes actually written (0 in case of error).
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT gzwrite (gzFile file, const voidp buf, unsigned len)
#else
int ZEXPORT gzwrite (file, buf, len)
gzFile file;
const voidp buf;
unsigned len;
#endif
{
gz_stream *s = (gz_stream*)file;
@@ -538,12 +582,18 @@ int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...)
}
#else /* not ANSI C */
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORTVA gzprintf (gzFile file const char* format, int a1, int a2, int a3, int a4,
int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12
int a13, int a14, int a15, int a16, int a17, int a18, int a19, int a20)
#else
int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
gzFile file;
const char *format;
int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
#endif
{
char buf[Z_PRINTF_BUFSIZE];
int len;
@@ -566,9 +616,13 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
Writes c, converted to an unsigned char, into the compressed file.
gzputc returns the value that was written, or -1 in case of error.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT gzputc(gzFile file, int c)
#else
int ZEXPORT gzputc(file, c)
gzFile file;
int c;
#endif
{
unsigned char cc = (unsigned char) c; /* required for big endian systems */
@@ -581,9 +635,13 @@ int ZEXPORT gzputc(file, c)
the terminating null character.
gzputs returns the number of characters written, or -1 in case of error.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT gzputs(gzFile file, const char* s)
#else
int ZEXPORT gzputs(file, s)
gzFile file;
const char *s;
#endif
{
return gzwrite(file, (char*)s, (unsigned)strlen(s));
}
@@ -593,9 +651,13 @@ int ZEXPORT gzputs(file, s)
Flushes all pending output into the compressed file. The parameter
flush is as in the deflate() function.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local int do_flush (gzFile file, int flush)
#else
local int do_flush (file, flush)
gzFile file;
int flush;
#endif
{
uInt len;
int done = 0;
@@ -623,18 +685,22 @@ local int do_flush (file, flush)
if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK;
/* deflate has finished flushing only when it hasn't used up
* all the available space in the output buffer:
* all the available space in the output buffer:
*/
done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break;
}
return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT gzflush (gzFile file, int flush)
#else
int ZEXPORT gzflush (file, flush)
gzFile file;
int flush;
#endif
{
gz_stream *s = (gz_stream*)file;
int err = do_flush (file, flush);
@@ -653,10 +719,14 @@ int ZEXPORT gzflush (file, flush)
SEEK_END is not implemented, returns error.
In this version of the library, gzseek can be extremely slow.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
z_off_t ZEXPORT gzseek (gzFile file, z_off_t offset, int whence)
#else
z_off_t ZEXPORT gzseek (file, offset, whence)
gzFile file;
z_off_t offset;
int whence;
#endif
{
gz_stream *s = (gz_stream*)file;
@@ -664,7 +734,7 @@ z_off_t ZEXPORT gzseek (file, offset, whence)
s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) {
return -1L;
}
if (s->mode == 'w') {
#ifdef NO_DEFLATE
return -1L;
@@ -732,13 +802,17 @@ z_off_t ZEXPORT gzseek (file, offset, whence)
}
/* ===========================================================================
Rewinds input file.
Rewinds input file.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT gzrewind (gzFile file)
#else
int ZEXPORT gzrewind (file)
gzFile file;
#endif
{
gz_stream *s = (gz_stream*)file;
if (s == NULL || s->mode != 'r') return -1;
s->z_err = Z_OK;
@@ -760,8 +834,12 @@ int ZEXPORT gzrewind (file)
given compressed file. This position represents a number of bytes in the
uncompressed data stream.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
z_off_t ZEXPORT gztell (gzFile file)
#else
z_off_t ZEXPORT gztell (file)
gzFile file;
#endif
{
return gzseek(file, 0L, SEEK_CUR);
}
@@ -770,20 +848,28 @@ z_off_t ZEXPORT gztell (file)
Returns 1 when EOF has previously been detected reading the given
input stream, otherwise zero.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT gzeof (gzFile file)
#else
int ZEXPORT gzeof (file)
gzFile file;
#endif
{
gz_stream *s = (gz_stream*)file;
return (s == NULL || s->mode != 'r') ? 0 : s->z_eof;
}
/* ===========================================================================
Outputs a long in LSB order to the given file
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void putLong (FILE* file, uLong x)
#else
local void putLong (file, x)
FILE *file;
uLong x;
#endif
{
int n;
for (n = 0; n < 4; n++) {
@@ -793,10 +879,14 @@ local void putLong (file, x)
}
/* ===========================================================================
Reads a long in LSB order from the given gz_stream. Sets
Reads a long in LSB order from the given gz_stream. Sets
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local uLong getLong (gz_stream* s)
#else
local uLong getLong (s)
gz_stream *s;
#endif
{
uLong x = (uLong)get_byte(s);
int c;
@@ -813,8 +903,12 @@ local uLong getLong (s)
Flushes all pending output if necessary, closes the compressed file
and deallocates all the (de)compression state.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT gzclose (gzFile file)
#else
int ZEXPORT gzclose (file)
gzFile file;
#endif
{
int err;
gz_stream *s = (gz_stream*)file;
@@ -842,9 +936,13 @@ int ZEXPORT gzclose (file)
errnum is set to Z_ERRNO and the application may consult errno
to get the exact error code.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
const char* ZEXPORT gzerror (gzFile file, int* errnum)
#else
const char* ZEXPORT gzerror (file, errnum)
gzFile file;
int *errnum;
#endif
{
char *m;
gz_stream *s = (gz_stream*)file;

View File

@@ -1,6 +1,6 @@
/* infblock.c -- interpret and process block types to last block
* Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zutil.h"
@@ -65,10 +65,14 @@ local const uInt border[] = { /* Order of the bit length code lengths */
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
void inflate_blocks_reset(inflate_blocks_statef* s, z_streamp z, uLongf* c)
#else
void inflate_blocks_reset(s, z, c)
inflate_blocks_statef *s;
z_streamp z;
uLongf *c;
#endif
{
if (c != Z_NULL)
*c = s->check;
@@ -85,11 +89,14 @@ uLongf *c;
Tracev((stderr, "inflate: blocks reset\n"));
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
inflate_blocks_statef *inflate_blocks_new(z_streamp z, check_func c, uInt w)
#else
inflate_blocks_statef *inflate_blocks_new(z, c, w)
z_streamp z;
check_func c;
uInt w;
#endif
{
inflate_blocks_statef *s;
@@ -116,11 +123,14 @@ uInt w;
return s;
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int inflate_blocks(inflate_blocks_statef* s, z_streamp z, int r)
#else
int inflate_blocks(s, z, r)
inflate_blocks_statef *s;
z_streamp z;
int r;
#endif
{
uInt t; /* temporary storage */
uLong b; /* bit buffer */
@@ -370,10 +380,13 @@ int r;
}
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int inflate_blocks_free(inflate_blocks_statef* s, z_streamp z)
#else
int inflate_blocks_free(s, z)
inflate_blocks_statef *s;
z_streamp z;
#endif
{
inflate_blocks_reset(s, z, Z_NULL);
ZFREE(z, s->window);
@@ -383,23 +396,29 @@ z_streamp z;
return Z_OK;
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
void inflate_set_dictionary(inflate_blocks_statef* s, const Bytef* d, uInt n)
#else
void inflate_set_dictionary(s, d, n)
inflate_blocks_statef *s;
const Bytef *d;
uInt n;
#endif
{
zmemcpy(s->window, d, n);
s->read = s->write = s->window + n;
}
/* Returns true if inflate is currently at the end of a block generated
* by Z_SYNC_FLUSH or Z_FULL_FLUSH.
* by Z_SYNC_FLUSH or Z_FULL_FLUSH.
* IN assertion: s != Z_NULL
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int inflate_blocks_sync_point(inflate_blocks_statef* s)
#else
int inflate_blocks_sync_point(s)
inflate_blocks_statef *s;
#endif
{
return s->mode == LENS;
}

View File

@@ -1,6 +1,6 @@
/* infcodes.c -- process literals and length/distance pairs
* Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zutil.h"
@@ -55,12 +55,15 @@ struct inflate_codes_state {
};
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
inflate_codes_statef* inflate_codes_new(uInt bl, uInt bd, inflate_huft* tl, inflate_huft* td, z_streamp z)
#else
inflate_codes_statef *inflate_codes_new(bl, bd, tl, td, z)
uInt bl, bd;
inflate_huft *tl;
inflate_huft *td; /* need separate declaration for Borland C++ */
z_streamp z;
#endif
{
inflate_codes_statef *c;
@@ -77,11 +80,14 @@ z_streamp z;
return c;
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int inflate_codes(inflate_blocks_statef* s, z_streamp z, int r)
#else
int inflate_codes(s, z, r)
inflate_blocks_statef *s;
z_streamp z;
int r;
#endif
{
uInt j; /* temporary storage */
inflate_huft *t; /* temporary pointer */
@@ -240,10 +246,13 @@ int r;
#endif
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
void inflate_codes_free(inflate_codes_statef* c, z_streamp z)
#else
void inflate_codes_free(c, z)
inflate_codes_statef *c;
z_streamp z;
#endif
{
ZFREE(z, c);
Tracev((stderr, "inflate: codes free\n"));

View File

@@ -1,6 +1,6 @@
/* inffast.c -- process literals and length/distance pairs fast
* Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zutil.h"
@@ -25,12 +25,16 @@ struct inflate_codes_state {int dummy;}; /* for buggy compilers */
at least ten. The ten bytes are six bytes for the longest length/
distance pair plus four bytes for overloading the bit buffer. */
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int inflate_fast(uInt bl, uInt bd, inflate_huft* tl, inflate_huft* td, inflate_blocks_statef* s, z_streamp z)
#else
int inflate_fast(bl, bd, tl, td, s, z)
uInt bl, bd;
inflate_huft *tl;
inflate_huft *td; /* need separate declaration for Borland C++ */
inflate_blocks_statef *s;
z_streamp z;
#endif
{
inflate_huft *t; /* temporary pointer */
uInt e; /* extra bits or operation */

View File

@@ -1,6 +1,6 @@
/* inflate.c -- zlib interface to inflate modules
* Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zutil.h"
@@ -44,14 +44,18 @@ struct internal_state {
/* mode independent information */
int nowrap; /* flag for no wrapper */
uInt wbits; /* log2(window size) (8..15, defaults to 15) */
inflate_blocks_statef
inflate_blocks_statef
*blocks; /* current inflate_blocks state */
};
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT inflateReset(z_streamp z)
#else
int ZEXPORT inflateReset(z)
z_streamp z;
#endif
{
if (z == Z_NULL || z->state == Z_NULL)
return Z_STREAM_ERROR;
@@ -64,8 +68,12 @@ z_streamp z;
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT inflateEnd(z_streamp z)
#else
int ZEXPORT inflateEnd(z)
z_streamp z;
#endif
{
if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
return Z_STREAM_ERROR;
@@ -77,12 +85,15 @@ z_streamp z;
return Z_OK;
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT inflateInit2_(z_streamp z, int w, const char* version, int stream_size)
#else
int ZEXPORT inflateInit2_(z, w, version, stream_size)
z_streamp z;
int w;
const char *version;
int stream_size;
#endif
{
if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
stream_size != sizeof(z_stream))
@@ -134,22 +145,28 @@ int stream_size;
return Z_OK;
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT inflateInit_(z_streamp z, const char* version, int stream_size)
#else
int ZEXPORT inflateInit_(z, version, stream_size)
z_streamp z;
const char *version;
int stream_size;
#endif
{
return inflateInit2_(z, DEF_WBITS, version, stream_size);
}
#define NEEDBYTE {if(z->avail_in==0)return r;r=f;}
#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT inflate(z_streamp z, int f)
#else
int ZEXPORT inflate(z, f)
z_streamp z;
int f;
#endif
{
int r;
uInt b;
@@ -274,11 +291,14 @@ int f;
#endif
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT inflateSetDictionary(z_streamp z, const Bytef* dictionary, uInt dictLength)
#else
int ZEXPORT inflateSetDictionary(z, dictionary, dictLength)
z_streamp z;
const Bytef *dictionary;
uInt dictLength;
#endif
{
uInt length = dictLength;
@@ -298,9 +318,12 @@ uInt dictLength;
return Z_OK;
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT inflateSync(z_streamp z)
#else
int ZEXPORT inflateSync(z)
z_streamp z;
#endif
{
uInt n; /* number of bytes to look at */
Bytef *p; /* pointer to bytes */
@@ -349,7 +372,6 @@ z_streamp z;
return Z_OK;
}
/* Returns true if inflate is currently at the end of a block generated
* by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
* implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH
@@ -357,8 +379,12 @@ z_streamp z;
* decompressing, PPP checks that at the end of input packet, inflate is
* waiting for these length bytes.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT inflateSyncPoint(z_streamp z)
#else
int ZEXPORT inflateSyncPoint(z)
z_streamp z;
#endif
{
if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL)
return Z_STREAM_ERROR;

View File

@@ -1,6 +1,6 @@
/* inftrees.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zutil.h"
@@ -24,7 +24,6 @@ struct internal_state {int dummy;}; /* for buggy compilers */
#define exop word.what.Exop
#define bits word.what.Bits
local int huft_build OF((
uIntf *, /* code lengths in bits */
uInt, /* number of codes */
@@ -90,6 +89,10 @@ local const uInt cpdext[30] = { /* Extra bits for distance codes */
/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */
#define BMAX 15 /* maximum bit length of any code */
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local int huft_build(uIntf* b, uInt n, uInt s, const uIntf* d, const uIntf* e,
inflate_huft* FAR *t, uIntf* m, inflate_huft* hp, uInt* hn, uIntf* v)
#else
local int huft_build(b, n, s, d, e, t, m, hp, hn, v)
uIntf *b; /* code lengths in bits (all assumed <= BMAX) */
uInt n; /* number of codes (assumed <= 288) */
@@ -106,6 +109,7 @@ uIntf *v; /* working area: values in order of bit length */
if the given code set is incomplete (the tables are still built in this
case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of
lengths), or Z_MEM_ERROR if not enough memory. */
#endif
{
uInt a; /* counter for codes of length k */
@@ -290,13 +294,16 @@ uIntf *v; /* working area: values in order of bit length */
return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int inflate_trees_bits(uIntf* c, uIntf* bb, inflate_huft* FAR *tb, inflate_huft* hp, z_streamp z)
#else
int inflate_trees_bits(c, bb, tb, hp, z)
uIntf *c; /* 19 code lengths */
uIntf *bb; /* bits tree desired/actual depth */
inflate_huft * FAR *tb; /* bits tree result */
inflate_huft *hp; /* space for trees */
z_streamp z; /* for messages */
#endif
{
int r;
uInt hn = 0; /* hufts used in space */
@@ -317,7 +324,10 @@ z_streamp z; /* for messages */
return r;
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int inflate_trees_dynamic(uInt nl, uInt nd, uInt* c, uInt* bl, uInt *bd, inflate_huft* FAR *tl,
inflate_huft* FAR *td, inflate_huft* hp, z_streamp z)
#else
int inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, hp, z)
uInt nl; /* number of literal/length codes */
uInt nd; /* number of distance codes */
@@ -328,6 +338,7 @@ inflate_huft * FAR *tl; /* literal/length tree result */
inflate_huft * FAR *td; /* distance tree result */
inflate_huft *hp; /* space for trees */
z_streamp z; /* for messages */
#endif
{
int r;
uInt hn = 0; /* hufts used in space */
@@ -381,7 +392,6 @@ z_streamp z; /* for messages */
return Z_OK;
}
/* build fixed tables only once--keep them here */
#ifdef BUILDFIXED
local int fixed_built = 0;
@@ -395,13 +405,17 @@ local inflate_huft *fixed_td;
#include "inffixed.h"
#endif
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int inflate_trees_fixed(uIntf* bl, uIntf *bd, inflate_huft* FAR *tl,
inflate_huft* FAR *td, z_streamp z)
#else
int inflate_trees_fixed(bl, bd, tl, td, z)
uIntf *bl; /* literal desired/actual bit depth */
uIntf *bd; /* distance desired/actual bit depth */
inflate_huft * FAR *tl; /* literal/length tree result */
inflate_huft * FAR *td; /* distance tree result */
z_streamp z; /* for memory allocation */
#endif
{
#ifdef BUILDFIXED
/* build fixed tables if not already */

View File

@@ -1,6 +1,6 @@
/* inflate_util.c -- data and routines common to blocks and codes
* Copyright (C) 1995-1998 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zutil.h"
@@ -20,10 +20,14 @@ uInt inflate_mask[17] = {
/* copy as much as possible from the sliding window to the output area */
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int inflate_flush(inflate_blocks_statef* s, z_streamp z, int r)
#else
int inflate_flush(s, z, r)
inflate_blocks_statef *s;
z_streamp z;
int r;
#endif
{
uInt n;
Bytef *p;

View File

@@ -1,6 +1,6 @@
/* trees.c -- output deflated data using Huffman coding
* 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
*/
/*
@@ -189,10 +189,14 @@ local void gen_trees_header OF((void));
#ifdef __WXDEBUG__
local void send_bits OF((deflate_state *s, int value, int length));
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void send_bits(deflate_state* s, int value, int length)
#else
local void send_bits(s, value, length)
deflate_state *s;
int value; /* value to send */
int length; /* number of bits */
#endif
{
Tracevv((stderr," l %2d v %4x ", length, value));
Assert(length > 0 && length <= 15, "invalid length");
@@ -373,8 +377,12 @@ void gen_trees_header()
/* ===========================================================================
* Initialize the tree data structures for a new zlib stream.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
void _tr_init(deflate_state* s)
#else
void _tr_init(s)
deflate_state *s;
#endif
{
tr_static_init();
@@ -403,8 +411,12 @@ void _tr_init(s)
/* ===========================================================================
* Initialize a new block.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void init_block(deflate_state* s)
#else
local void init_block(s)
deflate_state *s;
#endif
{
int n; /* iterates over tree elements */
@@ -447,10 +459,14 @@ local void init_block(s)
* when the heap property is re-established (each father smaller than its
* two sons).
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void pqdownheap(deflate_state* s, ct_data* tree, int k)
#else
local void pqdownheap(s, tree, k)
deflate_state *s;
ct_data *tree; /* the tree to restore */
int k; /* node to move down */
#endif
{
int v = s->heap[k];
int j = k << 1; /* left son of k */
@@ -482,9 +498,13 @@ local void pqdownheap(s, tree, k)
* The length opt_len is updated; static_len is also updated if stree is
* not null.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void gen_bitlen(deflate_state* s, tree_desc* desc)
#else
local void gen_bitlen(s, desc)
deflate_state *s;
tree_desc *desc; /* the tree descriptor */
#endif
{
ct_data *tree = desc->dyn_tree;
int max_code = desc->max_code;
@@ -569,10 +589,14 @@ local void gen_bitlen(s, desc)
* OUT assertion: the field code is set for all tree elements of non
* zero code length.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void gen_codes (ct_data* tree, int max_code, ushf* bl_count)
#else
local void gen_codes (tree, max_code, bl_count)
ct_data *tree; /* the tree to decorate */
int max_code; /* largest code with non zero frequency */
ushf *bl_count; /* number of codes at each bit length */
#endif
{
ush next_code[MAX_BITS+1]; /* next code value for each bit length */
ush code = 0; /* running code value */
@@ -611,9 +635,13 @@ local void gen_codes (tree, max_code, bl_count)
* and corresponding code. The length opt_len is updated; static_len is
* also updated if stree is not null. The field max_code is set.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void build_tree(deflate_state* s, tree_desc* desc)
#else
local void build_tree(s, desc)
deflate_state *s;
tree_desc *desc; /* the tree descriptor */
#endif
{
ct_data *tree = desc->dyn_tree;
const ct_data *stree = desc->stat_desc->static_tree;
@@ -698,10 +726,14 @@ local void build_tree(s, desc)
* Scan a literal or distance tree to determine the frequencies of the codes
* in the bit length tree.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void scan_tree (deflate_state* s, ct_data* tree, int max_code)
#else
local void scan_tree (s, tree, max_code)
deflate_state *s;
ct_data *tree; /* the tree to be scanned */
int max_code; /* and its largest code of non zero frequency */
#endif
{
int n; /* iterates over all tree elements */
int prevlen = -1; /* last emitted length */
@@ -743,10 +775,14 @@ local void scan_tree (s, tree, max_code)
* Send a literal or distance tree in compressed form, using the codes in
* bl_tree.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void send_tree (deflate_state* s, ct_data* tree, int max_code)
#else
local void send_tree (s, tree, max_code)
deflate_state *s;
ct_data *tree; /* the tree to be scanned */
int max_code; /* and its largest code of non zero frequency */
#endif
{
int n; /* iterates over all tree elements */
int prevlen = -1; /* last emitted length */
@@ -794,8 +830,12 @@ local void send_tree (s, tree, max_code)
* Construct the Huffman tree for the bit lengths and return the index in
* bl_order of the last bit length code to send.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local int build_bl_tree( deflate_state* s)
#else
local int build_bl_tree(s)
deflate_state *s;
#endif
{
int max_blindex; /* index of last bit length code of non zero freq */
@@ -829,9 +869,13 @@ local int build_bl_tree(s)
* lengths of the bit length codes, the literal tree and the distance tree.
* IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void send_all_trees(deflate_state* s, int lcodes, int dcodes, int blcodes)
#else
local void send_all_trees(s, lcodes, dcodes, blcodes)
deflate_state *s;
int lcodes, dcodes, blcodes; /* number of codes for each tree */
#endif
{
int rank; /* index in bl_order */
@@ -858,11 +902,15 @@ local void send_all_trees(s, lcodes, dcodes, blcodes)
/* ===========================================================================
* Send a stored block
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
void _tr_stored_block(deflate_state* s, charf* buf, ulg stored_len, int eof)
#else
void _tr_stored_block(s, buf, stored_len, eof)
deflate_state *s;
charf *buf; /* input block */
ulg stored_len; /* length of input block */
int eof; /* true if this is the last block for a file */
#endif
{
send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */
s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
@@ -882,8 +930,12 @@ void _tr_stored_block(s, buf, stored_len, eof)
* To simplify the code, we assume the worst case of last real code encoded
* on one bit only.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
void _tr_align(deflate_state* s)
#else
void _tr_align(s)
deflate_state *s;
#endif
{
send_bits(s, STATIC_TREES<<1, 3);
send_code(s, END_BLOCK, static_ltree);
@@ -908,11 +960,15 @@ void _tr_align(s)
* trees or store, and output the encoded block to the zip file. This function
* returns the total compressed length for the file so far.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
ulg _tr_flush_block(deflate_state* s, charf* buf, ulg stored_len, int eof)
#else
ulg _tr_flush_block(s, buf, stored_len, eof)
deflate_state *s;
charf *buf; /* input block, or NULL if too old */
ulg stored_len; /* length of input block */
int eof; /* true if this is the last block for a file */
#endif
{
ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
int max_blindex = 0; /* index of last bit length code of non zero freq */
@@ -1020,10 +1076,14 @@ ulg _tr_flush_block(s, buf, stored_len, eof)
* Save the match info and tally the frequency counts. Return true if
* the current block must be flushed.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int _tr_tally (deflate_state* s, unsigned dist, unsigned lc)
#else
int _tr_tally (s, dist, lc)
deflate_state *s;
unsigned dist; /* distance of matched string */
unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
#endif
{
s->d_buf[s->last_lit] = (ush)dist;
s->l_buf[s->last_lit++] = (uch)lc;
@@ -1070,10 +1130,14 @@ int _tr_tally (s, dist, lc)
/* ===========================================================================
* Send the block data compressed using the given Huffman trees
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void compress_block(deflate_state* s, ct_data* ltree, ct_data* dtree)
#else
local void compress_block(s, ltree, dtree)
deflate_state *s;
ct_data *ltree; /* literal tree */
ct_data *dtree; /* distance tree */
#endif
{
unsigned dist; /* distance of matched string */
int lc; /* match length or unmatched char (if dist == 0) */
@@ -1123,8 +1187,12 @@ local void compress_block(s, ltree, dtree)
* IN assertion: the fields freq of dyn_ltree are set and the total of all
* frequencies does not exceed 64K (to fit in an int on 16 bit machines).
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void set_data_type(deflate_state* s)
#else
local void set_data_type(s)
deflate_state *s;
#endif
{
int n = 0;
unsigned ascii_freq = 0;
@@ -1140,9 +1208,13 @@ local void set_data_type(s)
* method would use a table)
* IN assertion: 1 <= len <= 15
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local unsigned bi_reverse(unsigned code, int len)
#else
local unsigned bi_reverse(code, len)
unsigned code; /* the value to invert */
int len; /* its bit length */
#endif
{
register unsigned res = 0;
do {
@@ -1155,8 +1227,12 @@ local unsigned bi_reverse(code, len)
/* ===========================================================================
* Flush the bit buffer, keeping at most 7 bits in it.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void bi_flush(deflate_state* s)
#else
local void bi_flush(s)
deflate_state *s;
#endif
{
if (s->bi_valid == 16) {
put_short(s, s->bi_buf);
@@ -1172,8 +1248,12 @@ local void bi_flush(s)
/* ===========================================================================
* Flush the bit buffer and align the output on a byte boundary
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void bi_windup(deflate_state* s)
#else
local void bi_windup(s)
deflate_state *s;
#endif
{
if (s->bi_valid > 8) {
put_short(s, s->bi_buf);
@@ -1191,17 +1271,21 @@ local void bi_windup(s)
* Copy a stored block, storing first the length and its
* one's complement if requested.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
local void copy_block(deflate_state* s, charf* buf, unsigned len, int header)
#else
local void copy_block(s, buf, len, header)
deflate_state *s;
charf *buf; /* the input data */
unsigned len; /* its length */
int header; /* true if block header must be written */
#endif
{
bi_windup(s); /* align on byte boundary */
s->last_eob_len = 8; /* enough lookahead for inflate */
if (header) {
put_short(s, (ush)len);
put_short(s, (ush)len);
put_short(s, (ush)~len);
#ifdef __WXDEBUG__
s->bits_sent += 2*16;

View File

@@ -1,6 +1,6 @@
/* uncompr.c -- decompress a memory buffer
* 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$ */
@@ -22,11 +22,15 @@
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer, or Z_DATA_ERROR if the input data was corrupted.
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int ZEXPORT uncompress (Bytef* dest, uLongf* destLen, const Bytef* source, uLong sourceLen)
#else
int ZEXPORT uncompress (dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
#endif
{
z_stream stream;
int err;

View File

@@ -1,6 +1,6 @@
/* 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$ */
@@ -51,7 +51,7 @@
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
# define WIN32
#endif
#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
#if defined(__GNUC__) || defined(WIN32) || defined(OS232) || defined(__386__) || defined(i386)
# ifndef __32BIT__
# define __32BIT__
# endif
@@ -71,7 +71,7 @@
# define UNALIGNED_OK
#endif
#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32) || defined(OS232)) && !defined(STDC)
# define STDC
#endif
#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
@@ -196,6 +196,9 @@ typedef unsigned long uLong; /* 32 bits or more */
#else
typedef Byte FAR Bytef;
#endif
#if defined(__VISAGECPP__)
# define Bytef Byte FAR
#endif
typedef char FAR charf;
typedef int FAR intf;
typedef uInt FAR uIntf;

View File

@@ -1,6 +1,6 @@
/* zutil.c -- target dependent utility functions for the 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$ */
@@ -38,8 +38,12 @@ const char * ZEXPORT zlibVersion()
# endif
int z_verbose = verbose;
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
void z_error (char* m)
#else
void z_error (m)
char *m;
#endif
{
fprintf(stderr, "%s\n", m);
exit(1);
@@ -49,8 +53,12 @@ void z_error (m)
/* exported to allow conversion of error code to string for compress() and
* uncompress()
*/
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
const char* ZEXPORT zError(int err)
#else
const char * ZEXPORT zError(err)
int err;
#endif
{
return ERR_MSG(err);
}
@@ -58,10 +66,14 @@ const char * ZEXPORT zError(err)
#ifndef HAVE_MEMCPY
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
void zmemcpy(Bytef* dest, Bytef* source, Uint len)
#else
void zmemcpy(dest, source, len)
Bytef* dest;
Bytef* source;
uInt len;
#endif
{
if (len == 0) return;
do {
@@ -69,10 +81,14 @@ void zmemcpy(dest, source, len)
} while (--len != 0);
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
int zmemcmp(Bytef* s1, Bytef* s2, int len)
#else
int zmemcmp(s1, s2, len)
Bytef* s1;
Bytef* s2;
uInt len;
#endif
{
uInt j;
@@ -82,9 +98,13 @@ int zmemcmp(s1, s2, len)
return 0;
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
void zmemzero(Bytef* dest, uInt len)
#else
void zmemzero(dest, len)
Bytef* dest;
uInt len;
#endif
{
if (len == 0) return;
do {
@@ -205,18 +225,26 @@ extern voidp calloc OF((uInt items, uInt size));
extern void free OF((voidpf ptr));
#endif
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
#else
voidpf zcalloc (opaque, items, size)
voidpf opaque;
unsigned items;
unsigned size;
#endif
{
if (opaque) items += size - size; /* make compiler happy */
return (voidpf)calloc(items, size);
}
#if defined(__VISAGECPP__) // Visual game can't handle this antiquated interface
void zcfree(voidpf opaque, voidpf ptr)
#else
void zcfree (opaque, ptr)
voidpf opaque;
voidpf ptr;
#endif
{
free(ptr);
if (opaque) return; /* make compiler happy */

View File

@@ -208,10 +208,15 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
#endif
typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf,
typedef uLong (ZEXPORT _Optlink *check_func) OF((uLong check, const Bytef *buf,
uInt len));
#if defined(__VISAGECPP__)
voidpf _Optlink zcalloc OF((voidpf opaque, unsigned items, unsigned size));
void _Optlink zcfree OF((voidpf opaque, voidpf ptr));
#else
voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
void zcfree OF((voidpf opaque, voidpf ptr));
#endif
#define ZALLOC(strm, items, size) \
(*((strm)->zalloc))((strm)->opaque, (items), (size))