libmpm

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

commit b960256fbaefdbf7d773c7260dd7ed93e1ce42cc
parent 7ad50c1d9c4c648e7221e2bba365578560caf988
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Wed, 12 Apr 2017 20:02:09 +0200

Fix(Packer): Add len to the package output, and some doxgen comments on a structure

Diffstat:
Minc/packer.h | 4++--
Msrc/packer.c | 5++++-
2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/inc/packer.h b/inc/packer.h @@ -49,8 +49,8 @@ typedef struct packer_header_package_s { } packer_header_package_t; typedef struct packer_conf_opt_s { - char *name; - char *value; + char *name; /*!< Name of the option (can be NULL) */ + char *value; /*!< Value of the option */ } packer_conf_opt_t; typedef struct packer_header_comp_s { diff --git a/src/packer.c b/src/packer.c @@ -418,6 +418,7 @@ MPX_STATIC void write_package_header(FILE *fd, packer_t *ctx) { mlist_t *tmp = NULL; packer_conf_opt_t *opt = NULL; const char *tmp_str = NULL; + u32_t list_len = 0; fprintf(fd, PACKER_MPX_MAGIC); fprintf(fd, "%s%c", h->package->name, 0); @@ -435,7 +436,9 @@ MPX_STATIC void write_package_header(FILE *fd, packer_t *ctx) { fprintf(fd, "%s%c", h->compilation->test, 0); fprintf(fd, "%s%c", h->compilation->install, 0); - /* TODO: print binary size of the list before content */ + list_len = htonl(list_size(h->dependencies->list)); + fwrite(&list_len, sizeof(u32_t), 1, fd); + list_for_each(h->dependencies->list, tmp, tmp_str) { fprintf(fd, "%s%c", tmp_str, 0); }