-
Notifications
You must be signed in to change notification settings - Fork 162
/
pkgi_db.h
70 lines (55 loc) · 1.44 KB
/
pkgi_db.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#include <stdint.h>
typedef enum {
PresenceUnknown,
PresenceIncomplete,
PresenceInstalled,
PresenceMissing,
} DbPresence;
typedef enum {
SortByTitle,
SortByRegion,
SortByName,
SortBySize,
} DbSort;
typedef enum {
SortAscending,
SortDescending,
} DbSortOrder;
typedef enum {
DbFilterRegionASA = 0x01,
DbFilterRegionEUR = 0x02,
DbFilterRegionJPN = 0x04,
DbFilterRegionUSA = 0x08,
// TODO: implement these two
DbFilterInstalled = 0x10,
DbFilterMissing = 0x20,
DbFilterAllRegions = DbFilterRegionUSA | DbFilterRegionEUR | DbFilterRegionJPN | DbFilterRegionASA,
DbFilterAll = DbFilterAllRegions | DbFilterInstalled | DbFilterMissing,
} DbFilter;
typedef struct {
DbPresence presence;
const char* content;
uint32_t flags;
const char* name;
const char* name_org;
const char* zrif;
const char* url;
const uint8_t* digest;
int64_t size;
} DbItem;
typedef enum {
RegionASA,
RegionEUR,
RegionJPN,
RegionUSA,
RegionUnknown,
} GameRegion;
typedef struct Config Config;
int pkgi_db_update(const char* update_url, char* error, uint32_t error_size);
void pkgi_db_get_update_status(uint32_t* updated, uint32_t* total);
void pkgi_db_configure(const char* search, const Config* config);
uint32_t pkgi_db_count(void);
uint32_t pkgi_db_total(void);
DbItem* pkgi_db_get(uint32_t index);
GameRegion pkgi_get_region(const char* content);