/* 
 * Thomas Pantzer: t_ringbuf.h, v0.1b  6.8.99 16:10 
 * 
 * 
 * Copyright 1999 by Thomas Pantzer
 * 
 * Permission to use, copy, modify, and distribute this software for noncommercial 
 * use and without fee is hereby granted, provided that the above copyright notice 
 * appear in all copies and that both that copyright notice and this permission 
 * notice appear in supporting documentation, and that the name of the Author not be 
 * used in advertising or publicity pertaining to distribution of the software 
 * without specific, written prior permission. The Author makes no representations about
 * the suitability of this software for any purpose.  It is provided "as is" 
 * without expressed or implied warranty. 
 * 
 * 
 * pantec@zorro.informatik.uni-leipzig.de   (Thomas Pantzer) 
 * 
 */





#ifndef T_RINGBUF_H
#define T_RINGBUF_H




class t_ringbuf {
public:
	void Init(int s);
	void Done(void);

	char Get_c(void);
	char Get_c(int past);

	void Put_c(char c);

	

	void CopyFrom(char *S, int count);
	int PasteTo(char *S, int count);

	int ReadFrom(int fd, int count);
	int WriteTo(int fd, int count);



	char *GetString(int pos);
	
	void Advance(int l);

	char *A;
private:
	int w_ptr,r_ptr,size,last_rptr;
};




#ifdef T_RINGBUF_G
	#define m_extern
#else
	#define m_extern extern
#endif





#undef m_extern
#endif
