diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-17 00:32:19 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-17 00:32:19 +0000 |
commit | 0d382a262c0638d0f572fc37193ccc5ed3dc895f (patch) | |
tree | 8578dcddfce4191f3f7a142a37769df7add48475 /k9vamps/k9fifo.h | |
download | k9copy-0d382a262c0638d0f572fc37193ccc5ed3dc895f.tar.gz k9copy-0d382a262c0638d0f572fc37193ccc5ed3dc895f.zip |
Added old abandoned version of k9copy
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k9copy@1091546 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'k9vamps/k9fifo.h')
-rw-r--r-- | k9vamps/k9fifo.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/k9vamps/k9fifo.h b/k9vamps/k9fifo.h new file mode 100644 index 0000000..42fbbef --- /dev/null +++ b/k9vamps/k9fifo.h @@ -0,0 +1,39 @@ +// +// C++ Interface: k9fifo +// +// Description: +// +// +// Author: Jean-Michel PETIT <[email protected]>, (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9FIFO_H +#define K9FIFO_H + +#include "k9common.h" +#include <qmutex.h> +/** + @author Jean-Michel PETIT <[email protected]> +*/ + +#define INPUT_SIZE ( 0x2000*1024) + +class k9fifo { +private: + uint32_t head,queue; + uchar *array; + uint32_t m_count; + QMutex mutex; +public: + k9fifo () { head=queue=m_count=0;array= new uchar[INPUT_SIZE];}; + uint32_t count(); // { return (queue-head)%INPUT_SIZE ;} + uint32_t freespace() {return INPUT_SIZE-count();}; + void enqueue (uchar *_buffer, uint32_t _size) ; + void dequeue(uchar *_buffer,uint32_t _size) ; + void clear(); + ~k9fifo() { delete[] array;}; +}; + +#endif |