1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 08:34:05 +02:00
wernermisc/qpkg/qpkg.h
Werner Almesberger c05e6d5dbb qpkg: sort package version list such that highest comes first
- Makefile (OBJS_qpkg): added fixup.o
- fixup.h, fixup.c (sort_versions): sort package versions
- qpkg.c (do_fixups, main): do fixups when done gobbling
- qpkg.h: need to include id.h to be self-contained
- test/sortver: test version sorting
2010-11-21 22:57:35 -03:00

61 lines
1.0 KiB
C

/*
* qpkg.h - Quick package database query
*
* Written 2010 by Werner Almesberger
* Copyright 2010 Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef QPKG_H
#define QPKG_H
#include "id.h"
enum flags {
/* parse-time flags */
QPKG_INSTALLED = 1 << 0, /* installed on target */
/* run-time flags */
QPKG_ADDING = 1 << 10, /* resolving dependencies */
};
enum relop {
rel_eq,
rel_ge,
rel_lt,
};
struct pkg;
struct ref {
struct id *pkg;
struct id *version;
enum relop relop; /* undefined if version == NULL */
struct ref *next;
};
struct pkg {
struct id *id;
struct id *version;
const char *arch;
struct ref *conflicts;
struct ref *depends;
const char *filename;
int flags; /* see enum flags */
struct pkg *more;
int mark;
};
struct tree *packages;
struct tree *versions;
int debug;
#endif /* !QPKG_H */