Enlightenment CVS committal
Author : doursse
Project : e17
Module : proto/evil
Dir : e17/proto/evil/src/lib
Modified Files:
Evil.h evil.c
Log Message:
* src/lib/Evil.h:
add POSIX definitions
* src/lib/evil.c:
make realpath available with cegcc. The function
just copy the file name to the resolved name with
that compiler
===================================================================
RCS file: /cvs/e/e17/proto/evil/src/lib/Evil.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- Evil.h 22 Mar 2008 08:35:43 -0000 1.6
+++ Evil.h 23 Mar 2008 14:51:22 -0000 1.7
@@ -282,6 +282,29 @@
#if defined(__MSDOS__) || defined(__EMX__) || \
(defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN__) &&
!defined(__CEGCC__))
# if defined(_MSC_VER) || defined(__MINGW32__)
+
+struct stat
+{
+ _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
+ _ino_t st_ino; /* Always zero ? */
+ _mode_t st_mode; /* See above constants */
+ short st_nlink; /* Number of links. */
+ short st_uid; /* User: Maybe significant on NT ? */
+ short st_gid; /* Group: Ditto */
+ _dev_t st_rdev; /* Seems useless (not even filled in) */
+ _off_t st_size; /* File size in bytes */
+ time_t st_atime; /* Accessed date (always 00:00 hrs local
+ * on FAT) */
+ time_t st_mtime; /* Modified time */
+ time_t st_ctime; /* Creation time */
+};
+
+# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
+# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
+
+# define S_IRUSR _S_IRUSR
+# define S_IWUSR _S_IWUSR
+# define S_IXUSR _S_IXUSR
# define S_IRGRP S_IRUSR
# define S_IROTH S_IRUSR
# define S_IWGRP S_IWUSR
@@ -294,11 +317,10 @@
# define write(fd,buffer,count) _write((fd),(buffer),(count))
# define unlink(filename) _unlink((filename))
# define mkdir(p,m) _mkdir(p)
+
# endif
#endif
-
-#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )
/**
* @brief Return an absolute or full path name for a specified relative path
name.
*
@@ -324,9 +346,6 @@
* @ingroup Evil
*/
EAPI char *realpath(const char *file_name, char *resolved_name);
-
-#endif /* ! __CEGCC__ && ! __MINGW32CE__ */
-
/**
* @brief Initiates the use of Windows sockets.
===================================================================
RCS file: /cvs/e/e17/proto/evil/src/lib/evil.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- evil.c 5 Mar 2008 11:22:46 -0000 1.4
+++ evil.c 23 Mar 2008 14:51:22 -0000 1.5
@@ -151,6 +151,7 @@
if (FAILED(pISL->lpVtbl->QueryInterface(pISL, &IID_IPersistFile, (void
**)persit_file)))
goto no_queryinterface;
+ /* FIXME: is it for cegcc ??? */
mbstowcs(new_path, newpath, MB_CUR_MAX);
if (FAILED(pIPF->lpVtbl->Save(pIPF, new_path, FALSE)))
goto no_save;
@@ -345,13 +346,23 @@
#endif /* ! __CEGCC__ */
-#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )
char *
realpath(const char *file_name, char *resolved_name)
{
- return _fullpath(resolved_name, file_name, PATH_MAX);
+#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )
+ return _fullpath(resolved_name, file_name, PATH_MAX);
+#else
+ int length;
+
+ length = strlen(file_name);
+ if ((length + 1) > PATH_MAX)
+ length = PATH_MAX - 1;
+ memcpy(resolved_name, file_name, length);
+ resolved_name[length] = '\0';
+
+ return resolved_name;
+#endif /* __CEGCC__ || __MINGW32CE__ */
}
-#endif /* ! __CEGCC__ && ! __MINGW32CE__ */
int
evil_sockets_init(void)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs