diff options
| author | Thomas Schmucker <ts@its1.de> | 2021-05-28 09:54:14 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2021-05-28 09:54:14 +0200 |
| commit | d585045aaf6c3413b357922b92c947a07f99f30c (patch) | |
| tree | d42bff7fbed505f532f00b6dcac89bb80c20c6b9 | |
| download | use-libuuid-d585045aaf6c3413b357922b92c947a07f99f30c.tar.gz use-libuuid-d585045aaf6c3413b357922b92c947a07f99f30c.tar.bz2 use-libuuid-d585045aaf6c3413b357922b92c947a07f99f30c.zip | |
feat: Erster import
| -rw-r--r-- | main.c | 16 | ||||
| -rw-r--r-- | makefile | 11 |
2 files changed, 27 insertions, 0 deletions
| @@ -0,0 +1,16 @@ | |||
| 1 | #include <stdio.h> | ||
| 2 | #include <stdlib.h> | ||
| 3 | #include <uuid/uuid.h> | ||
| 4 | |||
| 5 | int main(void) | ||
| 6 | { | ||
| 7 | uuid_t uuid; | ||
| 8 | uuid_generate(uuid); | ||
| 9 | |||
| 10 | char out[37]; | ||
| 11 | uuid_unparse(uuid, out); | ||
| 12 | |||
| 13 | printf("UUID: %s\n", out); | ||
| 14 | printf("sizeof(uuid) = %zu\n", sizeof uuid); | ||
| 15 | return 0; | ||
| 16 | } | ||
diff --git a/makefile b/makefile new file mode 100644 index 0000000..e56f0ef --- /dev/null +++ b/makefile | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | all: uuid-test | ||
| 2 | |||
| 3 | uuid-test: main.o | ||
| 4 | cc -L/usr/local/lib -luuid -s -o $@ main.o | ||
| 5 | |||
| 6 | main.o: main.c | ||
| 7 | cc -Wall -Werror -std=c99 -pedantic -I/usr/local/include -O2 -c main.c -o $@ | ||
| 8 | |||
| 9 | .PHONY: clean | ||
| 10 | clean: | ||
| 11 | rm -f main.o uuid-test | ||
