From: Kamalesh Babulal Date: Thu, 30 Jun 2022 14:38:54 +0000 (+0530) Subject: tools/tools-common.h: increase the column width to 100 X-Git-Tag: v3.0~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a7c4ef4f07c8593e97cdb4b0d6f5eb26d815303;p=thirdparty%2Flibcgroup.git tools/tools-common.h: increase the column width to 100 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 Signed-off-by: Tom Hromatka --- diff --git a/src/tools/tools-common.h b/src/tools/tools-common.h index cbc9610f..20ce28aa 100644 --- a/src/tools/tools-common.h +++ b/src/tools/tools-common.h @@ -19,10 +19,10 @@ extern "C" { #include -#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 */