Permalink
Browse files

Wraps an extern "C" block around C header API

Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
  • Loading branch information...
1 parent bbbe112 commit 483bb2179f2dae4a103fb7a193aee59df694eb03 @gorakhargosh gorakhargosh committed Dec 29, 2010
Showing with 17 additions and 0 deletions.
  1. +5 −0 src/_watchdog_fsevents.c
  2. +12 −0 src/_watchdog_fsevents.h
View
@@ -31,6 +31,7 @@
PyDoc_STRVAR(watchdog_fsevents_module__doc__,
"Low-level FSEvents Python/C API.");
+
PyDoc_STRVAR(watchdog_fsevents_read_events__doc__,
MODULE_NAME ".read_events(emitter_thread) -> None\n\
Blocking function that runs an event loop associated with an emitter thread.\n\n\
@@ -70,6 +71,7 @@ watchdog_fsevents_read_events(PyObject *self, PyObject *emitter_thread)
return Py_None;
}
+
PyDoc_STRVAR(watchdog_fsevents_add_watch__doc__,
MODULE_NAME ".add_watch(emitter_thread, watch, callback, paths) -> None\
\nAdds a watch into the event loop for the given emitter thread.\n\n\
@@ -142,6 +144,7 @@ watchdog_fsevents_add_watch(PyObject *self, PyObject *args)
return Py_None;
}
+
PyDoc_STRVAR(watchdog_fsevents_remove_watch__doc__,
MODULE_NAME ".remove_watch(watch) -> None\n\
Removes a watch from the event loop.\n\n\
@@ -164,6 +167,7 @@ watchdog_fsevents_remove_watch(PyObject *self, PyObject *watch)
return Py_None;
}
+
PyDoc_STRVAR(watchdog_fsevents_stop__doc__,
MODULE_NAME ".stop(emitter_thread) -> None\n\
Stops running the event loop from the specified thread.\n\n\
@@ -186,6 +190,7 @@ watchdog_fsevents_stop(PyObject *self, PyObject *emitter_thread)
return Py_None;
}
+
/**
* Module public API.
*/
View
@@ -33,6 +33,12 @@
#include <CoreFoundation/CoreFoundation.h>
#include <CoreServices/CoreServices.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
/**
* Py_ssize_t type for Python versions that don't define it.
*/
@@ -165,5 +171,11 @@ FSEventStreamRef
Watchdog_FSEventStream_Create(StreamCallbackInfo *stream_callback_info,
PyObject *py_path_list);
+
+#ifdef __cplusplus
+} /* extern "C" { */
+#endif /* __cplusplus */
+
+
#endif /* _WATCHDOG_FSEVENTS_H_ */

0 comments on commit 483bb21

Please sign in to comment.