delta.c File Reference

#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "delta.h"
#include "error.h"
#include "util.h"
#include "log.h"
#include "alpm_list.h"
#include "alpm.h"

Include dependency graph for delta.c:

Go to the source code of this file.

Functions

const char * alpm_delta_get_from (pmdelta_t *delta)
const char * alpm_delta_get_to (pmdelta_t *delta)
unsigned long alpm_delta_get_size (pmdelta_t *delta)
const char * alpm_delta_get_filename (pmdelta_t *delta)
const char * alpm_delta_get_md5sum (pmdelta_t *delta)
unsigned long _alpm_delta_path_size (alpm_list_t *deltas)
unsigned long _alpm_delta_path_size_uncached (alpm_list_t *deltas)
alpm_list_t_alpm_shortest_delta_path (alpm_list_t *deltas, const char *from, const char *to)
pmdelta_t_alpm_delta_parse (char *line)


Function Documentation

pmdelta_t* _alpm_delta_parse ( char *  line  ) 

Parses the string representation of a pmdelta_t object.

This function assumes that the string is in the correct format.

Parameters:
line the string to parse
Returns:
A pointer to the new pmdelta_t object

Definition at line 234 of file delta.c.

References CALLOC, DLT_FILENAME_LEN, DLT_MD5SUM_LEN, DLT_VERSION_LEN, __pmdelta_t::filename, __pmdelta_t::from, __pmdelta_t::md5sum, PM_ERR_MEMORY, RET_ERR, __pmdelta_t::size, and __pmdelta_t::to.

Referenced by _alpm_db_read().

Here is the caller graph for this function:

unsigned long _alpm_delta_path_size ( alpm_list_t deltas  ) 

Calculates the combined size of a list of delta files.

Parameters:
deltas the list of pmdelta_t * objects
Returns:
the combined size

Definition at line 96 of file delta.c.

References alpm_list_getdata(), alpm_list_next(), and __pmdelta_t::size.

Here is the call graph for this function:

unsigned long _alpm_delta_path_size_uncached ( alpm_list_t deltas  ) 

Calculates the combined size of a list of delta files that are not in the cache.

Parameters:
deltas the list of pmdelta_t * objects
Returns:
the combined size

Definition at line 118 of file delta.c.

References _alpm_filecache_find(), alpm_list_getdata(), alpm_list_next(), __pmdelta_t::filename, FREE, and __pmdelta_t::size.

Referenced by alpm_pkg_download_size().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_list_t* _alpm_shortest_delta_path ( alpm_list_t deltas,
const char *  from,
const char *  to 
)

Calculates the shortest path from one version to another.

The shortest path is defined as the path with the smallest combined size, not the length of the path.

Parameters:
deltas the list of pmdelta_t * objects that a package has
from the version to start from
to the version to end at
Returns:
the list of pmdelta_t * objects that has the smallest size. NULL (the empty list) is returned if there is no path between the versions.

Definition at line 216 of file delta.c.


Generated on Mon Jan 14 23:56:28 2008 for libalpm by  doxygen 1.5.4