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

#include "Msg.h"
typedef Msg__Msg Files__Result;
#define Files__noLength -1
#define Files__noPosition -2
#define Files__done NULL
#define Files__invalidChannel 1
#define Files__writeError 2
#define Files__noRoom 3
#define Files__outOfRange 4
#define Files__readAfterEnd 5
#define Files__channelClosed 6
#define Files__readError 7
#define Files__invalidFormat 8
#define Files__noReadAccess 9
#define Files__noWriteAccess 10
#define Files__closeError 11
#define Files__noModTime 12
#define Files__noTmpName 13
#define Files__accessDenied 14
#define Files__isDirectory 15
#define Files__tooManyFiles 16
#define Files__noSuchFile 17
#define Files__directoryFull 18
#define Files__readOnlyFileSystem 19
#define Files__invalidTime 20
#define Files__notOwner 21
#define Files__anonymousFile 22
#define Files__dirWriteDenied 23
#define Files__fileError 24
#define Files__nameTooLong 25
#define Files__notDirectory 26
#define Files__linkLoop 27
#define Files__read 0
#define Files__write 1
#define Files__tryRead 2
#define Files__tryWrite 3
#include "PosixFileDescr.h"
#include "Channel.h"
typedef struct Files__FileDesc {
  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;
  struct Files__FileDesc* next;
  unsigned char* tmpName;
  unsigned char* name;
  unsigned char anonymous;
  char _57pad, _58pad, _59pad;
} Files__FileDesc;
typedef struct Files__FileDesc* Files__File;
typedef struct Files__ReaderDesc {
  Channel__Channel base;
  Msg__Msg res;
  int bytesRead;
  unsigned char positionable;
  char _13pad, _14pad, _15pad;
  int pos;
} Files__ReaderDesc;
typedef struct Files__ReaderDesc* Files__Reader;
typedef struct Files__WriterDesc {
  Channel__Channel base;
  Msg__Msg res;
  int bytesWritten;
  unsigned char positionable;
  char _13pad, _14pad, _15pad;
  int pos;
} Files__WriterDesc;
typedef struct Files__WriterDesc* Files__Writer;
typedef struct Files__ErrorContextDesc {
  Msg__StringPtr id;
} Files__ErrorContextDesc;
typedef struct Files__ErrorContextDesc* Files__ErrorContext;
extern Files__File Files__New(const unsigned char* file__ref, int file_0d, unsigned int flags, Msg__Msg *res);
extern Files__File Files__Old(const unsigned char* file__ref, int file_0d, unsigned int flags, Msg__Msg *res);
extern Files__File Files__Tmp(const unsigned char* file__ref, int file_0d, unsigned int flags, Msg__Msg *res);
#include "Time.h"
extern void Files__SetModTime(const unsigned char* file__ref, int file_0d, const Time__TimeStamp *mtime__ref, Msg__Msg *res);
extern void Files__GetModTime(const unsigned char* file__ref, int file_0d, Time__TimeStamp *mtime, _Type mtime__tag, Msg__Msg *res);
extern unsigned char Files__Exists(const unsigned char* file__ref, int file_0d);
#define _TBP_Files__ErrorContextDesc_GetTemplate void(*)(Files__ErrorContext context, Msg__Msg msg, Msg__LString templ, int templ_0d)
#define _TBN_Files__ErrorContextDesc_GetTemplate 0
extern void Files__ErrorContextDesc_GetTemplate(Files__ErrorContext context, Msg__Msg msg, Msg__LString templ, int templ_0d);
#define _TBP_Files__FileDesc_Register void(*)(Files__File f)
#define _TBN_Files__FileDesc_Register 7
extern void Files__FileDesc_Register(Files__File f);
#define _TBP_Files__FileDesc_NewReader Files__Reader(*)(Files__File f)
#define _TBN_Files__FileDesc_NewReader 2
extern Files__Reader Files__FileDesc_NewReader(Files__File f);
#define _TBP_Files__FileDesc_NewWriter Files__Writer(*)(Files__File f)
#define _TBN_Files__FileDesc_NewWriter 3
extern Files__Writer Files__FileDesc_NewWriter(Files__File f);
#define _TBP_Files__FileDesc_Close void(*)(Files__File f)
#define _TBN_Files__FileDesc_Close 5
extern void Files__FileDesc_Close(Files__File f);
#define _TBP_Files__WriterDesc_Truncate void(*)(Files__Writer w, int newLength)
#define _TBN_Files__WriterDesc_Truncate 5
extern void Files__WriterDesc_Truncate(Files__Writer w, int newLength);
extern struct _TD Files__FileDesc_td;
extern struct _TD Files__ReaderDesc_td;
extern struct _TD Files__WriterDesc_td;
extern struct _TD Files__ErrorContextDesc_td;
extern void Files_init(void);

#endif
