]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-id128: rename Id128FormatFlag -> Id128Flag
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 1 Apr 2023 12:30:45 +0000 (21:30 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 4 Apr 2023 02:46:18 +0000 (11:46 +0900)
As the flag is not only for formatting.

src/libsystemd/sd-id128/id128-util.c
src/libsystemd/sd-id128/id128-util.h

index ab4108204ecb4e51f89aed5e1c7f75cbeaf2223a..0d77b04735c2c561e5e8a5d25525e3cb6ccb2026 100644 (file)
@@ -40,7 +40,7 @@ bool id128_is_valid(const char *s) {
         return false;
 }
 
-int id128_read_fd(int fd, Id128FormatFlag f, sd_id128_t *ret) {
+int id128_read_fd(int fd, Id128Flag f, sd_id128_t *ret) {
         char buffer[SD_ID128_UUID_STRING_MAX + 1]; /* +1 is for trailing newline */
         ssize_t l;
         int r;
@@ -101,7 +101,7 @@ int id128_read_fd(int fd, Id128FormatFlag f, sd_id128_t *ret) {
         return r == -EINVAL ? -EUCLEAN : r;
 }
 
-int id128_read(const char *path, Id128FormatFlag f, sd_id128_t *ret) {
+int id128_read(const char *path, Id128Flag f, sd_id128_t *ret) {
         _cleanup_close_ int fd = -EBADF;
 
         assert(path);
@@ -113,7 +113,7 @@ int id128_read(const char *path, Id128FormatFlag f, sd_id128_t *ret) {
         return id128_read_fd(fd, f, ret);
 }
 
-int id128_write_fd(int fd, Id128FormatFlag f, sd_id128_t id) {
+int id128_write_fd(int fd, Id128Flag f, sd_id128_t id) {
         char buffer[SD_ID128_UUID_STRING_MAX + 1]; /* +1 is for trailing newline */
         size_t sz;
         int r;
@@ -143,7 +143,7 @@ int id128_write_fd(int fd, Id128FormatFlag f, sd_id128_t id) {
         return 0;
 }
 
-int id128_write(const char *path, Id128FormatFlag f, sd_id128_t id) {
+int id128_write(const char *path, Id128Flag f, sd_id128_t id) {
         _cleanup_close_ int fd = -EBADF;
 
         assert(path);
index 4be10bb3103bb0590a625b21fbb08bc6f6562a9c..834fa4cd75f2492353a37f9a62eaa9949e3a615d 100644 (file)
 
 bool id128_is_valid(const char *s) _pure_;
 
-typedef enum Id128FormatFlag {
-        ID128_FORMAT_PLAIN = 1 << 0,  /* formatted as 32 hex chars as-is */
-        ID128_FORMAT_UUID  = 1 << 1,  /* formatted as 36 character uuid string */
-        ID128_FORMAT_ANY   = ID128_FORMAT_PLAIN | ID128_FORMAT_UUID,
+typedef enum Id128Flag {
+        ID128_FORMAT_PLAIN  = 1 << 0,  /* formatted as 32 hex chars as-is */
+        ID128_FORMAT_UUID   = 1 << 1,  /* formatted as 36 character uuid string */
+        ID128_FORMAT_ANY    = ID128_FORMAT_PLAIN | ID128_FORMAT_UUID,
 
         ID128_SYNC_ON_WRITE = 1 << 2, /* Sync the file after write. Used only when writing an ID. */
-} Id128FormatFlag;
+} Id128Flag;
 
-int id128_read_fd(int fd, Id128FormatFlag f, sd_id128_t *ret);
-int id128_read(const char *path, Id128FormatFlag f, sd_id128_t *ret);
+int id128_read_fd(int fd, Id128Flag f, sd_id128_t *ret);
+int id128_read(const char *path, Id128Flag f, sd_id128_t *ret);
 
-int id128_write_fd(int fd, Id128FormatFlag f, sd_id128_t id);
-int id128_write(const char *path, Id128FormatFlag f, sd_id128_t id);
+int id128_write_fd(int fd, Id128Flag f, sd_id128_t id);
+int id128_write(const char *path, Id128Flag f, sd_id128_t id);
 
 void id128_hash_func(const sd_id128_t *p, struct siphash *state);
 int id128_compare_func(const sd_id128_t *a, const sd_id128_t *b) _pure_;