1 diff -crN 025win/Makefile 025linux/Makefile
2 *** 025win/Makefile 1970-01-01 09:00:00.000000000 +0900
3 --- 025linux/Makefile 2012-02-19 03:21:03.082870623 +0900
7 + # PC/SC Lite libraries and headers.
8 + PCSC_CFLAGS ?= `pkg-config libpcsclite --cflags`
9 + PCSC_LDLIBS ?= `pkg-config libpcsclite --libs`
12 + CFLAGS = -Wall -O2 -g $(PCSC_CFLAGS) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
13 + LDLIBS = $(PCSC_LDLIBS) -lm -lrt
16 + OBJS = arib_std_b25.o b_cas_card.o multi2.o td.o ts_section_parser.o
20 + 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
21 + b_cas_card.o: b_cas_card.c b_cas_card.h portable.h b_cas_card_error_code.h
22 + multi2.o: multi2.c multi2.h portable.h multi2_error_code.h
23 + td.o: td.c arib_std_b25.h portable.h b_cas_card.h
24 + ts_section_parser.o: ts_section_parser.c ts_section_parser.h ts_common_types.h portable.h ts_section_parser_error_code.h
27 + $(CC) $(LDLIBS) -o $(TARGET) $(OBJS)
32 diff -crN 025win/arib_std_b25.c 025linux/arib_std_b25.c
33 *** 025win/arib_std_b25.c 2012-02-13 02:14:17.000000000 +0900
34 --- 025linux/arib_std_b25.c 2012-02-19 02:57:04.000000000 +0900
37 static uint8_t *resync(uint8_t *head, uint8_t *tail, int32_t unit);
\r
38 static uint8_t *resync_force(uint8_t *head, uint8_t *tail, int32_t unit);
\r
40 - static uint32_t crc32(uint8_t *head, uint8_t *tail);
\r
42 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\r
43 interface method implementation
\r
44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
\r
46 diff -crN 025win/b_cas_card.c 025linux/b_cas_card.c
47 *** 025win/b_cas_card.c 2008-12-29 14:11:48.000000000 +0900
48 --- 025linux/b_cas_card.c 2012-02-19 02:57:39.000000000 +0900
54 ! #include <windows.h>
\r
55 #include <winscard.h>
\r
57 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\r
62 ! #if defined(WIN32)
\r
63 ! #include <windows.h>
\r
65 #include <winscard.h>
\r
67 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\r
68 diff -crN 025win/portable.h 025linux/portable.h
69 *** 025win/portable.h 2007-11-09 00:58:40.000000000 +0900
70 --- 025linux/portable.h 2012-02-19 02:58:23.000000000 +0900
76 ! #if (MSC_VER < 1300)
\r
78 typedef unsigned char uint8_t;
\r
79 typedef signed char int8_t;
\r
84 ! #if (defined(WIN32) && MSC_VER < 1300)
\r
86 typedef unsigned char uint8_t;
\r
87 typedef signed char int8_t;
\r
94 + #if !defined(WIN32)
\r
95 + #define _open open
\r
96 + #define _close close
\r
97 + #define _read read
\r
98 + #define _write write
\r
99 + #define _lseeki64 lseek
\r
100 + #define _telli64(fd) (lseek(fd,0,SEEK_CUR))
\r
101 + #define _O_BINARY (0)
\r
102 + #define _O_RDONLY (O_RDONLY)
\r
103 + #define _O_WRONLY (O_WRONLY)
\r
104 + #define _O_SEQUENTIAL (0)
\r
105 + #define _O_CREAT (O_CREAT)
\r
106 + #define _O_TRUNC (O_TRUNC)
\r
107 + #define _S_IREAD (S_IRUSR|S_IRGRP|S_IROTH)
\r
108 + #define _S_IWRITE (S_IWUSR|S_IWGRP|S_IWOTH)
\r
111 #endif /* PORTABLE_H */
\r
112 diff -crN 025win/td.c 025linux/td.c
113 *** 025win/td.c 2012-02-13 02:15:19.000000000 +0900
114 --- 025linux/td.c 2012-02-19 14:12:30.583733648 +0900
118 #include <string.h>
\r
122 #include <sys/stat.h>
\r
123 #include <sys/types.h>
\r
125 ! #include <windows.h>
\r
126 ! #include <crtdbg.h>
\r
128 #include "arib_std_b25.h"
\r
129 #include "b_cas_card.h"
\r
132 #include <string.h>
\r
135 #include <sys/stat.h>
\r
136 #include <sys/types.h>
\r
138 ! #if defined(WIN32)
\r
140 ! #include <windows.h>
\r
141 ! #include <crtdbg.h>
\r
143 ! #define __STDC_FORMAT_MACROS
\r
144 ! #include <inttypes.h>
\r
145 ! #include <unistd.h>
\r
146 ! #include <time.h>
\r
147 ! unsigned long GetTickCount(void)
\r
149 ! struct timespec now;
\r
150 ! if (clock_gettime(CLOCK_MONOTONIC, &now))
\r
152 ! return now.tv_sec * 1000.0 + now.tv_nsec / 1000000.0;
\r
156 #include "arib_std_b25.h"
\r
157 #include "b_cas_card.h"
\r
164 + #if defined(WIN32)
\r
165 _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
\r
166 _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT );
\r
167 _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );
\r
171 _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );
\r
172 _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT );
\r
173 _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_DELAY_FREE_MEM_DF|_CRTDBG_CHECK_ALWAYS_DF|_CRTDBG_LEAK_CHECK_DF);
\r
176 n = parse_arg(&opt, argc, argv);
\r
181 test_arib_std_b25(argv[n+0], argv[n+1], &opt);
\r
184 + #if defined(WIN32)
\r
185 _CrtDumpMemoryLeaks();
\r
188 return EXIT_SUCCESS;
\r
193 fprintf(stderr, " channel: %d\n", pgrm.program_number);
\r
194 fprintf(stderr, " unpurchased ECM count: %d\n", pgrm.ecm_unpurchased_count);
\r
195 fprintf(stderr, " last ECM error code: %04x\n", pgrm.last_ecm_error_code);
\r
196 + #if defined(WIN32)
\r
197 fprintf(stderr, " undecrypted TS packet: %d\n", pgrm.undecrypted_packet_count);
\r
198 fprintf(stderr, " total TS packet: %d\n", pgrm.total_packet_count);
\r
200 + fprintf(stderr, " undecrypted TS packet: %"PRId64"\n", pgrm.undecrypted_packet_count);
\r
201 + fprintf(stderr, " total TS packet: %"PRId64"\n", pgrm.total_packet_count);
\r