diff options
Diffstat (limited to 'mpeglib/example/yaf/yafcore')
-rw-r--r-- | mpeglib/example/yaf/yafcore/CMakeLists.txt | 55 | ||||
-rw-r--r-- | mpeglib/example/yaf/yafcore/inputInterface.cpp | 8 |
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; |