razor-internal.h
author Kristian H?gsberg <krh@redhat.com>
Mon Jun 09 12:47:37 2008 -0400 (2008-06-09)
changeset 230 c1e2aed8dd07
parent 91 6884cefd1b8c
permissions -rw-r--r--
Rewrite depsolver to use a series of passes over all packages.

The big change is that we follow one step of the depedency chain for
each package to resolve in each iteration, and repeat until there are
no more possible moves. In contrast the old depsolver would try to
follow the dependency chain completely for one package at a time.

This new approach is simpler and faster, and at the same time more
roboust. Instead of knowing how one newly installed package may
affect other packages (obsoleting, pulling in new packages etc), the
new algorithm just looks at the total list of requires, provides,
obsoletes and conflicts after installing new packages.
krh@91
     1
#ifndef _RAZOR_INTERNAL_H_
krh@91
     2
#define _RAZOR_INTERNAL_H_
krh@91
     3
krh@91
     4
#define ALIGN(value, base) (((value) + (base - 1)) & ~((base) - 1))
krh@91
     5
krh@91
     6
/* Utility functions */
krh@91
     7
krh@91
     8
int razor_create_dir(const char *root, const char *path);
krh@91
     9
int razor_write(int fd, const void *data, size_t size);
krh@91
    10
krh@186
    11
krh@186
    12
typedef int (*razor_compare_with_data_func_t)(const void *p1,
krh@186
    13
					      const void *p,
krh@186
    14
					      void *data);
krh@186
    15
uint32_t *
krh@186
    16
razor_qsort_with_data(void *base, size_t nelem, size_t size,
krh@186
    17
		      razor_compare_with_data_func_t compare, void *data);
krh@186
    18
krh@91
    19
#endif /* _RAZOR_INTERNAL_H_ */