/* file generated by oo2c -- do not edit */
#ifndef _MODULE_PosixFileDescr_
#define _MODULE_PosixFileDescr_

#include "Msg.h"
typedef Msg__Msg PosixFileDescr__Result;
#define PosixFileDescr__noLength -1
#define PosixFileDescr__noPosition -2
#define PosixFileDescr__done NULL
#define PosixFileDescr__invalidChannel 1
#define PosixFileDescr__writeError 2
#define PosixFileDescr__noRoom 3
#define PosixFileDescr__outOfRange 4
#define PosixFileDescr__readAfterEnd 5
#define PosixFileDescr__channelClosed 6
#define PosixFileDescr__readError 7
#define PosixFileDescr__invalidFormat 8
#define PosixFileDescr__noReadAccess 9
#define PosixFileDescr__noWriteAccess 10
#define PosixFileDescr__closeError 11
#define PosixFileDescr__noModTime 12
#define PosixFileDescr__noTmpName 13
#define PosixFileDescr__freeErrorCode 14
#define PosixFileDescr__readOnly 0
#define PosixFileDescr__writeOnly 1
#define PosixFileDescr__readWrite 2
#define PosixFileDescr__stdinFileno 0
#define PosixFileDescr__stdoutFileno 1
#define PosixFileDescr__stderrFileno 2
#define PosixFileDescr__noBuffer 0
#define PosixFileDescr__lineBuffer 1
#define PosixFileDescr__blockBuffer 2
#include "Channel.h"
typedef struct PosixFileDescr__ReaderDesc {
  Channel__Channel base;
  Msg__Msg res;
  int bytesRead;
  unsigned char positionable;
  char _13pad, _14pad, _15pad;
  int pos;
} PosixFileDescr__ReaderDesc;
typedef struct PosixFileDescr__ReaderDesc* PosixFileDescr__Reader;
typedef struct PosixFileDescr__WriterDesc {
  Channel__Channel base;
  Msg__Msg res;
  int bytesWritten;
  unsigned char positionable;
  char _13pad, _14pad, _15pad;
  int pos;
} PosixFileDescr__WriterDesc;
typedef struct PosixFileDescr__WriterDesc* PosixFileDescr__Writer;
typedef struct PosixFileDescr__ChannelDesc {
  Msg__Msg res;
  unsigned char readable;
  unsigned char writable;
  unsigned char open;
  char _7pad;
  int fd;
  int pos;
  unsigned char positionable;
  unsigned char append;
  unsigned char dirty;
  signed char buffering;
  unsigned char* buf;
  int sizeBuffer;
  int bufStart;
  int bufEnd;
  PosixFileDescr__Reader reader;
  PosixFileDescr__Writer writer;
} PosixFileDescr__ChannelDesc;
typedef struct PosixFileDescr__ChannelDesc* PosixFileDescr__Channel;
extern int _program_argc;
#include "C.h"
extern C__charPtr2d _program_argv;
typedef struct PosixFileDescr__ErrorContextDesc {
  Msg__StringPtr id;
} PosixFileDescr__ErrorContextDesc;
extern void PosixFileDescr__InitReader(PosixFileDescr__Reader r, PosixFileDescr__Channel ch);
extern void PosixFileDescr__InitWriter(PosixFileDescr__Writer w, PosixFileDescr__Channel ch);
extern void PosixFileDescr__Init(PosixFileDescr__Channel ch, int fd, signed char mode);
extern void PosixFileDescr__Truncate(PosixFileDescr__Writer w, int newLength);
typedef struct PosixFileDescr__ErrorContextDesc* PosixFileDescr__ErrorContext;
#define _TBP_PosixFileDescr__ErrorContextDesc_GetTemplate void(*)(PosixFileDescr__ErrorContext context, Msg__Msg msg, Msg__LString templ, int templ_0d)
#define _TBN_PosixFileDescr__ErrorContextDesc_GetTemplate 0
extern void PosixFileDescr__ErrorContextDesc_GetTemplate(PosixFileDescr__ErrorContext context, Msg__Msg msg, Msg__LString templ, int templ_0d);
#define _TBP_PosixFileDescr__ReaderDesc_Pos int(*)(PosixFileDescr__Reader r)
#define _TBN_PosixFileDescr__ReaderDesc_Pos 0
extern int PosixFileDescr__ReaderDesc_Pos(PosixFileDescr__Reader r);
#define _TBP_PosixFileDescr__ReaderDesc_Available int(*)(PosixFileDescr__Reader r)
#define _TBN_PosixFileDescr__ReaderDesc_Available 1
extern int PosixFileDescr__ReaderDesc_Available(PosixFileDescr__Reader r);
#define _TBP_PosixFileDescr__ReaderDesc_SetPos void(*)(PosixFileDescr__Reader r, int newPos)
#define _TBN_PosixFileDescr__ReaderDesc_SetPos 2
extern void PosixFileDescr__ReaderDesc_SetPos(PosixFileDescr__Reader r, int newPos);
#define _TBP_PosixFileDescr__ReaderDesc_ReadByte void(*)(PosixFileDescr__Reader r, unsigned char *x)
#define _TBN_PosixFileDescr__ReaderDesc_ReadByte 3
extern void PosixFileDescr__ReaderDesc_ReadByte(PosixFileDescr__Reader r, unsigned char *x);
#define _TBP_PosixFileDescr__ReaderDesc_ReadBytes void(*)(PosixFileDescr__Reader r, unsigned char* x, int x_0d, int start, int n)
#define _TBN_PosixFileDescr__ReaderDesc_ReadBytes 4
extern void PosixFileDescr__ReaderDesc_ReadBytes(PosixFileDescr__Reader r, unsigned char* x, int x_0d, int start, int n);
#define _TBP_PosixFileDescr__WriterDesc_Pos int(*)(PosixFileDescr__Writer w)
#define _TBN_PosixFileDescr__WriterDesc_Pos 0
extern int PosixFileDescr__WriterDesc_Pos(PosixFileDescr__Writer w);
#define _TBP_PosixFileDescr__WriterDesc_SetPos void(*)(PosixFileDescr__Writer w, int newPos)
#define _TBN_PosixFileDescr__WriterDesc_SetPos 1
extern void PosixFileDescr__WriterDesc_SetPos(PosixFileDescr__Writer w, int newPos);
#define _TBP_PosixFileDescr__WriterDesc_WriteByte void(*)(PosixFileDescr__Writer w, unsigned char x)
#define _TBN_PosixFileDescr__WriterDesc_WriteByte 2
extern void PosixFileDescr__WriterDesc_WriteByte(PosixFileDescr__Writer w, unsigned char x);
#define _TBP_PosixFileDescr__WriterDesc_WriteBytes void(*)(PosixFileDescr__Writer w, unsigned char* x, int x_0d, int start, int n)
#define _TBN_PosixFileDescr__WriterDesc_WriteBytes 3
extern void PosixFileDescr__WriterDesc_WriteBytes(PosixFileDescr__Writer w, unsigned char* x, int x_0d, int start, int n);
#define _TBP_PosixFileDescr__ChannelDesc_Length int(*)(PosixFileDescr__Channel ch)
#define _TBN_PosixFileDescr__ChannelDesc_Length 0
extern int PosixFileDescr__ChannelDesc_Length(PosixFileDescr__Channel ch);
#include "Time.h"
#define _TBP_PosixFileDescr__ChannelDesc_GetModTime void(*)(PosixFileDescr__Channel ch, Time__TimeStamp *mtime, _Type mtime__tag)
#define _TBN_PosixFileDescr__ChannelDesc_GetModTime 1
extern void PosixFileDescr__ChannelDesc_GetModTime(PosixFileDescr__Channel ch, Time__TimeStamp *mtime, _Type mtime__tag);
#define _TBP_PosixFileDescr__ChannelDesc_NewReader PosixFileDescr__Reader(*)(PosixFileDescr__Channel ch)
#define _TBN_PosixFileDescr__ChannelDesc_NewReader 2
extern PosixFileDescr__Reader PosixFileDescr__ChannelDesc_NewReader(PosixFileDescr__Channel ch);
#define _TBP_PosixFileDescr__ChannelDesc_NewWriter PosixFileDescr__Writer(*)(PosixFileDescr__Channel ch)
#define _TBN_PosixFileDescr__ChannelDesc_NewWriter 3
extern PosixFileDescr__Writer PosixFileDescr__ChannelDesc_NewWriter(PosixFileDescr__Channel ch);
#define _TBP_PosixFileDescr__ChannelDesc_Flush void(*)(PosixFileDescr__Channel ch)
#define _TBN_PosixFileDescr__ChannelDesc_Flush 4
extern void PosixFileDescr__ChannelDesc_Flush(PosixFileDescr__Channel ch);
#define _TBP_PosixFileDescr__ChannelDesc_Close void(*)(PosixFileDescr__Channel ch)
#define _TBN_PosixFileDescr__ChannelDesc_Close 5
extern void PosixFileDescr__ChannelDesc_Close(PosixFileDescr__Channel ch);
extern struct _TD PosixFileDescr__ChannelDesc_td;
extern struct _TD PosixFileDescr__ReaderDesc_td;
extern struct _TD PosixFileDescr__WriterDesc_td;
extern struct _TD PosixFileDescr__ErrorContextDesc_td;
extern void PosixFileDescr_init(void);

#endif
