extern void blkid_unparse_uuid(const unsigned char *uuid, char *str, size_t len)
__attribute__((nonnull));
+extern int blkid_uuid_is_empty(const unsigned char *buf, size_t len);
+
extern size_t blkid_rtrim_whitespace(unsigned char *str)
__attribute__((nonnull));
extern size_t blkid_ltrim_whitespace(unsigned char *str)
}
#endif
+/* like uuid_is_null() from libuuid, but works with arbitrary size of UUID */
+int blkid_uuid_is_empty(const unsigned char *buf, size_t len)
+{
+ size_t i;
+
+ for (i = 0; i < len; i++)
+ if (buf[i])
+ return 0;
+ return 1;
+}
/* Removes whitespace from the right-hand side of a string (trailing
* whitespace).
return 0;
}
-/* like uuid_is_null() from libuuid, but works with arbitrary size of UUID */
-static int uuid_is_empty(const unsigned char *buf, size_t len)
-{
- size_t i;
-
- for (i = 0; i < len; i++)
- if (buf[i])
- return 0;
- return 1;
-}
-
int blkid_probe_sprintf_uuid(blkid_probe pr, unsigned char *uuid,
size_t len, const char *fmt, ...)
{
if (len > BLKID_PROBVAL_BUFSIZ)
len = BLKID_PROBVAL_BUFSIZ;
- if (uuid_is_empty(uuid, len))
+ if (blkid_uuid_is_empty(uuid, len))
return 0;
if ((chn->flags & BLKID_SUBLKS_UUIDRAW) &&
struct blkid_chain *chn = blkid_probe_get_chain(pr);
struct blkid_prval *v;
- if (uuid_is_empty(uuid, 16))
+ if (blkid_uuid_is_empty(uuid, 16))
return 0;
if (!name) {