Subversion Repositories SvarDOS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
221 mateuszvis 1
/*
2
 * Package database manipulation routines.
3
 * This file is part of the FDNPKG project.
4
 *
5
 * Copyright (C) 2012-2017 Mateusz Viste
6
 */
7
 
8
#ifndef pkgdb_sentinel
9
#define pkgdb_sentinel
10
 
11
struct pkgrepo {
12
  unsigned char repo;
13
  char version[16];
14
  unsigned long crc32zip;
15
  unsigned long crc32zib;
16
  struct pkgrepo *nextrepo;
17
};
18
 
19
struct pkgdb {
20
  char name[9];
21
  char *desc;  /* the description of the package - will be strdup()ed when time will come */
22
  struct pkgrepo *repolist;
23
  struct pkgdb *nextpkg;
24
};
25
 
26
 
27
struct pkgdb *createdb(void);
28
void freedb(struct pkgdb **db);
29
struct pkgdb *findpkg(struct pkgdb *db, char *pkgname, struct pkgdb **lastmatch);
30
int loaddb(struct pkgdb *db, char *datafile, unsigned char repo, char **dbmsg);
31
int loaddb_fromcache(struct pkgdb *db, char *datafile, unsigned long crc32val, long maxcachetime);
32
void dumpdb(struct pkgdb *db, char *datafile, unsigned long crc32val);
33
 
34
#endif