view intercom/cirbuf.h @ 3:c6c5a16ce2f2

compilation fixes
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Fri, 25 Jun 2010 09:59:25 +0200
parents 13be24d74cd2
children
line wrap: on
line source

/* 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 init();
  int push(char *from, int size);
  int pop(char *to, int size);
  int getlen() {
    return len;
  }
};

#define _CIRBUF_H
#endif

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