Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct bundle_result {
- char bundle_name[BUNDLE_NAME_MAXLEN];
- long topsize;
- long size;
- double score;
- struct list *files;
- struct list *includes;
- bool is_tracked;
- };
- ...
- /* record contentsize and includes for install size calculation */
- /* subman is a manifest */
- struct bundle_result *bundle = NULL;
- bundle = calloc(sizeof(struct bundle_result), 1);
- strncpy(bundle->bundle_name, subman->component, BUNDLE_NAME_MAXLEN - 1);
- bundle->topsize = subman->contentsize;
- bundle->includes = list_clone(subman->includes);
- bundle_info = list_prepend_data(bundle_info, bundle);
- struct list *ptr = list_head(bundle_info);
- struct list *incptr = list_head(ptr);
- while (ptr) {
- struct bundle_result *intermed;
- intermed = ptr->data;
- ptr = ptr->next;
- incptr = list_head(intermed->includes);
- printf("%s\n", intermed->bundle_name);
- while (incptr) {
- char *inc = incptr->data;
- incptr = incptr->next;
- printf("\tinc: %s\n", inc);
- }
- }
- OUTPUT:
- python-basic-dev
- inc: [+
- inc: ctions/document-open-symbolic.symbolic.png
- inc:
- inc:
- inc: 6x256/status/media-playlist-repeat-song-rtl.png
- inc:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement