| 106 | } |
| 107 | |
| 108 | GListPtr |
| 109 | node_list_dup(GListPtr list1, gboolean reset, gboolean filter) |
| 110 | { |
| 111 | GListPtr result = NULL; |
| 112 | GListPtr gIter = list1; |
| 113 | |
| 114 | for (; gIter != NULL; gIter = gIter->next) { |
| 115 | node_t *new_node = NULL; |
| 116 | node_t *this_node = (node_t *) gIter->data; |
| 117 | |
| 118 | if (filter && this_node->weight < 0) { |
| 119 | continue; |
| 120 | } |
| 121 | |
| 122 | new_node = node_copy(this_node); |
| 123 | if (reset) { |
| 124 | new_node->weight = 0; |
| 125 | } |
| 126 | if (new_node != NULL) { |
| 127 | result = g_list_prepend(result, new_node); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | return result; |
| 132 | } |
| 133 | |
| 134 | gint |
| 135 | sort_node_uname(gconstpointer a, gconstpointer b) |
no test coverage detected