summaryrefslogtreecommitdiff
path: root/man/id128-app-specific.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-07-27 08:24:45 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-08-02 15:45:24 +0200
commit787f78b6a106d34bbf52eabb02995733ea6a7d4d (patch)
treeb23f4929a95d2c641526084e9330c933348ac2af /man/id128-app-specific.c
parent2c47fff6d2d9750ddf9e97fc45714aa8984b5eb6 (diff)
downloadsystemd-787f78b6a106d34bbf52eabb02995733ea6a7d4d.tar.gz
man: move more examples to stand-alone files and use 2-space indentation consistenty
Moving them out makes it easier to run them through a compiler, use automatic indentation, and opens the possibility to provide a download link in the future. I verified that all examples compile cleanly. (2-space indentation is used because the examples are already significantly indented in the man page, and we need to keep them narrow so that they display well on standard terminals.)
Diffstat (limited to 'man/id128-app-specific.c')
-rw-r--r--man/id128-app-specific.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/man/id128-app-specific.c b/man/id128-app-specific.c
new file mode 100644
index 0000000000..b81e50ff32
--- /dev/null
+++ b/man/id128-app-specific.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+#include <systemd/sd-id128.h>
+
+#define OUR_APPLICATION_ID SD_ID128_MAKE(c2,73,27,73,23,db,45,4e,a6,3b,b9,6e,79,b5,3e,97)
+
+int main(int argc, char *argv[]) {
+ sd_id128_t id;
+ sd_id128_get_machine_app_specific(OUR_APPLICATION_ID, &id);
+ printf("Our application ID: " SD_ID128_FORMAT_STR "\n", SD_ID128_FORMAT_VAL(id));
+ return 0;
+}