1wofi-utils(3) Library Functions Manual wofi-utils(3)
2
3
4
6 wofi - Utility functions and documentation
7
8
10 The functions documented here are general utility functions. They are
11 defined in utils.h.
12
13
15 The following functions are general convenience functions.
16
17
18 time_t utils_get_time_millis(void)
19 Returns the current unix time in milliseconds.
20
21
22 void utils_sleep_millis(time_t millis)
23 Sleeps for the specified amount of time.
24
25 time_t millis - The time to sleep for in milliseconds.
26
27
28 char* utils_concat(size_t arg_count, ...)
29 Concatenates strings together. The returned result is newly
30 allocated and must be freed by the caller when finished using
31 it.
32
33 size_t arg_count - The number of arguments provided
34
35 varargs - The list of strings to be concatenated.
36
37
38 size_t utils_min(size_t n1, size_t n2)
39 Returns the smaller of the two inputs.
40
41 size_t n1 - The first number.
42
43 size_t n2 - The second number.
44
45
46 size_t utils_min3(size_t n1, size_t n2, size_t n3)
47 Returns the smallest of the three inputs.
48
49 size_t n1 - The first number.
50
51 size_t n2 - The second number.
52
53 size_t n3 - The third number.
54
55
56 size_t utils_distance(const char* haystack, const char* needle)
57 Computes the Levenshtein distance between the two inputs.
58
59 const char* haystack - The string to search in.
60
61 const char* needle - The string to search for.
62
63
64
65 wofi-utils(3)