Browse Source

Function's brace on new line

Serj Kalichev 3 years ago
parent
commit
2ac3b42bc5

+ 4 - 4
faux/base/fs.c

@@ -22,8 +22,8 @@
  * @param [in] path File/directory name.
  * @return 0 - success, < 0 on error.
  */
-int faux_rm(const char *path) {
-
+int faux_rm(const char *path)
+{
 	struct stat statbuf = {};
 	DIR *dir = NULL;
 	struct dirent *dir_entry = NULL;
@@ -64,8 +64,8 @@ int faux_rm(const char *path) {
  * @param [in] path Path to expand.
  * @return Expanded string or NULL on error.
  */
-char *faux_expand_tilde(const char *path) {
-
+char *faux_expand_tilde(const char *path)
+{
 	char *home_dir = getenv("HOME");
 	char *result = NULL;
 

+ 8 - 8
faux/base/io.c

@@ -18,8 +18,8 @@
  * @param [in] n Number of bytes to write.
  * @return Number of bytes written or < 0 on error.
  */
-ssize_t faux_write(int fd, const void *buf, size_t n) {
-
+ssize_t faux_write(int fd, const void *buf, size_t n)
+{
 	ssize_t bytes_written = 0;
 
 	assert(fd != -1);
@@ -50,8 +50,8 @@ ssize_t faux_write(int fd, const void *buf, size_t n) {
  * < n then insufficient space or error (but some data was already written).
  * < 0 - error.
  */
-ssize_t faux_write_block(int fd, const void *buf, size_t n) {
-
+ssize_t faux_write_block(int fd, const void *buf, size_t n)
+{
 	ssize_t bytes_written = 0;
 	size_t total_written = 0;
 	size_t left = n;
@@ -86,8 +86,8 @@ ssize_t faux_write_block(int fd, const void *buf, size_t n) {
  * @return Number of bytes readed or < 0 on error.
  * 0 bytes indicates EOF
  */
-ssize_t faux_read(int fd, void *buf, size_t n) {
-
+ssize_t faux_read(int fd, void *buf, size_t n)
+{
 	ssize_t bytes_readed = 0;
 
 	assert(fd != -1);
@@ -118,8 +118,8 @@ ssize_t faux_read(int fd, void *buf, size_t n) {
  * < n EOF or error (but some data was already readed).
  * < 0 Error.
  */
-size_t faux_read_block(int fd, void *buf, size_t n) {
-
+size_t faux_read_block(int fd, void *buf, size_t n)
+{
 	ssize_t bytes_readed = 0;
 	size_t total_readed = 0;
 	size_t left = n;

+ 8 - 8
faux/base/mem.c

@@ -22,8 +22,8 @@
  * @param [in] ptr Memory pointer to free.
  * @sa free()
  */
-void faux_free(void *ptr) {
-
+void faux_free(void *ptr)
+{
 #if 0
 	if (ptr)
 #endif
@@ -42,8 +42,8 @@ void faux_free(void *ptr) {
  * @return Allocated memory or NULL on error.
  * @sa malloc()
  */
-void *faux_malloc(size_t size) {
-
+void *faux_malloc(size_t size)
+{
 	assert(size != 0);
 	if (0 == size)
 		return NULL;
@@ -61,8 +61,8 @@ void *faux_malloc(size_t size) {
  * @param [in] size Size of memory (in bytes) to zero it.
  * @sa bzero()
  */
-void faux_bzero(void *ptr, size_t size) {
-
+void faux_bzero(void *ptr, size_t size)
+{
 	memset(ptr, '\0', size);
 }
 
@@ -76,8 +76,8 @@ void faux_bzero(void *ptr, size_t size) {
  * @param [in] size Memory size to allocate.
  * @return Allocated zeroed memory or NULL on error.
  */
-void *faux_zmalloc(size_t size) {
-
+void *faux_zmalloc(size_t size)
+{
 	void *ptr = NULL;
 
 	ptr = faux_malloc(size);

+ 20 - 20
faux/conv/conv.c

@@ -20,8 +20,8 @@
  * @param [in] base Base to convert.
  * @return 0 - success, < 0 - error
  */
-int faux_conv_atol(const char *str, long int *val, int base) {
-
+int faux_conv_atol(const char *str, long int *val, int base)
+{
 	char *endptr = NULL;
 	long int res = 0;
 
@@ -50,8 +50,8 @@ int faux_conv_atol(const char *str, long int *val, int base) {
  * @param [in] base Base to convert.
  * @return 0 - success, < 0 - error
  */
-int faux_conv_atoul(const char *str, unsigned long int *val, int base) {
-
+int faux_conv_atoul(const char *str, unsigned long int *val, int base)
+{
 	char *endptr = NULL;
 	unsigned long int res = 0;
 
@@ -80,8 +80,8 @@ int faux_conv_atoul(const char *str, unsigned long int *val, int base) {
  * @param [in] base Base to convert.
  * @return 0 - success, < 0 - error
  */
-int faux_conv_atoll(const char *str, long long int *val, int base) {
-
+int faux_conv_atoll(const char *str, long long int *val, int base)
+{
 	char *endptr = NULL;
 	long long int res = 0;
 
@@ -110,8 +110,8 @@ int faux_conv_atoll(const char *str, long long int *val, int base) {
  * @param [in] base Base to convert.
  * @return 0 - success, < 0 - error
  */
-int faux_conv_atoull(const char *str, unsigned long long int *val, int base) {
-
+int faux_conv_atoull(const char *str, unsigned long long int *val, int base)
+{
 	char *endptr = NULL;
 	unsigned long long int res = 0;
 
@@ -140,8 +140,8 @@ int faux_conv_atoull(const char *str, unsigned long long int *val, int base) {
  * @param [in] base Base to convert.
  * @return 0 - success, < 0 - error
  */
-int faux_conv_atoi(const char *str, int *val, int base) {
-
+int faux_conv_atoi(const char *str, int *val, int base)
+{
 	long int tmp = 0;
 
 	// Use existent func. The long int is longer or equal to int.
@@ -166,8 +166,8 @@ int faux_conv_atoi(const char *str, int *val, int base) {
  * @param [in] base Base to convert.
  * @return 0 - success, < 0 - error
  */
-int faux_conv_atoui(const char *str, unsigned int *val, int base) {
-
+int faux_conv_atoui(const char *str, unsigned int *val, int base)
+{
 	unsigned long int tmp = 0;
 
 	// Use existent func. The long int is longer or equal to int.
@@ -192,8 +192,8 @@ int faux_conv_atoui(const char *str, unsigned int *val, int base) {
  * @param [in] base Base to convert.
  * @return 0 - success, < 0 - error
  */
-int faux_conv_atos(const char *str, short *val, int base) {
-
+int faux_conv_atos(const char *str, short *val, int base)
+{
 	long int tmp = 0;
 
 	if (faux_conv_atol(str, &tmp, base) < 0)
@@ -217,8 +217,8 @@ int faux_conv_atos(const char *str, short *val, int base) {
  * @param [in] base Base to convert.
  * @return 0 - success, < 0 - error
  */
-int faux_conv_atous(const char *str, unsigned short *val, int base) {
-
+int faux_conv_atous(const char *str, unsigned short *val, int base)
+{
 	unsigned long int tmp = 0;
 
 	if (faux_conv_atoul(str, &tmp, base) < 0)
@@ -242,8 +242,8 @@ int faux_conv_atous(const char *str, unsigned short *val, int base) {
  * @param [in] base Base to convert.
  * @return 0 - success, < 0 - error
  */
-int faux_conv_atoc(const char *str, char *val, int base) {
-
+int faux_conv_atoc(const char *str, char *val, int base)
+{
 	long int tmp = 0;
 
 	if (faux_conv_atol(str, &tmp, base) < 0)
@@ -267,8 +267,8 @@ int faux_conv_atoc(const char *str, char *val, int base) {
  * @param [in] base Base to convert.
  * @return 0 - success, < 0 - error
  */
-int faux_conv_atouc(const char *str, unsigned char *val, int base) {
-
+int faux_conv_atouc(const char *str, unsigned char *val, int base)
+{
 	unsigned long int tmp = 0;
 
 	if (faux_conv_atoul(str, &tmp, base) < 0)

+ 8 - 8
faux/ctype/ctype.c

@@ -20,8 +20,8 @@
  * @param [in] c Character to classify.
  * @return BOOL_TRUE if char is digit and BOOL_FALSE else.
  */
-bool_t faux_ctype_isdigit(char c) {
-
+bool_t faux_ctype_isdigit(char c)
+{
 	// isdigit() man says that argument must be unsigned char
 	return isdigit((unsigned char)c) ? BOOL_TRUE : BOOL_FALSE;
 }
@@ -35,8 +35,8 @@ bool_t faux_ctype_isdigit(char c) {
  * @param [in] c Character to classify.
  * @return BOOL_TRUE if char is space and BOOL_FALSE else.
  */
-bool_t faux_ctype_isspace(char c) {
-
+bool_t faux_ctype_isspace(char c)
+{
 	// isspace() man says that argument must be unsigned char
 	return isspace((unsigned char)c) ? BOOL_TRUE : BOOL_FALSE;
 }
@@ -50,8 +50,8 @@ bool_t faux_ctype_isspace(char c) {
  * @param [in] c Character to convert.
  * @return Converted character.
  */
-char faux_ctype_tolower(char c) {
-
+char faux_ctype_tolower(char c)
+{
 	// tolower() man says that argument must be unsigned char
 	return tolower((unsigned char)c);
 }
@@ -64,8 +64,8 @@ char faux_ctype_tolower(char c) {
  * @param [in] c Character to convert.
  * @return Converted character.
  */
-char faux_ctype_toupper(char c) {
-
+char faux_ctype_toupper(char c)
+{
 	// toupper() man says that argument must be unsigned char
 	return toupper((unsigned char)c);
 }

+ 36 - 37
faux/file/file.c

@@ -37,8 +37,8 @@
  * @param [in] fd Already opened file descriptor.
  * @return Allocated and initialized file object or NULL on error.
  */
-faux_file_t *faux_file_fdopen(int fd) {
-
+faux_file_t *faux_file_fdopen(int fd)
+{
 	struct stat stat_struct = {};
 	faux_file_t *f = NULL;
 
@@ -81,8 +81,8 @@ faux_file_t *faux_file_fdopen(int fd) {
  * @param [in] mode File permissions if file will be created.
  * @return File object or NULL on error.
  */
-faux_file_t *faux_file_open(const char *pathname, int flags, mode_t mode) {
-
+faux_file_t *faux_file_open(const char *pathname, int flags, mode_t mode)
+{
 	int fd = -1;
 
 	assert(pathname);
@@ -105,8 +105,8 @@ faux_file_t *faux_file_open(const char *pathname, int flags, mode_t mode) {
  * @param [in] f File object to close and free.
  * @return 0 - success, < 0 - error
  */
-int faux_file_close(faux_file_t *f) {
-
+int faux_file_close(faux_file_t *f)
+{
 	int fd = -1;
 
 	assert(f);
@@ -128,8 +128,8 @@ int faux_file_close(faux_file_t *f) {
  * @param [in] f File object.
  * @return Linked file descriptor.
  */
-int faux_file_fileno(faux_file_t *f) {
-
+int faux_file_fileno(faux_file_t *f)
+{
 	assert(f);
 	if (!f)
 		return -1;
@@ -143,8 +143,8 @@ int faux_file_fileno(faux_file_t *f) {
  * @param [in] f File object
  * @return BOOL_TRUE if it's end of file and BOOL_FALSE else.
  */
-bool_t faux_file_eof(const faux_file_t *f) {
-
+bool_t faux_file_eof(const faux_file_t *f)
+{
 	assert(f);
 	if (!f)
 		return BOOL_FALSE;
@@ -169,8 +169,8 @@ bool_t faux_file_eof(const faux_file_t *f) {
  * @return Allocated string (with trailing '\0') with data to get.
  */
 static char *faux_file_takeaway(faux_file_t *f,
-	size_t bytes_get, size_t bytes_drop) {
-
+	size_t bytes_get, size_t bytes_drop)
+{
 	size_t remove_len = 0;
 	char *line = NULL;
 
@@ -207,8 +207,8 @@ static char *faux_file_takeaway(faux_file_t *f,
  * @param [in] f File object.
  * @return Allocated string (with trailing '\0') with data to get.
  */
-static char *faux_file_takeaway_rest(faux_file_t *f) {
-
+static char *faux_file_takeaway_rest(faux_file_t *f)
+{
 	assert(f);
 	if (!f)
 		return NULL;
@@ -230,8 +230,8 @@ static char *faux_file_takeaway_rest(faux_file_t *f) {
  * BOOL_FALSE - don't include
  * @return Allocated string (with trailing '\0') with line.
  */
-static char *faux_file_takeaway_line_internal(faux_file_t *f, bool_t raw) {
-
+static char *faux_file_takeaway_line_internal(faux_file_t *f, bool_t raw)
+{
 	char *find = NULL;
 	const char *eol = "\n\r";
 	size_t line_len = 0;
@@ -266,8 +266,8 @@ static char *faux_file_takeaway_line_internal(faux_file_t *f, bool_t raw) {
  * @param [in] f File object.
  * @return Allocated string (with trailing '\0') with line.
  */
-static char *faux_file_takeaway_line_raw(faux_file_t *f) {
-
+static char *faux_file_takeaway_line_raw(faux_file_t *f)
+{
 	return faux_file_takeaway_line_internal(f, BOOL_TRUE);
 }
 
@@ -283,8 +283,8 @@ static char *faux_file_takeaway_line_raw(faux_file_t *f) {
  * @param [in] f File object.
  * @return Allocated string (with trailing '\0') with line.
  */
-static char *faux_file_takeaway_line(faux_file_t *f) {
-
+static char *faux_file_takeaway_line(faux_file_t *f)
+{
 	return faux_file_takeaway_line_internal(f, BOOL_FALSE);
 }
 
@@ -297,8 +297,8 @@ static char *faux_file_takeaway_line(faux_file_t *f) {
  * @param [in] f File objects.
  * @return 0 - success, < 0 - error
  */
-static int faux_file_enlarge_buffer(faux_file_t *f) {
-
+static int faux_file_enlarge_buffer(faux_file_t *f)
+{
 	size_t new_size = 0;
 	char *new_buf = NULL;
 
@@ -332,8 +332,8 @@ static int faux_file_enlarge_buffer(faux_file_t *f) {
  * BOOL_FALSE - without trailing EOL
  * @return Line pointer or NULL on error.
  */
-char *faux_file_getline_internal(faux_file_t *f, bool_t raw) {
-
+char *faux_file_getline_internal(faux_file_t *f, bool_t raw)
+{
 	ssize_t bytes_readed = 0;
 
 	assert(f);
@@ -386,13 +386,12 @@ char *faux_file_getline_internal(faux_file_t *f, bool_t raw) {
  * @param [in] f File object.
  * @return Line pointer or NULL on error.
  */
-char *faux_file_getline_raw(faux_file_t *f) {
-
+char *faux_file_getline_raw(faux_file_t *f)
+{
 	return faux_file_getline_internal(f, BOOL_TRUE);
 }
 
 
-
 /** @brief Read line from file.
  *
  * Actually function searches for line within internal buffer. If line is not
@@ -404,8 +403,8 @@ char *faux_file_getline_raw(faux_file_t *f) {
  * @param [in] f File object.
  * @return Line pointer or NULL on error.
  */
-char *faux_file_getline(faux_file_t *f) {
-
+char *faux_file_getline(faux_file_t *f)
+{
 	return faux_file_getline_internal(f, BOOL_FALSE);
 }
 
@@ -421,8 +420,8 @@ char *faux_file_getline(faux_file_t *f) {
  * @param [in] n Number of bytes to write.
  * @return Number of bytes written or < 0 on error.
  */
-ssize_t faux_file_write(faux_file_t *f, const void *buf, size_t n) {
-
+ssize_t faux_file_write(faux_file_t *f, const void *buf, size_t n)
+{
 	assert(f);
 	if (!f)
 		return -1;
@@ -440,8 +439,8 @@ ssize_t faux_file_write(faux_file_t *f, const void *buf, size_t n) {
  * @param [in] n Number of bytes to write.
  * @return Number of bytes written or < 0 on error.
  */
-ssize_t faux_file_write_block(faux_file_t *f, const void *buf, size_t n) {
-
+ssize_t faux_file_write_block(faux_file_t *f, const void *buf, size_t n)
+{
 	assert(f);
 	if (!f)
 		return -1;
@@ -459,8 +458,8 @@ ssize_t faux_file_write_block(faux_file_t *f, const void *buf, size_t n) {
  * @param [in] n Number of bytes.
  * @return Number of bytes readed or < 0 on error.
  */
-ssize_t faux_file_read(faux_file_t *f, void *buf, size_t n) {
-
+ssize_t faux_file_read(faux_file_t *f, void *buf, size_t n)
+{
 	assert(f);
 	if (!f)
 		return -1;
@@ -480,8 +479,8 @@ ssize_t faux_file_read(faux_file_t *f, void *buf, size_t n) {
  * @param [in] n Number of bytes.
  * @return Number of bytes readed or < 0 on error.
  */
-ssize_t faux_file_read_block(faux_file_t *f, void *buf, size_t n) {
-
+ssize_t faux_file_read_block(faux_file_t *f, void *buf, size_t n)
+{
 	assert(f);
 	if (!f)
 		return -1;

+ 24 - 23
faux/ini/ini.c

@@ -21,8 +21,8 @@
  *
  * @return Allocated and initialized INI object or NULL on error.
  */
-faux_ini_t *faux_ini_new(void) {
-
+faux_ini_t *faux_ini_new(void)
+{
 	faux_ini_t *ini;
 
 	ini = faux_zmalloc(sizeof(*ini));
@@ -42,8 +42,8 @@ faux_ini_t *faux_ini_new(void) {
  * After using the INI object must be freed. Function frees INI objecr itself
  * and all pairs 'name/value' stored within INI object.
  */
-void faux_ini_free(faux_ini_t *ini) {
-
+void faux_ini_free(faux_ini_t *ini)
+{
 	assert(ini);
 	if (!ini)
 		return;
@@ -72,8 +72,8 @@ void faux_ini_free(faux_ini_t *ini) {
  * NULL on error
  */
 const faux_pair_t *faux_ini_set(
-	faux_ini_t *ini, const char *name, const char *value) {
-
+	faux_ini_t *ini, const char *name, const char *value)
+{
 	faux_pair_t *pair = NULL;
 	faux_list_node_t *node = NULL;
 	faux_pair_t *found_pair = NULL;
@@ -123,8 +123,8 @@ const faux_pair_t *faux_ini_set(
  * @param [in] ini Allocated and initialized INI object.
  * @param [in] name Name field to search for the entry.
  */
-void faux_ini_unset(faux_ini_t *ini, const char *name) {
-
+void faux_ini_unset(faux_ini_t *ini, const char *name)
+{
 	faux_ini_set(ini, name, NULL);
 }
 
@@ -139,8 +139,8 @@ void faux_ini_unset(faux_ini_t *ini, const char *name) {
  * Found pair 'name/value'.
  * NULL on errror.
  */
-const faux_pair_t *faux_ini_find_pair(const faux_ini_t *ini, const char *name) {
-
+const faux_pair_t *faux_ini_find_pair(const faux_ini_t *ini, const char *name)
+{
 	assert(ini);
 	assert(name);
 	if (!ini || !name)
@@ -160,8 +160,8 @@ const faux_pair_t *faux_ini_find_pair(const faux_ini_t *ini, const char *name) {
  * Found value field.
  * NULL on errror.
  */
-const char *faux_ini_find(const faux_ini_t *ini, const char *name) {
-
+const char *faux_ini_find(const faux_ini_t *ini, const char *name)
+{
 	const faux_pair_t *pair = faux_ini_find_pair(ini, name);
 
 	if (!pair)
@@ -180,8 +180,8 @@ const char *faux_ini_find(const faux_ini_t *ini, const char *name) {
  * @return Initialized iterator.
  * @sa faux_ini_each()
  */
-faux_ini_node_t *faux_ini_iter(const faux_ini_t *ini) {
-
+faux_ini_node_t *faux_ini_iter(const faux_ini_t *ini)
+{
 	assert(ini);
 	if (!ini)
 		return NULL;
@@ -202,8 +202,8 @@ faux_ini_node_t *faux_ini_iter(const faux_ini_t *ini) {
  * @return Pair 'name/value'.
  * @sa faux_ini_iter()
  */
-const faux_pair_t *faux_ini_each(faux_ini_node_t **iter) {
-
+const faux_pair_t *faux_ini_each(faux_ini_node_t **iter)
+{
 	return (const faux_pair_t *)faux_list_each((faux_list_node_t **)iter);
 }
 
@@ -224,7 +224,8 @@ const faux_pair_t *faux_ini_each(faux_ini_node_t **iter) {
  * @param [in] str String to find word in it.
  * @return Purified copy of word or NULL.
  */
-static char *faux_ini_purify_word(const char *str) {
+static char *faux_ini_purify_word(const char *str)
+{
 	const char *word;
 	const char *string = str;
 	bool_t quoted = BOOL_FALSE;
@@ -289,8 +290,8 @@ static char *faux_ini_purify_word(const char *str) {
  * @param [in] string String to parse.
  * @return 0 - succes, < 0 - error
  */
-int faux_ini_parse_str(faux_ini_t *ini, const char *string) {
-
+int faux_ini_parse_str(faux_ini_t *ini, const char *string)
+{
 	char *buffer = NULL;
 	char *saveptr = NULL;
 	char *line = NULL;
@@ -368,8 +369,8 @@ int faux_ini_parse_str(faux_ini_t *ini, const char *string) {
  * @return 0 - succes, < 0 - error
  * @sa faux_ini_parse_str()
  */
-int faux_ini_parse_file(faux_ini_t *ini, const char *fn) {
-
+int faux_ini_parse_file(faux_ini_t *ini, const char *fn)
+{
 	bool_t eof = BOOL_FALSE;
 	faux_file_t *f = NULL;
 	char *buf = NULL;
@@ -410,8 +411,8 @@ int faux_ini_parse_file(faux_ini_t *ini, const char *fn) {
  * @param [in] fn File name to write to.
  * @return 0 - success, < 0 - error
  */
-int faux_ini_write_file(const faux_ini_t *ini, const char *fn) {
-
+int faux_ini_write_file(const faux_ini_t *ini, const char *fn)
+{
 	faux_file_t *f = NULL;
 	faux_ini_node_t *iter = NULL;
 	const faux_pair_t *pair = NULL;

+ 16 - 16
faux/ini/pair.c

@@ -10,8 +10,8 @@
 #include "faux/str.h"
 #include "faux/ini.h"
 
-int faux_pair_compare(const void *first, const void *second) {
-
+int faux_pair_compare(const void *first, const void *second)
+{
 	const faux_pair_t *f = (const faux_pair_t *)first;
 	const faux_pair_t *s = (const faux_pair_t *)second;
 
@@ -19,8 +19,8 @@ int faux_pair_compare(const void *first, const void *second) {
 }
 
 
-int faux_pair_kcompare(const void *key, const void *list_item) {
-
+int faux_pair_kcompare(const void *key, const void *list_item)
+{
 	const char *f = (const char *)key;
 	const faux_pair_t *s = (const faux_pair_t *)list_item;
 
@@ -28,8 +28,8 @@ int faux_pair_kcompare(const void *key, const void *list_item) {
 }
 
 
-faux_pair_t *faux_pair_new(const char *name, const char *value) {
-
+faux_pair_t *faux_pair_new(const char *name, const char *value)
+{
 	faux_pair_t *pair = NULL;
 
 	pair = faux_zmalloc(sizeof(*pair));
@@ -45,8 +45,8 @@ faux_pair_t *faux_pair_new(const char *name, const char *value) {
 }
 
 
-void faux_pair_free(void *ptr) {
-
+void faux_pair_free(void *ptr)
+{
 	faux_pair_t *pair = (faux_pair_t *)ptr;
 
 	assert(pair);
@@ -58,8 +58,8 @@ void faux_pair_free(void *ptr) {
 }
 
 
-const char *faux_pair_name(const faux_pair_t *pair) {
-
+const char *faux_pair_name(const faux_pair_t *pair)
+{
 	assert(pair);
 	if (!pair)
 		return NULL;
@@ -68,8 +68,8 @@ const char *faux_pair_name(const faux_pair_t *pair) {
 }
 
 
-void faux_pair_set_name(faux_pair_t *pair, const char *name) {
-
+void faux_pair_set_name(faux_pair_t *pair, const char *name)
+{
 	assert(pair);
 	if (!pair)
 		return;
@@ -79,8 +79,8 @@ void faux_pair_set_name(faux_pair_t *pair, const char *name) {
 }
 
 
-const char *faux_pair_value(const faux_pair_t *pair) {
-
+const char *faux_pair_value(const faux_pair_t *pair)
+{
 	assert(pair);
 	if (!pair)
 		return NULL;
@@ -89,8 +89,8 @@ const char *faux_pair_value(const faux_pair_t *pair) {
 }
 
 
-void faux_pair_set_value(faux_pair_t *pair, const char *value) {
-
+void faux_pair_set_value(faux_pair_t *pair, const char *value)
+{
 	assert(pair);
 	if (!pair)
 		return;

+ 2 - 2
faux/ini/testc_ini.c

@@ -6,8 +6,8 @@
 #include "faux/testc_helpers.h"
 
 
-int testc_faux_ini_parse_file(void) {
-
+int testc_faux_ini_parse_file(void)
+{
 	// Source INI file
 	const char *src_file =
 		"# Comment\n"

+ 54 - 54
faux/list/list.c

@@ -24,8 +24,8 @@
  * @param [in] data User defined data to store within node.
  * @return Newly created list node instance or NULL on error.
  */
-static faux_list_node_t *faux_list_new_node(void *data) {
-
+static faux_list_node_t *faux_list_new_node(void *data)
+{
 	faux_list_node_t *node = NULL;
 
 	node = faux_zmalloc(sizeof(*node));
@@ -46,8 +46,8 @@ static faux_list_node_t *faux_list_new_node(void *data) {
  *
  * @param [in] node List node instance.
  */
-static void faux_list_free_node(faux_list_node_t *node) {
-
+static void faux_list_free_node(faux_list_node_t *node)
+{
 	assert(node);
 	faux_free(node);
 }
@@ -58,8 +58,8 @@ static void faux_list_free_node(faux_list_node_t *node) {
  * @param [in] this List node instance.
  * @return List node previous in list.
  */
-faux_list_node_t *faux_list_prev_node(const faux_list_node_t *node) {
-
+faux_list_node_t *faux_list_prev_node(const faux_list_node_t *node)
+{
 	assert(node);
 	if (!node)
 		return NULL;
@@ -73,8 +73,8 @@ faux_list_node_t *faux_list_prev_node(const faux_list_node_t *node) {
  * @param [in] this List node instance.
  * @return List node next in list.
  */
-faux_list_node_t *faux_list_next_node(const faux_list_node_t *node) {
-
+faux_list_node_t *faux_list_next_node(const faux_list_node_t *node)
+{
 	assert(node);
 	if (!node)
 		return NULL;
@@ -88,8 +88,8 @@ faux_list_node_t *faux_list_next_node(const faux_list_node_t *node) {
  * @param [in] this List node instance.
  * @return User data stored within specified list node.
  */
-void *faux_list_data(const faux_list_node_t *node) {
-
+void *faux_list_data(const faux_list_node_t *node)
+{
 	assert(node);
 	if (!node)
 		return NULL;
@@ -106,8 +106,8 @@ void *faux_list_data(const faux_list_node_t *node) {
  * @param [in,out] iter List node ptr used as an iterator.
  * @return List node or NULL if list elements are over.
  */
-faux_list_node_t *faux_list_each_node(faux_list_node_t **iter) {
-
+faux_list_node_t *faux_list_each_node(faux_list_node_t **iter)
+{
 	faux_list_node_t *current_node = *iter;
 
 	// No assert() on current_node. NULL iterator is normal
@@ -127,8 +127,8 @@ faux_list_node_t *faux_list_each_node(faux_list_node_t **iter) {
  * @param [in,out] iter List node ptr used as an iterator.
  * @return List node or NULL if list elements are over.
  */
-faux_list_node_t *faux_list_eachr_node(faux_list_node_t **iter) {
-
+faux_list_node_t *faux_list_eachr_node(faux_list_node_t **iter)
+{
 	faux_list_node_t *current_node = *iter;
 
 	// No assert() on current_node. NULL iterator is normal
@@ -148,8 +148,8 @@ faux_list_node_t *faux_list_eachr_node(faux_list_node_t **iter) {
  * @param [in,out] iter List node ptr used as an iterator.
  * @return User data or NULL if list elements are over.
  */
-void *faux_list_each(faux_list_node_t **iter) {
-
+void *faux_list_each(faux_list_node_t **iter)
+{
 	faux_list_node_t *current_node = NULL;
 
 	// No assert() on current_node. NULL iterator is normal
@@ -169,8 +169,8 @@ void *faux_list_each(faux_list_node_t **iter) {
  * @param [in,out] iter List node ptr used as an iterator.
  * @return User data or NULL if list elements are over.
  */
-void *faux_list_eachr(faux_list_node_t **iter) {
-
+void *faux_list_eachr(faux_list_node_t **iter)
+{
 	faux_list_node_t *current_node = NULL;
 
 	// No assert() on current_node. NULL iterator is normal
@@ -199,8 +199,8 @@ void *faux_list_eachr(faux_list_node_t **iter) {
  */
 faux_list_t *faux_list_new(faux_list_sorted_t sorted, faux_list_unique_t unique,
 	faux_list_cmp_fn cmpFn, faux_list_kcmp_fn kcmpFn,
-	faux_list_free_fn freeFn) {
-
+	faux_list_free_fn freeFn)
+{
 	faux_list_t *list = NULL;
 
 	// Sorted list must have cmpFn
@@ -239,8 +239,8 @@ faux_list_t *faux_list_new(faux_list_sorted_t sorted, faux_list_unique_t unique,
  *
  * @param [in] list List to free.
  */
-void faux_list_free(faux_list_t *list) {
-
+void faux_list_free(faux_list_t *list)
+{
 	faux_list_node_t *iter = NULL;
 
 	if (!list)
@@ -258,8 +258,8 @@ void faux_list_free(faux_list_t *list) {
  * @param [in] list List.
  * @return List node first in list.
  */
-faux_list_node_t *faux_list_head(const faux_list_t *list) {
-
+faux_list_node_t *faux_list_head(const faux_list_t *list)
+{
 	assert(list);
 	if (!list)
 		return NULL;
@@ -273,8 +273,8 @@ faux_list_node_t *faux_list_head(const faux_list_t *list) {
  * @param [in] list List.
  * @return List node last in list.
  */
-faux_list_node_t *faux_list_tail(const faux_list_t *list) {
-
+faux_list_node_t *faux_list_tail(const faux_list_t *list)
+{
 	assert(list);
 	if (!list)
 		return NULL;
@@ -288,8 +288,8 @@ faux_list_node_t *faux_list_tail(const faux_list_t *list) {
  * @param [in] list List.
  * @return Current length of list.
  */
-size_t faux_list_len(const faux_list_t *list) {
-
+size_t faux_list_len(const faux_list_t *list)
+{
 	assert(list);
 	if (!list)
 		return 0;
@@ -308,8 +308,8 @@ size_t faux_list_len(const faux_list_t *list) {
  * @return Newly added list node.
  */
 static faux_list_node_t *faux_list_add_generic(
-	faux_list_t *list, void *data, bool_t find) {
-
+	faux_list_t *list, void *data, bool_t find)
+{
 	faux_list_node_t *node = NULL;
 	faux_list_node_t *iter = NULL;
 
@@ -398,8 +398,8 @@ static faux_list_node_t *faux_list_add_generic(
  * @param [in] data User data.
  * @return Newly created list node or NULL on error.
  */
-faux_list_node_t *faux_list_add(faux_list_t *list, void *data) {
-
+faux_list_node_t *faux_list_add(faux_list_t *list, void *data)
+{
 	return faux_list_add_generic(list, data, BOOL_FALSE);
 }
 
@@ -414,8 +414,8 @@ faux_list_node_t *faux_list_add(faux_list_t *list, void *data) {
  * @param [in] data User data.
  * @return Newly created list node, existent equal node or NULL on error.
  */
-faux_list_node_t *faux_list_add_find(faux_list_t *list, void *data) {
-
+faux_list_node_t *faux_list_add_find(faux_list_t *list, void *data)
+{
 	assert(list);
 	if (!list)
 		return NULL;
@@ -439,8 +439,8 @@ faux_list_node_t *faux_list_add_find(faux_list_t *list, void *data) {
  * @param [in] node List node to take away.
  * @return User data from removed node or NULL on error.
  */
-void *faux_list_takeaway(faux_list_t *list, faux_list_node_t *node) {
-
+void *faux_list_takeaway(faux_list_t *list, faux_list_node_t *node)
+{
 	void *data = NULL;
 
 	assert(list);
@@ -475,8 +475,8 @@ void *faux_list_takeaway(faux_list_t *list, faux_list_node_t *node) {
  * @param [in] node List node to delete.
  * @return 0 on success, < 0 on error.
  */
-int faux_list_del(faux_list_t *list, faux_list_node_t *node) {
-
+int faux_list_del(faux_list_t *list, faux_list_node_t *node)
+{
 	void *data = NULL;
 
 	assert(list);
@@ -518,8 +518,8 @@ int faux_list_del(faux_list_t *list, faux_list_node_t *node) {
  */
 faux_list_node_t *faux_list_match_node(const faux_list_t *list,
 	faux_list_kcmp_fn matchFn, const void *userkey,
-	faux_list_node_t **saveptr) {
-
+	faux_list_node_t **saveptr)
+{
 	faux_list_node_t *iter = NULL;
 
 	assert(list);
@@ -557,8 +557,8 @@ faux_list_node_t *faux_list_match_node(const faux_list_t *list,
  * @sa faux_list_match_node()
  */
 faux_list_node_t *faux_list_kmatch_node(const faux_list_t *list,
-	const void *userkey, faux_list_node_t **saveptr) {
-
+	const void *userkey, faux_list_node_t **saveptr)
+{
 	assert(list);
 	if (!list)
 		return NULL;
@@ -574,8 +574,8 @@ faux_list_node_t *faux_list_kmatch_node(const faux_list_t *list,
  * @sa faux_list_match_node()
  */
 void *faux_list_match(const faux_list_t *list, faux_list_kcmp_fn matchFn,
-	const void *userkey, faux_list_node_t **saveptr) {
-
+	const void *userkey, faux_list_node_t **saveptr)
+{
 	faux_list_node_t *res =
 		faux_list_match_node(list, matchFn, userkey, saveptr);
 	if (!res)
@@ -593,8 +593,8 @@ void *faux_list_match(const faux_list_t *list, faux_list_kcmp_fn matchFn,
  * @sa faux_list_match_node()
  */
 void *faux_list_kmatch(const faux_list_t *list, const void *userkey,
-	faux_list_node_t **saveptr) {
-
+	faux_list_node_t **saveptr)
+{
 	assert(list);
 	if (!list)
 		return NULL;
@@ -611,8 +611,8 @@ void *faux_list_kmatch(const faux_list_t *list, const void *userkey,
  * @sa faux_list_match_node()
  */
 faux_list_node_t *faux_list_find_node(const faux_list_t *list,
-	faux_list_kcmp_fn matchFn, const void *userkey) {
-
+	faux_list_kcmp_fn matchFn, const void *userkey)
+{
 	return faux_list_match_node(list, matchFn, userkey, NULL);
 }
 
@@ -625,8 +625,8 @@ faux_list_node_t *faux_list_find_node(const faux_list_t *list,
  * @sa faux_list_match_node()
  */
 faux_list_node_t *faux_list_kfind_node(const faux_list_t *list,
-	const void *userkey) {
-
+	const void *userkey)
+{
 	return faux_list_find_node(list, list->kcmpFn, userkey);
 }
 
@@ -639,8 +639,8 @@ faux_list_node_t *faux_list_kfind_node(const faux_list_t *list,
  * @sa faux_list_match_node()
  */
 void *faux_list_find(const faux_list_t *list, faux_list_kcmp_fn matchFn,
-	const void *userkey) {
-
+	const void *userkey)
+{
 	return faux_list_match(list, matchFn, userkey, NULL);
 }
 
@@ -653,7 +653,7 @@ void *faux_list_find(const faux_list_t *list, faux_list_kcmp_fn matchFn,
  * @sa faux_list_match_node()
  */
 void *faux_list_kfind(const faux_list_t *list,
-	const void *userkey) {
-
+	const void *userkey)
+{
 	return faux_list_find(list, list->kcmpFn, userkey);
 }

+ 2 - 2
faux/log/log.c

@@ -54,8 +54,8 @@ static struct log_name log_names[] = {
  * @param [out] facility Facility in digital form.
  * @returns 0 - success, < 0 - parsing error
  */
-int faux_log_facility(const char *str, int *facility) {
-
+int faux_log_facility(const char *str, int *facility)
+{
 	int i = 0;
 
 	assert(facility);

+ 34 - 34
faux/str/str.c

@@ -29,8 +29,8 @@
  *
  * @param [in] str String to free
  */
-void faux_str_free(char *str) {
-
+void faux_str_free(char *str)
+{
 	faux_free(str);
 }
 
@@ -45,8 +45,8 @@ void faux_str_free(char *str) {
  * @param [in] str String to duplicate.
  * @return Pointer to allocated string or NULL.
  */
-char *faux_str_dup(const char *str) {
-
+char *faux_str_dup(const char *str)
+{
 	if (!str)
 		return NULL;
 	return strdup(str);
@@ -65,8 +65,8 @@ char *faux_str_dup(const char *str) {
  * @param [in] n Number of bytes to copy.
  * @return Pointer to allocated string or NULL.
  */
-char *faux_str_dupn(const char *str, size_t n) {
-
+char *faux_str_dupn(const char *str, size_t n)
+{
 	char *res = NULL;
 	size_t len = 0;
 
@@ -93,8 +93,8 @@ char *faux_str_dupn(const char *str, size_t n) {
  * @param [in] str String to convert.
  * @return Pointer to lowercase string copy or NULL.
  */
-char *faux_str_tolower(const char *str) {
-
+char *faux_str_tolower(const char *str)
+{
 	char *res = faux_str_dup(str);
 	char *p = res;
 
@@ -119,8 +119,8 @@ char *faux_str_tolower(const char *str) {
  * @param [in] str String to convert.
  * @return Pointer to lowercase string copy or NULL.
  */
-char *faux_str_toupper(const char *str) {
-
+char *faux_str_toupper(const char *str)
+{
 	char *res = faux_str_dup(str);
 	char *p = res;
 
@@ -148,8 +148,8 @@ char *faux_str_toupper(const char *str) {
  * @param [in] n Number of bytes to add.
  * @return Pointer to resulting string or NULL.
  */
-char *faux_str_catn(char **str, const char *text, size_t n) {
-
+char *faux_str_catn(char **str, const char *text, size_t n)
+{
 	size_t str_len = 0;
 	size_t text_len = 0;
 	char *res = NULL;
@@ -185,8 +185,8 @@ char *faux_str_catn(char **str, const char *text, size_t n) {
  * @param [in] text Text to add to the first string.
  * @return Pointer to resulting string or NULL.
  */
-char *faux_str_cat(char **str, const char *text) {
-
+char *faux_str_cat(char **str, const char *text)
+{
 	size_t len = 0;
 
 	if (!text)
@@ -211,8 +211,8 @@ char *faux_str_cat(char **str, const char *text) {
  * @param [in] text Text to add to the first string.
  * @return Pointer to resulting string or NULL.
  */
-char *faux_str_vcat(char **str, ...) {
-
+char *faux_str_vcat(char **str, ...)
+{
 	va_list ap;
 	const char *arg = NULL;
 	char *retval = *str;
@@ -241,8 +241,8 @@ char *faux_str_vcat(char **str, ...) {
  * @param [in] arg Number of arguments.
  * @return Allocated resulting string or NULL on error.
  */
-char *faux_str_sprintf(const char *fmt, ...) {
-
+char *faux_str_sprintf(const char *fmt, ...)
+{
 	int size = 1;
 	char calc_buf[1] = "";
 	char *line = NULL;
@@ -290,8 +290,8 @@ char *faux_str_sprintf(const char *fmt, ...) {
  * = 0 if char1 = char2
  * > 0 if char1 > char2
  */
-static int faux_str_cmp_chars(char char1, char char2) {
-
+static int faux_str_cmp_chars(char char1, char char2)
+{
 	unsigned char ch1 = (unsigned char)char1;
 	unsigned char ch2 = (unsigned char)char2;
 
@@ -310,8 +310,8 @@ static int faux_str_cmp_chars(char char1, char char2) {
  * @param [in] n Number of characters to compare.
  * @return < 0, 0, > 0, see the strcasecmp().
  */
-int faux_str_casecmpn(const char *str1, const char *str2, size_t n) {
-
+int faux_str_casecmpn(const char *str1, const char *str2, size_t n)
+{
 	const char *p1 = str1;
 	const char *p2 = str2;
 	size_t num = n;
@@ -344,8 +344,8 @@ int faux_str_casecmpn(const char *str1, const char *str2, size_t n) {
  * @param [in] str2 Second string to compare.
  * @return < 0, 0, > 0, see the strcasecmp().
  */
-int faux_str_casecmp(const char *str1, const char *str2) {
-
+int faux_str_casecmp(const char *str1, const char *str2)
+{
 	const char *p1 = str1;
 	const char *p2 = str2;
 
@@ -373,8 +373,8 @@ int faux_str_casecmp(const char *str1, const char *str2) {
  * Pointer to first occurence of substring in the string.
  * NULL on error
  */
-char *faux_str_casestr(const char *haystack, const char *needle) {
-
+char *faux_str_casestr(const char *haystack, const char *needle)
+{
 	const char *ptr = haystack;
 	size_t ptr_len = 0;
 	size_t needle_len = 0;
@@ -405,8 +405,8 @@ char *faux_str_casestr(const char *haystack, const char *needle) {
  * @param [in] src String for escaping.
  * @return Escaped string or NULL on error.
  */
-char *faux_str_c_esc(const char *src) {
-
+char *faux_str_c_esc(const char *src)
+{
 	const char *src_ptr = src;
 	char *dst = NULL;
 	char *dst_ptr = NULL;
@@ -489,8 +489,8 @@ char *faux_str_c_esc(const char *src) {
  * @param [in] src Binary block for conversion.
  * @return C-string or NULL on error.
  */
-char *faux_str_c_bin(const char *src, size_t n) {
-
+char *faux_str_c_bin(const char *src, size_t n)
+{
 	const char *src_ptr = src;
 	char *dst = NULL;
 	char *dst_ptr = NULL;
@@ -536,8 +536,8 @@ char *faux_str_c_bin(const char *src, size_t n) {
  * @return Pointer to the first occurence of one of specified chars.
  * NULL on error.
  */
-char *faux_str_charsn(const char *str, const char *chars_to_search, size_t n) {
-
+char *faux_str_charsn(const char *str, const char *chars_to_search, size_t n)
+{
 	const char *current_char = str;
 	size_t len = n;
 
@@ -566,8 +566,8 @@ char *faux_str_charsn(const char *str, const char *chars_to_search, size_t n) {
  * @return Pointer to the first occurence of one of specified chars.
  * NULL on error.
  */
-char *faux_str_chars(const char *str, const char *chars_to_search) {
-
+char *faux_str_chars(const char *str, const char *chars_to_search)
+{
 	assert(str);
 	if (!str)
 		return NULL;

+ 8 - 8
faux/sysdb/sysdb.c

@@ -27,8 +27,8 @@
  * @return Pointer to allocated passwd structure.
  * @warning The resulting pointer (return value) must be freed by faux_free().
  */
-struct passwd *faux_sysdb_getpwnam(const char *name) {
-
+struct passwd *faux_sysdb_getpwnam(const char *name)
+{
 	long int size = 0;
 	char *buf = NULL;
 	struct passwd *pwbuf = NULL;
@@ -67,8 +67,8 @@ struct passwd *faux_sysdb_getpwnam(const char *name) {
  * @return Pointer to allocated passwd structure.
  * @warning The resulting pointer (return value) must be freed by faux_free().
  */
-struct passwd *faux_sysdb_getpwuid(uid_t uid) {
-
+struct passwd *faux_sysdb_getpwuid(uid_t uid)
+{
 	long int size = 0;
 	char *buf = NULL;
 	struct passwd *pwbuf = NULL;
@@ -107,8 +107,8 @@ struct passwd *faux_sysdb_getpwuid(uid_t uid) {
  * @return Pointer to allocated group structure.
  * @warning The resulting pointer (return value) must be freed by faux_free().
  */
-struct group *faux_sysdb_getgrnam(const char *name) {
-
+struct group *faux_sysdb_getgrnam(const char *name)
+{
 	long int size;
 	char *buf;
 	struct group *grbuf;
@@ -147,8 +147,8 @@ struct group *faux_sysdb_getgrnam(const char *name) {
  * @return Pointer to allocated group structure.
  * @warning The resulting pointer (return value) must be freed by faux_free().
  */
-struct group *faux_sysdb_getgrgid(gid_t gid) {
-
+struct group *faux_sysdb_getgrgid(gid_t gid)
+{
 	long int size;
 	char *buf;
 	struct group *grbuf;

+ 6 - 6
faux/testc_helpers/testc_helpers.c

@@ -17,8 +17,8 @@
 #include "faux/testc_helpers.h"
 
 
-ssize_t faux_testc_file_deploy(const char *fn, const char *str) {
-
+ssize_t faux_testc_file_deploy(const char *fn, const char *str)
+{
 	faux_file_t *f = NULL;
 	ssize_t bytes_written = 0;
 
@@ -39,8 +39,8 @@ ssize_t faux_testc_file_deploy(const char *fn, const char *str) {
 }
 
 
-char *faux_testc_tmpfile_deploy(const char *str) {
-
+char *faux_testc_tmpfile_deploy(const char *str)
+{
 	char *template = NULL;
 	int fd = -1;
 	faux_file_t *f = NULL;
@@ -78,8 +78,8 @@ char *faux_testc_tmpfile_deploy(const char *str) {
 
 #define CHUNK_SIZE 1024
 
-int faux_testc_file_cmp(const char *first_file, const char *second_file) {
-
+int faux_testc_file_cmp(const char *first_file, const char *second_file)
+{
 	int ret = -1; // Pessimistic retval
 	faux_file_t *f = NULL;
 	faux_file_t *s = NULL;

+ 6 - 6
faux/testc_module/demo.c

@@ -1,8 +1,8 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-int testc_faux_ini_good(void) {
-
+int testc_faux_ini_good(void)
+{
 	char *path = NULL;
 
 	path = getenv("TESTC_TMPDIR");
@@ -12,15 +12,15 @@ int testc_faux_ini_good(void) {
 }
 
 
-int testc_faux_ini_bad(void) {
-
+int testc_faux_ini_bad(void)
+{
 	printf("Some debug information here\n");
 	return -1;
 }
 
 
-int testc_faux_ini_signal(void) {
-
+int testc_faux_ini_signal(void)
+{
 	char *p = NULL;
 
 	printf("%s\n", p);

+ 3 - 0
indent.sh

@@ -16,4 +16,7 @@ opts="$opts -nlp -i8 -ci8 -ip0 -ts8 -il1"
 # Breaking long lines
 opts="$opts -nbbo -hnl -l80"
 
+# Comments
+opts="$opts"
+
 indent $opts "$@"

+ 18 - 18
testc/testc.c

@@ -68,8 +68,8 @@ static int exec_test(int (*test_sym)(void), faux_list_t **buf_list);
 static void print_test_output(faux_list_t *buf_list);
 
 
-int main(int argc, char *argv[]) {
-
+int main(int argc, char *argv[])
+{
 	opts_t *opts = NULL; // Command line options
 	faux_list_node_t *iter = NULL;
 	char *so = NULL; // Shared object name
@@ -349,15 +349,15 @@ int main(int argc, char *argv[]) {
 }
 
 
-static void free_iov(struct iovec *iov) {
-
+static void free_iov(struct iovec *iov)
+{
 	faux_free(iov->iov_base);
 	faux_free(iov);
 }
 
 
-static faux_list_t *read_test_output(int fd, size_t limit) {
-
+static faux_list_t *read_test_output(int fd, size_t limit)
+{
 	struct iovec *iov = NULL;
 	size_t total_len = 0;
 	faux_list_t *buf_list = NULL; // Buffer list
@@ -393,8 +393,8 @@ static faux_list_t *read_test_output(int fd, size_t limit) {
 }
 
 
-static void print_test_output(faux_list_t *buf_list) {
-
+static void print_test_output(faux_list_t *buf_list)
+{
 	faux_list_node_t *iter = NULL;
 	struct iovec *iov = NULL;
 
@@ -412,8 +412,8 @@ static void print_test_output(faux_list_t *buf_list) {
  * @param [in] buf_list
  * @return Testing function return value
  */
-static int exec_test(int (*test_sym)(void), faux_list_t **buf_list) {
-
+static int exec_test(int (*test_sym)(void), faux_list_t **buf_list)
+{
 	pid_t pid = -1;
 	int wstatus = -1;
 	int pipefd[2];
@@ -456,8 +456,8 @@ static int exec_test(int (*test_sym)(void), faux_list_t **buf_list) {
  *
  * @param [in] opts Allocated opts_t structure.
  */
-static void opts_free(opts_t *opts) {
-
+static void opts_free(opts_t *opts)
+{
 	assert(opts);
 	if (!opts)
 		return;
@@ -474,8 +474,8 @@ static void opts_free(opts_t *opts) {
  * @return Allocated and initialized opts_t structure.
  * @warning The returned opts_t structure must be freed later by opts_free().
  */
-static opts_t *opts_new(void) {
-
+static opts_t *opts_new(void)
+{
 	opts_t *opts = NULL;
 
 	opts = faux_zmalloc(sizeof(*opts));
@@ -508,8 +508,8 @@ static opts_t *opts_new(void) {
  * @return Filled opts_t structure with parsed command line options.
  * @warning The returned opts_t structure must be freed later by opts_free().
  */
-static opts_t *opts_parse(int argc, char *argv[]) {
-
+static opts_t *opts_parse(int argc, char *argv[])
+{
 	opts_t *opts = NULL;
 
 	static const char *shortopts = "hvdt";
@@ -579,8 +579,8 @@ static opts_t *opts_parse(int argc, char *argv[]) {
  * help information.
  * @param [in] argv0 The argv[0] argument i.e. programm name
  */
-static void help(int status, const char *argv0) {
-
+static void help(int status, const char *argv0)
+{
 	const char *name = NULL;
 
 	if (!argv0)

+ 10 - 10
utils/faux-file2c.c

@@ -58,8 +58,8 @@ static void opts_free(opts_t *opts);
 static void help(int status, const char *argv0);
 
 
-int main(int argc, char *argv[]) {
-
+int main(int argc, char *argv[])
+{
 	opts_t *opts = NULL; // Command line options
 	faux_list_node_t *iter = NULL;
 	char *fn = NULL; // Text file
@@ -176,8 +176,8 @@ int main(int argc, char *argv[]) {
  *
  * @param [in] opts Allocated opts_t structure.
  */
-static void opts_free(opts_t *opts) {
-
+static void opts_free(opts_t *opts)
+{
 	assert(opts);
 	if (!opts)
 		return;
@@ -194,8 +194,8 @@ static void opts_free(opts_t *opts) {
  * @return Allocated and initialized opts_t structure.
  * @warning The returned opts_t structure must be freed later by opts_free().
  */
-static opts_t *opts_new(void) {
-
+static opts_t *opts_new(void)
+{
 	opts_t *opts = NULL;
 
 	opts = faux_zmalloc(sizeof(*opts));
@@ -228,8 +228,8 @@ static opts_t *opts_new(void) {
  * @return Filled opts_t structure with parsed command line options.
  * @warning The returned opts_t structure must be freed later by opts_free().
  */
-static opts_t *opts_parse(int argc, char *argv[]) {
-
+static opts_t *opts_parse(int argc, char *argv[])
+{
 	opts_t *opts = NULL;
 
 	static const char *shortopts = "hvdbt";
@@ -303,8 +303,8 @@ static opts_t *opts_parse(int argc, char *argv[]) {
  * help information.
  * @param [in] argv0 The argv[0] argument i.e. programm name
  */
-static void help(int status, const char *argv0) {
-
+static void help(int status, const char *argv0)
+{
 	const char *name = NULL;
 
 	if (!argv0)