X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fquick_tests%2Flib.c;h=a7219c59f31d303f31ac2757902ae2fba19278d9;hp=e5a8859d3c358992e6d6cd44c9d21a6be87b2629;hb=a32621e0d7f5f391e9152cfe710fa6c99ca44c50;hpb=26592c53da98ac887099559afbcb8dda05264e1c diff --git a/direct/timothy_tests/quick_tests/lib.c b/direct/timothy_tests/quick_tests/lib.c index e5a8859..a7219c5 100644 --- a/direct/timothy_tests/quick_tests/lib.c +++ b/direct/timothy_tests/quick_tests/lib.c @@ -1,7 +1,21 @@ +/* + * YAFFS: Yet another FFS. A NAND-flash specific file system. + * + * Copyright (C) 2002-2010 Aleph One Ltd. + * for Toby Churchill Ltd and Brightstar Engineering + * + * Created by Timothy Manning + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + #include "lib.h" -void join_paths(char *path1,char *path2,char *new_path ){ +void join_paths(char *path1,char *path2,char *new_path ) +{ //strcat(new_path,path1); /*since all functions have this then pull it out*/ if ( (path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]!='/') { @@ -11,31 +25,35 @@ void join_paths(char *path1,char *path2,char *new_path ){ //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))]; //strcpy(new_path,strcat(path1,path2)); //return new_path; - } - else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]=='/') { + } else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]=='/') { /*paths are compatiable. concatanate them*/ strcat(new_path,path1); strcat(new_path,path2); - } - else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]!='/') { + } else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]!='/') { /*need to add a "/". */ strcat(new_path,path1); strcat(new_path,"/"); strcat(new_path,path2); - - } - else if ((path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]=='/') { + } else if ((path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]=='/') { /*need to remove a "/". */ /*yaffs does not mind the extra slash. */ strcat(new_path,path1); strcat(new_path,path2); - } - else{ + } else { //error //return -1; } } +void print_message(char *message,char print_level) +{ + if (print_level <= PRINT_LEVEL){ + printf(message); + } +} + + +