[uim-commit] r1170 - in trunk: scm uim

yamaken at freedesktop.org yamaken at freedesktop.org
Tue Aug 9 11:34:54 EST 2005


Author: yamaken
Date: 2005-08-08 18:34:51 -0700 (Mon, 08 Aug 2005)
New Revision: 1170

Modified:
   trunk/scm/custom-rt.scm
   trunk/uim/uim-util.c
Log:
* uim/uim-util.c
  - (get_file_mtime): Rename to file_mtime() to be consistent with
    other preexisting file-related function names
  - (file_mtime): Renamed from get_file_mtime()
  - (uim_init_util_subrs): Rename get-file-mtime with file-mtime to be
    consistent with other preexisting file-related procedure names
* scm/custom-rt.scm
  - (update-gsym-mtime, custom-load-updated-group-conf): Replace
    get-file-mtime with file-mtime


Modified: trunk/scm/custom-rt.scm
===================================================================
--- trunk/scm/custom-rt.scm	2005-08-09 01:27:02 UTC (rev 1169)
+++ trunk/scm/custom-rt.scm	2005-08-09 01:34:51 UTC (rev 1170)
@@ -72,7 +72,7 @@
 (define update-gsym-mtime
   (lambda (gsym path)
     (set-cdr! (assq gsym custom-reload-group-syms)
-	      (get-file-mtime path))
+	      (file-mtime path))
 	      #t))
 
 (define custom-load-updated-group-conf
@@ -80,7 +80,7 @@
     (let ((path (custom-file-path gsym)))
       (if (not (memq gsym (map (lambda (x) (car x)) custom-reload-group-syms)))
 	  (prepend-new-reload-group-syms gsym path))
-      (if (= (get-file-mtime path)
+      (if (= (file-mtime path)
 	     (cdr (assq gsym custom-reload-group-syms)))
 	  #t ; File isn't modified, no need to reload. 
 	  (if (try-load path)

Modified: trunk/uim/uim-util.c
===================================================================
--- trunk/uim/uim-util.c	2005-08-09 01:27:02 UTC (rev 1169)
+++ trunk/uim/uim-util.c	2005-08-09 01:34:51 UTC (rev 1170)
@@ -128,6 +128,20 @@
 }
 
 static uim_lisp
+file_mtime(uim_lisp f)
+{
+  const char *filename = uim_scm_refer_c_str(f);
+  struct stat buf;
+
+  if(stat(filename, &buf) == 0) {
+    return uim_scm_make_int(buf.st_mtime);
+  } else {
+    /* FIXME: Write error handling code. */
+    return uim_scm_make_int(0);
+  }
+}
+
+static uim_lisp
 charcode2string(uim_lisp x)
 {
   char buf[2];
@@ -600,20 +614,6 @@
   return uim_scm_f();
 }
 
-static uim_lisp
-get_file_mtime(uim_lisp f)
-{
-  const char *filename = uim_scm_refer_c_str(f);
-  struct stat buf;
-
-  if(stat(filename, &buf) == 0) {
-    return uim_scm_make_int(buf.st_mtime);
-  } else {
-    /* FIXME: Write error handling code. */
-    return uim_scm_make_int(0);
-  }
-}
-
 void
 uim_init_util_subrs(void)
 {
@@ -626,6 +626,7 @@
   uim_scm_init_subr_1("file-executable?", file_executablep);
   uim_scm_init_subr_1("file-regular?", file_regularp);
   uim_scm_init_subr_1("file-directory?", file_directoryp);
+  uim_scm_init_subr_1("file-mtime", file_mtime);
   uim_scm_init_subr_2("nthcdr", nthcdr);
   uim_scm_init_subr_1("charcode->string", charcode2string);
   uim_scm_init_subr_1("string->charcode", string2charcode);
@@ -646,5 +647,4 @@
   uim_scm_init_subr_2("find-tail", find_tail);
   uim_scm_init_subr_1("lang-code->lang-name-raw", lang_code_to_lang_name_raw);
   uim_scm_init_subr_0("is-set-ugid?", is_setugidp);
-  uim_scm_init_subr_1("get-file-mtime", get_file_mtime);
 }



More information about the uim-commit mailing list