]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic,shared: mark eligible functions with _pure_/_const_
authorMike Yuan <me@yhndnzj.com>
Mon, 26 May 2025 18:04:54 +0000 (20:04 +0200)
committerMike Yuan <me@yhndnzj.com>
Mon, 26 May 2025 18:26:58 +0000 (20:26 +0200)
Following the recent witch hunt done to static inline functions
I figure we should at least give the compiler some more hint
on optimizations.

19 files changed:
src/basic/af-list.h
src/basic/arphrd-util.h
src/basic/errno-list.h
src/basic/in-addr-util.h
src/basic/path-util.h
src/basic/process-util.h
src/basic/sha256.h
src/basic/socket-util.h
src/basic/stat-util.h
src/basic/string-util.h
src/basic/strv.h
src/basic/user-util.h
src/basic/utf8.h
src/shared/exit-status.h
src/shared/gpt.h
src/shared/group-record.h
src/shared/main-func.h
src/shared/mount-setup.h
src/shared/nsflags.h

index 425c713408cfadbb100a85f70052c4df8247ca7b..6b7154cb5997117678857aa2e745514b19b96ecf 100644 (file)
@@ -8,7 +8,7 @@ int af_from_name(const char *name) _pure_;
 
 const char* af_to_name_short(int id) _const_;
 
-const char* af_to_ipv4_ipv6(int id);
-int af_from_ipv4_ipv6(const char *af);
+const char* af_to_ipv4_ipv6(int id) _const_;
+int af_from_ipv4_ipv6(const char *af) _pure_;
 
-int af_max(void);
+int af_max(void) _const_;
index 95c6a887c49b593b433945131f4ec1b9cbce1dc3..97a1c0b248c5fed47e218f5fe703d779322c4b0f 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "forward.h"
 
-const char* arphrd_to_name(int id);
-int arphrd_from_name(const char *name);
+const char* arphrd_to_name(int id) _const_;
+int arphrd_from_name(const char *name) _pure_;
 
-size_t arphrd_to_hw_addr_len(uint16_t arphrd);
+size_t arphrd_to_hw_addr_len(uint16_t arphrd) _const_;
index 9040211b17fa16b15126577a6e88d423309003e7..5b29642ce492d7a8c5abb66451f595018320cf53 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "forward.h"
 
-const char* errno_to_name(int id);
+const char* errno_to_name(int id) _const_;
 int errno_from_name(const char *name) _pure_;
 
 static inline bool errno_is_valid(int n) {
index a9491806ec56ab58b0aeee28c9e835dc8f106f7c..cb76ef221c72072d8d718ddf047fe923aed52fd0 100644 (file)
@@ -16,15 +16,15 @@ struct in_addr_data {
         union in_addr_union address;
 };
 
-bool in4_addr_is_null(const struct in_addr *a);
+bool in4_addr_is_null(const struct in_addr *a) _pure_;
 static inline bool in4_addr_is_set(const struct in_addr *a) {
         return !in4_addr_is_null(a);
 }
-bool in6_addr_is_null(const struct in6_addr *a);
+bool in6_addr_is_null(const struct in6_addr *a) _pure_;
 static inline bool in6_addr_is_set(const struct in6_addr *a) {
         return !in6_addr_is_null(a);
 }
-int in_addr_is_null(int family, const union in_addr_union *u);
+int in_addr_is_null(int family, const union in_addr_union *u) _pure_;
 static inline bool in_addr_is_set(int family, const union in_addr_union *u) {
         return in_addr_is_null(family, u) == 0;
 }
@@ -36,43 +36,43 @@ static inline bool in_addr_data_is_set(const struct in_addr_data *a) {
         return in_addr_data_is_null(a);
 }
 
-bool in4_addr_is_multicast(const struct in_addr *a);
-bool in6_addr_is_multicast(const struct in6_addr *a);
-int in_addr_is_multicast(int family, const union in_addr_union *u);
+bool in4_addr_is_multicast(const struct in_addr *a) _pure_;
+bool in6_addr_is_multicast(const struct in6_addr *a) _pure_;
+int in_addr_is_multicast(int family, const union in_addr_union *u) _pure_;
 
-bool in4_addr_is_link_local(const struct in_addr *a);
-bool in4_addr_is_link_local_dynamic(const struct in_addr *a);
-bool in6_addr_is_link_local(const struct in6_addr *a);
-int in_addr_is_link_local(int family, const union in_addr_union *u);
-bool in6_addr_is_link_local_all_nodes(const struct in6_addr *a);
+bool in4_addr_is_link_local(const struct in_addr *a) _pure_;
+bool in4_addr_is_link_local_dynamic(const struct in_addr *a) _pure_;
+bool in6_addr_is_link_local(const struct in6_addr *a) _pure_;
+int in_addr_is_link_local(int family, const union in_addr_union *u) _pure_;
+bool in6_addr_is_link_local_all_nodes(const struct in6_addr *a) _pure_;
 
-bool in4_addr_is_localhost(const struct in_addr *a);
-int in_addr_is_localhost(int family, const union in_addr_union *u);
-int in_addr_is_localhost_one(int family, const union in_addr_union *u);
+bool in4_addr_is_localhost(const struct in_addr *a) _pure_;
+int in_addr_is_localhost(int family, const union in_addr_union *u) _pure_;
+int in_addr_is_localhost_one(int family, const union in_addr_union *u) _pure_;
 
-bool in4_addr_is_local_multicast(const struct in_addr *a);
-bool in4_addr_is_non_local(const struct in_addr *a);
-bool in6_addr_is_ipv4_mapped_address(const struct in6_addr *a);
+bool in4_addr_is_local_multicast(const struct in_addr *a) _pure_;
+bool in4_addr_is_non_local(const struct in_addr *a) _pure_;
+bool in6_addr_is_ipv4_mapped_address(const struct in6_addr *a) _pure_;
 
-bool in4_addr_equal(const struct in_addr *a, const struct in_addr *b);
-bool in6_addr_equal(const struct in6_addr *a, const struct in6_addr *b);
-int in_addr_equal(int family, const union in_addr_union *a, const union in_addr_union *b);
+bool in4_addr_equal(const struct in_addr *a, const struct in_addr *b) _pure_;
+bool in6_addr_equal(const struct in6_addr *a, const struct in6_addr *b) _pure_;
+int in_addr_equal(int family, const union in_addr_union *a, const union in_addr_union *b) _pure_;
 bool in4_addr_prefix_intersect(
                 const struct in_addr *a,
                 unsigned aprefixlen,
                 const struct in_addr *b,
-                unsigned bprefixlen);
+                unsigned bprefixlen) _pure_;
 bool in6_addr_prefix_intersect(
                 const struct in6_addr *a,
                 unsigned aprefixlen,
                 const struct in6_addr *b,
-                unsigned bprefixlen);
+                unsigned bprefixlen) _pure_;
 int in_addr_prefix_intersect(
                 int family,
                 const union in_addr_union *a,
                 unsigned aprefixlen,
                 const union in_addr_union *b,
-                unsigned bprefixlen);
+                unsigned bprefixlen) _pure_;
 int in_addr_prefix_next(int family, union in_addr_union *u, unsigned prefixlen);
 int in_addr_prefix_nth(int family, union in_addr_union *u, unsigned prefixlen, uint64_t nth);
 int in_addr_random_prefix(int family, union in_addr_union *u, unsigned prefixlen_fixed_part, unsigned prefixlen);
index 1cc1fce1e09810e3d996f7a8c042e21d2d1fc5d8..a209223bccd404d46715433b3f7a45a87a0c6532 100644 (file)
@@ -158,14 +158,14 @@ int file_in_same_dir(const char *path, const char *filename, char **ret);
 
 bool hidden_or_backup_file(const char *filename) _pure_;
 
-bool is_device_path(const char *path);
+bool is_device_path(const char *path) _pure_;
 
-bool valid_device_node_path(const char *path);
-bool valid_device_allow_pattern(const char *path);
+bool valid_device_node_path(const char *path) _pure_;
+bool valid_device_allow_pattern(const char *path) _pure_;
 
-bool dot_or_dot_dot(const char *path);
+bool dot_or_dot_dot(const char *path) _pure_;
 
-bool path_implies_directory(const char *path);
+bool path_implies_directory(const char *path) _pure_;
 
 static inline const char* skip_dev_prefix(const char *p) {
         const char *e;
@@ -177,7 +177,7 @@ static inline const char* skip_dev_prefix(const char *p) {
         return e ?: p;
 }
 
-bool empty_or_root(const char *path);
+bool empty_or_root(const char *path) _pure_;
 const char* empty_to_root(const char *path) _pure_;
 
 bool path_strv_contains(char * const *l, const char *path);
index c636b6d14a8dfe93b3b80c6024eb1ff3befa5648..17065420dc2da450fa313e6aa5c7db35077e51ff 100644 (file)
@@ -136,7 +136,7 @@ void valgrind_summary_hack(void);
 
 int pid_compare_func(const pid_t *a, const pid_t *b);
 
-bool nice_is_valid(int n);
+bool nice_is_valid(int n) _const_;
 
 bool sched_policy_is_valid(int i) _const_;
 bool sched_priority_is_valid(int i) _const_;
index 3711292958afae7cb7522ca33dddc4106b97d66b..8ec35a3ba58a34f54b6df82dbc2b80fa66062934 100644 (file)
@@ -9,4 +9,4 @@ int sha256_fd(int fd, uint64_t max_size, uint8_t ret[static SHA256_DIGEST_SIZE])
 
 int parse_sha256(const char *s, uint8_t res[static SHA256_DIGEST_SIZE]);
 
-bool sha256_is_valid(const char *s);
+bool sha256_is_valid(const char *s) _pure_;
index a5a1d8775da5d861fdddd0b05a42845d649c30aa..bd26338f4d22f9091b80aa46149dc8a272809679 100644 (file)
@@ -136,12 +136,12 @@ typedef enum {
         IFNAME_VALID_SPECIAL     = 1 << 2, /* Allow the special names "all" and "default" */
         _IFNAME_VALID_ALL        = IFNAME_VALID_ALTERNATIVE | IFNAME_VALID_NUMERIC | IFNAME_VALID_SPECIAL,
 } IfnameValidFlags;
-bool ifname_valid_char(char a);
-bool ifname_valid_full(const char *p, IfnameValidFlags flags);
+bool ifname_valid_char(char a) _const_;
+bool ifname_valid_full(const char *p, IfnameValidFlags flags) _pure_;
 static inline bool ifname_valid(const char *p) {
         return ifname_valid_full(p, 0);
 }
-bool address_label_valid(const char *p);
+bool address_label_valid(const char *p) _pure_;
 
 int getpeercred(int fd, struct ucred *ucred);
 int getpeersec(int fd, char **ret);
index 1087c264f0a86b7c0b17b7977097c80abb758332..11da6f4ab7a7713f744e734deb96d930d821c886 100644 (file)
@@ -85,15 +85,15 @@ bool statx_mount_same(const struct statx *a, const struct statx *b);
 
 int xstatfsat(int dir_fd, const char *path, struct statfs *ret);
 
-usec_t statx_timestamp_load(const struct statx_timestamp *ts);
-nsec_t statx_timestamp_load_nsec(const struct statx_timestamp *ts);
+usec_t statx_timestamp_load(const struct statx_timestamp *ts) _pure_;
+nsec_t statx_timestamp_load_nsec(const struct statx_timestamp *ts) _pure_;
 
 void inode_hash_func(const struct stat *q, struct siphash *state);
 int inode_compare_func(const struct stat *a, const struct stat *b);
 extern const struct hash_ops inode_hash_ops;
 
-const char* inode_type_to_string(mode_t m);
-mode_t inode_type_from_string(const char *s);
+const char* inode_type_to_string(mode_t m) _const_;
+mode_t inode_type_from_string(const char *s) _pure_;
 
 /* Macros that check whether the stat/statx structures have been initialized already. For "struct stat" we
  * use a check for .st_dev being non-zero, since the kernel unconditionally fills that in, mapping the file
index f28d9f12aac43d9bab4f1b6be39ccdae51400f9e..b715e85299db4de353f5b9e8ae6addd0d9a40357 100644 (file)
@@ -124,11 +124,11 @@ static inline char* skip_leading_chars(const char *s, const char *bad) {
         return (char*) s + strspn(s, bad);
 }
 
-char ascii_tolower(char x);
+char ascii_tolower(char x) _const_;
 char* ascii_strlower(char *s);
 char* ascii_strlower_n(char *s, size_t n);
 
-char ascii_toupper(char x);
+char ascii_toupper(char x) _const_;
 char* ascii_strupper(char *s);
 
 int ascii_strcasecmp_n(const char *a, const char *b, size_t n);
@@ -257,7 +257,7 @@ typedef enum MakeCStringMode {
 
 int make_cstring(const char *s, size_t n, MakeCStringMode mode, char **ret);
 
-size_t strspn_from_end(const char *str, const char *accept);
+size_t strspn_from_end(const char *str, const char *accept) _pure_;
 
 char* strdupspn(const char *a, const char *accept);
 char* strdupcspn(const char *a, const char *reject);
@@ -279,12 +279,11 @@ char* find_line_startswith(const char *haystack, const char *needle);
 char* find_line(const char *haystack, const char *needle);
 char* find_line_after(const char *haystack, const char *needle);
 
-bool version_is_valid(const char *s);
-
-bool version_is_valid_versionspec(const char *s);
+bool version_is_valid(const char *s) _pure_;
+bool version_is_valid_versionspec(const char *s) _pure_;
 
 ssize_t strlevenshtein(const char *x, const char *y);
 
-char* strrstr(const char *haystack, const char *needle);
+char* strrstr(const char *haystack, const char *needle) _pure_;
 
-size_t str_common_prefix(const char *a, const char *b);
+size_t str_common_prefix(const char *a, const char *b) _pure_;
index 55eb020d5694c3a3001e8889cbde33e71c9c654a..394376a8062dc12f98fd4915682e6abd4c9d23c5 100644 (file)
@@ -80,14 +80,14 @@ int strv_consume_prepend(char ***l, char *value);
 
 char** strv_remove(char **l, const char *s);
 char** strv_uniq(char **l);
-bool strv_is_uniq(char * const *l);
+bool strv_is_uniq(char * const *l) _pure_;
 
-int strv_compare(char * const *a, char * const *b);
+int strv_compare(char * const *a, char * const *b) _pure_;
 static inline bool strv_equal(char * const *a, char * const *b) {
         return strv_compare(a, b) == 0;
 }
 
-bool strv_equal_ignore_order(char * const *a, char * const *b);
+bool strv_equal_ignore_order(char * const *a, char * const *b) _pure_;
 
 char** strv_new_internal(const char *x, ...) _sentinel_;
 char** strv_new_ap(const char *x, va_list ap);
index c2c7d3983d569301556e2ef062f7331dac13545c..8ce25ab35c3dfed2283c3fd02bc2ec0c407936c8 100644 (file)
@@ -18,7 +18,7 @@
 #define MAP_UID_MIN ((uid_t) 60514)
 #define MAP_UID_MAX ((uid_t) 60577)
 
-bool uid_is_valid(uid_t uid);
+bool uid_is_valid(uid_t uid) _const_;
 
 static inline bool gid_is_valid(gid_t gid) {
         return uid_is_valid((uid_t) gid);
@@ -37,8 +37,7 @@ char* getusername_malloc(void);
 const char* default_root_shell_at(int rfd);
 const char* default_root_shell(const char *root);
 
-bool is_nologin_shell(const char *shell);
-
+bool is_nologin_shell(const char *shell) _pure_;
 bool shell_is_placeholder(const char *shell) _pure_;
 
 typedef enum UserCredsFlags {
index e5368205bd53c238501400847def6cdaf979edc1..dc97f4aee716cc50fe3ba747199c24826f241c2d 100644 (file)
@@ -6,7 +6,7 @@
 #define UTF8_REPLACEMENT_CHARACTER "\xef\xbf\xbd"
 #define UTF8_BYTE_ORDER_MARK "\xef\xbb\xbf"
 
-bool unichar_is_valid(char32_t c);
+bool unichar_is_valid(char32_t c) _const_;
 
 char* utf8_is_valid_n(const char *str, size_t len_bytes) _pure_;
 static inline char* utf8_is_valid(const char *str) {
@@ -35,10 +35,10 @@ size_t utf16_encode_unichar(char16_t *out, char32_t c);
 char* utf16_to_utf8(const char16_t *s, size_t length /* bytes! */);
 char16_t *utf8_to_utf16(const char *s, size_t length);
 
