[ECOS] RE: IO Streams

RAMPARANY Fano FTRD/DIH/GRE fano.ramparany@rd.francetelecom.fr
Thu Apr 26 00:33:00 GMT 2001


Hi Andy,

I've developped a simple io stream module, with the
following API:

#define STREAMBUFSIZE 10000

typedef struct {
  unsigned char _buf[STREAMBUFSIZE];
  unsigned int _offset;
  unsigned int _top;
  short _init_p;
  cyg_sem_t _empty_semaphore;
  cyg_sem_t _full_semaphore;
  cyg_mutex_t _buf_mutex;
} streambufType;

void streambuf_init (streambufType *sb)
void streambuf_get (streambufType *sb, void *dest, int requested_size)
/* attempts to copy <size> items from <sb> into <dest> (waits if the sb is
empty) */
void streambuf_put (streambufType *sb, void *src, int requested_size)
/* attempts to copy <size> items from <src> into <sb> (waits if sb is full)
*/

If you're interested I can send you the file with
some examples on how to use it. Conversely, if such functionality
is available in eCos, I'll be happy to know. Up to now, I've been
suggested the message box facility, but it is mostly convenient for
accessing one item at a time.

Fano

-----Message d'origine-----
De : Andy Simpkins [ mailto:Andy.Simpkins@TardisMobile.com ]
Envoyé : lundi 23 avril 2001 18:45
À : Ecos-Discuss (E-mail)
Objet : IO Streams


Hi there,

Does anyone use libiostream with eCos?
If so what steps do I need to take to use it?

If not does eCos support IO streams and if so what do I need to use and what
files do I need to look at?

I don't fully understand the subject yet so please go gently with any reply!

Kind regards

Andy




More information about the Ecos-discuss mailing list