blob: 1254fb374ef871f043dd25031f7d81cc1802898f (
plain)
1 // Copyright (C) 2015 James Buren
2 //
3 // This file is part of revdep.
4 //
5 // revdep is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // revdep is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with revdep. If not, see <http://www.gnu.org/licenses/>.
17
18 #pragma once
19
20 typedef struct
21 {
22 char *path;
23 unsigned int key;
24 } File;
25
26 typedef struct
27 {
28 File *list;
29 unsigned int length;
30 unsigned int size;
31 } FileList;
32
33 typedef struct
34 {
35 char *name;
36 char *version;
37 FileList *files;
38 unsigned int key;
39 unsigned int ignore;
40 } Package;
41
42 typedef struct
43 {
44 Package *list;
45 unsigned int length;
46 unsigned int size;
47 } PackageList;
48
49 enum
50 {
51 FILE_COMPARE_EXACT,
52 FILE_COMPARE_WITHIN
53 };
54
55 extern PackageList *packages_load_from_database(const char *path);
56 extern void packages_free(PackageList *pkgs);
57 extern void packages_sort(PackageList *pkgs);
58 extern void packages_sort_all_files(PackageList *pkgs);
59 extern Package *packages_search(PackageList *pkgs, const char *name);
60 extern void files_sort(FileList *files);
61 extern void files_free(FileList *files);
62 extern File *files_search(FileList *files, const char *key, int compare_type);
|