]> Kevux Git Server - fll/commitdiff
Progress: Continue mass converting to f_string_static_t and use const more.
authorKevin Day <thekevinday@gmail.com>
Thu, 17 Feb 2022 04:45:52 +0000 (22:45 -0600)
committerKevin Day <thekevinday@gmail.com>
Thu, 17 Feb 2022 04:49:48 +0000 (22:49 -0600)
Continue on in the f_string_static_t refactoring.
Also take care of adding "const" to the function parameters that pass pointers.

25 files changed:
level_0/f_account/c/account.c
level_0/f_account/c/account.h
level_0/f_account/c/private-account.c
level_0/f_account/c/private-account.h
level_0/f_account/tests/unit/c/test-account-by_name.c
level_0/f_account/tests/unit/c/test-account-group_id_by_name.c
level_0/f_account/tests/unit/c/test-account-id_by_name.c
level_0/f_account/tests/unit/c/test-account.h
level_0/f_capability/c/capability.c
level_0/f_capability/c/capability.h
level_0/f_capability/tests/unit/c/test-capability-file_get.c
level_0/f_capability/tests/unit/c/test-capability-file_set.c
level_0/f_capability/tests/unit/c/test-capability-from_name.c
level_0/f_capability/tests/unit/c/test-capability-from_text.c
level_0/f_capability/tests/unit/c/test-capability-mode_get_name.c
level_0/f_capability/tests/unit/c/test-capability.h
level_0/f_color/tests/unit/c/test-color.h
level_0/f_console/tests/unit/c/test-console.h
level_0/f_control_group/tests/unit/c/test-control_group.h
level_0/f_conversion/tests/unit/c/test-conversion.h
level_0/f_memory/tests/unit/c/test-memory.h
level_0/f_type_array/tests/unit/c/test-type_array.h
level_3/controller/c/controller/private-controller.c
level_3/controller/c/rule/private-rule.c
level_3/fake/c/private-make.c

