summaryrefslogtreecommitdiffstats
path: root/mpeglib/example/yaf/yafcore
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2017-03-26 15:58:46 +0200
committerSlávek Banko <slavek.banko@axis.cz>2017-03-26 15:58:46 +0200
commit8b12682035e2ae92a29a9ce12abc5fbcf38b1192 (patch)
tree1cc5c3fe9ef3b23557fc4e9e507fd0d23d007160 /mpeglib/example/yaf/yafcore
parent250d713ff809fa943f614459009d1160e269dcef (diff)
downloadtdemultimedia-8b12682035e2ae92a29a9ce12abc5fbcf38b1192.tar.gz
tdemultimedia-8b12682035e2ae92a29a9ce12abc5fbcf38b1192.zip
Initial cmake conversion
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'mpeglib/example/yaf/yafcore')
-rw-r--r--mpeglib/example/yaf/yafcore/CMakeLists.txt55
-rw-r--r--mpeglib/example/yaf/yafcore/inputInterface.cpp8
2 files changed, 63 insertions, 0 deletions
diff --git a/mpeglib/example/yaf/yafcore/CMakeLists.txt b/mpeglib/example/yaf/yafcore/CMakeLists.txt
new file mode 100644
index 00000000..1e0abe1b
--- /dev/null
+++ b/mpeglib/example/yaf/yafcore/CMakeLists.txt
@@ -0,0 +1,55 @@
+#################################################
+#
+# (C) 2017 Slávek Banko
+# slavek (DOT) banko (AT) axis.cz
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${CMAKE_BINARY_DIR}
+ ${TQT_INCLUDE_DIRS}
+ ${TDE_INCLUDE_DIR}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+ ${ARTS_LIBRARY_DIRS}
+)
+
+
+##### yafcore (library) #########################
+
+tde_add_library( yafcore SHARED
+ SOURCES
+ buffer.cpp
+ lineStack.cpp
+ commandLine.cpp
+ parser.cpp
+ outputInterface.cpp
+ inputInterface.cpp
+ commandTable.cpp
+ commandTableYAF.cpp
+ runtimeTableYAF.cpp
+ inputDecoder.cpp
+ outputDecoder.cpp
+ yaf_control.cpp
+ multiReader.cpp
+ LINK
+ tdefakes-shared
+ mpeg-shared
+ DESTINATION ${LIB_INSTALL_DIR}
+)
+
+
+##### other data ################################
+
+install(
+ FILES
+ inputInterface.h outputInterface.h
+ buffer.h inputDecoder.h yaf_control.h
+ DESTINATION ${INCLUDE_INSTALL_DIR}/mpeglib/util/yaf/yafcore
+)
diff --git a/mpeglib/example/yaf/yafcore/inputInterface.cpp b/mpeglib/example/yaf/yafcore/inputInterface.cpp
index 455ddd40..c5beaeda 100644
--- a/mpeglib/example/yaf/yafcore/inputInterface.cpp
+++ b/mpeglib/example/yaf/yafcore/inputInterface.cpp
@@ -75,7 +75,11 @@ int InputInterface::write(int fd,const char* txt) {
snprintf(loopback->getData(),300,
"Command:41 Msg:%s",txt);
} else {
+#if defined(HAVE_STRLCPY) || defined(HAVE_STRLCPY_PROTO)
strlcpy(loopback->getData(),txt, loopback->getSize());
+#else
+ strncpy(loopback->getData(),txt, loopback->getSize());
+#endif
}
len =loopback->len();
back=::write(fd,loopback->getData(),len);
@@ -136,7 +140,11 @@ void InputInterface::makeValidLine(char* line) {
"Command:%d Msg:%s",currentCommandNumber,line);
} else {
increaseCurrentCommandNumber();
+#if defined(HAVE_STRLCPY) || defined(HAVE_STRLCPY_PROTO)
strlcpy(currentLine->getData(),line, currentLine->getSize());
+#else
+ strncpy(currentLine->getData(),line, currentLine->getSize());
+#endif
}
return;