mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
51799f99ae
Instead of calling `google::InitGoogleLogging()` directly, introduce an indirection via a new utility library. After this change, Sandboxed API should consistently use `sapi::InitLogging()` everywhere. For now, `sapi::InitLogging()` simply calls its glog equivalent. However, this enables us to migrate away from the gflags dependency and use Abseil flags. Once a follow-up change lands, `sapi::InitLogging()` will instead initialize the google logging library with flags defined from Aseil. Later still, once Abseil releases logging, we can then drop the glog dependency entirely. PiperOrigin-RevId: 445363592 Change-Id: Ia23a7dc88b8ffe65a422ea4d5233bba7bdd1303a |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
helloworld.cc | ||
idle-basic.cc | ||
README.md | ||
uvcat.cc |
LibUV Sandbox Examples
Each example in this folder is the sandboxed version of a code snippet from LibUV's User Guide. These examples perform some basic tasks using LibUV, and can be useful both to understand how to use LibUV Sandbox, but also to get an idea of how regular and sandboxed code compare to each other.
This is the list of examples:
- helloworld.cc: sandboxed version of helloworld/main.c. It simply starts a loop that exits immediately. It shows how to run a simple loop in LibUV Sandbox.
- idle-basic.cc: sandboxed version of idle-basic/main.c. Creates an idle watcher that stops the loop after a certain number of iterations. It shows how a simple callback can be used in LibUV Sandbox.
- uvcat.cc: sandboxed version of
uvcat/main.c.
Takes a single argument, the absolute path of a file, and prints its contents
(it is a simplified version of the command line tootl
cat
). It shows how to manage various complex callbacks for opening, reading and writing files.