From 04efc58c21ec343998bb65c3a653698e6be901ff Mon Sep 17 00:00:00 2001 From: Tim Champagne Date: Mon, 26 May 2003 17:00:11 +0000 Subject: Get asf plugin to build in Win32. Also starting to clean up some Win32 code (more to come). CVS patchset: 4947 CVS date: 2003/05/26 17:00:11 --- src/demuxers/asfheader.h | 17 ++-- src/demuxers/demux_asf.c | 14 +-- src/input/mms.c | 15 +-- src/input/mmsh.c | 15 +-- win32/include/inttypes.h | 251 ++++++++++++++++++++++++++++++++++++----------- win32/include/netdb.h | 1 + 6 files changed, 227 insertions(+), 86 deletions(-) create mode 100644 win32/include/netdb.h diff --git a/src/demuxers/asfheader.h b/src/demuxers/asfheader.h index d6745970b..095a1a573 100644 --- a/src/demuxers/asfheader.h +++ b/src/demuxers/asfheader.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: asfheader.h,v 1.1 2002/12/12 22:40:06 tmattern Exp $ + * $Id: asfheader.h,v 1.2 2003/05/26 17:00:11 tchamp Exp $ * * demultiplexer for asf streams * @@ -98,13 +98,18 @@ #define ASF_MAX_NUM_STREAMS 23 -typedef struct { - uint32_t v1; - uint16_t v2; - uint16_t v3; - uint8_t v4[8]; +#ifndef GUID_DEFINED +#define GUID_DEFINED + +typedef struct _GUID { /* size is 16 */ + uint32_t Data1; + uint16_t Data2; + uint16_t Data3; + uint8_t Data4[8]; } GUID; +#endif /* !GUID_DEFINED */ + static const struct { const char* name; diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index e43dc40ea..39796a3a3 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_asf.c,v 1.116 2003/05/24 14:11:24 tmattern Exp $ + * $Id: demux_asf.c,v 1.117 2003/05/26 17:00:12 tchamp Exp $ * * demultiplexer for asf streams * @@ -243,11 +243,11 @@ static int get_guid (demux_asf_t *this) { int i; GUID g; - g.v1 = get_le32(this); - g.v2 = get_le16(this); - g.v3 = get_le16(this); + g.Data1 = get_le32(this); + g.Data2 = get_le16(this); + g.Data3 = get_le16(this); for(i = 0; i < 8; i++) { - g.v4[i] = get_byte(this); + g.Data4[i] = get_byte(this); } for (i = 1; i < GUID_END; i++) { @@ -262,8 +262,8 @@ static int get_guid (demux_asf_t *this) { if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) printf ("demux_asf: unknown GUID: 0x%x, 0x%x, 0x%x, " "{ 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx }\n", - g.v1, g.v2, g.v3, - g.v4[0], g.v4[1], g.v4[2], g.v4[3], g.v4[4], g.v4[5], g.v4[6], g.v4[7]); + g.Data1, g.Data2, g.Data3, + g.Data4[0], g.Data4[1], g.Data4[2], g.Data4[3], g.Data4[4], g.Data4[5], g.Data4[6], g.Data4[7]); return GUID_ERROR; } diff --git a/src/input/mms.c b/src/input/mms.c index 1ddbb851f..b727b2b04 100644 --- a/src/input/mms.c +++ b/src/input/mms.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: mms.c,v 1.27 2003/04/26 17:53:16 tmattern Exp $ + * $Id: mms.c,v 1.28 2003/05/26 17:00:13 tchamp Exp $ * * MMS over TCP protocol * based on work from major mms @@ -215,11 +215,11 @@ static int get_guid (unsigned char *buffer, int offset) { int i; GUID g; - g.v1 = get_32(buffer, offset); - g.v2 = get_16(buffer, offset + 4); - g.v3 = get_16(buffer, offset + 6); + g.Data1 = get_32(buffer, offset); + g.Data2 = get_16(buffer, offset + 4); + g.Data3 = get_16(buffer, offset + 6); for(i = 0; i < 8; i++) { - g.v4[i] = buffer[offset + 8 + i]; + g.Data4[i] = buffer[offset + 8 + i]; } for (i = 1; i < GUID_END; i++) { @@ -233,8 +233,9 @@ static int get_guid (unsigned char *buffer, int offset) { printf ("libmms: unknown GUID: 0x%x, 0x%x, 0x%x, " "{ 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx }\n", - g.v1, g.v2, g.v3, - g.v4[0], g.v4[1], g.v4[2], g.v4[3], g.v4[4], g.v4[5], g.v4[6], g.v4[7]); + g.Data1, g.Data2, g.Data3, + g.Data4[0], g.Data4[1], g.Data4[2], g.Data4[3], + g.Data4[4], g.Data4[5], g.Data4[6], g.Data4[7]); return GUID_ERROR; } diff --git a/src/input/mmsh.c b/src/input/mmsh.c index ed7d7a028..2ff02a87f 100644 --- a/src/input/mmsh.c +++ b/src/input/mmsh.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: mmsh.c,v 1.16 2003/04/26 13:26:28 tmattern Exp $ + * $Id: mmsh.c,v 1.17 2003/05/26 17:00:14 tchamp Exp $ * * MMS over HTTP protocol * written by Thibaut Mattern @@ -274,11 +274,11 @@ static int get_guid (unsigned char *buffer, int offset) { int i; GUID g; - g.v1 = get_32(buffer, offset); - g.v2 = get_16(buffer, offset + 4); - g.v3 = get_16(buffer, offset + 6); + g.Data1 = get_32(buffer, offset); + g.Data2 = get_16(buffer, offset + 4); + g.Data3 = get_16(buffer, offset + 6); for(i = 0; i < 8; i++) { - g.v4[i] = buffer[offset + 8 + i]; + g.Data4[i] = buffer[offset + 8 + i]; } for (i = 1; i < GUID_END; i++) { @@ -292,8 +292,9 @@ static int get_guid (unsigned char *buffer, int offset) { printf ("libmmsh: unknown GUID: 0x%x, 0x%x, 0x%x, " "{ 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx }\n", - g.v1, g.v2, g.v3, - g.v4[0], g.v4[1], g.v4[2], g.v4[3], g.v4[4], g.v4[5], g.v4[6], g.v4[7]); + g.Data1, g.Data2, g.Data3, + g.Data4[0], g.Data4[1], g.Data4[2], g.Data4[3], + g.Data4[4], g.Data4[5], g.Data4[6], g.Data4[7]); return GUID_ERROR; } diff --git a/win32/include/inttypes.h b/win32/include/inttypes.h index 90a7c81f5..bddfc8766 100644 --- a/win32/include/inttypes.h +++ b/win32/include/inttypes.h @@ -1,59 +1,192 @@ -/* - * 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 - * - * 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 +/* + * 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 + * + * 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; + +#define __WORDSIZE 32 + +/* The ISO C99 standard specifies that these macros must only be + defined if explicitly requested. */ +#if !defined __cplusplus || defined __STDC_FORMAT_MACROS + +# if __WORDSIZE == 64 +# define __PRI64_PREFIX "l" +# define __PRIPTR_PREFIX "l" +# else +# define __PRI64_PREFIX "I64" +# define __PRIPTR_PREFIX +# endif + +/* Macros for printing format specifiers. */ + +/* Decimal notation. */ +# define PRId8 "d" +# define PRId16 "d" +# define PRId32 "d" +# define PRId64 __PRI64_PREFIX "d" + +# define PRIdLEAST8 "d" +# define PRIdLEAST16 "d" +# define PRIdLEAST32 "d" +# define PRIdLEAST64 __PRI64_PREFIX "d" + +# define PRIdFAST8 "d" +# define PRIdFAST16 "d" +# define PRIdFAST32 "d" +# define PRIdFAST64 __PRI64_PREFIX "d" + + +# define PRIi8 "i" +# define PRIi16 "i" +# define PRIi32 "i" +# define PRIi64 __PRI64_PREFIX "i" + +# define PRIiLEAST8 "i" +# define PRIiLEAST16 "i" +# define PRIiLEAST32 "i" +# define PRIiLEAST64 __PRI64_PREFIX "i" + +# define PRIiFAST8 "i" +# define PRIiFAST16 "i" +# define PRIiFAST32 "i" +# define PRIiFAST64 __PRI64_PREFIX "i" + +/* Octal notation. */ +# define PRIo8 "o" +# define PRIo16 "o" +# define PRIo32 "o" +# define PRIo64 __PRI64_PREFIX "o" + +# define PRIoLEAST8 "o" +# define PRIoLEAST16 "o" +# define PRIoLEAST32 "o" +# define PRIoLEAST64 __PRI64_PREFIX "o" + +# define PRIoFAST8 "o" +# define PRIoFAST16 "o" +# define PRIoFAST32 "o" +# define PRIoFAST64 __PRI64_PREFIX "o" + +/* Unsigned integers. */ +# define PRIu8 "u" +# define PRIu16 "u" +# define PRIu32 "u" +# define PRIu64 __PRI64_PREFIX "u" + +# define PRIuLEAST8 "u" +# define PRIuLEAST16 "u" +# define PRIuLEAST32 "u" +# define PRIuLEAST64 __PRI64_PREFIX "u" + +# define PRIuFAST8 "u" +# define PRIuFAST16 "u" +# define PRIuFAST32 "u" +# define PRIuFAST64 __PRI64_PREFIX "u" + +/* lowercase hexadecimal notation. */ +# define PRIx8 "x" +# define PRIx16 "x" +# define PRIx32 "x" +# define PRIx64 __PRI64_PREFIX "x" + +# define PRIxLEAST8 "x" +# define PRIxLEAST16 "x" +# define PRIxLEAST32 "x" +# define PRIxLEAST64 __PRI64_PREFIX "x" + +# define PRIxFAST8 "x" +# define PRIxFAST16 "x" +# define PRIxFAST32 "x" +# define PRIxFAST64 __PRI64_PREFIX "x" + +/* UPPERCASE hexadecimal notation. */ +# define PRIX8 "X" +# define PRIX16 "X" +# define PRIX32 "X" +# define PRIX64 __PRI64_PREFIX "X" + +# define PRIXLEAST8 "X" +# define PRIXLEAST16 "X" +# define PRIXLEAST32 "X" +# define PRIXLEAST64 __PRI64_PREFIX "X" + +# define PRIXFAST8 "X" +# define PRIXFAST16 "X" +# define PRIXFAST32 "X" +# define PRIXFAST64 __PRI64_PREFIX "X" + + +/* Macros for printing `intmax_t' and `uintmax_t'. */ +# define PRIdMAX __PRI64_PREFIX "d" +# define PRIiMAX __PRI64_PREFIX "i" +# define PRIoMAX __PRI64_PREFIX "o" +# define PRIuMAX __PRI64_PREFIX "u" +# define PRIxMAX __PRI64_PREFIX "x" +# define PRIXMAX __PRI64_PREFIX "X" + + +/* Macros for printing `intptr_t' and `uintptr_t'. */ +# define PRIdPTR __PRIPTR_PREFIX "d" +# define PRIiPTR __PRIPTR_PREFIX "i" +# define PRIoPTR __PRIPTR_PREFIX "o" +# define PRIuPTR __PRIPTR_PREFIX "u" +# define PRIxPTR __PRIPTR_PREFIX "x" +# define PRIXPTR __PRIPTR_PREFIX "X" + +#endif /* !defined __cplusplus || defined __STDC_FORMAT_MACROS */ + + +#endif diff --git a/win32/include/netdb.h b/win32/include/netdb.h new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/win32/include/netdb.h @@ -0,0 +1 @@ + -- cgit v1.2.3