Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/delta.c
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2011-06-28 14:54:19 +1000
committerAllan McRae <allan@archlinux.org>2011-06-28 23:28:24 +1000
commit57b9b19b103a5d48a7116adfd546a516e121329c (patch)
tree659b396cec02543842184771214ca5dbd94c3262 /lib/libalpm/delta.c
parent08fc1db24c9d30f63c9ac858ab2cc50f64f8e38b (diff)
Rename pmgraph_t to alpm_graph_t
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/delta.c')
-rw-r--r--lib/libalpm/delta.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c
index c5770bfc..d2c2fe80 100644
--- a/lib/libalpm/delta.c
+++ b/lib/libalpm/delta.c
@@ -40,7 +40,7 @@ static alpm_list_t *graph_init(alpm_list_t *deltas, int reverse)
alpm_list_t *vertices = NULL;
/* create the vertices */
for(i = deltas; i; i = i->next) {
- pmgraph_t *v = _alpm_graph_new();
+ alpm_graph_t *v = _alpm_graph_new();
if(!v) {
alpm_list_free(vertices);
return NULL;
@@ -54,11 +54,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;
+ alpm_graph_t *v_i = 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;
+ alpm_graph_t *v_j = j->data;
alpm_delta_t *d_j = v_j->data;
/* We want to create a delta tree like the following:
* 1_to_2
@@ -84,7 +84,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;
+ alpm_graph_t *v = i->data;
alpm_delta_t *vdelta = v->data;
/* determine whether the delta file already exists */
@@ -109,12 +109,12 @@ static void graph_init_size(alpm_handle_t *handle, alpm_list_t *vertices)
static void dijkstra(alpm_list_t *vertices)
{
alpm_list_t *i;
- pmgraph_t *v;
+ alpm_graph_t *v;
while(1) {
v = NULL;
/* find the smallest vertice not visited yet */
for(i = vertices; i; i = i->next) {
- pmgraph_t *v_i = i->data;
+ alpm_graph_t *v_i = i->data;
if(v_i->state == -1) {
continue;
@@ -132,7 +132,7 @@ static void dijkstra(alpm_list_t *vertices)
v->childptr = v->children;
while(v->childptr) {
- pmgraph_t *v_c = v->childptr->data;
+ alpm_graph_t *v_c = v->childptr->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;
@@ -148,12 +148,12 @@ static void dijkstra(alpm_list_t *vertices)
static off_t shortest_path(alpm_list_t *vertices, const char *to, alpm_list_t **path)
{
alpm_list_t *i;
- pmgraph_t *v = NULL;
+ alpm_graph_t *v = NULL;
off_t bestsize = 0;
alpm_list_t *rpath = NULL;
for(i = vertices; i; i = i->next) {
- pmgraph_t *v_i = i->data;
+ alpm_graph_t *v_i = i->data;
alpm_delta_t *d_i = v_i->data;
if(strcmp(d_i->to, to) == 0) {
@@ -222,7 +222,7 @@ static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota
vertices = graph_init(deltas, 1);
for(i = vertices; i; i = i->next) {
- pmgraph_t *v = i->data;
+ alpm_graph_t *v = i->data;
alpm_delta_t *vdelta = v->data;
if(strcmp(vdelta->to, to) == 0)
{
@@ -231,7 +231,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;
+ alpm_graph_t *v = i->data;
alpm_delta_t *vdelta = v->data;
if(v->weight > quota) {
unused = alpm_list_add(unused, vdelta->delta);