Remove stale declarations (moved to monitor.h).
[bertos.git] / kern / file.h
1 /*!
2  * \file
3  * <!--
4  * Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
5  * Copyright 1999,2001,2003 Bernardo Innocenti <bernie@develer.com>
6  * This file is part of DevLib - See devlib/README for information.
7  * -->
8  *
9  * \brief Interface to KFile virtual class
10  *
11  * \version $Id$
12  *
13  * \author Bernardo Innocenti <bernie@develer.com>
14  */
15
16 /*#*
17  *#* $Log$
18  *#* Revision 1.4  2004/08/25 14:12:09  rasky
19  *#* Aggiornato il comment block dei log RCS
20  *#*
21  *#* Revision 1.3  2004/06/06 15:11:38  bernie
22  *#* Doxygenize.
23  *#*
24  *#* Revision 1.2  2004/06/03 11:27:09  bernie
25  *#* Add dual-license information.
26  *#*
27  *#* Revision 1.1  2004/05/23 17:27:00  bernie
28  *#* Import kern/ subdirectory.
29  *#*/
30 #ifndef KERN_KFILE_H
31 #define KERN_KFILE_H
32
33 #ifndef COMPILER_H
34 #include <compiler.h>
35 #endif
36
37 struct _KFile;
38
39 typedef size_t  (*ReadFunc_t)   (struct _KFile *fd, char *buf, size_t size);
40 typedef size_t  (*WriteFunc_t)  (struct _KFile *fd, const char *buf, size_t size);
41 typedef bool    (*SeekFunc_t)   (struct _KFile *fd, int32_t offset);
42 typedef bool    (*CloseFunc_t)  (struct _KFile *fd);
43 typedef bool    (*OpenFunc_t)   (struct _KFile *fd, const char *name, int mode);
44
45
46 /*!
47  * Context data for callback functions which operate on
48  * pseudo files.
49  */
50 typedef struct _KFile
51 {
52         ReadFunc_t              Read;
53         WriteFunc_t             Write;
54         SeekFunc_t              Seek;
55 /*      OpenFunc_t              Open;   unused */
56         CloseFunc_t             Close;
57
58         /* NOTE: these must _NOT_ be size_t on 16bit CPUs! */
59         uint32_t                SeekPos;
60         uint32_t                Size;
61 } KFile;
62
63
64 #endif /* KERN_KFILE_H */