#endif
#include <sys/file.h>
-#ifdef HAVE_FCNTL_H
#include <fcntl.h>
-#endif
-#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
static time_t boot_time;
static int boot_time_initialized;
-extern Lisp_Object Vshell_file_name;
-
#ifdef BOOT_TIME
-static void get_boot_time_1 (char *, int);
+static void get_boot_time_1 (const char *, int);
#endif
static time_t
Success is indicated by setting BOOT_TIME to a larger value. */
void
-get_boot_time_1 (char *filename, int newest)
+get_boot_time_1 (const char *filename, int newest)
{
struct utmp ut, *utp;
int desc;
{
register int err;
time_t boot_time;
- char *user_name;
- char *host_name;
+ const char *user_name;
+ const char *host_name;
char *lock_info_str;
/* Call this first because it can GC. */
static int
current_lock_owner (lock_info_type *owner, char *lfname)
{
-#ifndef index
- extern char *rindex (const char *, int), *index (const char *, int);
-#endif
int len, ret;
int local_owner = 0;
char *at, *dot, *colon;
/* Parse USER@HOST.PID:BOOT_TIME. If can't parse, return -1. */
/* The USER is everything before the last @. */
- at = rindex (lfinfo, '@');
- dot = rindex (lfinfo, '.');
+ at = strrchr (lfinfo, '@');
+ dot = strrchr (lfinfo, '.');
if (!at || !dot)
{
xfree (lfinfo);
doc: /* Lock FILE, if current buffer is modified.
FILE defaults to current buffer's visited file,
or else nothing is done if current buffer isn't visiting a file. */)
- (file)
- Lisp_Object file;
+ (Lisp_Object file)
{
if (NILP (file))
file = current_buffer->file_truename;
doc: /* Unlock the file visited in the current buffer.
If the buffer is not modified, this does nothing because the file
should not be locked in that case. */)
- ()
+ (void)
{
if (SAVE_MODIFF < MODIFF
&& STRINGP (current_buffer->file_truename))
doc: /* Return a value indicating whether FILENAME is locked.
The value is nil if the FILENAME is not locked,
t if it is locked by you, else a string saying which user has locked it. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object ret;
register char *lfname;
boot_time_initialized = 0;
}
+#endif /* CLASH_DETECTION */
+
void
syms_of_filelock (void)
{
doc: /* The directory for writing temporary files. */);
Vtemporary_file_directory = Qnil;
+#ifdef CLASH_DETECTION
defsubr (&Sunlock_buffer);
defsubr (&Slock_buffer);
defsubr (&Sfile_locked_p);
+#endif
}
-#endif /* CLASH_DETECTION */
-
/* arch-tag: e062676d-50b2-4be0-ab96-197c81b181a1
(do not change this comment) */