This commit was generated by cvs2svn to compensate for changes in r1073,
[chise/xemacs-chise.git.1] / src / editfns.c
index ce1f101..30b173d 100644 (file)
@@ -45,6 +45,7 @@ Boston, MA 02111-1307, USA.  */
 #include "systime.h"
 #include "sysdep.h"
 #include "syspwd.h"
+#include "sysfile.h"                   /* for getcwd */
 
 /* Some static data, and a function to initialize it for each run */
 
@@ -65,8 +66,6 @@ Lisp_Object Vuser_login_name; /* user name from LOGNAME or USER.  */
 Lisp_Object Vuser_full_name;
 EXFUN (Fuser_full_name, 1);
 
-char *get_system_name (void);
-
 Lisp_Object Qformat;
 
 Lisp_Object Qpoint, Qmark, Qregion_beginning, Qregion_end;
@@ -638,17 +637,17 @@ ignored and this function returns the login name for that UID, or nil.
        (uid))
 {
   char *returned_name;
-  int local_uid;
+  uid_t local_uid;
 
   if (!NILP (uid))
     {
       CHECK_INT (uid);
-      local_uid = XINT(uid);
-      returned_name = user_login_name(&local_uid);
+      local_uid = XINT (uid);
+      returned_name = user_login_name (&local_uid);
     }
   else
     {
-      returned_name = user_login_name(NULL);
+      returned_name = user_login_name (NULL);
     }
   /* #### - I believe this should return nil instead of "unknown" when pw==0
      pw=0 is indicated by a null return from user_login_name
@@ -664,14 +663,12 @@ ignored and this function returns the login name for that UID, or nil.
    corresponds to a nil argument to Fuser_login_name.
 */
 char*
-user_login_name (int *uid)
+user_login_name (uid_t *uid)
 {
-  struct passwd *pw = NULL;
-
   /* uid == NULL to return name of this user */
   if (uid != NULL)
     {
-      pw = getpwuid (*uid);
+      struct passwd *pw = getpwuid (*uid);
       return pw ? pw->pw_name : NULL;
     }
   else
@@ -692,7 +689,7 @@ user_login_name (int *uid)
        return (user_name);
       else
        {
-         pw = getpwuid (geteuid ());
+         struct passwd *pw = getpwuid (geteuid ());
 #ifdef __CYGWIN32__
          /* Since the Cygwin environment may not have an /etc/passwd,
             return "unknown" instead of the null if the username
@@ -912,14 +909,6 @@ Return the name of the machine you are running on, as a string.
     return Fcopy_sequence (Vsystem_name);
 }
 
-/* For the benefit of callers who don't want to include lisp.h.
-   Caller must free! */
-char *
-get_system_name (void)
-{
-  return xstrdup ((char *) XSTRING_DATA (Vsystem_name));
-}
-
 DEFUN ("emacs-pid", Femacs_pid, 0, 0, 0, /*
 Return the process ID of Emacs, as an integer.
 */
@@ -1040,6 +1029,8 @@ FORMAT-STRING may contain %-sequences to substitute parts of the time.
 %p is replaced by AM or PM, as appropriate.
 %r is a synonym for "%I:%M:%S %p".
 %R is a synonym for "%H:%M".
+%s is replaced by the time in seconds since 00:00:00, Jan 1, 1970 (a
+      nonstandard extension)
 %S is replaced by the second (00-60).
 %t is a synonym for "\\t".
 %T is a synonym for "%H:%M:%S".