qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs qe.h util.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs qe.h util.c
Date: Fri, 28 Mar 2008 12:21:39 +0000

CVSROOT:        /cvsroot/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        08/03/28 12:21:39

Modified files:
        .              : qe.h util.c 

Log message:
        added is_directory

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.67&r2=1.68
http://cvs.savannah.gnu.org/viewcvs/qemacs/util.c?cvsroot=qemacs&r1=1.41&r2=1.42

Patches:
Index: qe.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qe.h,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -b -r1.67 -r1.68
--- qe.h        26 Mar 2008 08:03:56 -0000      1.67
+++ qe.h        28 Mar 2008 12:21:39 -0000      1.68
@@ -175,6 +175,7 @@
 FindFileState *find_file_open(const char *path, const char *pattern);
 int find_file_next(FindFileState *s, char *filename, int filename_size_max);
 void find_file_close(FindFileState *s);
+int is_directory(const char *path);
 void canonicalize_path(char *buf, int buf_size, const char *path);
 void canonicalize_absolute_path(char *buf, int buf_size, const char *path1);
 const char *basename(const char *filename);

Index: util.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/util.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -b -r1.41 -r1.42
--- util.c      26 Mar 2008 20:32:47 -0000      1.41
+++ util.c      28 Mar 2008 12:21:39 -0000      1.42
@@ -126,6 +126,16 @@
 }
 #endif
 
+int is_directory(const char *path)
+{
+    struct stat st;
+
+    if (!stat(path, &st) && S_ISDIR(st.st_mode))
+        return 1;
+    else
+        return 0;
+}
+
 /* suppress redundant ".", ".." and "/" from paths */
 /* XXX: make it better */
 static void canonicalize_path1(char *buf, int buf_size, const char *path)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]