From 870828c8af077562c4394e243a399017552434ed Mon Sep 17 00:00:00 2001 From: woclass Date: Tue, 1 Feb 2022 05:52:42 +0800 Subject: doc/guide: update content and sample code (#3408) - Add `Makefile` for example codes. (cherry-pick from old uvbook repo) - Add a new example "Default loop" to "Basics of libuv"/"Default loop" - Document review and update: `Introduction`, `Basics of libuv`, `Filesystem` + Update the referenced libuv code snippet + Link update: http->https **Content Updates**: - `filesystem.rst`#L291-L297: Add note for `uv_fs_event_start` - `filesystem.rst`#L334: Add description of the callback function parameter `status` The following examples have been tested manually in WSL2 (Ubuntu 20.04) with libuv 1.42.0: - helloworld - default-loop - idle-basic - uvcat - uvtee - onchange (test on macOS) Co-authored-by: Nikhil Marathe --- docs/code/default-loop/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/code/default-loop/main.c (limited to 'docs/code/default-loop/main.c') diff --git a/docs/code/default-loop/main.c b/docs/code/default-loop/main.c new file mode 100644 index 00000000..e00a4d2b --- /dev/null +++ b/docs/code/default-loop/main.c @@ -0,0 +1,12 @@ +#include +#include + +int main() { + uv_loop_t *loop = uv_default_loop(); + + printf("Default loop.\n"); + uv_run(loop, UV_RUN_DEFAULT); + + uv_loop_close(loop); + return 0; +} -- cgit v1.2.3