From df1c80ee79cb7f85f2593c09e433193396dd0036 Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Thu, 22 Nov 2007 11:29:13 +0000 Subject: [PATCH] Made cfs implementation adhere to (new) cfs interface. --- core/cfs/cfs-eeprom.c | 12 +++++------- core/cfs/cfs-ram.c | 15 +++++++-------- core/cfs/cfs-xmem.c | 12 +++++------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/core/cfs/cfs-eeprom.c b/core/cfs/cfs-eeprom.c index 77e1ecb71..be3cc7675 100644 --- a/core/cfs/cfs-eeprom.c +++ b/core/cfs/cfs-eeprom.c @@ -30,9 +30,8 @@ * * Author: Adam Dunkels * - * $Id: cfs-eeprom.c,v 1.3 2007/11/17 18:01:00 adamdunkels Exp $ + * $Id: cfs-eeprom.c,v 1.4 2007/11/22 11:29:13 oliverschmidt Exp $ */ -#include "contiki.h" #include "cfs/cfs.h" #include "dev/eeprom.h" @@ -95,7 +94,7 @@ cfs_write(int f, void *buf, unsigned int len) } } /*---------------------------------------------------------------------------*/ -int +unsigned int cfs_seek(int f, unsigned int o) { if(f == 1) { @@ -109,18 +108,17 @@ cfs_seek(int f, unsigned int o) int cfs_opendir(struct cfs_dir *p, const char *n) { - return 1; + return -1; } /*---------------------------------------------------------------------------*/ int cfs_readdir(struct cfs_dir *p, struct cfs_dirent *e) { - return 1; + return -1; } /*---------------------------------------------------------------------------*/ -int +void cfs_closedir(struct cfs_dir *p) { - return 1; } /*---------------------------------------------------------------------------*/ diff --git a/core/cfs/cfs-ram.c b/core/cfs/cfs-ram.c index 2c029732f..6d14bff1f 100644 --- a/core/cfs/cfs-ram.c +++ b/core/cfs/cfs-ram.c @@ -30,12 +30,12 @@ * * Author: Adam Dunkels * - * $Id: cfs-ram.c,v 1.4 2007/11/17 18:01:00 adamdunkels Exp $ + * $Id: cfs-ram.c,v 1.5 2007/11/22 11:29:13 oliverschmidt Exp $ */ -#include "contiki.h" + +#include #include "cfs/cfs.h" -#include struct filestate { int flag; @@ -120,7 +120,7 @@ cfs_write(int f, void *buf, unsigned int len) } } /*---------------------------------------------------------------------------*/ -int +unsigned int cfs_seek(int f, unsigned int o) { if(f == 1) { @@ -137,18 +137,17 @@ cfs_seek(int f, unsigned int o) int cfs_opendir(struct cfs_dir *p, const char *n) { - return 1; + return -1; } /*---------------------------------------------------------------------------*/ int cfs_readdir(struct cfs_dir *p, struct cfs_dirent *e) { - return 1; + return -1; } /*---------------------------------------------------------------------------*/ -int +void cfs_closedir(struct cfs_dir *p) { - return 1; } /*---------------------------------------------------------------------------*/ diff --git a/core/cfs/cfs-xmem.c b/core/cfs/cfs-xmem.c index 9b01d128b..d2216187d 100644 --- a/core/cfs/cfs-xmem.c +++ b/core/cfs/cfs-xmem.c @@ -30,9 +30,8 @@ * * Author: Adam Dunkels * - * $Id: cfs-xmem.c,v 1.5 2007/11/17 18:01:00 adamdunkels Exp $ + * $Id: cfs-xmem.c,v 1.6 2007/11/22 11:29:13 oliverschmidt Exp $ */ -#include "contiki.h" #include "cfs/cfs.h" #include "dev/xmem.h" @@ -127,7 +126,7 @@ cfs_write(int f, void *buf, unsigned int len) } } /*---------------------------------------------------------------------------*/ -int +unsigned int cfs_seek(int f, unsigned int o) { if(f == 1) { @@ -144,18 +143,17 @@ cfs_seek(int f, unsigned int o) int cfs_opendir(struct cfs_dir *p, const char *n) { - return 1; + return -1; } /*---------------------------------------------------------------------------*/ int cfs_readdir(struct cfs_dir *p, struct cfs_dirent *e) { - return 1; + return -1; } /*---------------------------------------------------------------------------*/ -int +void cfs_closedir(struct cfs_dir *p) { - return 1; } /*---------------------------------------------------------------------------*/