From 80dae2dab98eceab53c8c4f1def5a8b6293f6e68 Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Wed, 17 Aug 2011 12:23:27 +0200 Subject: [PATCH] MAKEFILE : Remove the Abstraction Layer (deprecated) --- Makefile | 5 +- Sources/tools/AL/AL_Mutex.cpp | 179 ---------------------------------- Sources/tools/AL/AL_Mutex.h | 45 --------- 3 files changed, 3 insertions(+), 226 deletions(-) delete mode 100644 Sources/tools/AL/AL_Mutex.cpp delete mode 100644 Sources/tools/AL/AL_Mutex.h diff --git a/Makefile b/Makefile index 092ef9b..0cc426a 100644 --- a/Makefile +++ b/Makefile @@ -155,8 +155,7 @@ CXXFILES+= tools/EdnTemplate/EdnVectorBuf.cpp \ # Tools internal: -CXXFILES+= tools/AL/AL_Mutex.cpp \ - tools/Display/Display.cpp \ +CXXFILES+= tools/Display/Display.cpp \ tools/ClipBoard/ClipBoard.cpp \ tools/MsgBroadcast/MsgBroadcast.cpp \ tools/MsgBroadcast/AccelKey.cpp \ @@ -296,6 +295,8 @@ install: .encadrer .versionFile $(OUTPUT_NAME_RELEASE) @echo $(F_VERT)" (data) data/* ==> /usr/share/edn/ "$(F_NORMALE) @mkdir -p /usr/share/edn/ @cp -vf data/*.xml /usr/share/edn/ + @mkdir -p /usr/share/edn/images/ + @cp -vf data/imagesSources/icone.png /usr/share/edn/images/ # http://alp.developpez.com/tutoriels/debian/creer-paquet/ diff --git a/Sources/tools/AL/AL_Mutex.cpp b/Sources/tools/AL/AL_Mutex.cpp deleted file mode 100644 index d476f27..0000000 --- a/Sources/tools/AL/AL_Mutex.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/** - ******************************************************************************* - * @file AL_Mutex.c - * @brief Editeur De N'ours : Abstraction Layer Mutex - * @author Edouard DUPIN - * @date 04/12/2010 - * @par Project - * Edn - * - * @par Copyright - * Copyright 2010 Edouard DUPIN, all right reserved - * - * This software is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY. - * - * Licence summary : - * You can modify and redistribute the sources code and binaries. - * You can send me the bug-fix - * You can not earn money with this Software (if the source extract from Edn - * represent less than 50% of original Sources) - * Term of the licence in in the file licence.txt. - * - ******************************************************************************* - */ - - -#include "tools_debug.h" -#include "AL_Mutex.h" -// /usr/include/pthread.h - - -/** - * @brief initialize the curent Mutex - * - * @param[in,out] pointerMutex Pointer on the mutex that might be init - * @param[in] recursive Enable the possibility that one thread can lock multiple time the same Mutex - * - * @return an standard Error Code (ERR_NONE / ERR_FAIL) - * - */ -erreurCode_te AL_mutex_init(AL_MUTEX * pointerMutex,bool recursive) -{ - int systemRet; - pthread_mutexattr_t mutexattr; - erreurCode_te myError= ERR_NONE; - EDN_CHECK_INOUT(pointerMutex); - // init mutex attributes - systemRet = pthread_mutexattr_init(&mutexattr); - if (0 == systemRet) { - if (true == recursive) { - systemRet = pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE_NP); - EDN_ASSERT(!systemRet, "pthread_mutexattr_settype Error"); - } - else { - systemRet = pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_ERRORCHECK_NP); - EDN_ASSERT(!systemRet, "pthread_mutexattr_settype Error"); - } - } - if (0 == systemRet) { - systemRet = pthread_mutex_init(pointerMutex, &mutexattr); - EDN_ASSERT(!systemRet, "pthread_mutex_init Error Mutex Init"); - if (systemRet) { - myError = ERR_FAIL; - } - } - systemRet = pthread_mutexattr_destroy(&mutexattr); - EDN_ASSERT(0 == systemRet, "pthread_mutexattr_destroy Error"); - return myError; -} - - -/** - * @brief Destroy the current Mutex - * - * @param[in,out] pointerMutex Pointer on the mutex that might be init - * - * @return an standard Error Code (ERR_NONE / ERR_FAIL) - * - */ -erreurCode_te AL_mutex_destroy(AL_MUTEX * pointerMutex) -{ - int systemRet; - EDN_CHECK_INOUT(pointerMutex); - systemRet = pthread_mutex_destroy(pointerMutex); - EDN_ASSERT(!systemRet, "pthread_mutex_destroy Error Mutex Destroy"); - if (systemRet) { - return ERR_FAIL; - } - return ERR_NONE; -} - - -/** - * @brief Lock the curent Mutex. Lock call - * - * @param[in,out] pointerMutex Pointer on the mutex that might be init - * - * @return --- - * - */ -void AL_mutex_lock(AL_MUTEX * pointerMutex) -{ - int systemRet; - EDN_CHECK_INOUT(pointerMutex); - systemRet = pthread_mutex_lock(pointerMutex); - EDN_ASSERT(!systemRet, "pthread_mutex_lock Error Mutex lock"); -} - - -/** - * @brief Unlock the current Mutex - * - * @param[in,out] pointerMutex Pointer on the mutex that might be init - * - * @return --- - * - */ -void AL_mutex_unlock(AL_MUTEX * pointerMutex) -{ - int systemRet; - EDN_CHECK_INOUT(pointerMutex); - systemRet = pthread_mutex_unlock(pointerMutex); - EDN_ASSERT(!systemRet, "pthread_mutex_unlock Error Mutex unlock"); -} - - -/** - * @brief Try the lock of the curent Mutex - * - * @param[in,out] pointerMutex Pointer on the mutex that might be init - * - * @return an standard Error Code (ERR_NONE / ERR_BUSY) - * - */ -erreurCode_te AL_mutex_trylock(AL_MUTEX * pointerMutex) -{ - int systemRet; - EDN_CHECK_INOUT(pointerMutex); - systemRet = pthread_mutex_trylock(pointerMutex); - EDN_ASSERT(0==systemRet || EBUSY==systemRet, "pthread_mutex_trylock Error Mutex unlock"); - if (EBUSY==systemRet) { - return ERR_BUSY; - } - return ERR_NONE; -} - - -/** - * @brief try lock in a periode of time - * - * @param[in,out] pointerMutex Pointer on the mutex that might be init - * - * @return an standard Error Code (ERR_NONE / ERR_TIMEOUT) - * - */ -erreurCode_te AL_mutex_timedlock(AL_MUTEX * pointerMutex, int32_t delay) -{ -/* - int systemRet; - EDN_CHECK_INOUT(pointerMutex); - if (0 == delay) { - return ERR_NONE; - } - // TODO ... check is it OK... - systemRet = pthread_mutex_timedlock(pointerMutex, delay); - EDN_ASSERT(0 == systemRet || ETIMEDOUT == systemRet, "pthread_mutex_timedlock Error"); - if (ETIMEDOUT == systemRet) { - return ERR_TIMEOUT; - } -*/ - return ERR_NONE; -} - - - - - - - diff --git a/Sources/tools/AL/AL_Mutex.h b/Sources/tools/AL/AL_Mutex.h deleted file mode 100644 index e6ac8a9..0000000 --- a/Sources/tools/AL/AL_Mutex.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - ******************************************************************************* - * @file AL_Mutex.h - * @brief Editeur De N'ours : Abstraction Layer Mutex - * @author Edouard DUPIN - * @date 04/12/2010 - * @par Project - * Edn - * - * @par Copyright - * Copyright 2010 Edouard DUPIN, all right reserved - * - * This software is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY. - * - * Licence summary : - * You can modify and redistribute the sources code and binaries. - * You can send me the bug-fix - * You can not earn money with this Software (if the source extract from Edn - * represent less than 50% of original Sources) - * Term of the licence in in the file licence.txt. - * - ******************************************************************************* - */ - -#ifndef __AL_MUTEX_H__ -#define __AL_MUTEX_H__ - -//basic mutex with pthread system -#include -#include - - -typedef pthread_mutex_t AL_MUTEX; - -erreurCode_te AL_mutex_init(AL_MUTEX * pointerMutex,bool recursive); -erreurCode_te AL_mutex_destroy(AL_MUTEX * pointerMutex); -void AL_mutex_lock(AL_MUTEX * pointerMutex); -void AL_mutex_unlock(AL_MUTEX * pointerMutex); -erreurCode_te AL_mutex_trylock(AL_MUTEX * pointerMutex); -//erreurCode_te AL_mutex_timedlock(AL_MUTEX * pointerMutex, int32_t delay); - -#endif - -