Added file queue handling
This commit is contained in:
@ -83,25 +83,6 @@ static inline void print_error(const char * str, ...) {
|
||||
free(p);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Controlla se la stringa passata come primo argomento e' un numero.
|
||||
* \return 0 ok 1 non e' un numbero 2 overflow/underflow
|
||||
*/
|
||||
static inline int isNumber(const char* s, long* n) {
|
||||
if (s==NULL) return 1;
|
||||
if (strlen(s)==0) return 1;
|
||||
char* e = NULL;
|
||||
errno=0;
|
||||
long val = strtol(s, &e, 10);
|
||||
if (errno == ERANGE) return 2; // overflow/underflow
|
||||
if (e != NULL && *e == (char)0) {
|
||||
*n = val;
|
||||
return 0; // successo
|
||||
}
|
||||
return 1; // non e' un numero
|
||||
}
|
||||
|
||||
#define LOCK(l) if (pthread_mutex_lock(l)!=0) { \
|
||||
fprintf(stderr, "ERRORE FATALE lock\n"); \
|
||||
pthread_exit((void*)EXIT_FAILURE); \
|
||||
|
||||
Reference in New Issue
Block a user