Debian Codegraph @

debian/tests/compile-and-execute

raw
1 #!/bin/sh
2 set -e
3 trap 'rm o' 0
4 cflags="-Wall -Wextra -Wpedantic"
5 cflags="$cflags $(pkg-config --libs --cflags libimobiledevice-glue-1.0)"
6 cc -x c - -o o $cflags <<EOF
7 #include <libimobiledevice-glue/utils.h>
8 #include <libimobiledevice-glue/glue.h>
9 #include <string.h>
10 int main(void) {
11 printf("Glue version: %s\n", libimobiledevice_glue_version());
12 char *uuid = string_toupper(generate_uuid());
13 printf("A random UUID: %s\n", uuid);
14 /* An UUID must contain no characters other than these and be 128 bits long:
15 * https://datatracker.ietf.org/doc/html/rfc4122
16 */
17 return uuid[strspn(uuid, "0123456789ABCDEF-")] && strlen(uuid) == 128;
18 }
19 EOF
20 ./o