Commit 6f6c5431 authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Improvement of messges

parent 17b30f93
BLC core
========
Copyright : [ETIS](http://www.etis.ensea.fr/neurocyber) - ENSEA, University of Cergy-Pontoise, CNRS (2011-2016)
Author : [Arnaud Blanchard](http://arnaudblanchard.thoughtsheet.com)
Licence : [CeCILL v2.1](http://www.cecill.info/licences/Licence_CeCILL_V2-en.html)
- Copyright : [ETIS](http://www.etis.ensea.fr/neurocyber) - ENSEA, University of Cergy-Pontoise, CNRS (2011-2016)
- Author : [Arnaud Blanchard](http://arnaudblanchard.thoughtsheet.com)
- Licence : [CeCILL v2.1](http://www.cecill.info/licences/Licence_CeCILL_V2-en.html)
Core of Basic Libraries for C/C++
---------------------------------
It is composed of three modules (need a POSIX system), for Linux and OSX.
Core functions used by almost all the projects of [BLAAR](https://framagit.org/blaar)
- **blc_text** manage ASCII terminals (colors, cursor, sizes)
- **blc_tools** macros and functions to simplify coding and memory management
- **blc_mem** a memory structure (data pointer and size) essentially to manage dynamic memory buffers
See [online user documentation](https://framagit.org/blaar/blc_core/wikis/home) or download it:
` git submodule update doc`
Building
--------
You need git, g++, cmake and doxygen for the documentation:
- Ubuntu: `sudo apt-get install git g++ cmake doxygen`
- OSX with [homebrew](http://brew.sh): `brew install git g++ cmake doxygen`
You can copy past the following code.
git clone https://framagit.org/blaar/blc_core.git
cd blc_core
mkdir build
cd build
cmake ..
make
The created librairy `libblc_core.{so|dylib}` and `libblc_core.a` will be in `build/`
You can create a debian package (.deb) with:
make package
Documentation
-------------
The [documentation](build/doc/html/index.html) is in `build/doc/{html|latex}` (the library need to be compiled before).
......@@ -27,7 +27,7 @@ Few functions helping for pseudo realtime applications.
#define EXIT_ON_PTHREAD_ERROR(pthread_error_id, ...) fatal_pthread_error(__FILE__, __FUNCTION__, __LINE__, pthread_error_id, NULL, __VA_ARGS__)
///Stop on pthread error and display the error message. Error is an int you need to give to the macro.
///Stop on pthread error and display the error message. Error is any int variable you need to provide to the macro.
#define PTHREAD_CHECK(command, error_variable, ...) do{if (((error_variable)=(command))) fatal_pthread_error(__FILE__, __FUNCTION__, __LINE__, error_variable, STRINGIFY(command), __VA_ARGS__);}while(0)
START_EXTERN_C
......
......@@ -36,7 +36,7 @@ void fatal_pthread_error(const char *name_of_file, const char* name_of_function,
if (command) fprintf(stderr, "Executing: %s\n", command);
color_fprintf(BLC_BRIGHT_RED, stderr, "Pthread error:");
switch (error_id){
case EPERM:pthread_message="EPERM: Operation not permited. You may try to change a statu of mutex you already have (i.e. lock a locked or unlock an unlocked one)"; break;
case EPERM:pthread_message="EPERM: Operation not permited. You may try to change a statu of mutex in which you already are (i.e. lock a locked or unlock an unlocked one) or you unlock a mutex you do not hold."; break;
case EINVAL: pthread_message="EINVAL: The arguments are invalid.";break;
case EDEADLK: pthread_message="EDEADLK: A deadlock would occur if the thread blocked waiting for mutex.";break;
case ENOMEM: pthread_message="ENOMEM: Out of memory."; break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment