Enlightenment CVS committal Author : raster Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/lib/file Modified Files: evas_path.c Log Message: whitespace =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/file/evas_path.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- evas_path.c 28 Aug 2004 08:41:12 -0000 1.7 +++ evas_path.c 22 May 2005 02:49:49 -0000 1.8 @@ -32,7 +32,7 @@ { char *res = NULL; int len; - + if ((!path) && (!end)) return NULL; if (!path) return strdup(end); if (!end) return strdup(path); @@ -51,7 +51,7 @@ evas_file_path_exists(char *path) { struct stat st; - + if (stat(path, &st) != -1) return 0; return 1; } @@ -60,7 +60,7 @@ evas_file_path_is_file(char *path) { struct stat st; - + if (stat(path, &st) != -1) return 0; if (S_ISREG(st.st_mode)) return 1; return 0; @@ -70,7 +70,7 @@ evas_file_path_is_dir(char *path) { struct stat st; - + if (stat(path, &st) != -1) return 0; if (S_ISDIR(st.st_mode)) return 1; return 0; @@ -81,20 +81,20 @@ { Evas_List *files = NULL; DIR *dir; - + dir = opendir(path); if (!dir) return NULL; { struct dirent *dp; int flags; - + flags = FNM_PATHNAME; #ifdef FNM_CASEFOLD if (!match_case) flags |= FNM_CASEFOLD; #else /*#warning "Your libc does not provide case-insensitive matching!"*/ -#endif +#endif while ((dp = readdir(dir))) { if ((!strcmp(dp->d_name, ".")) || (!strcmp(dp->d_name, ".."))) @@ -105,7 +105,7 @@ files = evas_list_append(files, strdup(dp->d_name)); } else - files = evas_list_append(files, strdup(dp->d_name)); + files = evas_list_append(files, strdup(dp->d_name)); } closedir(dir); } @@ -116,7 +116,7 @@ evas_file_modified_time(const char *file) { struct stat st; - + if (stat(file, &st) < 0) return 0; if (st.st_ctime > st.st_mtime) return (DATA64)st.st_ctime; else return (DATA64)st.st_mtime; @@ -127,13 +127,13 @@ evas_file_path_resolve(const char *file) { char buf[PATH_MAX], *buf2; - + return strdup(file); -#if 0 +#if 0 if (!realpath(file, buf)) return NULL; buf2 = strdup(buf); return buf2; -#endif +#endif } #else @@ -152,13 +152,13 @@ { int len; wchar_t *punicode; - + len = strlen(putf)+ 1; //add one for safety - + punicode = (wchar_t *)malloc(len * sizeof(wchar_t)); - + if (punicode == NULL) return NULL; - + #ifdef UNICODE strcpy(punicode,putf); #else @@ -176,15 +176,15 @@ { int len; char *putf; - + /* add one for safety */ len = wcslen(punicode) + 1; - + /* this will alloc too many bytes */ putf = (char *)malloc(len * sizeof(wchar_t)); - + if (putf == NULL) return NULL; - + #ifdef UNICODE strcpy(putf,punicode); #else @@ -207,11 +207,11 @@ { DWORD fa; wchar_t *pwpath; /* A wide character type */ - - pwpath = convert_utf_unicode(path); + + pwpath = convert_utf_unicode(path); /* 0xFFFFFFFF is the error return val for the GetFile Attributes Function */ /* so I am usin this as an error return up here */ - if (pwpath == NULL) return 0xFFFFFFFF; + if (pwpath == NULL) return 0xFFFFFFFF; /* this function needed the wide string"*/ /* I dont think that WinCe has mbcs equiv functions and only provides UNICODE*/ fa = GetFileAttributesW(pwpath); @@ -232,7 +232,7 @@ { char *res = NULL; int len; - + if ((!path) && (!end)) return NULL; if (!path) return strdup(end); if (!end) return strdup(path); @@ -251,7 +251,7 @@ evas_file_path_exists(char *path) { DWORD fa; - + fa = winstat(path); if (fa == 0xFFFFFFFF) return 0; return 1; @@ -261,7 +261,7 @@ evas_file_path_is_file(char *path) { DWORD fa; - + fa = winstat(path); if (fa == 0xFFFFFFFF) return 0; if (fa & FILE_ATTRIBUTE_DIRECTORY) return 0; @@ -272,7 +272,7 @@ evas_file_path_is_dir(char *path) { DWORD fa; - + fa = winstat(path); if (fa == 0xFFFFFFFF) return 0; if (fa & FILE_ATTRIBUTE_DIRECTORY) return 1; @@ -288,12 +288,12 @@ int fullpathlen; char *pfp; /* full path pointer */ wchar_t *pfup; /* full unicode path pointer */ - + /* * work out the full path length of the combined patch and match - * if we are looking for a specific match eg *.txt then we will will add + * if we are looking for a specific match eg *.txt then we will will add * the length of *.txt and \\ to the string - * if we are not looking for a match then we want to list the whole + * if we are not looking for a match then we want to list the whole * directory and we find the length of \\*.* */ fullpathlen = strlen(path); @@ -304,12 +304,12 @@ } else fullpathlen += strlen("\\*.*"); - + /* Create the full search path */ - + pfp = (char *)malloc(fullpathlen + 1); /* add one for safety*/ if (pfp == NULL) return NULL; - + /* construct the full path */ strcpy(pfp, path); if (match) @@ -319,27 +319,27 @@ } else strcat(pfp,"\\*.*"); - + /* pfp now contains the fully constructed path*/ - + pfup = convert_utf_unicode(pfp); - free(pfp); /* chuck it away now as we don't need it, we have a unicode version */ + free(pfp); /* chuck it away now as we don't need it, we have a unicode version */ if (pfup == NULL) return NULL; - + fh = FindFirstFileW(pfup,&find); free(pfup); /* chuck it away now as we don't need it, we have a handle */ if (fh == INVALID_HANDLE_VALUE) return NULL; - + /* OK now go through the directory picking up filenames */ do { if (!(find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) files = evas_list_append(files,convert_unicode_utf(find.cFileName)); - + } while (FindNextFileW(fh,&find)); FindClose(fh); - + return files; } @@ -350,10 +350,10 @@ HANDLE fh; ULARGE_INTEGER modtime; wchar_t *pufile; - + pufile = convert_utf_unicode(file); if (pufile == NULL) return 0; - + fh = FindFirstFileW(pufile,&find); if (fh == INVALID_HANDLE_VALUE) { @@ -362,10 +362,10 @@ } FindClose(fh); free(pufile); - + modtime.u.HighPart = find.ftCreationTime.dwHighDateTime; modtime.u.LowPart = find.ftCreationTime.dwLowDateTime; - + return modtime.QuadPart; } ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs