]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
tools/tools-common.h: increase the column width to 100
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Thu, 30 Jun 2022 14:38:54 +0000 (20:08 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 11 Jul 2022 19:19:54 +0000 (13:19 -0600)
100 column width is more comfortable to read over 80 columns, lets
increase it.  This patch, also introduced/removes empty lines across
the file, making it more readable.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/tools/tools-common.h

index cbc9610ff8839d79628f24e912c9472957c22967..20ce28aa4f85366d0e69654136df1cc49914e771 100644 (file)
@@ -19,10 +19,10 @@ extern "C" {
 
 #include <libcgroup.h>
 
-#define cgroup_err(x...) cgroup_log(CGROUP_LOG_ERROR, "Error: " x)
-#define cgroup_warn(x...) cgroup_log(CGROUP_LOG_WARNING, "Warning: " x)
-#define cgroup_info(x...) cgroup_log(CGROUP_LOG_INFO, "Info: " x)
-#define cgroup_dbg(x...) cgroup_log(CGROUP_LOG_DEBUG, x)
+#define cgroup_err(x...)       cgroup_log(CGROUP_LOG_ERROR, "Error: " x)
+#define cgroup_warn(x...)      cgroup_log(CGROUP_LOG_WARNING, "Warning: " x)
+#define cgroup_info(x...)      cgroup_log(CGROUP_LOG_INFO, "Info: " x)
+#define cgroup_dbg(x...)       cgroup_log(CGROUP_LOG_DEBUG, x)
 
 #define err(x...)      fprintf(stderr, x)
 #define info(x...)     fprintf(stdout, x)
@@ -49,16 +49,16 @@ struct cgroup_string_list {
  * The option must have form of 'controller1,controller2,..:group_name'.
  *
  * The parsed list of controllers and group name is added at the end of
- * provided cdptr, i.e. on place of first NULL cgroup_group_spec*.
+ * provided cdptr,
+ * i.e. on place of first NULL cgroup_group_spec*.
  *
- * @param cdptr Target data structure to fill. New item is allocated and added
- *             at the end.
+ * @param cdptr Target data structure to fill. New item is allocated and
+ *     added at the end.
  * @param optarg Argument to parse.
  * @param capacity The capacity of the cdptr array.
  * @return 0 on success, != 0 on error.
  */
-int parse_cgroup_spec(struct cgroup_group_spec **cdptr, char *optarg,
-               int capacity);
+int parse_cgroup_spec(struct cgroup_group_spec **cdptr, char *optarg, int capacity);
 
 /**
  * Free a single cgroup_group_spec structure.
@@ -66,14 +66,12 @@ int parse_cgroup_spec(struct cgroup_group_spec **cdptr, char *optarg,
  */
 void cgroup_free_group_spec(struct cgroup_group_spec *cl);
 
-
 /**
  * Initialize a new list.
  * @param list The list to initialize.
  * @param initial_size The initial size of the list to pre-allocate.
  */
-int cgroup_string_list_init(struct cgroup_string_list *list,
-                           int initial_size);
+int cgroup_string_list_init(struct cgroup_string_list *list, int initial_size);
 
 /**
  * Destroy a list, automatically freeing all its items.
@@ -82,26 +80,23 @@ int cgroup_string_list_init(struct cgroup_string_list *list,
 void cgroup_string_list_free(struct cgroup_string_list *list);
 
 /**
- * Adds new item to the list. It automatically resizes underlying array if
- * needed.
+ * Adds new item to the list. It automatically resizes underlying array if needed.
  * @param list The list to modify.
  * @param item The item to add. The item is automatically copied to new buffer.
  */
-int cgroup_string_list_add_item(struct cgroup_string_list *list,
-                               const char *item);
+int cgroup_string_list_add_item(struct cgroup_string_list *list, const char *item);
 
 /**
- * Add alphabetically sorted files present in given directory (without subdirs)
- * to list of strings. The function exits on error.
+ * Add alphabetically sorted files present in given directory
+ * (without subdirs) to list of strings.
+ * The function exits on error.
  * @param list The list to add files to.
  * @param dirname Full path to directory to examime.
- * @param program_name Name of the executable, it will be used for printing
- * errors to stderr.
- *
+ * @param program_name Name of the executable, it will be used for
+ *     printing errors to stderr.
  */
-int cgroup_string_list_add_directory(struct cgroup_string_list *list,
-                                    char *dirname, char *program_name);
-
+int cgroup_string_list_add_directory(struct cgroup_string_list *list, char *dirname,
+                                    char *program_name);
 
 /**
  * Parse file permissions as octal number.
@@ -118,18 +113,16 @@ int parse_mode(char *string, mode_t *pmode, const char *program_name);
  * @param gid Parsed GID (-1 if 'group' is missing in the string).
  * @param program_name Argv[0] to show error messages.
  */
-int parse_uid_gid(char *string, uid_t *uid, gid_t *gid,
-                 const char *program_name);
+int parse_uid_gid(char *string, uid_t *uid, gid_t *gid, const char *program_name);
 
 /**
- * Functions that are defined as STATIC can be placed within the UNIT_TEST
- * ifdef.  This will allow them to be included in the unit tests while
- * remaining static in a normal libcgroup build.
+ * Functions that are defined as STATIC can be placed within the
+ * UNIT_TEST ifdef.  This will allow them to be included in the unit tests
+ * while remaining static in a normal libcgroup build.
  */
 #ifdef UNIT_TEST
 
-int parse_r_flag(const char * const program_name,
-                const char * const name_value_str,
+int parse_r_flag(const char * const program_name, const char * const name_value_str,
                 struct control_value * const name_value);
 
 #endif /* UNIT_TEST */