aboutsummaryrefslogtreecommitdiff
path: root/storage.h
blob: 9689a56a1e883d5fd5674181717cd832ec0ffc78 (plain) (blame)
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
#ifndef STORAGE_H
#define STORAGE_H

#include "db.h"

#define MAXPATH 4096
#define MAXTAGS 4096


typedef struct{
	char path[MAXPATH];
	char tags[MAXTAGS];
	uint16_t numTags;
	uint16_t lentags;
	
} row;


row *newRow(const char *path);

void split(const char *src, char sep, char ***arr, int *len);

void swapWords(char ***arr, int a, int b);

char *normalizeTag(char *tag);

void insertTag(row *r, char *tag);

void removeTag(row *r, char *tag);

#endif