libalpm
Arch Linux Package Manager Library
Functions
delta.c File Reference
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <limits.h>
#include <sys/types.h>
#include <regex.h>
#include "delta.h"
#include "alpm_list.h"
#include "util.h"
#include "log.h"
#include "graph.h"
Include dependency graph for delta.c:

Go to the source code of this file.

Functions

off_t _alpm_shortest_delta_path (alpm_handle_t *handle, alpm_list_t *deltas, const char *to, alpm_list_t **path)
 Calculates the shortest path from one version to another.
alpm_list_talpm_pkg_unused_deltas (alpm_pkg_t *pkg)
alpm_delta_t_alpm_delta_parse (alpm_handle_t *handle, const char *line)
 Parses the string representation of a alpm_delta_t object.
void _alpm_delta_free (alpm_delta_t *delta)
alpm_delta_t_alpm_delta_dup (const alpm_delta_t *delta)

Function Documentation

Definition at line 337 of file delta.c.

References CALLOC, _alpm_delta_t::delta, _alpm_delta_t::delta_md5, _alpm_delta_t::delta_size, _alpm_delta_t::download_size, _alpm_delta_t::from, STRDUP, and _alpm_delta_t::to.

Referenced by _alpm_pkg_dup().

Here is the caller graph for this function:

void _alpm_delta_free ( alpm_delta_t delta)

Definition at line 328 of file delta.c.

References _alpm_delta_t::delta, _alpm_delta_t::delta_md5, FREE, _alpm_delta_t::from, and _alpm_delta_t::to.

Referenced by _alpm_pkg_free().

Here is the caller graph for this function:

alpm_delta_t* _alpm_delta_parse ( alpm_handle_t handle,
const char *  line 
)

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

Parameters:
handlethe context handle
linethe string to parse
Returns:
A pointer to the new alpm_delta_t object

Definition at line 280 of file delta.c.

References _alpm_strtoofft(), CALLOC, _alpm_delta_t::delta, _alpm_delta_t::delta_md5, __alpm_handle_t::delta_regex, __alpm_handle_t::delta_regex_compiled, _alpm_delta_t::delta_size, _alpm_delta_t::from, STRNDUP, and _alpm_delta_t::to.

Here is the call graph for this function:

off_t _alpm_shortest_delta_path ( alpm_handle_t handle,
alpm_list_t deltas,
const char *  to,
alpm_list_t **  path 
)

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:
handlethe context handle
deltasthe list of alpm_delta_t * objects that a file has
tothe file to start the search at
paththe 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.
Returns:
the size of the path stored, or LONG_MAX if path is unfindable

Definition at line 203 of file delta.c.

References _alpm_graph_free(), _alpm_log(), alpm_list_free(), alpm_list_free_inner(), and ALPM_LOG_DEBUG.

Here is the call graph for this function: