Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.72 KB | None | 0 0
  1.  struct bundle_result {
  2.         char bundle_name[BUNDLE_NAME_MAXLEN];
  3.         long topsize;
  4.         long size;
  5.         double score;
  6.         struct list *files;
  7.         struct list *includes;
  8.         bool is_tracked;
  9.  };
  10.  
  11. ...
  12.  
  13.  
  14.                /* record contentsize and includes for install size calculation */
  15.                /* subman is a manifest */
  16.                struct bundle_result *bundle = NULL;
  17.                bundle = calloc(sizeof(struct bundle_result), 1);
  18.                strncpy(bundle->bundle_name, subman->component, BUNDLE_NAME_MAXLEN - 1);
  19.                bundle->topsize = subman->contentsize;
  20.                bundle->includes = list_clone(subman->includes);
  21.                bundle_info = list_prepend_data(bundle_info, bundle);
  22.                struct list *ptr = list_head(bundle_info);
  23.                struct list *incptr = list_head(ptr);
  24.                while (ptr) {
  25.                        struct bundle_result *intermed;
  26.                        intermed = ptr->data;
  27.                        ptr = ptr->next;
  28.  
  29.                        incptr = list_head(intermed->includes);
  30.                        printf("%s\n", intermed->bundle_name);
  31.                        while (incptr) {
  32.                                char *inc = incptr->data;
  33.                                incptr = incptr->next;
  34.                                printf("\tinc: %s\n", inc);
  35.                        }
  36.                }
  37.  
  38.  
  39. OUTPUT:
  40.  
  41. python-basic-dev                        
  42.         inc: [+                  
  43.         inc: ctions/document-open-symbolic.symbolic.png
  44.         inc:                                    
  45.         inc:                      
  46.         inc: 6x256/status/media-playlist-repeat-song-rtl.png
  47.         inc:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement