| 100 | } |
| 101 | |
| 102 | void print_bundle_list(FILE *fp, struct bundle_list *list) |
| 103 | { |
| 104 | const char *mode; |
| 105 | |
| 106 | switch (list->mode) { |
| 107 | case BUNDLE_MODE_ALL: |
| 108 | mode = "all"; |
| 109 | break; |
| 110 | |
| 111 | case BUNDLE_MODE_ANY: |
| 112 | mode = "any"; |
| 113 | break; |
| 114 | |
| 115 | case BUNDLE_MODE_NONE: |
| 116 | default: |
| 117 | mode = "<unknown>"; |
| 118 | } |
| 119 | |
| 120 | fprintf(fp, "[bundle]\n"); |
| 121 | fprintf(fp, "\tversion = %d\n", list->version); |
| 122 | fprintf(fp, "\tmode = %s\n", mode); |
| 123 | |
| 124 | if (list->heuristic) { |
| 125 | int i; |
| 126 | for (i = 0; i < BUNDLE_HEURISTIC__COUNT; i++) { |
| 127 | if (heuristics[i].heuristic == list->heuristic) { |
| 128 | fprintf(fp, "\theuristic = %s\n", |
| 129 | heuristics[list->heuristic].name); |
| 130 | break; |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | for_all_bundles_in_list(list, summarize_bundle, fp); |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * Given a key-value pair, update the state of the given bundle list. |