aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gfilenotify.c23
-rw-r--r--src/inotify.c2
-rw-r--r--src/kqueue.c2
-rw-r--r--src/w32notify.c2
4 files changed, 25 insertions, 4 deletions
diff --git a/src/gfilenotify.c b/src/gfilenotify.c
index 30d0753f7e7..1ad989a0d95 100644
--- a/src/gfilenotify.c
+++ b/src/gfilenotify.c
@@ -258,7 +258,7 @@ WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. */)
258} 258}
259 259
260DEFUN ("gfile-valid-p", Fgfile_valid_p, Sgfile_valid_p, 1, 1, 0, 260DEFUN ("gfile-valid-p", Fgfile_valid_p, Sgfile_valid_p, 1, 1, 0,
261 doc: /* "Check a watch specified by its WATCH-DESCRIPTOR. 261 doc: /* Check a watch specified by its WATCH-DESCRIPTOR.
262 262
263WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. 263WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'.
264 264
@@ -278,6 +278,26 @@ invalid. */)
278 } 278 }
279} 279}
280 280
281DEFUN ("gfile-monitor-name", Fgfile_monitor_name, Sgfile_monitor_name, 1, 1, 0,
282 doc: /* Return the internal monitor name for WATCH-DESCRIPTOR.
283
284The result is a string, either "GInotifyFileMonitor",
285"GKqueueFileMonitor", or "GPollFileMonitor".
286
287WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'.
288If WATCH-DESCRIPTOR is not valid, nil is returned. */)
289 (Lisp_Object watch_descriptor)
290{
291 if (NILP (Fgfile_valid_p (watch_descriptor)))
292 return Qnil;
293 else
294 {
295 Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list);
296 GFileMonitor *monitor = XINTPTR (watch_descriptor);
297 return build_string (G_OBJECT_TYPE_NAME (monitor));
298 }
299}
300
281 301
282void 302void
283globals_of_gfilenotify (void) 303globals_of_gfilenotify (void)
@@ -294,6 +314,7 @@ syms_of_gfilenotify (void)
294 defsubr (&Sgfile_add_watch); 314 defsubr (&Sgfile_add_watch);
295 defsubr (&Sgfile_rm_watch); 315 defsubr (&Sgfile_rm_watch);
296 defsubr (&Sgfile_valid_p); 316 defsubr (&Sgfile_valid_p);
317 defsubr (&Sgfile_monitor_name);
297 318
298 /* Filter objects. */ 319 /* Filter objects. */
299 DEFSYM (Qchange, "change"); 320 DEFSYM (Qchange, "change");
diff --git a/src/inotify.c b/src/inotify.c
index 38c8df5a29a..cacc6dca147 100644
--- a/src/inotify.c
+++ b/src/inotify.c
@@ -364,7 +364,7 @@ See inotify_rm_watch(2) for more information.
364} 364}
365 365
366DEFUN ("inotify-valid-p", Finotify_valid_p, Sinotify_valid_p, 1, 1, 0, 366DEFUN ("inotify-valid-p", Finotify_valid_p, Sinotify_valid_p, 1, 1, 0,
367 doc: /* "Check a watch specified by its WATCH-DESCRIPTOR. 367 doc: /* Check a watch specified by its WATCH-DESCRIPTOR.
368 368
369WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'. 369WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'.
370 370
diff --git a/src/kqueue.c b/src/kqueue.c
index d1d0a612044..8ebd132fdc3 100644
--- a/src/kqueue.c
+++ b/src/kqueue.c
@@ -491,7 +491,7 @@ WATCH-DESCRIPTOR should be an object returned by `kqueue-add-watch'. */)
491} 491}
492 492
493DEFUN ("kqueue-valid-p", Fkqueue_valid_p, Skqueue_valid_p, 1, 1, 0, 493DEFUN ("kqueue-valid-p", Fkqueue_valid_p, Skqueue_valid_p, 1, 1, 0,
494 doc: /* "Check a watch specified by its WATCH-DESCRIPTOR. 494 doc: /* Check a watch specified by its WATCH-DESCRIPTOR.
495 495
496WATCH-DESCRIPTOR should be an object returned by `kqueue-add-watch'. 496WATCH-DESCRIPTOR should be an object returned by `kqueue-add-watch'.
497 497
diff --git a/src/w32notify.c b/src/w32notify.c
index 32a03f70a66..e23e2b8740c 100644
--- a/src/w32notify.c
+++ b/src/w32notify.c
@@ -670,7 +670,7 @@ w32_get_watch_object (void *desc)
670} 670}
671 671
672DEFUN ("w32notify-valid-p", Fw32notify_valid_p, Sw32notify_valid_p, 1, 1, 0, 672DEFUN ("w32notify-valid-p", Fw32notify_valid_p, Sw32notify_valid_p, 1, 1, 0,
673 doc: /* "Check a watch specified by its WATCH-DESCRIPTOR for validity. 673 doc: /* Check a watch specified by its WATCH-DESCRIPTOR for validity.
674 674
675WATCH-DESCRIPTOR should be an object returned by `w32notify-add-watch'. 675WATCH-DESCRIPTOR should be an object returned by `w32notify-add-watch'.
676 676