diff options
author | Allan McRae <allan@archlinux.org> | 2011-06-28 14:38:38 +1000 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2011-06-28 23:28:23 +1000 |
commit | bfe1771067e372420d857094befd6c6ea5b28495 (patch) | |
tree | 3543ccd6a7c3d697fa91de839971a311491b0141 /lib | |
parent | 1fdbe7902219c5ed3e56b921acae4f3a58b9e76e (diff) | |
download | pacman-bfe1771067e372420d857094befd6c6ea5b28495.tar.xz |
Rename pmdelta_t to alpm_delta_t
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libalpm/alpm.h | 4 | ||||
-rw-r--r-- | lib/libalpm/delta.c | 40 | ||||
-rw-r--r-- | lib/libalpm/delta.h | 6 | ||||
-rw-r--r-- | lib/libalpm/sync.c | 6 |
4 files changed, 28 insertions, 28 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 5af2efd7..9c321d67 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -145,7 +145,7 @@ typedef struct _alpm_group_t { } alpm_group_t; /** Package upgrade delta */ -typedef struct _pmdelta_t { +typedef struct _alpm_delta_t { /** filename of the delta patch */ char *delta; /** md5sum of the delta file */ @@ -158,7 +158,7 @@ typedef struct _pmdelta_t { off_t delta_size; /** download filesize of the delta file */ off_t download_size; -} pmdelta_t; +} alpm_delta_t; /** Local package or package file backup entry */ typedef struct _pmbackup_t { 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); diff --git a/lib/libalpm/delta.h b/lib/libalpm/delta.h index 1f38a572..05df4207 100644 --- a/lib/libalpm/delta.h +++ b/lib/libalpm/delta.h @@ -26,9 +26,9 @@ #include "alpm.h" -pmdelta_t *_alpm_delta_parse(char *line); -void _alpm_delta_free(pmdelta_t *delta); -pmdelta_t *_alpm_delta_dup(const pmdelta_t *delta); +alpm_delta_t *_alpm_delta_parse(char *line); +void _alpm_delta_free(alpm_delta_t *delta); +alpm_delta_t *_alpm_delta_dup(const alpm_delta_t *delta); off_t _alpm_shortest_delta_path(alpm_handle_t *handle, alpm_list_t *deltas, const char *to, alpm_list_t **path); diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 0c257684..37753487 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -600,7 +600,7 @@ static int apply_deltas(alpm_handle_t *handle) } for(dlts = delta_path; dlts; dlts = dlts->next) { - pmdelta_t *d = dlts->data; + alpm_delta_t *d = dlts->data; char *delta, *from, *to; char command[PATH_MAX]; size_t len = 0; @@ -704,7 +704,7 @@ static int validate_deltas(alpm_handle_t *handle, alpm_list_t *deltas, EVENT(trans, PM_TRANS_EVT_DELTA_INTEGRITY_START, NULL, NULL); for(i = deltas; i; i = i->next) { - pmdelta_t *d = alpm_list_getdata(i); + alpm_delta_t *d = alpm_list_getdata(i); char *filepath = _alpm_filecache_find(handle, d->delta); if(test_md5sum(trans, filepath, d->delta_md5) != 0) { @@ -766,7 +766,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) /* using deltas */ alpm_list_t *dlts; for(dlts = delta_path; dlts; dlts = dlts->next) { - pmdelta_t *delta = dlts->data; + alpm_delta_t *delta = dlts->data; if(delta->download_size != 0) { files = alpm_list_add(files, strdup(delta->delta)); } |