diff intercom/cirbuf.h @ 2:13be24d74cd2

import intercom-0.4.1
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Fri, 25 Jun 2010 09:57:52 +0200
parents
children c6c5a16ce2f2
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/intercom/cirbuf.h	Fri Jun 25 09:57:52 2010 +0200
@@ -0,0 +1,34 @@
+/* cirbuf.h
+ *
+ * Copyright (C) DFS Deutsche Flugsicherung (2004, 2005). 
+ * All Rights Reserved.
+ *
+ * Circular Buffers
+ *
+ * Version 0.2
+ */
+#ifndef _CIRBUF_H
+
+// must be multiple of FRAGSIZE and FRAMESIZE
+#define CIRBUFSIZE	(WIDEB*2*80*8*2)  
+
+/* circular buffer for FRAGSIZE to FRAMESIZE conversion with 
+ * overrun/underrun */
+class CIRBUF {
+  char buf[CIRBUFSIZE];         // must be multiple of FRAGSIZE and FRAMESIZE
+  int in;
+  int out;
+  int len;
+
+public:
+   CIRBUF();
+  void CIRBUF::init();
+  int CIRBUF::push(char *from, int size);
+  int CIRBUF::pop(char *to, int size);
+  int getlen() {
+    return len;
+  }
+};
+
+#define _CIRBUF_H
+#endif

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.