diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-21 06:58:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-21 06:58:44 +0000 |
commit | dbbdc02b322480ee799107d2cfa317533008e6c8 (patch) | |
tree | a22c11b459ba27df42ea3427d8b48f7873110104 /common.cc | |
parent | Adding upstream version 0.23. (diff) | |
download | tarlz-dbbdc02b322480ee799107d2cfa317533008e6c8.tar.xz tarlz-dbbdc02b322480ee799107d2cfa317533008e6c8.zip |
Adding upstream version 0.24.upstream/0.24
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | common.cc | 81 |
1 files changed, 1 insertions, 80 deletions
@@ -1,5 +1,5 @@ /* Tarlz - Archiver with multimember lzip compression - Copyright (C) 2013-2022 Antonio Diaz Diaz. + Copyright (C) 2013-2023 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() ); - } |