diff options
Diffstat (limited to 'lib/libalpm/delta.c')
-rw-r--r-- | lib/libalpm/delta.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c index 0128e556..c5770bfc 100644 --- a/lib/libalpm/delta.c +++ b/lib/libalpm/delta.c @@ -45,7 +45,7 @@ static alpm_list_t *graph_init(alpm_list_t *deltas, int reverse) alpm_list_free(vertices); return NULL; } - pmdelta_t *vdelta = i->data; + alpm_delta_t *vdelta = i->data; vdelta->download_size = vdelta->delta_size; v->weight = LONG_MAX; v->data = vdelta; @@ -55,11 +55,11 @@ static alpm_list_t *graph_init(alpm_list_t *deltas, int reverse) /* compute the edges */ for(i = vertices; i; i = i->next) { pmgraph_t *v_i = i->data; - pmdelta_t *d_i = v_i->data; + alpm_delta_t *d_i = v_i->data; /* loop a second time so we make all possible comparisons */ for(j = vertices; j; j = j->next) { pmgraph_t *v_j = j->data; - pmdelta_t *d_j = v_j->data; + alpm_delta_t *d_j = v_j->data; /* We want to create a delta tree like the following: * 1_to_2 * | @@ -85,7 +85,7 @@ static void graph_init_size(alpm_handle_t *handle, alpm_list_t *vertices) for(i = vertices; i; i = i->next) { char *fpath, *md5sum; pmgraph_t *v = i->data; - pmdelta_t *vdelta = v->data; + alpm_delta_t *vdelta = v->data; /* determine whether the delta file already exists */ fpath = _alpm_filecache_find(handle, vdelta->delta); @@ -133,7 +133,7 @@ static void dijkstra(alpm_list_t *vertices) v->childptr = v->children; while(v->childptr) { pmgraph_t *v_c = v->childptr->data; - pmdelta_t *d_c = v_c->data; + alpm_delta_t *d_c = v_c->data; if(v_c->weight > v->weight + d_c->download_size) { v_c->weight = v->weight + d_c->download_size; v_c->parent = v; @@ -154,7 +154,7 @@ static off_t shortest_path(alpm_list_t *vertices, const char *to, alpm_list_t ** for(i = vertices; i; i = i->next) { pmgraph_t *v_i = i->data; - pmdelta_t *d_i = v_i->data; + alpm_delta_t *d_i = v_i->data; if(strcmp(d_i->to, to) == 0) { if(v == NULL || v_i->weight < v->weight) { @@ -165,7 +165,7 @@ static off_t shortest_path(alpm_list_t *vertices, const char *to, alpm_list_t ** } while(v != NULL) { - pmdelta_t *vdelta = v->data; + alpm_delta_t *vdelta = v->data; rpath = alpm_list_add(rpath, vdelta); v = v->parent; } @@ -179,9 +179,9 @@ static off_t shortest_path(alpm_list_t *vertices, const char *to, alpm_list_t ** * The shortest path is defined as the path with the smallest combined * size, not the length of the path. * @param handle the context handle - * @param deltas the list of pmdelta_t * objects that a file has + * @param deltas the list of alpm_delta_t * objects that a file has * @param to the file to start the search at - * @param path the pointer to a list location where pmdelta_t * objects that + * @param path the pointer to a list location where alpm_delta_t * objects that * have the smallest size are placed. NULL is set if there is no path * possible with the files available. * @return the size of the path stored, or LONG_MAX if path is unfindable @@ -223,7 +223,7 @@ static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota for(i = vertices; i; i = i->next) { pmgraph_t *v = i->data; - pmdelta_t *vdelta = v->data; + alpm_delta_t *vdelta = v->data; if(strcmp(vdelta->to, to) == 0) { v->weight = vdelta->download_size; @@ -232,7 +232,7 @@ static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota dijkstra(vertices); for(i = vertices; i; i = i->next) { pmgraph_t *v = i->data; - pmdelta_t *vdelta = v->data; + alpm_delta_t *vdelta = v->data; if(v->weight > quota) { unused = alpm_list_add(unused, vdelta->delta); } @@ -259,17 +259,17 @@ alpm_list_t SYMEXPORT *alpm_pkg_unused_deltas(alpm_pkg_t *pkg) /** @} */ -/** Parses the string representation of a pmdelta_t object. +/** Parses the string representation of a alpm_delta_t object. * This function assumes that the string is in the correct format. * This format is as follows: * $deltafile $deltamd5 $deltasize $oldfile $newfile * @param line the string to parse - * @return A pointer to the new pmdelta_t object + * @return A pointer to the new alpm_delta_t object */ /* TODO this does not really belong here, but in a parsing lib */ -pmdelta_t *_alpm_delta_parse(char *line) +alpm_delta_t *_alpm_delta_parse(char *line) { - pmdelta_t *delta; + alpm_delta_t *delta; char *tmp = line, *tmp2; regex_t reg; @@ -284,7 +284,7 @@ pmdelta_t *_alpm_delta_parse(char *line) } regfree(®); - CALLOC(delta, 1, sizeof(pmdelta_t), return NULL); + CALLOC(delta, 1, sizeof(alpm_delta_t), return NULL); tmp2 = tmp; tmp = strchr(tmp, ' '); @@ -312,7 +312,7 @@ pmdelta_t *_alpm_delta_parse(char *line) return delta; } -void _alpm_delta_free(pmdelta_t *delta) +void _alpm_delta_free(alpm_delta_t *delta) { FREE(delta->delta); FREE(delta->delta_md5); @@ -321,10 +321,10 @@ void _alpm_delta_free(pmdelta_t *delta) FREE(delta); } -pmdelta_t *_alpm_delta_dup(const pmdelta_t *delta) +alpm_delta_t *_alpm_delta_dup(const alpm_delta_t *delta) { - pmdelta_t *newdelta; - CALLOC(newdelta, 1, sizeof(pmdelta_t), return NULL); + alpm_delta_t *newdelta; + CALLOC(newdelta, 1, sizeof(alpm_delta_t), return NULL); STRDUP(newdelta->delta, delta->delta, return NULL); STRDUP(newdelta->delta_md5, delta->delta_md5, return NULL); STRDUP(newdelta->from, delta->from, return NULL); |