From cb1387c92038634c063ee06a24e249b87525f519 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 23 Jan 2024 06:08:19 +0100 Subject: Merging upstream version 0.25. Signed-off-by: Daniel Baumann --- common.cc | 81 +-------------------------------------------------------------- 1 file changed, 1 insertion(+), 80 deletions(-) (limited to 'common.cc') 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 #include -#include -#include #include #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() ); - } -- cgit v1.2.3