index 5088951fd1eb9ee7cfae46f4fedb38b2e0b3e2fa..9d67cd36b94b4fbb9dc7f8190e0912b4ccd1f3d0 100644 (file)
@@ -6,7 +6,7 @@ extern "C" {
 #endif
 
 #ifndef _di_f_account_by_id_
-  f_status_t f_account_by_id(const uid_t id, f_account_t *account) {
+  f_status_t f_account_by_id(const uid_t id, f_account_t * const account) {
     #ifndef _di_level_0_parameter_checking_
       if (!account) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -87,7 +87,7 @@ extern "C" {
 #endif // _di_f_account_by_id_
 
 #ifndef _di_f_account_by_name_
-  f_status_t f_account_by_name(const f_string_t name, f_account_t *account) {
+  f_status_t f_account_by_name(const f_string_static_t name, f_account_t * const account) {
     #ifndef _di_level_0_parameter_checking_
       if (!account) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -117,7 +117,7 @@ extern "C" {
       errno = 0;
 
       char buffer[length];
-      const int result = getpwnam_r(name, &password, buffer, length, &pointer);
+      const int result = getpwnam_r(name.string, &password, buffer, length, &pointer);
 
       if (result) {
         if (errno == EINTR) return F_status_set_error(F_interrupt);
@@ -146,7 +146,7 @@ extern "C" {
 
     char buffer[F_account_pwd_length_fallback_second_d];
 
-    const int result = getpwnam_r(name, &password, buffer, length, &pointer);
+    const int result = getpwnam_r(name.string, &password, buffer, length, &pointer);
 
     if (result) {
       if (errno == EINTR) return F_status_set_error(F_interrupt);
@@ -168,7 +168,7 @@ extern "C" {
 #endif // _di_f_account_by_name_
 
 #ifndef _di_f_account_group_id_by_name_
-  f_status_t f_account_group_id_by_name(const f_string_t name, gid_t *id) {
+  f_status_t f_account_group_id_by_name(const f_string_static_t name, gid_t * const id) {
     #ifndef _di_level_0_parameter_checking_
       if (!id) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -190,7 +190,7 @@ extern "C" {
       errno = 0;
 
       char buffer[length];
-      int result = getgrnam_r(name, &group_data, buffer, length, &pointer);
+      int result = getgrnam_r(name.string, &group_data, buffer, length, &pointer);
 
       if (result) {
         if (errno == EINTR) return F_status_set_error(F_interrupt);
@@ -221,7 +221,7 @@ extern "C" {
 
     char buffer[F_account_pwd_length_fallback_second_d];
 
-    const int result = getgrnam_r(name, &group_data, buffer, length, &pointer);
+    const int result = getgrnam_r(name.string, &group_data, buffer, length, &pointer);
 
     if (result) {
       if (errno == EINTR) return F_status_set_error(F_interrupt);
@@ -245,7 +245,7 @@ extern "C" {
 #endif // _di_f_account_group_id_by_name_
 
 #ifndef _di_f_account_group_name_by_id_
-  f_status_t f_account_group_name_by_id(const gid_t id, f_string_dynamic_t *name) {
+  f_status_t f_account_group_name_by_id(const gid_t id, f_string_dynamic_t * const name) {
     #ifndef _di_level_0_parameter_checking_
       if (!name) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -342,7 +342,7 @@ extern "C" {
 #endif // _di_f_account_group_name_by_id_
 
 #ifndef _di_f_account_id_by_name_
-  f_status_t f_account_id_by_name(const f_string_t name, uid_t *id) {
+  f_status_t f_account_id_by_name(const f_string_static_t name, uid_t * const id) {
     #ifndef _di_level_0_parameter_checking_
       if (!id) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -364,7 +364,7 @@ extern "C" {
       errno = 0;
 
       char buffer[length];
-      const int result = getpwnam_r(name, &password, buffer, length, &pointer);
+      const int result = getpwnam_r(name.string, &password, buffer, length, &pointer);
 
       if (result) {
         if (errno == EINTR) return F_status_set_error(F_interrupt);
@@ -395,7 +395,7 @@ extern "C" {
 
     char buffer[F_account_pwd_length_fallback_second_d];
 
-    const int result = getpwnam_r(name, &password, buffer, length, &pointer);
+    const int result = getpwnam_r(name.string, &password, buffer, length, &pointer);
 
     if (result) {
       if (errno == EINTR) return F_status_set_error(F_interrupt);
@@ -419,7 +419,7 @@ extern "C" {
 #endif // _di_f_account_id_by_name_
 
 #ifndef _di_f_account_name_by_id_
-  f_status_t f_account_name_by_id(const uid_t id, f_string_dynamic_t *name) {
+  f_status_t f_account_name_by_id(const uid_t id, f_string_dynamic_t * const name) {
     #ifndef _di_level_0_parameter_checking_
       if (!name) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
index 7be1e31d06e3ee5c9ccba7188bc0838525ff34ca..e5b60d04b23e14afabef88369004619a2987de56 100644 (file)
@@ -56,7 +56,7 @@ extern "C" {
  * @see getpwuid_r()
  */
 #ifndef _di_f_account_by_id_
-  extern f_status_t f_account_by_id(const uid_t id, f_account_t *account);
+  extern f_status_t f_account_by_id(const uid_t id, f_account_t * const account);
 #endif // _di_f_account_by_id_
 
 /**
@@ -84,7 +84,7 @@ extern "C" {
  * @see getpwnam_r()
  */
 #ifndef _di_f_account_by_name_
-  extern f_status_t f_account_by_name(const f_string_t name, f_account_t *account);
+  extern f_status_t f_account_by_name(const f_string_static_t name, f_account_t * const account);
 #endif // _di_f_account_by_name_
 
 /**
@@ -111,7 +111,7 @@ extern "C" {
  * @see getgrnam_r()
  */
 #ifndef _di_f_account_group_id_by_name_
-  extern f_status_t f_account_group_id_by_name(const f_string_t name, gid_t *id);
+  extern f_status_t f_account_group_id_by_name(const f_string_static_t name, gid_t * const id);
 #endif // _di_f_account_group_id_by_name_
 
 /**
@@ -121,7 +121,7 @@ extern "C" {
  *   The id of the group.
  * @param name
  *   This is replaced with by the group name.
- *   The name will be NULL terminated.
+ *   The name will be NULL terminated after the name.used.
  *
  * @return
  *   F_none on success.
@@ -138,7 +138,7 @@ extern "C" {
  * @see getgrgid_r()
  */
 #ifndef _di_f_account_group_name_by_id_
-  extern f_status_t f_account_group_name_by_id(const gid_t id, f_string_dynamic_t *name);
+  extern f_status_t f_account_group_name_by_id(const gid_t id, f_string_dynamic_t * const name);
 #endif // _di_f_account_group_name_by_id_
 
 /**
@@ -165,7 +165,7 @@ extern "C" {
  * @see getpwnam_r()
  */
 #ifndef _di_f_account_id_by_name_
-  extern f_status_t f_account_id_by_name(const f_string_t name, uid_t *id);
+  extern f_status_t f_account_id_by_name(const f_string_static_t name, uid_t * const id);
 #endif // _di_f_account_id_by_name_
 
 /**
@@ -175,7 +175,7 @@ extern "C" {
  *   The id of the user.
  * @param name
  *   This is replaced with by the user name.
- *   The name will be NULL terminated.
+ *   The name will be NULL terminated after the name.used.
  *
  * @return
  *   F_none on success.
@@ -192,7 +192,7 @@ extern "C" {
  * @see getpwuid_r()
  */
 #ifndef _di_f_account_name_by_id_
-  extern f_status_t f_account_name_by_id(const uid_t id, f_string_dynamic_t *name);
+  extern f_status_t f_account_name_by_id(const uid_t id, f_string_dynamic_t * const name);
 #endif // _di_f_account_name_by_id_
 
 #ifdef __cplusplus
index f0619c9a17e85b288d5acd15638ce8a90aaea7c3..307d207d7c99da9c629e62ac24ea9dcfb9af0537 100644 (file)
@@ -6,7 +6,7 @@ extern "C" {
 #endif
 
 #if !defined(_di_f_account_by_name_) || !defined(_di_f_account_by_id_)
-  f_status_t private_f_account_from_passwd(const struct passwd password, const f_array_length_t password_length, f_account_t *account) {
+  f_status_t private_f_account_from_passwd(const struct passwd password, const f_array_length_t password_length, f_account_t * const account) {
 
     f_status_t status = F_none;
 
index 911efca01a5570e5953c94670785f3d6db37f842..2ec37ff457c2c8cb901d4e330a0b65dacb3c1975 100644 (file)
@@ -39,7 +39,7 @@ extern "C" {
  * @see macro_f_string_dynamic_t_resize()
  */
 #if !defined(_di_f_account_by_name_) || !defined(_di_f_account_by_id_)
-  extern f_status_t private_f_account_from_passwd(const struct passwd password, const f_array_length_t password_length, f_account_t *account) F_attribute_visibility_internal_d;
+  extern f_status_t private_f_account_from_passwd(const struct passwd password, const f_array_length_t password_length, f_account_t * const account) F_attribute_visibility_internal_d;
 #endif // !defined(_di_f_account_by_name_) || !defined(_di_f_account_by_id_)
 
 #ifdef __cplusplus
index e1faebf15748a17e675492b398be859580752c1c..6fa40329bbfcf15b4201c87ab6182908c68cf109 100644 (file)
@@ -8,9 +8,13 @@ extern "C" {
 void test__f_account_by_name__fails(void **state) {
 
   const long size = 20;
-  char *name = "name";
   f_account_t account = f_account_t_initialize;
 
+  f_string_t name_string = "name";
+  f_string_static_t name = f_string_static_t_initialize;
+  name.string = name_string;
+  name.used = 4;
+
   int errnos[] = {
     EINTR,
     EIO,
@@ -49,9 +53,13 @@ void test__f_account_by_name__not_found(void **state) {
 
   const long size = 20;
   struct passwd password;
-  char *name = "name";
   f_account_t account = f_account_t_initialize;
 
+  f_string_t name_string = "name";
+  f_string_static_t name = f_string_static_t_initialize;
+  name.string = name_string;
+  name.used = 4;
+
   {
     will_return(__wrap_sysconf, size);
     will_return(__wrap_getpwnam_r, false);
@@ -69,7 +77,7 @@ void test__f_account_by_name__not_found(void **state) {
 #ifndef _di_level_0_parameter_checking_
   void test__f_account_by_name__parameter_checking(void **state) {
 
-    const f_string_t name = f_string_t_initialize;
+    const f_string_static_t name = f_string_static_t_initialize;
 
     {
       const f_status_t status = f_account_by_name(name, 0);
@@ -84,14 +92,18 @@ void test__f_account_by_name__works(void **state) {
   const long size = 20;
   struct passwd password;
   struct passwd pointer;
-  char *name = "name";
   f_account_t account = f_account_t_initialize;
 
+  f_string_t name_string = "name";
+  f_string_static_t name = f_string_static_t_initialize;
+  name.string = name_string;
+  name.used = 4;
+
   password.pw_uid = 1;
   password.pw_gid = 2;
   password.pw_dir = "pw_dir";
   password.pw_gecos = "pw_gecos";
-  password.pw_name = name;
+  password.pw_name = name_string;
   password.pw_passwd = "pw_passwd";
   password.pw_shell = "pw_shell";
 
index 954e5b3ef7c8153023193a3ce5da23fe960b47dd..0e91d954a4587a5acdc07193880cd28b87a3c47d 100644 (file)
@@ -8,9 +8,13 @@ extern "C" {
 void test__f_account_group_id_by_name__fails(void **state) {
 
   const long size = 20;
-  char *name = "name";
   gid_t gid = 0;
 
+  f_string_t name_string = "name";
+  f_string_static_t name = f_string_static_t_initialize;
+  name.string = name_string;
+  name.used = 4;
+
   int errnos[] = {
     EINTR,
     EIO,
@@ -47,9 +51,13 @@ void test__f_account_group_id_by_name__not_found(void **state) {
 
   const long size = 20;
   struct group group_data;
-  char *name = "name";
   gid_t gid = 0;
 
+  f_string_t name_string = "name";
+  f_string_static_t name = f_string_static_t_initialize;
+  name.string = name_string;
+  name.used = 4;
+
   {
     will_return(__wrap_sysconf, size);
     will_return(__wrap_getgrnam_r, false);
@@ -65,7 +73,7 @@ void test__f_account_group_id_by_name__not_found(void **state) {
 #ifndef _di_level_0_parameter_checking_
   void test__f_account_group_id_by_name__parameter_checking(void **state) {
 
-    const f_string_t name = f_string_t_initialize;
+    const f_string_static_t name = f_string_static_t_initialize;
 
     {
       const f_status_t status = f_account_group_id_by_name(name, 0);
@@ -83,6 +91,8 @@ void test__f_account_group_id_by_name__works(void **state) {
   char *pointers[] = { "gr_mem", 0 };
   gid_t gid = 0;
 
+  f_string_static_t name = f_string_static_t_initialize;
+
   group_data.gr_gid = 1;
   group_data.gr_name = "gr_name";
   group_data.gr_passwd = "gr_passwd";
@@ -94,7 +104,10 @@ void test__f_account_group_id_by_name__works(void **state) {
     will_return(__wrap_getgrnam_r, &group_data);
     will_return(__wrap_getgrnam_r, &pointer);
 
-    const f_status_t status = f_account_group_id_by_name(group_data.gr_name, &gid);
+    name.string = group_data.gr_name;
+    name.used = strlen(group_data.gr_name);
+
+    const f_status_t status = f_account_group_id_by_name(name, &gid);
 
     assert_int_equal(status, F_none);
     assert_int_equal(gid, group_data.gr_gid);
index eeea2ae541820eb319d0cca4871a2eb4e340b85d..cb4998c3acdae4e0918618345e2df2b056e371d4 100644 (file)
@@ -8,9 +8,13 @@ extern "C" {
 void test__f_account_id_by_name__fails(void **state) {
 
   const long size = 20;
-  char *name = "name";
   uid_t uid = 0;
 
+  f_string_t name_string = "name";
+  f_string_static_t name = f_string_static_t_initialize;
+  name.string = name_string;
+  name.used = 4;
+
   int errnos[] = {
     EINTR,
     EIO,
@@ -47,9 +51,13 @@ void test__f_account_id_by_name__not_found(void **state) {
 
   const long size = 20;
   struct passwd password;
-  char *name = "name";
   uid_t uid = 0;
 
+  f_string_t name_string = "name";
+  f_string_static_t name = f_string_static_t_initialize;
+  name.string = name_string;
+  name.used = 4;
+
   {
     will_return(__wrap_sysconf, size);
     will_return(__wrap_getpwnam_r, false);
@@ -65,7 +73,7 @@ void test__f_account_id_by_name__not_found(void **state) {
 #ifndef _di_level_0_parameter_checking_
   void test__f_account_id_by_name__parameter_checking(void **state) {
 
-    const f_string_t name = f_string_t_initialize;
+    const f_string_static_t name = f_string_static_t_initialize;
 
     {
       const f_status_t status = f_account_id_by_name(name, 0);
@@ -82,6 +90,8 @@ void test__f_account_id_by_name__works(void **state) {
   struct passwd pointer;
   uid_t uid = 0;
 
+  f_string_static_t name = f_string_static_t_initialize;
+
   password.pw_uid = 1;
   password.pw_gid = 2;
   password.pw_dir = "pw_dir";
@@ -96,7 +106,10 @@ void test__f_account_id_by_name__works(void **state) {
     will_return(__wrap_getpwnam_r, &password);
     will_return(__wrap_getpwnam_r, &pointer);
 
-    const f_status_t status = f_account_id_by_name(password.pw_name, &uid);
+    name.string = password.pw_name;
+    name.used = strlen(password.pw_name);
+
+    const f_status_t status = f_account_id_by_name(name, &uid);
 
     assert_int_equal(status, F_none);
     assert_int_equal(uid, password.pw_uid);
index 369a2a82c6a52c3f1d7b0b48b44553708a709dfb..6e4e8db27abe8b4106466d1d954ca74e0ac2990f 100644 (file)
 // FLL-0 includes.
 #include <fll/level_0/account.h>
 
-// mock includes.
+// Mock includes.
 #include "mock-account.h"
 
-// test includes.
+// Test includes.
 #include "test-account-by_id.h"
 #include "test-account-by_name.h"
 #include "test-account-group_id_by_name.h"
index e56864a53bfacb437fc8d9401e1c55e99cdd86b3..2240ca46a6c132d6b036fedbf117986aed76edc4 100644 (file)
@@ -7,7 +7,7 @@ extern "C" {
 #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
 
   #ifndef _di_f_capability_ambient_get_
-    f_status_t f_capability_ambient_get(const f_capability_value_t value, int *ambient) {
+    f_status_t f_capability_ambient_get(const f_capability_value_t value, int * const ambient) {
       #ifndef _di_level_0_parameter_checking_
         if (!ambient) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -33,7 +33,7 @@ extern "C" {
 #ifdef _di_libcap_
 
   #ifndef _di_f_capability_clear_
-    f_status_t f_capability_clear(f_capability_t *capability) {
+    f_status_t f_capability_clear(f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -43,7 +43,7 @@ extern "C" {
   #endif // _di_f_capability_clear_
 
   #ifndef _di_f_capability_clear_flag_
-    f_status_t f_capability_clear_flag(const f_capability_flag_t flag, f_capability_t *capability) {
+    f_status_t f_capability_clear_flag(const f_capability_flag_t flag, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -53,13 +53,13 @@ extern "C" {
   #endif // _di_f_capability_clear_flag_
 
   #ifndef _di_f_capability_compare_
-    f_status_t f_capability_compare(const f_capability_t capability1, const f_capability_t capability2, int *flags) {
+    f_status_t f_capability_compare(const f_capability_t capability1, const f_capability_t capability2, int * const flags) {
       return F_status_set_error(F_implemented_not);
     }
   #endif // _di_f_capability_compare_
 
   #ifndef _di_f_capability_copy_
-    f_status_t f_capability_copy(const f_capability_t source, f_capability_t *destination) {
+    f_status_t f_capability_copy(const f_capability_t source, f_capability_t * const destination) {
       #ifndef _di_level_0_parameter_checking_
         if (!destination) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -69,7 +69,7 @@ extern "C" {
   #endif // _di_f_capability_copy_
 
   #ifndef _di_f_capability_copy_external_
-    f_status_t f_capability_copy_external(const f_capability_t capability, const ssize_t max, void *external, ssize_t *size) {
+    f_status_t f_capability_copy_external(const f_capability_t capability, const ssize_t max, void * const external, ssize_t * const size) {
       #ifndef _di_level_0_parameter_checking_
         if (!external) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -79,7 +79,7 @@ extern "C" {
   #endif // _di_f_capability_copy_external_
 
   #ifndef _di_f_capability_copy_internal_
-    f_status_t f_capability_copy_internal(const void *external, f_capability_t *capability) {
+    f_status_t f_capability_copy_internal(const void *external, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!external) return F_status_set_error(F_parameter);
         if (!capability) return F_status_set_error(F_parameter);
@@ -100,7 +100,7 @@ extern "C" {
   #endif // _di_f_capability_delete_
 
   #ifndef _di_f_capability_file_descriptor_get_
-    f_status_t f_capability_file_descriptor_get(const int descriptor, f_capability_t *capability) {
+    f_status_t f_capability_file_descriptor_get(const int descriptor, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -116,7 +116,7 @@ extern "C" {
   #endif // _di_f_capability_file_descriptor_set_
 
   #ifndef _di_f_capability_file_get_
-    f_status_t f_capability_file_get(const f_string_t path, f_capability_t *capability) {
+    f_status_t f_capability_file_get(const f_string_static_t path, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -126,13 +126,13 @@ extern "C" {
   #endif // _di_f_capability_file_get_
 
   #ifndef _di_f_capability_file_set_
-    f_status_t f_capability_file_set(const f_string_t path, const f_capability_t capability) {
+    f_status_t f_capability_file_set(const f_string_static_t path, const f_capability_t capability) {
       return F_status_set_error(F_implemented_not);
     }
   #endif // _di_f_capability_file_set_
 
   #ifndef _di_f_capability_flag_get_
-    f_status_t f_capability_flag_get(const f_capability_t capability, const f_capability_value_t code, const f_capability_flag_t flag, f_capability_flag_value_t *enabled) {
+    f_status_t f_capability_flag_get(const f_capability_t capability, const f_capability_value_t code, const f_capability_flag_t flag, f_capability_flag_value_t * const enabled) {
       #ifndef _di_level_0_parameter_checking_
         if (!enabled) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -142,7 +142,7 @@ extern "C" {
   #endif // _di_f_capability_flag_get_
 
   #ifndef _di_f_capability_flag_set_
-    f_status_t f_capability_flag_set(const f_capability_flag_t flag, const f_capability_flag_value_t enabled, const f_int32s_t codes, f_capability_t *capability) {
+    f_status_t f_capability_flag_set(const f_capability_flag_t flag, const f_capability_flag_value_t enabled, const f_int32s_t codes, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -152,7 +152,7 @@ extern "C" {
   #endif // _di_f_capability_flag_set_
 
   #ifndef _di_f_capability_from_name_
-    f_status_t f_capability_from_name(const f_string_t name, f_capability_value_t *code) {
+    f_status_t f_capability_from_name(const f_string_static_t name, f_capability_value_t * const code) {
       #ifndef _di_level_0_parameter_checking_
         if (!code) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -162,7 +162,7 @@ extern "C" {
   #endif // _di_f_capability_from_name_
 
   #ifndef _di_f_capability_from_text_
-    f_status_t f_capability_from_text(const f_string_t text, f_capability_t *capability) {
+    f_status_t f_capability_from_text(const f_string_static_t text, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -186,7 +186,7 @@ extern "C" {
 #ifdef _di_libcap_
 
   #ifndef _di_f_capability_initialize_
-    f_status_t f_capability_initialize(f_capability_t *capability) {
+    f_status_t f_capability_initialize(f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -200,7 +200,7 @@ extern "C" {
 #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
 
   #ifndef _di_f_capability_mode_get_
-    f_status_t f_capability_mode_get(f_capability_mode_t *mode) {
+    f_status_t f_capability_mode_get(f_capability_mode_t * const mode) {
       #ifndef _di_level_0_parameter_checking_
         if (!mode) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -210,7 +210,7 @@ extern "C" {
   #endif // _di_f_capability_mode_get_
 
   #ifndef _di_f_capability_mode_get_name_
-    f_status_t f_capability_mode_get_name(const f_capability_mode_t mode, f_string_constant_t *name) {
+    f_status_t f_capability_mode_get_name(const f_capability_mode_t mode, f_string_static_t * const name) {
       #ifndef _di_level_0_parameter_checking_
         if (!name) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -226,7 +226,7 @@ extern "C" {
   #endif // _di_f_capability_mode_set_
 
   #ifndef _di_f_capability_owner_get_
-    f_status_t f_capability_owner_get(const f_capability_t capability, uid_t *id_user) {
+    f_status_t f_capability_owner_get(const f_capability_t capability, uid_t * const id_user) {
       #ifndef _di_level_0_parameter_checking_
         if (!id_user) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -246,7 +246,7 @@ extern "C" {
 #ifdef _di_libcap_
 
   #ifndef _di_f_capability_process_bound_drop_
-    f_status_t f_capability_process_bound_drop(f_capability_value_t code, int *bound) {
+    f_status_t f_capability_process_bound_drop(f_capability_value_t code, int * const bound) {
       #ifndef _di_level_0_parameter_checking_
         if (!bound) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -256,7 +256,7 @@ extern "C" {
   #endif // _di_f_capability_process_bound_drop_
 
   #ifndef _di_f_capability_process_bound_get_
-    f_status_t f_capability_process_bound_get(f_capability_value_t code, int *bound) {
+    f_status_t f_capability_process_bound_get(f_capability_value_t code, int * const bound) {
       #ifndef _di_level_0_parameter_checking_
         if (!bound) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -266,7 +266,7 @@ extern "C" {
   #endif // _di_f_capability_process_bound_get_
 
   #ifndef _di_f_capability_process_get_
-    f_status_t f_capability_process_get(f_capability_t *capability) {
+    f_status_t f_capability_process_get(f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -276,7 +276,7 @@ extern "C" {
   #endif // _di_f_capability_process_get_
 
   #ifndef _di_f_capability_process_get_by_id_
-    f_status_t f_capability_process_get_by_id(const pid_t id, f_capability_t *capability) {
+    f_status_t f_capability_process_get_by_id(const pid_t id, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -296,7 +296,7 @@ extern "C" {
 #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
 
   #ifndef _di_f_capability_security_bits_get_
-    f_status_t f_capability_security_bits_get(f_capability_bits_t *bits) {
+    f_status_t f_capability_security_bits_get(f_capability_bits_t * const bits) {
       #ifndef _di_level_0_parameter_checking_
         if (!bits) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -316,7 +316,7 @@ extern "C" {
 #ifdef _di_libcap_
 
   #ifndef _di_f_capability_size_
-    f_status_t f_capability_size(const f_capability_t capability, ssize_t *size) {
+    f_status_t f_capability_size(const f_capability_t capability, ssize_t * const size) {
       #ifndef _di_level_0_parameter_checking_
         if (!size) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -352,7 +352,7 @@ extern "C" {
   #endif // _di_f_capability_supported_code_
 
   #ifndef _di_f_capability_to_name_
-    f_status_t f_capability_to_name(const int code, f_string_dynamic_t *name) {
+    f_status_t f_capability_to_name(const int code, f_string_dynamic_t * const name) {
       #ifndef _di_level_0_parameter_checking_
         if (!name) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -362,7 +362,7 @@ extern "C" {
   #endif // _di_f_capability_to_name_
 
   #ifndef _di_f_capability_to_text_
-    f_status_t f_capability_to_text(const f_capability_t capability, f_string_dynamic_t *text) {
+    f_status_t f_capability_to_text(const f_capability_t capability, f_string_dynamic_t * const text) {
       #ifndef _di_level_0_parameter_checking_
         if (!text) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -386,7 +386,7 @@ extern "C" {
 #if !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
 
   #ifndef _di_f_capability_ambient_get_
-    f_status_t f_capability_ambient_get(const f_capability_value_t value, int *ambient) {
+    f_status_t f_capability_ambient_get(const f_capability_value_t value, int * const ambient) {
       #ifndef _di_level_0_parameter_checking_
         if (!ambient) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -438,7 +438,7 @@ extern "C" {
 #ifndef _di_libcap_
 
   #ifndef _di_f_capability_clear_
-    f_status_t f_capability_clear(f_capability_t *capability) {
+    f_status_t f_capability_clear(f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -456,7 +456,7 @@ extern "C" {
   #endif // _di_f_capability_clear_
 
   #ifndef _di_f_capability_clear_flag_
-    f_status_t f_capability_clear_flag(const f_capability_flag_t flag, f_capability_t *capability) {
+    f_status_t f_capability_clear_flag(const f_capability_flag_t flag, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -472,7 +472,7 @@ extern "C" {
   #endif // _di_f_capability_clear_flag_
 
   #ifndef _di_f_capability_compare_
-    f_status_t f_capability_compare(const f_capability_t capability1, const f_capability_t capability2, int *flags) {
+    f_status_t f_capability_compare(const f_capability_t capability1, const f_capability_t capability2, int * const flags) {
 
       if (flags) {
         *flags = 0;
@@ -499,7 +499,7 @@ extern "C" {
   #endif // _di_f_capability_compare_
 
   #ifndef _di_f_capability_copy_
-    f_status_t f_capability_copy(const f_capability_t source, f_capability_t *destination) {
+    f_status_t f_capability_copy(const f_capability_t source, f_capability_t * const destination) {
       #ifndef _di_level_0_parameter_checking_
         if (!destination) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -518,7 +518,7 @@ extern "C" {
   #endif // _di_f_capability_copy_
 
   #ifndef _di_f_capability_copy_external_
-    f_status_t f_capability_copy_external(const f_capability_t capability, const ssize_t max, void *external, ssize_t *size) {
+    f_status_t f_capability_copy_external(const f_capability_t capability, const ssize_t max, void * const external, ssize_t * const size) {
       #ifndef _di_level_0_parameter_checking_
         if (!external) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -540,7 +540,7 @@ extern "C" {
   #endif // _di_f_capability_copy_external_
 
   #ifndef _di_f_capability_copy_internal_
-    f_status_t f_capability_copy_internal(const void *external, f_capability_t *capability) {
+    f_status_t f_capability_copy_internal(const void * const external, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!external) return F_status_set_error(F_parameter);
         if (!capability) return F_status_set_error(F_parameter);
@@ -561,7 +561,7 @@ extern "C" {
   #endif // _di_f_capability_copy_internal_
 
   #ifndef _di_f_capability_delete_
-    f_status_t f_capability_delete(f_capability_t *capability) {
+    f_status_t f_capability_delete(f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -580,7 +580,7 @@ extern "C" {
   #endif // _di_f_capability_delete_
 
   #ifndef _di_f_capability_file_descriptor_get_
-    f_status_t f_capability_file_descriptor_get(const int descriptor, f_capability_t *capability) {
+    f_status_t f_capability_file_descriptor_get(const int descriptor, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -627,12 +627,12 @@ extern "C" {
   #endif // _di_f_capability_file_descriptor_set_
 
   #ifndef _di_f_capability_file_get_
-    f_status_t f_capability_file_get(const f_string_t path, f_capability_t *capability) {
+    f_status_t f_capability_file_get(const f_string_static_t path, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
 
-      *capability = cap_get_file(path);
+      *capability = cap_get_file(path.string);
 
       if (*capability) {
         return F_none;
@@ -652,9 +652,9 @@ extern "C" {
   #endif // _di_f_capability_file_get_
 
   #ifndef _di_f_capability_file_set_
-    f_status_t f_capability_file_set(const f_string_t path, const f_capability_t capability) {
+    f_status_t f_capability_file_set(const f_string_static_t path, const f_capability_t capability) {
 
-      const int result = cap_set_file(path, capability);
+      const int result = cap_set_file(path.string, capability);
 
       if (result == -1) {
         if (errno == EACCES) return F_status_set_error(F_access_denied);
@@ -674,7 +674,7 @@ extern "C" {
   #endif // _di_f_capability_file_set_
 
   #ifndef _di_f_capability_flag_get_
-    f_status_t f_capability_flag_get(const f_capability_t capability, const f_capability_value_t code, const f_capability_flag_t flag, f_capability_flag_value_t *enabled) {
+    f_status_t f_capability_flag_get(const f_capability_t capability, const f_capability_value_t code, const f_capability_flag_t flag, f_capability_flag_value_t * const enabled) {
       #ifndef _di_level_0_parameter_checking_
         if (!enabled) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -690,7 +690,7 @@ extern "C" {
   #endif // _di_f_capability_flag_get_
 
   #ifndef _di_f_capability_flag_set_
-    f_status_t f_capability_flag_set(const f_capability_flag_t flag, const f_capability_flag_value_t enabled, const f_int32s_t codes, f_capability_t *capability) {
+    f_status_t f_capability_flag_set(const f_capability_flag_t flag, const f_capability_flag_value_t enabled, const f_int32s_t codes, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -706,12 +706,12 @@ extern "C" {
   #endif // _di_f_capability_flag_set_
 
   #ifndef _di_f_capability_from_name_
-    f_status_t f_capability_from_name(const f_string_t name, f_capability_value_t *code) {
+    f_status_t f_capability_from_name(const f_string_static_t name, f_capability_value_t * const code) {
       #ifndef _di_level_0_parameter_checking_
         if (!code) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
 
-      if (cap_from_name(name, code) == -1) {
+      if (cap_from_name(name.string, code) == -1) {
         if (errno == EINVAL) return F_status_set_error(F_parameter);
         if (errno == ENOMEM) return F_status_set_error(F_memory_not);
 
@@ -723,12 +723,12 @@ extern "C" {
   #endif // _di_f_capability_from_name_
 
   #ifndef _di_f_capability_from_text_
-    f_status_t f_capability_from_text(const f_string_t text, f_capability_t *capability) {
+    f_status_t f_capability_from_text(const f_string_static_t text, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
 
-      *capability = cap_from_text(text);
+      *capability = cap_from_text(text.string);
 
       if (*capability) {
         return F_none;
@@ -765,7 +765,7 @@ extern "C" {
 #ifndef _di_libcap_
 
   #ifndef _di_f_capability_initialize_
-    f_status_t f_capability_initialize(f_capability_t *capability) {
+    f_status_t f_capability_initialize(f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -800,13 +800,15 @@ extern "C" {
   #endif // _di_f_capability_mode_get_
 
   #ifndef _di_f_capability_mode_get_name_
-    f_status_t f_capability_mode_get_name(const f_capability_mode_t mode, f_string_constant_t *name) {
+    f_status_t f_capability_mode_get_name(const f_capability_mode_t mode, f_string_static_t * const name) {
       #ifndef _di_level_0_parameter_checking_
         if (!mode) return F_status_set_error(F_parameter);
         if (!name) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
 
-      *name = cap_mode_name(mode);
+      name.string = cap_mode_name(mode);
+      name.used = strnlen(name.string, F_string_t_size_d);
+      name.size = 0;
 
       return F_none;
     }
@@ -828,7 +830,7 @@ extern "C" {
   #endif // _di_f_capability_mode_set_
 
   #ifndef _di_f_capability_owner_get_
-    f_status_t f_capability_owner_get(const f_capability_t capability, uid_t *id_user) {
+    f_status_t f_capability_owner_get(const f_capability_t capability, uid_t * const id_user) {
       #ifndef _di_level_0_parameter_checking_
         if (!id_user) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -864,7 +866,7 @@ extern "C" {
 #ifndef _di_libcap_
 
   #ifndef _di_f_capability_process_bound_drop_
-    f_status_t f_capability_process_bound_drop(f_capability_value_t value, int *bound) {
+    f_status_t f_capability_process_bound_drop(f_capability_value_t value, int * const bound) {
       #ifndef _di_level_0_parameter_checking_
         if (!bound) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -884,7 +886,7 @@ extern "C" {
   #endif // _di_f_capability_process_bound_drop_
 
   #ifndef _di_f_capability_process_bound_get_
-    f_status_t f_capability_process_bound_get(f_capability_value_t value, int *bound) {
+    f_status_t f_capability_process_bound_get(f_capability_value_t value, int * const bound) {
       #ifndef _di_level_0_parameter_checking_
         if (!bound) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -900,7 +902,7 @@ extern "C" {
   #endif // _di_f_capability_process_bound_get_
 
   #ifndef _di_f_capability_process_get_
-    f_status_t f_capability_process_get(f_capability_t *capability) {
+    f_status_t f_capability_process_get(f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -919,7 +921,7 @@ extern "C" {
   #endif // _di_f_capability_process_get_
 
   #ifndef _di_f_capability_process_get_by_id_
-    f_status_t f_capability_process_get_by_id(const pid_t id, f_capability_t *capability) {
+    f_status_t f_capability_process_get_by_id(const pid_t id, f_capability_t * const capability) {
       #ifndef _di_level_0_parameter_checking_
         if (!capability) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -954,7 +956,7 @@ extern "C" {
 #if !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
 
   #ifndef _di_f_capability_security_bits_get_
-    f_status_t f_capability_security_bits_get(f_capability_bits_t *bits) {
+    f_status_t f_capability_security_bits_get(f_capability_bits_t * const bits) {
       #ifndef _di_level_0_parameter_checking_
         if (!bits) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -985,7 +987,7 @@ extern "C" {
 #ifndef _di_libcap_
 
   #ifndef _di_f_capability_size_
-    f_status_t f_capability_size(const f_capability_t capability, ssize_t *size) {
+    f_status_t f_capability_size(const f_capability_t capability, ssize_t * const size) {
       #ifndef _di_level_0_parameter_checking_
         if (!size) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -1041,7 +1043,7 @@ extern "C" {
   #endif // _di_f_capability_supported_code_
 
   #ifndef _di_f_capability_to_name_
-    f_status_t f_capability_to_name(const int code, f_string_dynamic_t *name) {
+    f_status_t f_capability_to_name(const int code, f_string_dynamic_t * const name) {
       #ifndef _di_level_0_parameter_checking_
         if (!name) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
@@ -1082,7 +1084,7 @@ extern "C" {
   #endif // _di_f_capability_to_name_
 
   #ifndef _di_f_capability_to_text_
-    f_status_t f_capability_to_text(const f_capability_t capability, f_string_dynamic_t *text) {
+    f_status_t f_capability_to_text(const f_capability_t capability, f_string_dynamic_t * const text) {
       #ifndef _di_level_0_parameter_checking_
         if (!text) return F_status_set_error(F_parameter);
       #endif // _di_level_0_parameter_checking_
index 60c3fa54a5bd18836e4c894bd076d3c8ce413e64..d9ce645b598cfcd5c730020b3785a04b88e147d3 100644 (file)
@@ -68,7 +68,7 @@ extern "C" {
  * @see cap_set_ambient()
  */
 #ifndef _di_f_capability_ambient_get_
-  extern f_status_t f_capability_ambient_get(const f_capability_value_t value, int *ambient);
+  extern f_status_t f_capability_ambient_get(const f_capability_value_t value, int * const ambient);
 #endif // _di_f_capability_ambient_get_
 
 /**
@@ -131,7 +131,7 @@ extern "C" {
  * @see cap_clear()
  */
 #ifndef _di_f_capability_clear_
-  extern f_status_t f_capability_clear(f_capability_t *capability);
+  extern f_status_t f_capability_clear(f_capability_t * const capability);
 #endif // _di_f_capability_clear_
 
 /**
@@ -154,7 +154,7 @@ extern "C" {
  * @see cap_clear_flag()
  */
 #ifndef _di_f_capability_clear_flag_
-  extern f_status_t f_capability_clear_flag(const f_capability_flag_t flag, f_capability_t *capability);
+  extern f_status_t f_capability_clear_flag(const f_capability_flag_t flag, f_capability_t * const capability);
 #endif // _di_f_capability_clear_flag_
 
 /**
@@ -180,7 +180,7 @@ extern "C" {
  * @see cap_compare()
  */
 #ifndef _di_f_capability_compare_
-  extern f_status_t f_capability_compare(const f_capability_t capability1, const f_capability_t capability2, int *flags);
+  extern f_status_t f_capability_compare(const f_capability_t capability1, const f_capability_t capability2, int * const flags);
 #endif // _di_f_capability_compare_
 
 /**
@@ -204,7 +204,7 @@ extern "C" {
  * @see cap_dup()
  */
 #ifndef _di_f_capability_copy_
-  extern f_status_t f_capability_copy(const f_capability_t source, f_capability_t *destination);
+  extern f_status_t f_capability_copy(const f_capability_t source, f_capability_t * const destination);
 #endif // _di_f_capability_copy_
 
 /**
@@ -233,7 +233,7 @@ extern "C" {
  * @see cap_copy_ext()
  */
 #ifndef _di_f_capability_copy_external_
-  extern f_status_t f_capability_copy_external(const f_capability_t capability, const ssize_t max, void *external, ssize_t *size);
+  extern f_status_t f_capability_copy_external(const f_capability_t capability, const ssize_t max, void * const external, ssize_t * const size);
 #endif // _di_f_capability_copy_external_
 
 /**
@@ -258,7 +258,7 @@ extern "C" {
  * @see cap_copy_int()
  */
 #ifndef _di_f_capability_copy_internal_
-  extern f_status_t f_capability_copy_internal(const void *external, f_capability_t *capability);
+  extern f_status_t f_capability_copy_internal(const void * const external, f_capability_t * const capability);
 #endif // _di_f_capability_copy_internal_
 
 /**
@@ -280,7 +280,7 @@ extern "C" {
  * @see cap_free()
  */
 #ifndef _di_f_capability_delete_
-  extern f_status_t f_capability_delete(f_capability_t *capability);
+  extern f_status_t f_capability_delete(f_capability_t * const capability);
 #endif // _di_f_capability_delete_
 
 /**
@@ -311,7 +311,7 @@ extern "C" {
  * @see cap_get_fd()
  */
 #ifndef _di_f_capability_file_descriptor_get_
-  extern f_status_t f_capability_file_descriptor_get(const int descriptor, f_capability_t *capability);
+  extern f_status_t f_capability_file_descriptor_get(const int descriptor, f_capability_t * const capability);
 #endif // _di_f_capability_file_descriptor_get_
 
 /**
@@ -372,7 +372,7 @@ extern "C" {
  * @see cap_get_file()
  */
 #ifndef _di_f_capability_file_get_
-  extern f_status_t f_capability_file_get(const f_string_t path, f_capability_t *capability);
+  extern f_status_t f_capability_file_get(const f_string_static_t path, f_capability_t * const capability);
 #endif // _di_f_capability_file_get_
 
 /**
@@ -402,7 +402,7 @@ extern "C" {
  * @see cap_set_file()
  */
 #ifndef _di_f_capability_file_set_
-  extern f_status_t f_capability_file_set(const f_string_t path, const f_capability_t capability);
+  extern f_status_t f_capability_file_set(const f_string_static_t path, const f_capability_t capability);
 #endif // _di_f_capability_file_set_
 
 /**
@@ -429,7 +429,7 @@ extern "C" {
  * @see cap_get_flag()
  */
 #ifndef _di_f_capability_flag_get_
-  extern f_status_t f_capability_flag_get(const f_capability_t capability, const f_capability_value_t code, const f_capability_flag_t flag, f_capability_flag_value_t *enabled);
+  extern f_status_t f_capability_flag_get(const f_capability_t capability, const f_capability_value_t code, const f_capability_flag_t flag, f_capability_flag_value_t * const enabled);
 #endif // _di_f_capability_flag_get
 
 /**
@@ -456,7 +456,7 @@ extern "C" {
  * @see cap_set_flag()
  */
 #ifndef _di_f_capability_flag_set_
-  extern f_status_t f_capability_flag_set(const f_capability_flag_t flag, const f_capability_flag_value_t enabled, const f_int32s_t codes, f_capability_t *capability);
+  extern f_status_t f_capability_flag_set(const f_capability_flag_t flag, const f_capability_flag_value_t enabled, const f_int32s_t codes, f_capability_t * const capability);
 #endif // _di_f_capability_flag_set_
 
 /**
@@ -480,17 +480,18 @@ extern "C" {
  * @see cap_from_name()
  */
 #ifndef _di_f_capability_from_name_
-  extern f_status_t f_capability_from_name(const f_string_t name, f_capability_value_t *code);
+  extern f_status_t f_capability_from_name(const f_string_static_t name, f_capability_value_t * const code);
 #endif // _di_f_capability_from_name_
 
 /**
  * Get the capability represented by the given string.
  *
  * @param text
- *   The human-readable NULL terminated string representing the capabilities (such as "cap_chown+ep").
+ *   The human-readable string representing the capabilities (such as "cap_chown+ep").
+ *   This must be a NULL terminated string.
  * @param capability
  *   The determined capabilities.
- *   This must be freed via f_capability_delete() when finished with.
+ *   This must be freed via f_capability_delete().
  *
  * @return
  *   F_none on success.
@@ -504,7 +505,7 @@ extern "C" {
  * @see cap_from_text()
  */
 #ifndef _di_f_capability_from_text_
-  extern f_status_t f_capability_from_text(const f_string_t text, f_capability_t *capability);
+  extern f_status_t f_capability_from_text(const f_string_static_t text, f_capability_t * const capability);
 #endif // _di_f_capability_from_text_
 
 /**
@@ -558,7 +559,7 @@ extern "C" {
  * @see cap_init()
  */
 #ifndef _di_f_capability_initialize_
-  extern f_status_t f_capability_initialize(f_capability_t *capability);
+  extern f_status_t f_capability_initialize(f_capability_t * const capability);
 #endif // _di_f_capability_initialize_
 
 /**
@@ -577,7 +578,7 @@ extern "C" {
  * @see cap_get_mode()
  */
 #ifndef _di_f_capability_mode_get_
-  extern f_status_t f_capability_mode_get(f_capability_mode_t *mode);
+  extern f_status_t f_capability_mode_get(f_capability_mode_t * const mode);
 #endif // _di_f_capability_mode_get_
 
 /**
@@ -587,8 +588,7 @@ extern "C" {
  *   The capability mode.
  * @param name
  *   The name of the mode.
- *   This is a NULL terminated string.
- *   This is not an allocated string.
+ *   This is NULL terminated after the name.used.
  *
  * @return
  *   F_none on success.
@@ -600,7 +600,7 @@ extern "C" {
  * @see cap_get_mode()
  */
 #ifndef _di_f_capability_mode_get_name_
-  extern f_status_t f_capability_mode_get_name(const f_capability_mode_t mode, f_string_constant_t *name);
+  extern f_status_t f_capability_mode_get_name(const f_capability_mode_t mode, f_string_static_t * const name);
 #endif // _di_f_capability_mode_get_name_
 
 /**
@@ -643,7 +643,7 @@ extern "C" {
  * @see cap_get_owner()
  */
 #ifndef _di_f_capability_owner_get_
-  extern f_status_t f_capability_owner_get(const f_capability_t capability, uid_t *id_user);
+  extern f_status_t f_capability_owner_get(const f_capability_t capability, uid_t * const id_user);
 #endif // _di_f_capability_owner_get_
 
 /**
@@ -704,7 +704,7 @@ extern "C" {
  * @see cap_drop_bound()
  */
 #ifndef _di_f_capability_process_bound_drop_
-  extern f_status_t f_capability_process_bound_drop(f_capability_value_t value, int *bound);
+  extern f_status_t f_capability_process_bound_drop(f_capability_value_t value, int * const bound);
 #endif // _di_f_capability_process_bound_drop_
 
 /**
@@ -727,7 +727,7 @@ extern "C" {
  * @see cap_get_bound()
  */
 #ifndef _di_f_capability_process_bound_get_
-  extern f_status_t f_capability_process_bound_get(f_capability_value_t value, int *bound);
+  extern f_status_t f_capability_process_bound_get(f_capability_value_t value, int * const bound);
 #endif // _di_f_capability_process_bound_get_
 
 /**
@@ -748,7 +748,7 @@ extern "C" {
  * @see cap_get_proc()
  */
 #ifndef _di_f_capability_process_get_
-  extern f_status_t f_capability_process_get(f_capability_t *capability);
+  extern f_status_t f_capability_process_get(f_capability_t * const capability);
 #endif // _di_f_capability_process_get_
 
 /**
@@ -772,7 +772,7 @@ extern "C" {
  * @see cap_get_pid()
  */
 #ifndef _di_f_capability_process_get_by_id_
-  extern f_status_t f_capability_process_get_by_id(const pid_t id, f_capability_t *capability);
+  extern f_status_t f_capability_process_get_by_id(const pid_t id, f_capability_t * const capability);
 #endif // _di_f_capability_process_get_by_id_
 
 /**
@@ -813,7 +813,7 @@ extern "C" {
  * @see cap_get_secbits()
  */
 #ifndef _di_f_capability_security_bits_get_
-  extern f_status_t f_capability_security_bits_get(f_capability_bits_t *bits);
+  extern f_status_t f_capability_security_bits_get(f_capability_bits_t * const bits);
 #endif // _di_f_capability_security_bits_get_
 
 /**
@@ -859,7 +859,7 @@ extern "C" {
  * @see cap_size()
  */
 #ifndef _di_f_capability_size_
-  extern f_status_t f_capability_size(const f_capability_t capability, ssize_t *size);
+  extern f_status_t f_capability_size(const f_capability_t capability, ssize_t * const size);
 #endif // _di_f_capability_size_
 
 /**
@@ -913,7 +913,7 @@ extern "C" {
  * @param name
  *   The determined name.
  *   The name is appended into this variable.
- *   This is not NULL terminated.
+ *   This is NULL terminated after the name.used.
  *
  * @return
  *   F_none on success.
@@ -933,18 +933,19 @@ extern "C" {
  * @see f_string_dynamic_resize()
  */
 #ifndef _di_f_capability_to_name_
-  extern f_status_t f_capability_to_name(const f_capability_value_t code, f_string_dynamic_t *name);
+  extern f_status_t f_capability_to_name(const f_capability_value_t code, f_string_dynamic_t * const name);
 #endif // _di_f_capability_to_name_
 
 /**
- * Convert the capability to a human-readable NULL terminated string.
+ * Convert the capability to a human-readable string.
  *
  * This will append the string to text.
  *
  * @param capability
  *   The capability code.
  * @param text
- *   The determined human-readable NULL terminated string.
+ *   The determined human-readable string.
+ *   This is NULL terminated after the text.used.
  *
  * @return
  *   F_none on success.
@@ -964,7 +965,7 @@ extern "C" {
  * @see f_string_dynamic_resize()
  */
 #ifndef _di_f_capability_to_text_
-  extern f_status_t f_capability_to_text(const f_capability_t capability, f_string_dynamic_t *text);
+  extern f_status_t f_capability_to_text(const f_capability_t capability, f_string_dynamic_t * const text);
 #endif // _di_f_capability_to_text_
 
 /**
index e02a9a64981d17d6a02402a8740943c486a81df4..2c72f783ee741cafda3447ebbd0e2ec66a9e27fa 100644 (file)
@@ -8,7 +8,7 @@ extern "C" {
 void test__f_capability_file_get__fails(void **state) {
 
   #if !defined(_di_libcap_)
-    const f_string_t path = f_string_t_initialize;
+    const f_string_static_t path = f_string_static_t_initialize;
     f_capability_t capability = f_capability_t_initialize;
 
     int errnos[] = {
@@ -50,7 +50,7 @@ void test__f_capability_file_get__fails(void **state) {
 #ifndef _di_level_0_parameter_checking_
   void test__f_capability_file_get__parameter_checking(void **state) {
 
-  const f_string_t path = f_string_t_initialize;
+  const f_string_static_t path = f_string_static_t_initialize;
 
     {
       const f_status_t status = f_capability_file_get(path, 0);
@@ -62,7 +62,7 @@ void test__f_capability_file_get__fails(void **state) {
 
 void test__f_capability_file_get__works(void **state) {
 
-  const f_string_t path = f_string_t_initialize;
+  const f_string_static_t path = f_string_static_t_initialize;
   f_capability_t capability = f_capability_t_initialize;
 
   #if defined(_di_libcap_)
index 25ca06973be8b008d872ff405bc624ec128e5f02..a1bb9dc7f1c5c35baadee5496349752fe3e01593 100644 (file)
@@ -8,7 +8,7 @@ extern "C" {
 void test__f_capability_file_set__fails(void **state) {
 
   #if !defined(_di_libcap_)
-    const f_string_t path = f_string_t_initialize;
+    const f_string_static_t path = f_string_static_t_initialize;
     f_capability_t capability = f_capability_t_initialize;
 
     int errnos[] = {
@@ -49,7 +49,7 @@ void test__f_capability_file_set__fails(void **state) {
 
 void test__f_capability_file_set__works(void **state) {
 
-  const f_string_t path = f_string_t_initialize;
+  const f_string_static_t path = f_string_static_t_initialize;
   f_capability_t capability = f_capability_t_initialize;
 
   #if defined(_di_libcap_)
index 73ba3dfddd0681faba9fd90c61b9deaf3eade7a8..c0e7eb806858486dae981d07e193247fb2130347 100644 (file)
@@ -8,7 +8,7 @@ extern "C" {
 void test__f_capability_from_name__fails(void **state) {
 
   #if !defined(_di_libcap_)
-    const f_string_t name = f_string_t_initialize;
+    const f_string_static_t name = f_string_static_t_initialize;
     f_capability_value_t capability_value = f_capability_value_t_initialize;
 
     int errnos[] = {
@@ -38,7 +38,7 @@ void test__f_capability_from_name__fails(void **state) {
 #ifndef _di_level_0_parameter_checking_
   void test__f_capability_from_name__parameter_checking(void **state) {
 
-    const f_string_t name = f_string_t_initialize;
+    const f_string_static_t name = f_string_static_t_initialize;
 
     {
       const f_status_t status = f_capability_from_name(name, 0);
@@ -50,7 +50,7 @@ void test__f_capability_from_name__fails(void **state) {
 
 void test__f_capability_from_name__works(void **state) {
 
-  const f_string_t name = f_string_t_initialize;
+  const f_string_static_t name = f_string_static_t_initialize;
   f_capability_value_t capability_value = f_capability_value_t_initialize;
 
   #if defined(_di_libcap_)
index 672dbc02c0e9a2f5034660a2e72239f94b8d8a8f..e9b48c659f2fa8ec96dad33c76e4086d8f280b93 100644 (file)
@@ -8,7 +8,7 @@ extern "C" {
 void test__f_capability_from_text__fails(void **state) {
 
   #if !defined(_di_libcap_)
-    const f_string_t text = f_string_t_initialize;
+    const f_string_static_t text = f_string_static_t_initialize;
     f_capability_t capability = f_capability_t_initialize;
 
     int errnos[] = {
@@ -38,7 +38,7 @@ void test__f_capability_from_text__fails(void **state) {
 #ifndef _di_level_0_parameter_checking_
   void test__f_capability_from_text__parameter_checking(void **state) {
 
-    const f_string_t text = f_string_t_initialize;
+    const f_string_static_t text = f_string_static_t_initialize;
 
     {
       const f_status_t status = f_capability_from_text(text, 0);
@@ -50,7 +50,7 @@ void test__f_capability_from_text__fails(void **state) {
 
 void test__f_capability_from_text__works(void **state) {
 
-  const f_string_t text = f_string_t_initialize;
+  const f_string_static_t text = f_string_static_t_initialize;
   f_capability_t capability = f_capability_t_initialize;
 
   #if defined(_di_libcap_)
index 78a0b3bd2e27b289331b87a1bfb47e46a2be7d47..a9d1443abd606a85c64fbd847531ac2ceabd291d 100644 (file)
@@ -21,7 +21,7 @@ extern "C" {
 void test__f_capability_mode_get_name__works(void **state) {
 
   const f_capability_mode_t mode = f_capability_mode_t_initialize;
-  f_string_constant_t constant = f_string_constant_t_initialize;
+  f_string_static_t name = f_string_static_t_initialize;
 
   #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
     printf("[  WARN    ] f_capability_mode_get_name() is not implemented and cannot be fully tested.\n");
@@ -30,7 +30,7 @@ void test__f_capability_mode_get_name__works(void **state) {
   #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
 
   {
-    const f_status_t status = f_capability_mode_get_name(mode, &constant);
+    const f_status_t status = f_capability_mode_get_name(mode, &name);
 
     #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
       assert_int_equal(F_status_set_fine(status), F_implemented_not);
index 1d3b9f34410ff289f8c2fd94d7d9324301ef4943..6278aea8ea8d2e3704b9799f3ede911889d5066a 100644 (file)
 // FLL-0 includes.
 #include <fll/level_0/capability.h>
 
-// mock includes.
+// Mock includes.
 #include "mock-capability.h"
 
-// test includes.
+// Test includes.
 #include "test-capability-ambient_get.h"
 #include "test-capability-ambient_reset.h"
 #include "test-capability-ambient_set.h"
index 865daa52e50ec0dc1bb74e62ac1c5a0bfc8cb898..d83c8e99fa619517b672791596b7cc05b4d84aef 100644 (file)
 // FLL-0 includes.
 #include <fll/level_0/color.h>
 
-// mock includes.
+// Mock includes.
 #include "mock-color.h"
 
-// test includes.
+// Test includes.
 #include "test-color-load_context.h"
 #include "test-color-save_1.h"
 #include "test-color-save_2.h"
index 028e2ee1fabe232109362f71b5f91dc574d435ca..8ae1c4fa5bc53991403e3a3d715c620157a09837 100644 (file)
@@ -22,7 +22,7 @@
 // FLL-0 includes.
 #include <fll/level_0/console.h>
 
-// test includes.
+// Test includes.
 #include "test-console-identify.h"
 #include "test-console-environment_process.h"
 #include "test-console-parameter_prioritize_left.h"
index 29e026184e2d1c69a92eac45a4bf5f3cf9e14e82..f60f43c775dbc2590f8f1f2d1fb414165514c16e 100644 (file)
@@ -22,7 +22,7 @@
 // FLL-0 includes.
 #include <fll/level_0/control_group.h>
 
-// test includes.
+// Test includes.
 #include "test-control_group-copy.h"
 
 #ifdef __cplusplus
index 1cff4e418186f691e085065f9296071be80c9b8d..0164c8d34b8de7bd0ad10001774921a8fb2aaa45 100644 (file)
 // FLL-0 includes.
 #include <fll/level_0/conversion.h>
 
-// mock includes.
+// Mock includes.
 #include "mock-conversion.h"
 
-// test includes.
+// Test includes.
 #include "test-conversion-character_is_binary.h"
 #include "test-conversion-character_is_decimal.h"
 #include "test-conversion-character_is_duodecimal.h"
index 54ff21abd08579ff876ce493ef45bad9ea9b9907..880da15bce99938e931dd063deba4de098b7ca15 100644 (file)
@@ -22,7 +22,7 @@
 // FLL-0 includes.
 #include <fll/level_0/memory.h>
 
-// test includes.
+// Test includes.
 #include "test-memory-adjust.h"
 #include "test-memory-delete.h"
 #include "test-memory-destroy.h"
index aedad9ca18f36c617e4b0b656804fe63ca550ffa..32990594ccb578b380cc43964b847054b11ea2de 100644 (file)
@@ -24,7 +24,7 @@
 #include <fll/level_0/memory.h>
 #include <fll/level_0/type_array.h>
 
-// test includes.
+// Test includes.
 #include "test-type_array-array_lengths_adjust.h"
 #include "test-type_array-array_lengths_append.h"
 #include "test-type_array-array_lengths_decimate_by.h"
index 273c5d29fcf6cea137c94cf49c73fc9cb5d1da58..68917dd195a1ee63de4ad735a441e2c6e619c940 100644 (file)
@@ -335,7 +335,7 @@ extern "C" {
         status = controller_dynamic_rip_nulless_terminated(buffer, range, &cache->action.generic);
         if (F_status_is_error(status)) return status;
 
-        status = f_account_id_by_name(cache->action.generic.string, id);
+        status = f_account_id_by_name(cache->action.generic, id);
         if (F_status_is_error(status)) return status;
 
         if (status == F_exist_not) {
@@ -370,7 +370,7 @@ extern "C" {
         status = controller_dynamic_rip_nulless_terminated(buffer, range, &cache->action.generic);
         if (F_status_is_error(status)) return status;
 
-        status = f_account_group_id_by_name(cache->action.generic.string, id);
+        status = f_account_group_id_by_name(cache->action.generic, id);
         if (F_status_is_error(status)) return status;
 
         if (status == F_exist_not) {
index f39808e3ed17257397d268ad0dfcae0791ea0b9d..21c98f3beafde2815c186841e8f4e67b75b022a4 100644 (file)
@@ -4729,7 +4729,7 @@ extern "C" {
             }
           }
 
-          status = f_capability_from_text(cache->action.generic.string, &rule->capability);
+          status = f_capability_from_text(cache->action.generic, &rule->capability);
 
           if (F_status_is_error(status) && F_status_set_fine(status) != F_supported_not) {
             if (F_status_set_fine(status) == F_memory_not) {
index db59bf12909977748d0bdd098f6073c648de94a4..464ad4576a7df8438132fa4c18aa97685092ac35 100644 (file)
@@ -60,7 +60,7 @@ extern "C" {
       status = F_status_set_fine(status);
 
       if (status == F_number) {
-        status = f_account_group_id_by_name(buffer.string, id);
+        status = f_account_group_id_by_name(buffer, id);
 
         if (F_status_is_error(status)) {
           fll_error_print(print, F_status_set_fine(status), "f_account_group_id_by_name", F_true);
@@ -151,7 +151,7 @@ extern "C" {
       status = F_status_set_fine(status);
 
       if (status == F_number) {
-        status = f_account_id_by_name(buffer.string, id);
+        status = f_account_id_by_name(buffer, id);
 
         if (F_status_is_error(status)) {
           fll_error_print(print, status, "f_account_id_by_name", F_true);