Usermode/libaxwin4 - Handle demarshal failure
[tpg/acess2.git] / Tools / nativelib / dummy_iocache.c
1 /*
2  * Acess2 Kernel
3  * - By thePowersGang (John Hodge)
4  * 
5  * dummy_iocache.c
6  * - Dummied-out Block IO Caching
7  */
8 #define DEBUG   0
9 #include <acess.h>
10 #include <iocache.h>
11
12 struct sIOCache
13 {
14         tIOCache_WriteCallback  Write;
15         void    *ID;
16 };
17
18 // === CODE ===
19 tIOCache *IOCache_Create( tIOCache_WriteCallback Write, void *ID, int SectorSize, int CacheSize )
20 {
21         tIOCache *ret = malloc(sizeof(tIOCache));
22         ret->Write = Write;
23         ret->ID = ID;
24         return ret;
25 }
26 int IOCache_Read( tIOCache *Cache, Uint64 Sector, void *Buffer )
27 {
28         return 0;
29 }
30 int IOCache_Add( tIOCache *Cache, Uint64 Sector, const void *Buffer )
31 {
32         return 1;
33 }
34 int IOCache_Write( tIOCache *Cache, Uint64 Sector, const void *Buffer )
35 {
36         #ifndef DISABLE_WRITE
37         Cache->Write(Cache->ID, Sector, Buffer);
38         #endif
39         return 1;
40 }
41 void IOCache_Flush( tIOCache *Cache )
42 {
43 }
44 void IOCache_Destroy( tIOCache *Cache )
45 {
46         free(Cache);
47 }
48

UCC git Repository :: git.ucc.asn.au