diff --git a/src/include/string.h b/src/include/string.h index 222c58d..caf4180 100644 --- a/src/include/string.h +++ b/src/include/string.h @@ -27,7 +27,7 @@ #include #include -extern char * strcpy(char *, const char *); + extern void * memcpy(void *, const void *, size_t); extern void * memset(void *, int, size_t); extern int memcmp(const void *, const void *, size_t); diff --git a/src/sys/include/lib/string.h b/src/sys/include/lib/string.h index 861a887..aaddbc5 100644 --- a/src/sys/include/lib/string.h +++ b/src/sys/include/lib/string.h @@ -36,6 +36,7 @@ extern "C" { #endif +char * strcpy(char *, const char *); int strcmp(const char *str1,const char *str2); int strncmp(const char * a, const char * b, size_t c); void *memcpy(const void *dst, const void * src, size_t length); @@ -57,6 +58,9 @@ /*** $Log$ + Revision 1.4 2004/07/06 23:26:12 reddawg + Fixed A Compilation Error + Revision 1.3 2004/06/28 23:12:58 reddawg file format now container:/path/to/file diff --git a/src/sys/include/ubixfs/dirCache.h b/src/sys/include/ubixfs/dirCache.h index d4ff114..3583b9b 100644 --- a/src/sys/include/ubixfs/dirCache.h +++ b/src/sys/include/ubixfs/dirCache.h @@ -15,4 +15,9 @@ unsigned int dirBlock; }; /* cacheNode */ +struct cacheNode * dirCacheFind(struct cacheNode *, char *); +struct cacheNode * dirCacheNew(const char *); +void dirCacheDelete(struct cacheNode **); +void dirCacheAdd(struct cacheNode *, struct cacheNode *); + #endif /* !DIRCACHE_H */ diff --git a/src/sys/ubixfs/dirCache.c b/src/sys/ubixfs/dirCache.c index e888de0..a745f09 100644 --- a/src/sys/ubixfs/dirCache.c +++ b/src/sys/ubixfs/dirCache.c @@ -6,7 +6,7 @@ struct cacheNode * -findNode(struct cacheNode * head, char * name) { +dirCacheFind(struct cacheNode * head, char * name) { struct cacheNode * tmp = head; unsigned int i; char dirName[256]; @@ -20,10 +20,6 @@ * for */ i = 0; -/* - memset(dirName, 0, sizeof(dirName)); - strcpy(dirName, "/"); -*/ while (name[i] != '\0' && name[i] != '/' && i < sizeof(dirName)) { dirName[i] = name[i]; i++; @@ -47,7 +43,7 @@ if (*nextDir != '\0') { while (tmp != NULL) { if (strcmp(tmp->name, dirName) == 0) - return findNode(tmp->subDirsHead, nextDir); + return dirCacheFind(tmp->subDirsHead, nextDir); tmp = tmp->next; } /* while */ /* if we're here, then one level of the dir isn't cached */ @@ -89,7 +85,7 @@ } /* findNode */ struct cacheNode * -newNode(const char * name) { +dirCacheNew(const char * name) { struct cacheNode * tmp = kmalloc(sizeof(struct cacheNode)); assert(tmp); tmp->parent = tmp; @@ -102,7 +98,7 @@ } /* newNode */ void -deleteNode(struct cacheNode ** head) { +dirCacheDelete(struct cacheNode ** head) { struct cacheNode * tmp = NULL; struct cacheNode * del = NULL; @@ -118,7 +114,7 @@ * will be caught with the above checks */ /* if (tmp->subDirsHead != NULL) */ - deleteNode(&tmp->subDirsHead); + dirCacheDelete(&tmp->subDirsHead); kfree(tmp->dirList); kfree(tmp->name); @@ -142,7 +138,7 @@ #endif void -addChildNode(struct cacheNode *node, struct cacheNode * newNode) { +dirCacheAdd(struct cacheNode *node, struct cacheNode * newNode) { struct cacheNode * tmp; assert(node); @@ -157,5 +153,5 @@ node->subDirsHead = newNode; tmp = node->subDirsHead; return; -} /* addChildNode */ +} /* dirCacheAdd */