-size_t char16_strlen(const char16_t *s); /* returns the number of 16-bit words in the string (not bytes!) */
-size_t char16_strsize(const char16_t *s);
+size_t char16_strlen(const char16_t *s) _pure_; /* returns the number of 16-bit words in the string (not bytes!) */
+size_t char16_strsize(const char16_t *s) _pure_;
 
-int utf8_encoded_valid_unichar(const char *str, size_t length);
+int utf8_encoded_valid_unichar(const char *str, size_t length) _pure_;
 int utf8_encoded_to_unichar(const char *str, char32_t *ret_unichar);
 
 static inline bool utf16_is_surrogate(char16_t c) {
@@ -53,8 +53,8 @@ static inline char32_t utf16_surrogate_pair_to_unichar(char16_t lead, char16_t t
         return ((((char32_t) lead - 0xd800U) << 10) + ((char32_t) trail - 0xdc00U) + 0x10000U);
 }
 
-size_t utf8_n_codepoints(const char *str);
-int utf8_char_console_width(const char *str);
-size_t utf8_console_width(const char *str);
+size_t utf8_n_codepoints(const char *str) _pure_;
+int utf8_char_console_width(const char *str) _pure_;
+size_t utf8_console_width(const char *str) _pure_;
 
-size_t utf8_last_length(const char *s, size_t n);
+size_t utf8_last_length(const char *s, size_t n) _pure_;
index 920caf5175872619f26dc20898b09c4049f1b136..e9a122e31dc1808119fbdf91188da223a3f399a8 100644 (file)
@@ -103,8 +103,8 @@ typedef enum ExitClean {
         EXIT_CLEAN_COMMAND,
 } ExitClean;
 
-bool is_clean_exit(int code, int status, ExitClean clean, const ExitStatusSet *success_status);
+bool is_clean_exit(int code, int status, ExitClean clean, const ExitStatusSet *success_status) _pure_;
 
 void exit_status_set_free(ExitStatusSet *x);
-bool exit_status_set_is_empty(const ExitStatusSet *x);
-bool exit_status_set_test(const ExitStatusSet *x, int code, int status);
+bool exit_status_set_is_empty(const ExitStatusSet *x) _pure_;
+bool exit_status_set_test(const ExitStatusSet *x, int code, int status) _pure_;
index 309bb32bc22a178f1677602e337819681fe60c4d..f81c377c68375cd589ba812bd29a01876a6806cd 100644 (file)
@@ -29,19 +29,19 @@ typedef enum PartitionDesignator {
         _PARTITION_DESIGNATOR_INVALID = -EINVAL,
 } PartitionDesignator;
 
-bool partition_designator_is_versioned(PartitionDesignator d);
+bool partition_designator_is_versioned(PartitionDesignator d) _const_;
 
-PartitionDesignator partition_verity_of(PartitionDesignator p);
-PartitionDesignator partition_verity_sig_of(PartitionDesignator p);
-PartitionDesignator partition_verity_to_data(PartitionDesignator d);
-PartitionDesignator partition_verity_sig_to_data(PartitionDesignator d);
+PartitionDesignator partition_verity_of(PartitionDesignator p) _const_;
+PartitionDesignator partition_verity_sig_of(PartitionDesignator p) _const_;
+PartitionDesignator partition_verity_to_data(PartitionDesignator d) _const_;
+PartitionDesignator partition_verity_sig_to_data(PartitionDesignator d) _const_;
 
 const char* partition_designator_to_string(PartitionDesignator d) _const_;
 PartitionDesignator partition_designator_from_string(const char *name) _pure_;
 
 const char* partition_mountpoint_to_string(PartitionDesignator d) _const_;
 
-const char* gpt_partition_type_uuid_to_string(sd_id128_t id);
+const char* gpt_partition_type_uuid_to_string(sd_id128_t id) _const_;
 const char* gpt_partition_type_uuid_to_string_harder(
                 sd_id128_t id,
                 char buffer[static SD_ID128_UUID_STRING_MAX]);
@@ -49,7 +49,7 @@ const char* gpt_partition_type_uuid_to_string_harder(
 #define GPT_PARTITION_TYPE_UUID_TO_STRING_HARDER(id) \
         gpt_partition_type_uuid_to_string_harder((id), (char[SD_ID128_UUID_STRING_MAX]) {})
 
-Architecture gpt_partition_type_uuid_to_arch(sd_id128_t id);
+Architecture gpt_partition_type_uuid_to_arch(sd_id128_t id) _const_;
 
 typedef struct GptPartitionType {
         sd_id128_t uuid;
@@ -65,14 +65,14 @@ int gpt_partition_label_valid(const char *s);
 GptPartitionType gpt_partition_type_from_uuid(sd_id128_t id);
 int gpt_partition_type_from_string(const char *s, GptPartitionType *ret);
 
-GptPartitionType gpt_partition_type_override_architecture(GptPartitionType type, Architecture arch);
+GptPartitionType gpt_partition_type_override_architecture(GptPartitionType type, Architecture arch) _const_;
 
 const char* gpt_partition_type_mountpoint_nulstr(GptPartitionType type);
 
-bool gpt_partition_type_knows_read_only(GptPartitionType type);
-bool gpt_partition_type_knows_growfs(GptPartitionType type);
-bool gpt_partition_type_knows_no_auto(GptPartitionType type);
-bool gpt_partition_type_has_filesystem(GptPartitionType type);
+bool gpt_partition_type_knows_read_only(GptPartitionType type) _const_;
+bool gpt_partition_type_knows_growfs(GptPartitionType type) _const_;
+bool gpt_partition_type_knows_no_auto(GptPartitionType type) _const_;
+bool gpt_partition_type_has_filesystem(GptPartitionType type) _const_;
 
 typedef struct {
         uint8_t partition_type_guid[16];
@@ -100,4 +100,4 @@ typedef struct {
         le32_t partition_entry_array_crc32;
 } _packed_ GptHeader;
 
-bool gpt_header_has_signature(const GptHeader *p);
+bool gpt_header_has_signature(const GptHeader *p) _pure_;
index c450fd1a2e52a2ff71413dea85837ebbedadad29..765fc613ba7d49a6b848789b2f4824132586921a 100644 (file)
@@ -52,5 +52,5 @@ UserDisposition group_record_disposition(GroupRecord *h);
 
 bool group_record_matches_group_name(const GroupRecord *g, const char *groupname);
 
-bool group_record_is_root(const GroupRecord *g);
-bool group_record_is_nobody(const GroupRecord *g);
+bool group_record_is_root(const GroupRecord *g) _pure_;
+bool group_record_is_nobody(const GroupRecord *g) _pure_;
index eca4c765a05e8a6981747a4f3533c31cafd0f3ed..ffe6fb5227455048b8db895a49def15262fb85df 100644 (file)
@@ -19,14 +19,14 @@ void main_finalize(int r, int exit_status);
                 return result_to_return_value(r);                       \
         }
 
-int exit_failure_if_negative(int result);
+int exit_failure_if_negative(int result) _const_;
 
 /* Negative return values from impl are mapped to EXIT_FAILURE, and
  * everything else means success! */
 #define DEFINE_MAIN_FUNCTION(impl)                                      \
         _DEFINE_MAIN_FUNCTION(,impl(argc, argv), exit_failure_if_negative, exit_failure_if_negative)
 
-int exit_failure_if_nonzero(int result);
+int exit_failure_if_nonzero(int result) _const_;
 
 /* Zero is mapped to EXIT_SUCCESS, negative values are mapped to EXIT_FAILURE,
  * and positive values are propagated.
index 5d505c17dc97b06dc99acd07c2b6fdb5fa556290..9e1787b2c5ac996c649b6c1c56ed6c4066e5f255 100644 (file)
@@ -3,8 +3,8 @@
 
 #include "forward.h"
 
-bool mount_point_is_api(const char *path);
-bool mount_point_ignore(const char *path);
+bool mount_point_is_api(const char *path) _pure_;
+bool mount_point_ignore(const char *path) _pure_;
 
 int mount_setup_early(void);
 int mount_setup(bool loaded_policy, bool leave_propagation);
index 9839d47dc77772dfb4822ad2e9f298f93d948406..1bb46d3d3cd67f50d399d136343c00708813576c 100644 (file)
@@ -22,4 +22,4 @@
 
 int namespace_flags_from_string(const char *name, unsigned long *ret);
 int namespace_flags_to_string(unsigned long flags, char **ret);
-const char* namespace_single_flag_to_string(unsigned long flag);
+const char* namespace_single_flag_to_string(unsigned long flag) _const_;