From: Guenter B. <gu...@us...> - 2003-04-20 16:42:13
|
Update of /cvsroot/xine/xine-lib/win32/include In directory sc8-pr-cvs1:/tmp/cvs-serv7171/win32/include Added Files: common.h config.h dirent.h dlfcn.h inttypes.h pthread.h pwd.h sched.h semaphore.h timer.h unistd.h zconf.h zlib.h Log Message: importing win32 contrib sources and msvc build environment --- NEW FILE: common.h --- /* * Copyright (C) 2000-2003 the xine project * * This file is part of xine, a unix video player. * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * * $Id: common.h,v 1.1 2003/04/20 16:42:09 guenter Exp $ * */ #ifndef __COMMON_H__ #define __COMMON_H__ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <xine.h> #include <xineutils.h> #if (0) #include "Imlib-light/Imlib.h" #include "xitk.h" #include "kbindings.h" #include "videowin.h" #include "mediamark.h" #include "actions.h" #include "config_wrapper.h" #include "control.h" #include "errors.h" #include "event.h" #include "event_sender.h" #include "i18n.h" #include "lang.h" #include "lirc.h" #include "mrl_browser.h" #include "network.h" #include "panel.h" #include "playlist.h" #include "session.h" #include "setup.h" #include "skins.h" #include "snapshot.h" #include "stream_infos.h" #include "viewlog.h" #include "download.h" #include "osd.h" #include "file_browser.h" #include "post.h" #include "utils.h" #endif #ifdef HAVE_ORBIT #include "../corba/xine-server.h" #endif #ifdef HAVE_LIRC #include <lirc/lirc_client.h> #endif /* * config related constants */ #define CONFIG_LEVEL_BEG 0 /* => beginner */ #define CONFIG_LEVEL_ADV 10 /* advanced user */ #define CONFIG_LEVEL_EXP 20 /* expert */ #define CONFIG_LEVEL_MAS 30 /* motku */ #define CONFIG_LEVEL_DEB 40 /* debugger (only available in debug mode) */ #define CONFIG_NO_DESC NULL #define CONFIG_NO_HELP NULL #define CONFIG_NO_CB NULL #define CONFIG_NO_DATA NULL /* * flags for autoplay options */ #define PLAY_ON_START 0x00000001 #define PLAYED_ON_START 0x00000002 #define QUIT_ON_STOP 0x00000004 #define FULL_ON_START 0x00000008 #define HIDEGUI_ON_START 0x00000010 #define PLAY_FROM_DVD 0x00000020 #define PLAY_FROM_VCD 0x00000040 /* Sound mixer capabilities */ #define MIXER_CAP_NOTHING 0x00000000 #define MIXER_CAP_VOL 0x00000001 #define MIXER_CAP_MUTE 0x00000002 /* Playlist loop modes */ #define PLAYLIST_LOOP_NO_LOOP 0 /* no loop (default) */ #define PLAYLIST_LOOP_LOOP 1 /* loop the whole playlist */ #define PLAYLIST_LOOP_REPEAT 2 /* loop the current mrl */ #define PLAYLIST_LOOP_SHUFFLE 3 /* random selection in playlist */ #define PLAYLIST_LOOP_SHUF_PLUS 4 /* random selection in playlist, never ending */ #define PLAYLIST_LOOP_MODES_NUM 5 #define SAFE_FREE(x) do { \ if((x)) { \ free((x)); \ x = NULL; \ } \ } while(0) /* Our default location for skin downloads */ #define SKIN_SERVER_URL "http://xine.sourceforge.net/skins/skins.slx" typedef struct { xine_video_port_t *vo_port; int post_video_num; xine_post_t *post_video; struct { int hue; int brightness; int saturation; int contrast; } video_settings; xine_audio_port_t *ao_port; xine_stream_t *stream; xine_stream_t *spu_stream; xine_t *xine; xine_event_queue_t *event_queue; int smart_mode; /* Visual stuff (like animation in video window while audio only playback) */ struct { xine_stream_t *stream; xine_event_queue_t *event_queue; int running; int current; int enabled; /* 0, 1:vpost, 2:vanim */ char **mrls; int num_mrls; int post_plugin_num; xine_post_t *post_output; int post_changed; } visual_anim; struct { int enabled; int timeout; xine_osd_t *sinfo; int sinfo_visible; xine_osd_t *bar[2]; int bar_visible; xine_osd_t *status; int status_visible; xine_osd_t *info; int info_visible; } osd; /* xine lib/gui configuration filename */ char *configfile; int experience_level; const char *logo_mrl; int logo_mode; int logo_has_changed; /* stuff like FULL_ON_START, QUIT_ON_STOP */ /*action_id_t actions_on_start[16];*/ char *autoscan_plugin; uint32_t debug_level; int is_display_mrl; int mrl_overrided; int running; int ignore_next; #ifdef HAVE_LIRC int lirc_enable; #endif #ifdef HAVE_XF86VIDMODE int XF86VidMode_fullscreen; #endif struct { int caps; /* MIXER_CAP_x */ int volume_level; int mute; } mixer; int layer_above; int always_layer_above; int network; int use_root_window; const char *snapshot_location; int ssaver_timeout; int skip_by_chapter; int auto_vo_visibility; int auto_panel_visibility; int eventer_sticky; int stream_info_auto_update; int play_anyway; pthread_mutex_t download_mutex; } gGui_t; #endif --- NEW FILE: config.h --- /* config.h. Generated by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ #ifndef _CONFIG_H_ #define _CONFIG_H_ #if defined(WIN32) #include <windows.h> #include <stdio.h> #include <string.h> #endif /* Define this if you're running PowerPC architecture */ /* #undef ARCH_PPC */ /* Define this if you're running x86 architecture */ /*define ARCH_X86*/ /* maximum supported data alignment */ #define ATTRIBUTE_ALIGNED_MAX 64 /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ /* #undef CRAY_STACKSEG_END */ /* Define to 1 if using `alloca.c'. */ /* #undef C_ALLOCA */ /* Define this if you have a Motorola 74xx CPU */ /* #undef ENABLE_ALTIVEC */ /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define this if you have Sun UltraSPARC CPU */ /* #undef ENABLE_VIS */ /* Define to select libmad fixed pointarithmetic implementation */ /* #undef FPM_64BIT */ /* Define to select libmad fixed point arithmetic implementation */ /* #undef FPM_ARM */ /* Define to select libmad fixed point arithmetic implementation */ /* #undef FPM_DEFAULT */ /* Define to select libmad fixed point arithmetic implementation */ #define FPM_INTEL 1 /* Define to select libmad fixed point arithmetic implementation */ /* #undef FPM_MIPS */ /* Define to select libmad fixed point arithmetic implementation */ /* #undef FPM_PPC */ /* Define to select libmad fixed point arithmetic implementation */ /* #undef FPM_SPARC */ /* Define to 1 if you have `alloca', as a function or macro. */ #define HAVE_ALLOCA 1 /* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). */ #define HAVE_ALLOCA_H 1 /* Define this if you have Alsa (libasound) installed */ /* #undef HAVE_ALSA */ /* Define this if you have alsa 0.9.x and more installed */ /* #undef HAVE_ALSA09 */ /* Define this if your asoundlib.h is installed in alsa/ */ /* #undef HAVE_ALSA_ASOUNDLIB_H */ /* Define to 1 if you have the <argz.h> header file. */ /* #undef HAVE_ARGZ_H */ /* Define this if you have ARTS (libartsc) installed */ /* #undef HAVE_ARTS */ /* Define to 1 if you have the <byteswap.h> header file. */ /* #undef HAVE_BYTESWAP_H */ /* Define this if you have CDROM ioctls */ /* #undef HAVE_CDROM_IOCTLS */ /* Define to 1 if you have the `dcgettext' function. */ #define HAVE_DCGETTEXT 1 /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 /* Define this if you have a suitable version of libdvdnav */ #define HAVE_DVDNAV 1 /* Define this if you have ESD (libesd) installed */ /* #undef HAVE_ESD */ /* Define this if you have linux framebuffer support */ /* #undef HAVE_FB */ /* Define to 1 if you have the `feof_unlocked' function. */ /* #undef HAVE_FEOF_UNLOCKED */ /* Define to 1 if you have the `fgets_unlocked' function. */ /* #undef HAVE_FGETS_UNLOCKED */ /* Define to 1 if you have the `getcwd' function. */ #define HAVE_GETCWD 1 /* Define to 1 if you have the `getegid' function. */ #define HAVE_GETEGID 1 /* Define to 1 if you have the `geteuid' function. */ #define HAVE_GETEUID 1 /* Define to 1 if you have the `getgid' function. */ #define HAVE_GETGID 1 /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 /* Define to 1 if you have the `getpwuid_r' function. */ #define HAVE_GETPWUID_R 1 /* Define if the GNU gettext() function is already present or preinstalled. */ #define HAVE_GETTEXT 1 /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 /* Define this if you have GLU support available */ /* #undef HAVE_GLU */ /* Define this if you have GLut support available */ /* #undef HAVE_GLUT */ /* Define this if you have gnome-vfs installed */ /* #undef HAVE_GNOME_VFS */ /* Define if you have the iconv() function. */ /* #undef HAVE_ICONV */ /* Define to 1 if you have the <inttypes.h> header file. */ /* #undef HAVE_INTTYPES_H */ /* Define this if you have ip_mreqn in netinet/in.h */ /* #undef HAVE_IP_MREQN */ /* Define this if you have a usable IRIX al interface available */ /* #undef HAVE_IRIXAL */ /* Define this if you have kernel statistics available via kstat interface */ /* #undef HAVE_KSTAT */ /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ /* #undef HAVE_LANGINFO_CODESET */ /* Define if your <locale.h> file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 /* Define this if you have libfame mpeg encoder installed (fame.sf.net) */ /* #undef HAVE_LIBFAME */ /* Define to 1 if you have the `posix4' library (-lposix4). */ /* #undef HAVE_LIBPOSIX4 */ /* Define this if you have librte mpeg encoder installed (zapping.sf.net) */ /* #undef HAVE_LIBRTE */ /* Define to 1 if you have the <limits.h> header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the <linux/cdrom.h> header file. */ /* #undef HAVE_LINUX_CDROM_H */ /* Define to 1 if you have the <locale.h> header file. */ #define HAVE_LOCALE_H 1 /* Define to 1 if you have the <malloc.h> header file. */ #define HAVE_MALLOC_H 1 /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `mempcpy' function. */ /* #undef HAVE_MEMPCPY */ /* Define this if you have mlib installed */ /* #undef HAVE_MLIB */ /* Define to 1 if you have a working `mmap' system call. */ /* #undef HAVE_MMAP */ /* Define to 1 if you have the `munmap' function. */ #define HAVE_MUNMAP 1 /* Define to 1 if you have the `nanosleep' function. */ /* #undef HAVE_NANOSLEEP */ /* Define this if you have libfame 0.8.10 or above */ /* #undef HAVE_NEW_LIBFAME */ /* Define to 1 if you have the <nl_types.h> header file. */ /* #undef HAVE_NL_TYPES_H */ /* Define this if you have OpenGL support available */ /* #undef HAVE_OPENGL */ /* Define to 1 if you have the `putenv' function. */ #define HAVE_PUTENV 1 /* Define this if you have SDL library installed */ /* #undef HAVE_SDL */ /* Define to 1 if you have the `setenv' function. */ #define HAVE_SETENV 1 /* Define to 1 if you have the `setlocale' function. */ #define HAVE_SETLOCALE 1 /* Define to 1 if you have the `sigaction' function. */ #define HAVE_SIGACTION 1 /* Define to 1 if you have the `sigset' function. */ /* #undef HAVE_SIGSET */ /* Define to 1 if you have the <stddef.h> header file. */ #define HAVE_STDDEF_H 1 /* Define to 1 if you have the <stdint.h> header file. */ /* #undef HAVE_STDINT_H */ /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `stpcpy' function. */ /* #undef HAVE_STPCPY */ /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the `strchr' function. */ #define HAVE_STRCHR 1 /* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strpbrk' function. */ #define HAVE_STRPBRK 1 /* Define to 1 if you have the `strsep' function. */ #define HAVE_STRSEP 1 /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 /* Define this if your asoundlib.h is installed in sys/ */ /* #undef HAVE_SYS_ASOUNDLIB_H */ /* Define to 1 if you have the <sys/cdio.h> header file. */ /* #undef HAVE_SYS_CDIO_H */ /* Define to 1 if you have the <sys/mixer.h> header file. */ /* #undef HAVE_SYS_MIXER_H */ /* Define to 1 if you have the <sys/mman.h> header file. */ #define HAVE_SYS_MMAN_H 1 /* Define to 1 if you have the <sys/param.h> header file. */ /* #undef HAVE_SYS_PARAM_H */ /* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the `tsearch' function. */ /* #undef HAVE_TSEARCH */ /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the `vsscanf' function. */ #define HAVE_VSSCANF 1 /* Define this if you have X11R6 installed */ /* #undef HAVE_X11 */ /* Define this if you have libXinerama installed */ /* #undef HAVE_XINERAMA */ /* Define this if you have libXv installed */ /* #undef HAVE_XV */ /* Define this if you have libXv.a */ /* #undef HAVE_XV_STATIC */ /* Define to 1 if you have the `__argz_count' function. */ /* #undef HAVE___ARGZ_COUNT */ /* Define to 1 if you have the `__argz_next' function. */ /* #undef HAVE___ARGZ_NEXT */ /* Define to 1 if you have the `__argz_stringify' function. */ /* #undef HAVE___ARGZ_STRINGIFY */ /* Define as const if the declaration of iconv() needs const. */ /* #undef ICONV_CONST */ /* Define this if you have mlib installed */ /* #undef LIBA52_MLIB */ /* Define this if you have mlib installed */ /* #undef LIBMPEG2_MLIB */ /* Name of package */ #define PACKAGE "xine-lib" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ #define PACKAGE_NAME "" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "" /* Define to the version of this package. */ #define PACKAGE_VERSION "" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ /* #undef STACK_DIRECTION */ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ #define VERSION "1-beta6" /* xine major version number */ #define XINE_MAJOR 1 /* xine minor version number */ #define XINE_MINOR 0 /* xine sub version number */ #define XINE_SUB 0 /* Define to 1 if the X Window System is missing or not being used. */ #define X_DISPLAY_MISSING 1 /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ /* #undef WORDS_BIGENDIAN */ /* Define this if you want nvtvd tvmode support */ /* #undef XINE_HAVE_NVTV */ #define HAVE_DVDCSS_DVDCSS_H 1 #if defined(WIN32) /* Ridiculous hack to return valid xine support * directories. These should be read from * a registry entry set at install time. */ static char tmp_win32_path[ 1024 ]; static char * exec_path_append_subdir( char * string ) { char * tmpchar; char * cmdline; char * back_slash; char * fore_slash; char * last_slash; // get program exec command line cmdline = GetCommandLine(); // check for " at beginning of string if( *cmdline == '\"' ) { // copy command line, skip first quote strcpy( tmp_win32_path, cmdline + 1 ); // terminate at second set of quotes tmpchar = strchr( tmp_win32_path, '\"' ); *tmpchar = 0; } else { // copy command line strcpy( tmp_win32_path, cmdline ); // terminate at first space tmpchar = strchr( tmp_win32_path, ' ' ); *tmpchar = 0; } // find the last occurance of a back // slash or fore slash back_slash = strrchr( tmp_win32_path, '\\' ); fore_slash = strrchr( tmp_win32_path, '/' ); // make sure the last back slash was not // after a drive letter if( back_slash > tmp_win32_path ) if( *( back_slash - 1 ) == ':' ) back_slash = 0; // which slash was the latter slash if( back_slash > fore_slash ) last_slash = back_slash; else last_slash = fore_slash; // detect if we had a relative or // distiguished path ( had a slash ) if( last_slash ) { // we had a slash charachter in our // command line *( last_slash + 1 ) = 0; // if had a string to append to the path if( string ) strcat( tmp_win32_path, string ); } else { // no slash, assume local directory strcpy( tmp_win32_path, "./" ); // if had a string to append to the path if( string ) strcat( tmp_win32_path, string ); } return tmp_win32_path; } #define XINE_HOMEDIR exec_path_append_subdir( 0 ) #define XINE_PLUGINDIR exec_path_append_subdir( "plugins" ) #define XINE_FONTDIR exec_path_append_subdir( "fonts" ) #define XINE_LOCALEDIR exec_path_append_subdir( "locale" ) #else /* Path where catalog files will be. */ #define XINE_LOCALEDIR "/usr/local/share/locale" /* Define this to plugins directory location */ #define XINE_PLUGINDIR "/usr/local/lib/xine/plugins/1.0.0" /* Define this if you're running x86 architecture */ #define __i386__ 1 /* Path where aclocal m4 files will be. */ #define XINE_ACFLAGS "-I ${prefix}/share/aclocal" #endif /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define as `__inline' if that's what the C compiler calls it, or to nothing if it is not supported. */ /* #undef inline */ /* Define to `long' if <sys/types.h> does not define. */ /* #undef off_t */ /* Define to `unsigned' if <sys/types.h> does not define. */ /* #undef size_t */ #endif /* defined CONFIG_H */ --- NEW FILE: dirent.h --- /* Declaration of POSIX directory browsing functions and types for Win32. Kevlin Henney (mailto:ke...@ac...), March 1997. Copyright Kevlin Henney, 1997. All rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for any purpose is hereby granted without fee, provided that this copyright and permissions notice appear in all copies and derivatives, and that no charge may be made for the software and its documentation except to cover cost of distribution. */ #ifndef DIRENT_INCLUDED #define DIRENT_INCLUDED typedef struct DIR DIR; struct dirent { char *d_name; }; DIR *opendir(const char *); int closedir(DIR *); struct dirent *readdir(DIR *); void rewinddir(DIR *); #endif --- NEW FILE: dlfcn.h --- /* * Copyright (C) 2000-2001 the xine project * * This file is part of xine, a unix video player. * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * * WIN32 PORT, * by Matthew Grooms <el...@al...> * * dlfcn.h - Mimic the dl functions of a *nix system * */ #define RTLD_LAZY 0 #define RTLD_GLOBAL 0 #define dlopen( A, B ) LoadLibrary( A ) #define dlclose( A ) FreeLibrary( A ) #define dlsym( A, B ) ( void * ) GetProcAddress( A, B ) #define dlerror() "dlerror" --- NEW FILE: inttypes.h --- /* * Copyright (C) 2000-2001 the xine project * * This file is part of xine, a unix video player. * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * * WIN32 PORT, * by Matthew Grooms <el...@al...> * * inttypes.h - Standard integer definitions. * */ #ifndef _SYS_INTTYPES_H_ #define _SYS_INTTYPES_H_ #define int8_t signed char #define int16_t signed short #define int32_t signed long #define int64_t signed hyper #define uint8_t unsigned char #define uint16_t unsigned short #define uint32_t unsigned long #define uint64_t unsigned hyper #define intptr_t signed int * #define uintptr_t unsigned int * #define __int8_t int8_t #define __int16_t int16_t #define __int32_t int32_t #define __int64_t int64_t #define __uint8_t uint8_t #define __uint16_t uint16_t #define __uint32_t uint32_t #define __uint64_t uint64_t #define __intptr_t intptr_t #define __uintptr_t uintptr_t typedef __int64 ulonglong; typedef __int64 longlong; #endif --- NEW FILE: pthread.h --- /* This is the POSIX thread API (POSIX 1003). * * Pthreads-win32 - POSIX Threads Library for Win32 * Copyright (C) 1998 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA [...1038 lines suppressed...] catch( ptw32_exception & ) { throw; } \ catch( ... ) #else /* _MSC_VER */ #define catch( E ) \ catch( ptw32_exception & ) { throw; } \ catch( E ) #endif /* _MSC_VER */ #endif /* __cplusplus */ #endif /* ! PTW32_BUILD */ #ifdef __cplusplus } /* End of extern "C" */ #endif /* __cplusplus */ #endif /* PTHREAD_H */ --- NEW FILE: pwd.h --- --- NEW FILE: sched.h --- /* * Module: sched.h * * Purpose: * Provides an implementation of POSIX realtime extensions * as defined in * * POSIX 1003.1b-1993 (POSIX.1b) * * Pthreads-win32 - POSIX Threads Library for Win32 * Copyright (C) 1998 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA */ #ifndef _SCHED_H #define _SCHED_H #if defined(__MINGW32__) || defined(_UWIN) /* For pid_t */ # include <sys/types.h> /* Required by Unix 98 */ # include <time.h> #else typedef int pid_t; #endif /* Thread scheduling policies */ enum { SCHED_OTHER = 0, SCHED_FIFO, SCHED_RR, SCHED_MIN = SCHED_OTHER, SCHED_MAX = SCHED_RR }; struct sched_param { int sched_priority; }; #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ int sched_yield (void); int sched_get_priority_min (int policy); int sched_get_priority_max (int policy); int sched_setscheduler (pid_t pid, int policy); int sched_getscheduler (pid_t pid); /* * Note that this macro returns ENOTSUP rather than * ENOSYS as might be expected. However, returning ENOSYS * should mean that sched_get_priority_{min,max} are * not implemented as well as sched_rr_get_interval. * This is not the case, since we just don't support * round-robin scheduling. Therefore I have chosen to * return the same value as sched_setscheduler when * SCHED_RR is passed to it. */ #define sched_rr_get_interval(_pid, _interval) \ ( errno = ENOTSUP, (int) -1 ) #ifdef __cplusplus } /* End of extern "C" */ #endif /* __cplusplus */ #endif /* !_SCHED_H */ --- NEW FILE: semaphore.h --- /* * Module: semaphore.h * * Purpose: * Semaphores aren't actually part of the PThreads standard. * They are defined by the POSIX Standard: * * POSIX 1003.1b-1993 (POSIX.1b) * * Pthreads-win32 - POSIX Threads Library for Win32 * Copyright (C) 1998 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA */ #if !defined( SEMAPHORE_H ) #define SEMAPHORE_H /* * This is a duplicate of what is in the autoconf config.h, * which is only used when building the pthread-win32 libraries. */ #ifndef PTW32_CONFIG_H # if defined(WINCE) # define NEED_ERRNO # define NEED_SEM # endif # if defined(_UWIN) || defined(__MINGW32__) # define HAVE_MODE_T # endif #endif /* * */ #ifdef NEED_SEM #include "need_errno.h" #else #include <errno.h> #endif #define _POSIX_SEMAPHORES #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef HAVE_MODE_T typedef unsigned int mode_t; #endif typedef struct sem_t_ * sem_t; int sem_init (sem_t * sem, int pshared, unsigned int value); int sem_destroy (sem_t * sem); int sem_trywait (sem_t * sem); int sem_wait (sem_t * sem); int sem_post (sem_t * sem); int sem_post_multiple (sem_t * sem, int count); int sem_open (const char * name, int oflag, mode_t mode, unsigned int value); int sem_close (sem_t * sem); int sem_unlink (const char * name); int sem_getvalue (sem_t * sem, int * sval); #ifdef __cplusplus } /* End of extern "C" */ #endif /* __cplusplus */ #endif /* !SEMAPHORE_H */ --- NEW FILE: timer.h --- #include <time.h> #include <winsock.h> #include "pthread.h" #ifndef _ITIMER_ #define _ITIMER_ #define ITIMER_REAL 0 #define ITIMER_VIRTUAL 1 // time reference // ---------------------------------- // // 1,000 milliseconds / sec // 1,000,000 microseconds / sec // 1,000,000,000 nanoseconds / sec // // timeval.time_sec = seconds // timeval.time_usec = microseconds struct itimerval { struct timeval it_interval; /* timer interval */ struct timeval it_value; /* current value */ }; struct timezone { int tz_minuteswest; /* minutes west of Greenwich */ int tz_dsttime; /* type of dst correction */ }; int gettimeofday( struct timeval *tp, struct timezone *tzp ); int setitimer( int which, struct itimerval * value, struct itimerval *ovalue ); int pause( void ); unsigned int sleep( unsigned int seconds ); int nanosleep( const struct timespec *rqtp, struct timespec *rmtp ); #endif --- NEW FILE: unistd.h --- /* * Copyright (C) 2000-2001 the xine project * * This file is part of xine, a unix video player. * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * * WIN32 PORT, * by Matthew Grooms <el...@al...> * * unistd.h - This is mostly a catch all header that maps standard unix * libc calls to the equivelent win32 functions. * */ #include <windows.h> #include <malloc.h> #include <errno.h> #include <direct.h> #include "timer.h" #ifndef _SYS_UNISTD_H_ #define _SYS_UNISTD_H_ #define inline __inline #define mkdir( A, B ) _mkdir( A ) #define lstat stat #define S_ISDIR(A) ( S_IFDIR & A ) #define S_IXUSR S_IEXEC #define S_IXGRP S_IEXEC #define S_IXOTH S_IEXEC #define M_PI 3.14159265358979323846 /* pi */ #define bzero( A, B ) memset( A, 0, B ) #define strcasecmp _stricmp #define strncasecmp _strnicmp #define snprintf _snprintf #define vsnprintf _vsnprintf // FIXME : I dont remember why this is here #define readlink #endif --- NEW FILE: zconf.h --- /* 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 */ /* @(#) $Id: zconf.h,v 1.1 2003/04/20 16:42:09 guenter Exp $ */ #ifndef _ZCONF_H #define _ZCONF_H /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. */ #ifdef Z_PREFIX # define deflateInit_ z_deflateInit_ # define deflate z_deflate # define deflateEnd z_deflateEnd # define inflateInit_ z_inflateInit_ # define inflate z_inflate # define inflateEnd z_inflateEnd # define deflateInit2_ z_deflateInit2_ # define deflateSetDictionary z_deflateSetDictionary # define deflateCopy z_deflateCopy # define deflateReset z_deflateReset # define deflateParams z_deflateParams # define inflateInit2_ z_inflateInit2_ # define inflateSetDictionary z_inflateSetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateReset z_inflateReset # define compress z_compress # define compress2 z_compress2 # define uncompress z_uncompress # define adler32 z_adler32 # define crc32 z_crc32 # define get_crc_table z_get_crc_table # define Byte z_Byte # define uInt z_uInt # define uLong z_uLong # define Bytef z_Bytef # define charf z_charf # define intf z_intf # define uIntf z_uIntf # define uLongf z_uLongf # define voidpf z_voidpf # define voidp z_voidp #endif #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) # define WIN32 #endif #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) # ifndef __32BIT__ # define __32BIT__ # endif #endif #if defined(__MSDOS__) && !defined(MSDOS) # define MSDOS #endif /* * Compile with -DMAXSEG_64K if the alloc function cannot allocate more * than 64k bytes at a time (needed on systems with 16-bit int). */ #if defined(MSDOS) && !defined(__32BIT__) # define MAXSEG_64K #endif #ifdef MSDOS # define UNALIGNED_OK #endif #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) # define STDC #endif #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__) # ifndef STDC # define STDC # endif #endif #ifndef STDC # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ # define const # endif #endif /* Some Mac compilers merge all .h files incorrectly: */ #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) # define NO_DUMMY_DECL #endif /* Old Borland C incorrectly complains about missing returns: */ #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) # define NEED_DUMMY_RETURN #endif /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL # ifdef MAXSEG_64K # define MAX_MEM_LEVEL 8 # else # define MAX_MEM_LEVEL 9 # endif #endif /* Maximum value for windowBits in deflateInit2 and inflateInit2. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files * created by gzip. (Files created by minigzip can still be extracted by * gzip.) */ #ifndef MAX_WBITS # define MAX_WBITS 15 /* 32K LZ77 window */ #endif /* The memory requirements for deflate are (in bytes): (1 << (windowBits+2)) + (1 << (memLevel+9)) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) plus a few kilobytes for small objects. For example, if you want to reduce the default memory requirements from 256K to 128K, compile with make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits that is, 32K for windowBits=15 (default value) plus a few kilobytes for small objects. */ /* Type declarations */ #ifndef OF /* function prototypes */ # ifdef STDC # define OF(args) args # else # define OF(args) () # endif #endif /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, * just define FAR to be empty. */ #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) /* MSC small or medium model */ # define SMALL_MEDIUM # ifdef _MSC_VER # define FAR _far # else # define FAR far # endif #endif #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__)) # ifndef __32BIT__ # define SMALL_MEDIUM # define FAR _far # endif #endif /* Compile with -DZLIB_DLL for Windows DLL support */ #if defined(ZLIB_DLL) # if defined(_WINDOWS) || defined(WINDOWS) # ifdef FAR # undef FAR # endif # include <windows.h> # define ZEXPORT WINAPI # ifdef WIN32 # define ZEXPORTVA WINAPIV # else # define ZEXPORTVA FAR _cdecl _export # endif # endif # if defined (__BORLANDC__) # if (__BORLANDC__ >= 0x0500) && defined (WIN32) # include <windows.h> # define ZEXPORT __declspec(dllexport) WINAPI # define ZEXPORTRVA __declspec(dllexport) WINAPIV # else # if defined (_Windows) && defined (__DLL__) # define ZEXPORT _export # define ZEXPORTVA _export # endif # endif # endif #endif #if defined (__BEOS__) # if defined (ZLIB_DLL) # define ZEXTERN extern __declspec(dllexport) # else # define ZEXTERN extern __declspec(dllimport) # endif #endif #ifndef ZEXPORT # define ZEXPORT #endif #ifndef ZEXPORTVA # define ZEXPORTVA #endif #ifndef ZEXTERN # define ZEXTERN extern #endif #ifndef FAR # define FAR #endif #if !defined(MACOS) && !defined(TARGET_OS_MAC) typedef unsigned char Byte; /* 8 bits */ #endif typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ #ifdef SMALL_MEDIUM /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ # define Bytef Byte FAR #else typedef Byte FAR Bytef; #endif typedef char FAR charf; typedef int FAR intf; typedef uInt FAR uIntf; typedef uLong FAR uLongf; #ifdef STDC typedef void FAR *voidpf; typedef void *voidp; #else typedef Byte FAR *voidpf; typedef Byte *voidp; #endif #ifdef HAVE_UNISTD_H # include <sys/types.h> /* for off_t */ # include <unistd.h> /* for SEEK_* and off_t */ # define z_off_t off_t #endif #ifndef SEEK_SET # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif #ifndef z_off_t # 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 */ --- NEW FILE: zlib.h --- /* zlib.h -- interface of the 'zlib' general purpose compression library version 1.1.3, July 9th, 1998 Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler jl...@gz... ma...@al... The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). */ #ifndef _ZLIB_H #define _ZLIB_H #include "zconf.h" #ifdef __cplusplus extern "C" { #endif #define ZLIB_VERSION "1.1.3" /* The 'zlib' compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method (deflation) but other algorithms will be added later and will have the same stream interface. Compression can be done in a single step if the buffers are large enough (for example if an input file is mmap'ed), or can be done by repeated calls of the compression function. In the latter case, the application must provide more input and/or consume the output (providing more output space) before each call. The library also supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio. The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash even in case of corrupted input. */ typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); typedef void (*free_func) OF((voidpf opaque, voidpf address)); struct internal_state; typedef struct z_stream_s { Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total nb of input bytes read so far */ Bytef *next_out; /* next output byte should be put there */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total nb of bytes output so far */ char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ int data_type; /* best guess about the data type: ascii or binary */ uLong adler; /* adler32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ } z_stream; typedef z_stream FAR *z_streamp; /* The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out has dropped to zero. The application must initialize zalloc, zfree and opaque before calling the init function. All other fields are set by the compression library and must not be updated by the application. The opaque value provided by the application will be passed as the first parameter for calls of zalloc and zfree. This can be useful for custom memory management. The compression library attaches no meaning to the opaque value. zalloc must return Z_NULL if there is not enough memory for the object. If zlib is used in a multi-threaded application, zalloc and zfree must be thread safe. On 16-bit systems, the functions zalloc and zfree must be able to allocate exactly 65536 bytes, but will not be required to allocate more than this if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers returned by zalloc for objects of exactly 65536 bytes *must* have their offset normalized to zero. The default allocation function provided by this library ensures this (see zutil.c). To reduce memory requirements and avoid any allocation of 64K objects, at the expense of compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). The fields total_in and total_out can be used for statistics or progress reports. After compression, total_in holds the total size of the uncompressed data and may be saved for use in the decompressor (particularly if the decompressor wants to decompress everything in a single step). */ /* constants */ #define Z_NO_FLUSH 0 #define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ #define Z_SYNC_FLUSH 2 #define Z_FULL_FLUSH 3 #define Z_FINISH 4 /* Allowed flush values; see deflate() below for details */ #define Z_OK 0 #define Z_STREAM_END 1 #define Z_NEED_DICT 2 #define Z_ERRNO (-1) #define Z_STREAM_ERROR (-2) #define Z_DATA_ERROR (-3) #define Z_MEM_ERROR (-4) #define Z_BUF_ERROR (-5) #define Z_VERSION_ERROR (-6) /* Return codes for the compression/decompression functions. Negative * values are errors, positive values are used for special but normal events. */ #define Z_NO_COMPRESSION 0 #define Z_BEST_SPEED 1 #define Z_BEST_COMPRESSION 9 #define Z_DEFAULT_COMPRESSION (-1) /* compression levels */ #define Z_FILTERED 1 #define Z_HUFFMAN_ONLY 2 #define Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ #define Z_BINARY 0 #define Z_ASCII 1 #define Z_UNKNOWN 2 /* Possible values of the data_type field */ #define Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ #define zlib_version zlibVersion() /* for compatibility with versions < 1.0.2 */ /* basic functions */ ZEXTERN const char * ZEXPORT zlibVersion OF((void)); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check is automatically made by deflateInit and inflateInit. */ /* ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If zalloc and zfree are set to Z_NULL, deflateInit updates them to use default allocation functions. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION requests a default compromise between speed and compression (currently equivalent to level 6). deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if level is not a valid compression level, Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); /* deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. deflate performs one or both of the following actions: - Compress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in and avail_in are updated and processing will resume at this point for the next call of deflate(). - Provide more output starting at next_out and update next_out and avail_out accordingly. This action is forced if the parameter flush is non zero. Forcing flush frequently degrades the compression ratio, so this parameter should be set only when necessary (in interactive applications). Some output may be provided even if flush is not set. Before the call of deflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating avail_in or avail_out accordingly; avail_out should never be zero before the call. The application can consume the compressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. If the parameter flush is set to Z_SYNC_FLUSH, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. (In particular avail_in is zero after the call if enough output space has been provided before the call.) Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. If flush is set to Z_FULL_FLUSH, all output is flushed as with Z_SYNC_FLUSH, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using Z_FULL_FLUSH too often can seriously degrade the compression. If deflate returns with avail_out == 0, this function must be called again with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was enough output space; if deflate returns with Z_OK, this function must be called again with Z_FINISH and more output space (updated avail_out) but no more input data, until it returns with Z_STREAM_END or an error. After deflate has returned Z_STREAM_END, the only possible operations on the stream are deflateReset or deflateEnd. Z_FINISH can be used immediately after deflateInit if all the compression is to be done in a single step. In this case, avail_out must be at least 0.1% larger than avail_in plus 12 bytes. If deflate does not return Z_STREAM_END, then it must be called again as described above. deflate() sets strm->adler to the adler32 checksum of all input read so far (that is, total_in bytes). deflate() may update data_type if it can make a good guess about the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered binary. This field is only for information purposes and does not affect the compression algorithm in any manner. deflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if all input has been consumed and all output has been produced (only when flush is set to Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible (for example avail_in or avail_out was zero). */ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent, Z_DATA_ERROR if the stream was freed prematurely (some input or output was discarded). In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. If next_in is not Z_NULL and avail_in is large enough (the exact value depends on the compression method), inflateInit determines the compression method from the zlib header and allocates all data structures accordingly; otherwise the allocation will be deferred to the first call of inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to use default allocation functions. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller. msg is set to null if there is no error message. inflateInit does not perform any decompression apart from reading the zlib header if present: this will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unchanged.) */ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may some introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. inflate performs one or both of the following actions: - Decompress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in is updated and processing will resume at this point for the next call of inflate(). - Provide more output starting at next_out and update next_out and avail_out accordingly. inflate() provides as much output as possible, until there is no more input data or no more space in the output buffer (see below about the flush parameter). Before the call of inflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating the next_* and avail_* values accordingly. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of inflate(). If inflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much output as possible to the output buffer. The flushing behavior of inflate is not specified for values of the flush parameter other than Z_SYNC_FLUSH and Z_FINISH, but the current implementation actually flushes as much output as possible anyway. inflate() should normally be called until it returns Z_STREAM_END or an error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to Z_FINISH. In this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all the uncompressed data. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The next operation on this stream must be inflateEnd to deallocate the decompression state. The use of Z_FINISH is never required, but can be used to inform inflate that a faster routine may be used for the single inflate() call. If a preset dictionary is needed at this point (see inflateSetDictionary below), inflate sets strm-adler to the adler32 checksum of the dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the adler32 checksum of all output produced so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described below. At the end of the stream, inflate() checks that its computed adler32 checksum is equal to that saved by the compressor and returns Z_STREAM_END only if the checksum is correct. inflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced, Z_NEED_DICT if a preset dictionary is needed at this point, Z_DATA_ERROR if the input data was corrupted (input stream not conforming to the zlib format or incorrect adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no progress is possible or if there was not enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR case, the application may then call inflateSync to look for a good compression block. */ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent. In the error case, msg may be set but then points to a static string (which must not be deallocated). */ ... [truncated message content] |