312 lines
11 KiB
Diff
312 lines
11 KiB
Diff
diff --git a/.gitignore b/.gitignore
|
|
index fb6efca..1651fae 100644
|
|
--- a/.gitignore
|
|
+++ b/.gitignore
|
|
@@ -10,6 +10,7 @@
|
|
/aclocal.m4
|
|
/aribb25-*/
|
|
/autom4te.cache
|
|
+/b25
|
|
/compile
|
|
/config.guess
|
|
/config.h
|
|
@@ -25,4 +26,7 @@
|
|
/m4/
|
|
/missing
|
|
/src/aribb25.pc
|
|
+/src/config.h
|
|
+/src/config.h.in
|
|
+/src/stamp-h1
|
|
/stamp-h1
|
|
diff --git a/Makefile.am b/Makefile.am
|
|
index b95a569..0cf8e51 100644
|
|
--- a/Makefile.am
|
|
+++ b/Makefile.am
|
|
@@ -3,10 +3,10 @@ ACLOCAL_AMFLAGS = -I m4
|
|
lib_LTLIBRARIES = libaribb25.la
|
|
libaribb25_la_SOURCES = src/arib_std_b25.c src/b_cas_card.c src/multi2.c \
|
|
src/portable.h src/ts_section_parser.c src/arib_std_b25_error_code.h \
|
|
- src/b_cas_card_error_code.h src/multi2_error_code.h src/td.c \
|
|
+ src/b_cas_card_error_code.h src/multi2_error_code.h \
|
|
src/ts_section_parser_error_code.h src/arib_std_b25.h src/b_cas_card.h \
|
|
src/multi2.h src/ts_common_types.h src/ts_section_parser.h src/aribb25api.h
|
|
-libaribb25_la_LIBADD = $(AM_LIBS) $(pcsclite_CFLAGS) $(PCSC_LIBS)
|
|
+libaribb25_la_LIBADD = $(AM_LIBS) $(pcsclite_LIBS) $(PCSC_LIBS)
|
|
libaribb25_la_CFLAGS = $(AM_CFLAGS) -Wall -Werror -fvisibility=hidden $(pcsclite_CFLAGS)
|
|
|
|
pkginclude_HEADERS = src/arib_std_b25_error_code.h src/b_cas_card_error_code.h \
|
|
@@ -17,4 +17,9 @@ pkginclude_HEADERS = src/arib_std_b25_error_code.h src/b_cas_card_error_code.h \
|
|
pkgconfigdir = $(libdir)/pkgconfig
|
|
pkgconfig_DATA = src/aribb25.pc
|
|
|
|
+bin_PROGRAMS = b25
|
|
+b25_SOURCES = src/td.c
|
|
+b25_CFLAGS = $(AM_CFLAGS) -Wall -Werror $(pcsclite_CFLAGS)
|
|
+b25_LDADD = libaribb25.la $(pcsclite_LIBS) $(PCSC_LIBS)
|
|
+
|
|
dist_doc_DATA = README.jp.txt README.md LICENCE
|
|
diff --git a/configure.ac b/configure.ac
|
|
index ec1d35f..baa856e 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -82,5 +82,6 @@ AS_IF([test "$SYS" = mingw32],[
|
|
], [AC_MSG_ERROR([${pcsclite_PKG_ERRORS}.])])
|
|
])
|
|
|
|
+AC_CONFIG_HEADERS([src/config.h])
|
|
AC_CONFIG_FILES([Makefile src/aribb25.pc])
|
|
AC_OUTPUT
|
|
diff --git a/src/arib_std_b25.h b/src/arib_std_b25.h
|
|
index 7edfbb3..a577731 100644
|
|
--- a/src/arib_std_b25.h
|
|
+++ b/src/arib_std_b25.h
|
|
@@ -16,8 +16,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
*******************************************************************************/
|
|
-#ifndef ARIB_STD_B25_H
|
|
-#define ARIB_STD_B25_H
|
|
+#ifndef B25_ARIB_STD_B25_H
|
|
+#define B25_ARIB_STD_B25_H
|
|
|
|
#include "aribb25api.h"
|
|
#include "portable.h"
|
|
@@ -79,5 +79,5 @@ ARIBB25API ARIB_STD_B25 *create_arib_std_b25();
|
|
}
|
|
#endif
|
|
|
|
-#endif /* ARIB_STD_B25_H */
|
|
+#endif /* B25_ARIB_STD_B25_H */
|
|
|
|
diff --git a/src/arib_std_b25_error_code.h b/src/arib_std_b25_error_code.h
|
|
index 12a2e03..10d0a09 100644
|
|
--- a/src/arib_std_b25_error_code.h
|
|
+++ b/src/arib_std_b25_error_code.h
|
|
@@ -16,8 +16,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
*******************************************************************************/
|
|
-#ifndef ARIB_STD_B25_ERROR_CODE_H
|
|
-#define ARIB_STD_B25_ERROR_CODE_H
|
|
+#ifndef B25_ARIB_STD_B25_ERROR_CODE_H
|
|
+#define B25_ARIB_STD_B25_ERROR_CODE_H
|
|
|
|
#define ARIB_STD_B25_ERROR_INVALID_PARAM -1
|
|
#define ARIB_STD_B25_ERROR_NO_ENOUGH_MEMORY -2
|
|
@@ -40,4 +40,4 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
#define ARIB_STD_B25_WARN_TS_SECTION_ID_MISSMATCH 2
|
|
#define ARIB_STD_B25_WARN_BROKEN_TS_SECTION 3
|
|
|
|
-#endif /* ARIB_STD_B25_ERROR_CODE_H */
|
|
+#endif /* B25_ARIB_STD_B25_ERROR_CODE_H */
|
|
diff --git a/src/aribb25api.h b/src/aribb25api.h
|
|
index 2f47f7d..23f1bce 100644
|
|
--- a/src/aribb25api.h
|
|
+++ b/src/aribb25api.h
|
|
@@ -16,8 +16,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
*******************************************************************************/
|
|
-#ifndef ARIBB25API_H
|
|
-#define ARIBB25API_H 1
|
|
+#ifndef B25_ARIBB25API_H
|
|
+#define B25_ARIBB25API_H 1
|
|
|
|
/* If building or using aribb25 as a DLL, define ARIBB25_DLL.
|
|
* */
|
|
@@ -54,4 +54,4 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
#endif
|
|
#endif
|
|
|
|
-#endif
|
|
+#endif /* B25_ARIBB25API_H */
|
|
diff --git a/src/b_cas_card.h b/src/b_cas_card.h
|
|
index 37b65ab..6f49941 100644
|
|
--- a/src/b_cas_card.h
|
|
+++ b/src/b_cas_card.h
|
|
@@ -16,8 +16,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
*******************************************************************************/
|
|
-#ifndef B_CAS_CARD_H
|
|
-#define B_CAS_CARD_H
|
|
+#ifndef B25_B_CAS_CARD_H
|
|
+#define B25_B_CAS_CARD_H
|
|
|
|
#include "aribb25api.h"
|
|
#include "portable.h"
|
|
@@ -91,4 +91,4 @@ ARIBB25API B_CAS_CARD *create_b_cas_card();
|
|
}
|
|
#endif
|
|
|
|
-#endif /* B_CAS_CARD_H */
|
|
+#endif /* B25_B_CAS_CARD_H */
|
|
diff --git a/src/b_cas_card_error_code.h b/src/b_cas_card_error_code.h
|
|
index 83802a4..c24d86a 100644
|
|
--- a/src/b_cas_card_error_code.h
|
|
+++ b/src/b_cas_card_error_code.h
|
|
@@ -16,8 +16,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
*******************************************************************************/
|
|
-#ifndef B_CAS_CARD_ERROR_CODE_H
|
|
-#define B_CAS_CARD_ERROR_CODE_H
|
|
+#ifndef B25_B_CAS_CARD_ERROR_CODE_H
|
|
+#define B25_B_CAS_CARD_ERROR_CODE_H
|
|
|
|
#define B_CAS_CARD_ERROR_INVALID_PARAMETER -1
|
|
#define B_CAS_CARD_ERROR_NOT_INITIALIZED -2
|
|
@@ -26,4 +26,4 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
#define B_CAS_CARD_ERROR_NO_ENOUGH_MEMORY -5
|
|
#define B_CAS_CARD_ERROR_TRANSMIT_FAILED -6
|
|
|
|
-#endif /* B_CAS_CARD_ERROR_CODE_H */
|
|
+#endif /* B25_B_CAS_CARD_ERROR_CODE_H */
|
|
diff --git a/src/multi2.h b/src/multi2.h
|
|
index 5708b7c..19ef922 100644
|
|
--- a/src/multi2.h
|
|
+++ b/src/multi2.h
|
|
@@ -16,8 +16,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
*******************************************************************************/
|
|
-#ifndef MULTI2_H
|
|
-#define MULTI2_H
|
|
+#ifndef B25_MULTI2_H
|
|
+#define B25_MULTI2_H
|
|
|
|
#include "aribb25api.h"
|
|
#include "portable.h"
|
|
@@ -51,4 +51,4 @@ ARIBB25API MULTI2 *create_multi2();
|
|
}
|
|
#endif
|
|
|
|
-#endif /* MULTI2_H */
|
|
+#endif /* B25_MULTI2_H */
|
|
diff --git a/src/multi2_error_code.h b/src/multi2_error_code.h
|
|
index f1ca9e6..dcc30ef 100644
|
|
--- a/src/multi2_error_code.h
|
|
+++ b/src/multi2_error_code.h
|
|
@@ -16,12 +16,12 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
*******************************************************************************/
|
|
-#ifndef MULTI2_ERROR_CODE_H
|
|
-#define MULTI2_ERROR_CODE_H
|
|
+#ifndef B25_MULTI2_ERROR_CODE_H
|
|
+#define B25_MULTI2_ERROR_CODE_H
|
|
|
|
#define MULTI2_ERROR_INVALID_PARAMETER -1
|
|
#define MULTI2_ERROR_UNSET_SYSTEM_KEY -2
|
|
#define MULTI2_ERROR_UNSET_CBC_INIT -3
|
|
#define MULTI2_ERROR_UNSET_SCRAMBLE_KEY -4
|
|
|
|
-#endif /* MULTI2_ERROR_CODE_H */
|
|
+#endif /* B25_MULTI2_ERROR_CODE_H */
|
|
diff --git a/src/portable.h b/src/portable.h
|
|
index 7e5f828..b9d5af7 100644
|
|
--- a/src/portable.h
|
|
+++ b/src/portable.h
|
|
@@ -16,8 +16,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
*******************************************************************************/
|
|
-#ifndef PORTABLE_H
|
|
-#define PORTABLE_H
|
|
+#ifndef B25_PORTABLE_H
|
|
+#define B25_PORTABLE_H
|
|
|
|
#include <stdint.h>
|
|
|
|
@@ -38,4 +38,4 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
#define _S_IWRITE (S_IWUSR|S_IWGRP|S_IWOTH)
|
|
#endif
|
|
|
|
-#endif /* PORTABLE_H */
|
|
+#endif /* B25_PORTABLE_H */
|
|
diff --git a/src/td.c b/src/td.c
|
|
index c27201f..288aa5a 100644
|
|
--- a/src/td.c
|
|
+++ b/src/td.c
|
|
@@ -37,6 +37,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
#include "arib_std_b25.h"
|
|
#include "b_cas_card.h"
|
|
+#include "config.h"
|
|
|
|
typedef struct {
|
|
int32_t round;
|
|
@@ -85,7 +86,7 @@ int main(int argc, char **argv)
|
|
|
|
static void show_usage()
|
|
{
|
|
- fprintf(stderr, "b25 - ARIB STD-B25 test program ver. 0.2.5 (2012, 2/13)\n");
|
|
+ fprintf(stderr, "%s\n", PACKAGE_STRING);
|
|
fprintf(stderr, "usage: b25 [options] src.m2t dst.m2t [more pair ..]\n");
|
|
fprintf(stderr, "options:\n");
|
|
fprintf(stderr, " -r round (integer, default=4)\n");
|
|
diff --git a/src/ts_common_types.h b/src/ts_common_types.h
|
|
index 67830f4..67b4da3 100644
|
|
--- a/src/ts_common_types.h
|
|
+++ b/src/ts_common_types.h
|
|
@@ -16,8 +16,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
*******************************************************************************/
|
|
-#ifndef TS_COMMON_TYPES_H
|
|
-#define TS_COMMON_TYPES_H
|
|
+#ifndef B25_TS_COMMON_TYPES_H
|
|
+#define B25_TS_COMMON_TYPES_H
|
|
|
|
#include "portable.h"
|
|
|
|
@@ -51,4 +51,4 @@ typedef struct {
|
|
uint8_t *tail;
|
|
} TS_SECTION;
|
|
|
|
-#endif /* TS_COMMON_TYPES_H */
|
|
\ No newline at end of file
|
|
+#endif /* B25_TS_COMMON_TYPES_H */
|
|
diff --git a/src/ts_section_parser.h b/src/ts_section_parser.h
|
|
index fdad1e2..2450d41 100644
|
|
--- a/src/ts_section_parser.h
|
|
+++ b/src/ts_section_parser.h
|
|
@@ -16,8 +16,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
*******************************************************************************/
|
|
-#ifndef TS_SECTION_PARSER_H
|
|
-#define TS_SECTION_PARSER_H
|
|
+#ifndef B25_TS_SECTION_PARSER_H
|
|
+#define B25_TS_SECTION_PARSER_H
|
|
|
|
#include "aribb25api.h"
|
|
#include "ts_common_types.h"
|
|
@@ -56,4 +56,4 @@ ARIBB25API TS_SECTION_PARSER *create_ts_section_parser();
|
|
}
|
|
#endif
|
|
|
|
-#endif /* TS_SECTION_PARSER_H */
|
|
+#endif /* B25_TS_SECTION_PARSER_H */
|
|
diff --git a/src/ts_section_parser_error_code.h b/src/ts_section_parser_error_code.h
|
|
index 67bbec9..6626e1f 100644
|
|
--- a/src/ts_section_parser_error_code.h
|
|
+++ b/src/ts_section_parser_error_code.h
|
|
@@ -16,8 +16,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
*******************************************************************************/
|
|
-#ifndef TS_SECTION_PARSER_ERROR_CODE_H
|
|
-#define TS_SECTION_PARSER_ERROR_CODE_H
|
|
+#ifndef B25_TS_SECTION_PARSER_ERROR_CODE_H
|
|
+#define B25_TS_SECTION_PARSER_ERROR_CODE_H
|
|
|
|
#define TS_SECTION_PARSER_ERROR_INVALID_PARAM -1
|
|
#define TS_SECTION_PARSER_ERROR_NO_ENOUGH_MEMORY -2
|
|
@@ -27,4 +27,4 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
#define TS_SECTION_PARSER_WARN_CRC_MISSMATCH 1
|
|
#define TS_SECTION_PARSER_WARN_LENGTH_MISSMATCH 2
|
|
|
|
-#endif /* TS_SECTION_PARSER_ERROR_CODE_H */
|
|
+#endif /* B25_TS_SECTION_PARSER_ERROR_CODE_H */
|