From e1b8f9c9e10f4805590e66f34f29fc5228d9d344 Mon Sep 17 00:00:00 2001 From: longinus Date: Sun, 19 Feb 2012 05:45:08 +0000 Subject: [PATCH] patch for arib_std_b25-0.2.5 to suit for linux git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@926 4e526526-5e11-4fc0-8910-f8fd03428081 --- tstools/arib_std_b25/arib_std_b25-0.2.5-w2l.patch | 205 ++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 tstools/arib_std_b25/arib_std_b25-0.2.5-w2l.patch diff --git a/tstools/arib_std_b25/arib_std_b25-0.2.5-w2l.patch b/tstools/arib_std_b25/arib_std_b25-0.2.5-w2l.patch new file mode 100644 index 0000000..63dbcf1 --- /dev/null +++ b/tstools/arib_std_b25/arib_std_b25-0.2.5-w2l.patch @@ -0,0 +1,205 @@ +diff -crN 025win/Makefile 025linux/Makefile +*** 025win/Makefile 1970-01-01 09:00:00.000000000 +0900 +--- 025linux/Makefile 2012-02-19 03:21:03.082870623 +0900 +*************** +*** 0 **** +--- 1,25 ---- ++ # PC/SC Lite libraries and headers. ++ PCSC_CFLAGS ?= `pkg-config libpcsclite --cflags` ++ PCSC_LDLIBS ?= `pkg-config libpcsclite --libs` ++ ++ CC = gcc ++ CFLAGS = -Wall -O2 -g $(PCSC_CFLAGS) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ++ LDLIBS = $(PCSC_LDLIBS) -lm -lrt ++ ++ TARGET = b25 ++ OBJS = arib_std_b25.o b_cas_card.o multi2.o td.o ts_section_parser.o ++ ++ all: $(TARGET) ++ ++ arib_std_b25.o: arib_std_b25.c arib_std_b25.h portable.h b_cas_card.h arib_std_b25_error_code.h multi2.h ts_section_parser.h ts_common_types.h ++ b_cas_card.o: b_cas_card.c b_cas_card.h portable.h b_cas_card_error_code.h ++ multi2.o: multi2.c multi2.h portable.h multi2_error_code.h ++ td.o: td.c arib_std_b25.h portable.h b_cas_card.h ++ ts_section_parser.o: ts_section_parser.c ts_section_parser.h ts_common_types.h portable.h ts_section_parser_error_code.h ++ ++ $(TARGET): $(OBJS) ++ $(CC) $(LDLIBS) -o $(TARGET) $(OBJS) ++ ++ clean: ++ rm -f *.o ++ rm -f $(TARGET) +diff -crN 025win/arib_std_b25.c 025linux/arib_std_b25.c +*** 025win/arib_std_b25.c 2012-02-13 02:14:17.000000000 +0900 +--- 025linux/arib_std_b25.c 2012-02-19 02:57:04.000000000 +0900 +*************** +*** 409,416 **** + static uint8_t *resync(uint8_t *head, uint8_t *tail, int32_t unit); + static uint8_t *resync_force(uint8_t *head, uint8_t *tail, int32_t unit); + +- static uint32_t crc32(uint8_t *head, uint8_t *tail); +- + /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + interface method implementation + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +--- 409,414 ---- +diff -crN 025win/b_cas_card.c 025linux/b_cas_card.c +*** 025win/b_cas_card.c 2008-12-29 14:11:48.000000000 +0900 +--- 025linux/b_cas_card.c 2012-02-19 02:57:39.000000000 +0900 +*************** +*** 6,12 **** + + #include + +! #include + #include + + /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +--- 6,14 ---- + + #include + +! #if defined(WIN32) +! #include +! #endif + #include + + /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +diff -crN 025win/portable.h 025linux/portable.h +*** 025win/portable.h 2007-11-09 00:58:40.000000000 +0900 +--- 025linux/portable.h 2012-02-19 02:58:23.000000000 +0900 +*************** +*** 1,7 **** + #ifndef PORTABLE_H + #define PORTABLE_H + +! #if (MSC_VER < 1300) + + typedef unsigned char uint8_t; + typedef signed char int8_t; +--- 1,7 ---- + #ifndef PORTABLE_H + #define PORTABLE_H + +! #if (defined(WIN32) && MSC_VER < 1300) + + typedef unsigned char uint8_t; + typedef signed char int8_t; +*************** +*** 18,21 **** +--- 18,38 ---- + + #endif + ++ #if !defined(WIN32) ++ #define _open open ++ #define _close close ++ #define _read read ++ #define _write write ++ #define _lseeki64 lseek ++ #define _telli64(fd) (lseek(fd,0,SEEK_CUR)) ++ #define _O_BINARY (0) ++ #define _O_RDONLY (O_RDONLY) ++ #define _O_WRONLY (O_WRONLY) ++ #define _O_SEQUENTIAL (0) ++ #define _O_CREAT (O_CREAT) ++ #define _O_TRUNC (O_TRUNC) ++ #define _S_IREAD (S_IRUSR|S_IRGRP|S_IROTH) ++ #define _S_IWRITE (S_IWUSR|S_IWGRP|S_IWOTH) ++ #endif ++ + #endif /* PORTABLE_H */ +diff -crN 025win/td.c 025linux/td.c +*** 025win/td.c 2012-02-13 02:15:19.000000000 +0900 +--- 025linux/td.c 2012-02-19 14:12:30.583733648 +0900 +*************** +*** 2,14 **** + #include + #include + +- #include + #include + #include + #include + +! #include +! #include + + #include "arib_std_b25.h" + #include "b_cas_card.h" +--- 2,28 ---- + #include + #include + + #include + #include + #include + +! #if defined(WIN32) +! #include +! #include +! #include +! #else +! #define __STDC_FORMAT_MACROS +! #include +! #include +! #include +! unsigned long GetTickCount(void) +! { +! struct timespec now; +! if (clock_gettime(CLOCK_MONOTONIC, &now)) +! return 0; +! return now.tv_sec * 1000.0 + now.tv_nsec / 1000000.0; +! } +! #endif + + #include "arib_std_b25.h" + #include "b_cas_card.h" +*************** +*** 31,36 **** +--- 45,51 ---- + int n; + OPTION opt; + ++ #if defined(WIN32) + _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); + _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); + _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); +*************** +*** 38,43 **** +--- 53,59 ---- + _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); + _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT ); + _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_DELAY_FREE_MEM_DF|_CRTDBG_CHECK_ALWAYS_DF|_CRTDBG_LEAK_CHECK_DF); ++ #endif + + n = parse_arg(&opt, argc, argv); + if(n+2 > argc){ +*************** +*** 49,55 **** +--- 65,73 ---- + test_arib_std_b25(argv[n+0], argv[n+1], &opt); + } + ++ #if defined(WIN32) + _CrtDumpMemoryLeaks(); ++ #endif + + return EXIT_SUCCESS; + } +*************** +*** 311,318 **** +--- 329,341 ---- + fprintf(stderr, " channel: %d\n", pgrm.program_number); + fprintf(stderr, " unpurchased ECM count: %d\n", pgrm.ecm_unpurchased_count); + fprintf(stderr, " last ECM error code: %04x\n", pgrm.last_ecm_error_code); ++ #if defined(WIN32) + fprintf(stderr, " undecrypted TS packet: %d\n", pgrm.undecrypted_packet_count); + fprintf(stderr, " total TS packet: %d\n", pgrm.total_packet_count); ++ #else ++ fprintf(stderr, " undecrypted TS packet: %"PRId64"\n", pgrm.undecrypted_packet_count); ++ fprintf(stderr, " total TS packet: %"PRId64"\n", pgrm.total_packet_count); ++ #endif + } + } + -- 2.11.0