-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplinter_cli_cmd_uuid.c
More file actions
35 lines (28 loc) · 718 Bytes
/
splinter_cli_cmd_uuid.c
File metadata and controls
35 lines (28 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* Copyright 2025 Tim Post
* License: Apache 2 (MIT available upon request to timthepost@protonmail.com)
*
* @file splinter_cli_cmd_uuid.c
* @brief Implements the CLI 'uuid' command.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include "3rdparty/uuid4.h"
#include "splinter_cli.h"
static const char *modname = "uuid";
void help_cmd_uuid(unsigned int level) {
(void) level;
printf("%s provides a UUID v4 unique identifier.\n",
modname);
}
int cmd_uuid(int argc, char *argv[]) {
(void) argc;
(void) argv;
char buff[UUID4_LEN] = { 0 };
if (uuid4_init() < 0) return 1;
uuid4_generate(buff);
printf("%s\n", buff);
return 0;
}