2011-03-08 22:34:44 +01:00
|
|
|
/*
|
2015-03-08 00:10:38 +01:00
|
|
|
Copyright (C) 2006-2015 Con Kolivas
|
2011-03-08 22:34:44 +01:00
|
|
|
Copyright (C) 2011 Peter Hyman
|
|
|
|
|
Copyright (C) 1998-2003 Andrew Tridgell
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef LRZIP_STREAM_H
|
|
|
|
|
#define LRZIP_STREAM_H
|
|
|
|
|
|
|
|
|
|
#include "lrzip_private.h"
|
|
|
|
|
#include <pthread.h>
|
|
|
|
|
|
2012-03-11 01:49:40 +01:00
|
|
|
bool create_pthread(rzip_control *control, pthread_t *thread, pthread_attr_t * attr,
|
2011-03-08 22:34:44 +01:00
|
|
|
void * (*start_routine)(void *), void *arg);
|
2011-08-12 08:43:42 +02:00
|
|
|
bool join_pthread(pthread_t th, void **thread_return);
|
2012-03-11 01:49:40 +01:00
|
|
|
bool init_mutex(rzip_control *control, pthread_mutex_t *mutex);
|
|
|
|
|
bool unlock_mutex(rzip_control *control, pthread_mutex_t *mutex);
|
|
|
|
|
bool lock_mutex(rzip_control *control, pthread_mutex_t *mutex);
|
2011-03-14 01:15:35 +01:00
|
|
|
ssize_t write_1g(rzip_control *control, void *buf, i64 len);
|
2011-03-14 10:22:45 +01:00
|
|
|
ssize_t read_1g(rzip_control *control, int fd, void *buf, i64 len);
|
2011-09-14 03:33:40 +02:00
|
|
|
i64 get_readseek(rzip_control *control, int fd);
|
2011-09-16 15:06:17 +02:00
|
|
|
bool prepare_streamout_threads(rzip_control *control);
|
|
|
|
|
bool close_streamout_threads(rzip_control *control);
|
2011-03-08 22:34:44 +01:00
|
|
|
void *open_stream_out(rzip_control *control, int f, unsigned int n, i64 chunk_limit, char cbytes);
|
2011-03-18 13:18:36 +01:00
|
|
|
void *open_stream_in(rzip_control *control, int f, int n, char cbytes);
|
2015-03-09 23:46:35 +01:00
|
|
|
void flush_buffer(rzip_control *control, struct stream_info *sinfo, int stream);
|
|
|
|
|
void write_stream(rzip_control *control, void *ss, int streamno, uchar *p, i64 len);
|
2011-03-10 22:35:15 +01:00
|
|
|
i64 read_stream(rzip_control *control, void *ss, int streamno, uchar *p, i64 len);
|
2011-03-08 22:34:44 +01:00
|
|
|
int close_stream_out(rzip_control *control, void *ss);
|
2011-09-14 17:45:10 +02:00
|
|
|
int close_stream_in(rzip_control *control, void *ss);
|
2011-03-18 00:37:09 +01:00
|
|
|
ssize_t put_fdout(rzip_control *control, void *offset_buf, ssize_t ret);
|
2011-03-08 22:34:44 +01:00
|
|
|
|
|
|
|
|
#endif
|