libmpm

morphux C package management library
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/libmpm

commit 6bf4fab97cc67a8c72326a77e13b0ca278de1ea1
parent ece240626a878b49bdab5d32ae3e1f621cb53670
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Mon,  6 Mar 2017 19:28:09 +0100

Fix(Code style): files{c,h}

Diffstat:
Minc/files.h | 8++++----
Msrc/files.c | 9++++++---
2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/inc/files.h b/inc/files.h @@ -29,17 +29,17 @@ typedef struct s_package package_t; -enum { +typedef enum file_type_e { FILE_TYPE_CONFIG = 1, FILE_TYPE_BIN, FILE_TYPE_LIB, FILE_TYPE_OTHER -}; +} file_type_t; -typedef struct s_file { +typedef struct file_s { u64_t id; char *path; - u8_t type; + file_type_t type; package_t *parent; char *parent_name; char *hash; diff --git a/src/files.c b/src/files.c @@ -21,7 +21,8 @@ * \param ptr Structure to initialize */ void mpm_file_init(file_t *ptr) { - if (ptr) { + if (ptr) + { ptr->path = NULL; ptr->parent = NULL; ptr->hash = NULL; @@ -36,11 +37,13 @@ void mpm_file_init(file_t *ptr) { int mpm_file_free(void *tmp) { file_t *ptr = tmp; - if (ptr) { + if (ptr) + { free(ptr->path); free(ptr->hash); free(ptr->parent_name); - if (ptr->parent != NULL) { + if (ptr->parent != NULL) + { mpm_package_free(ptr->parent); free(ptr->parent); }