diff options
author | woclass <git@wo-class.cn> | 2022-02-01 05:52:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-31 16:52:42 -0500 |
commit | 870828c8af077562c4394e243a399017552434ed (patch) | |
tree | 916254c5b1af0512006218bb01ccb0af0a7d0098 /docs/code/default-loop | |
parent | 930af43437e6dddca715ebb4f2ff4b5e3602f19e (diff) | |
download | libuv-870828c8af077562c4394e243a399017552434ed.tar.gz libuv-870828c8af077562c4394e243a399017552434ed.zip |
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 <nsm.nikhil@gmail.com>
Diffstat (limited to 'docs/code/default-loop')
-rw-r--r-- | docs/code/default-loop/main.c | 12 |
1 files changed, 12 insertions, 0 deletions
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 <stdio.h> +#include <uv.h> + +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; +} |