summaryrefslogtreecommitdiffstats
path: root/common.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-01-23 05:08:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-01-23 05:08:19 +0000
commitcb1387c92038634c063ee06a24e249b87525f519 (patch)
treeaeebf76566be407c42678fff1c2482ee9dc8fe17 /common.cc
parentReleasing debian version 0.23-3. (diff)
downloadtarlz-cb1387c92038634c063ee06a24e249b87525f519.tar.xz
tarlz-cb1387c92038634c063ee06a24e249b87525f519.zip
Merging upstream version 0.25.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'common.cc')
-rw-r--r--common.cc81
1 files changed, 1 insertions, 80 deletions
diff --git a/common.cc b/common.cc
index 444280d..b653e01 100644
--- a/common.cc
+++ b/common.cc
@@ -1,5 +1,5 @@
/* Tarlz - Archiver with multimember lzip compression
- Copyright (C) 2013-2022 Antonio Diaz Diaz.
+ Copyright (C) 2013-2024 Antonio Diaz Diaz.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,82 +19,9 @@
#include <cctype>
#include <cerrno>
-#include <cstdlib>
-#include <pthread.h>
#include <unistd.h>
#include "tarlz.h"
-#include "arg_parser.h"
-
-
-void xinit_mutex( pthread_mutex_t * const mutex )
- {
- const int errcode = pthread_mutex_init( mutex, 0 );
- if( errcode )
- { show_error( "pthread_mutex_init", errcode ); exit_fail_mt(); }
- }
-
-void xinit_cond( pthread_cond_t * const cond )
- {
- const int errcode = pthread_cond_init( cond, 0 );
- if( errcode )
- { show_error( "pthread_cond_init", errcode ); exit_fail_mt(); }
- }
-
-
-void xdestroy_mutex( pthread_mutex_t * const mutex )
- {
- const int errcode = pthread_mutex_destroy( mutex );
- if( errcode )
- { show_error( "pthread_mutex_destroy", errcode ); exit_fail_mt(); }
- }
-
-void xdestroy_cond( pthread_cond_t * const cond )
- {
- const int errcode = pthread_cond_destroy( cond );
- if( errcode )
- { show_error( "pthread_cond_destroy", errcode ); exit_fail_mt(); }
- }
-
-
-void xlock( pthread_mutex_t * const mutex )
- {
- const int errcode = pthread_mutex_lock( mutex );
- if( errcode )
- { show_error( "pthread_mutex_lock", errcode ); exit_fail_mt(); }
- }
-
-
-void xunlock( pthread_mutex_t * const mutex )
- {
- const int errcode = pthread_mutex_unlock( mutex );
- if( errcode )
- { show_error( "pthread_mutex_unlock", errcode ); exit_fail_mt(); }
- }
-
-
-void xwait( pthread_cond_t * const cond, pthread_mutex_t * const mutex )
- {
- const int errcode = pthread_cond_wait( cond, mutex );
- if( errcode )
- { show_error( "pthread_cond_wait", errcode ); exit_fail_mt(); }
- }
-
-
-void xsignal( pthread_cond_t * const cond )
- {
- const int errcode = pthread_cond_signal( cond );
- if( errcode )
- { show_error( "pthread_cond_signal", errcode ); exit_fail_mt(); }
- }
-
-
-void xbroadcast( pthread_cond_t * const cond )
- {
- const int errcode = pthread_cond_broadcast( cond );
- if( errcode )
- { show_error( "pthread_cond_broadcast", errcode ); exit_fail_mt(); }
- }
unsigned long long parse_octal( const uint8_t * const ptr, const int size )
@@ -143,9 +70,3 @@ int writeblock( const int fd, const uint8_t * const buf, const int size )
}
return sz;
}
-
-
-bool nonempty_arg( const Arg_parser & parser, const int i )
- {
- return ( parser.code( i ) == 0 && !parser.argument( i ).empty() );
- }