summaryrefslogtreecommitdiff
path: root/src/config.h
blob: c8e9fe062256fe6081e30f10e8b56449881564a8 (plain)
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
#ifndef INCLUDE_config_h__
#define INCLUDE_config_h__

#include "git2/config.h"

struct git_config {
	git_cvar *vars;
	git_cvar *vars_tail;

	struct {
		gitfo_buf buffer;
		char *read_ptr;
		int line_number;
		int eof;
	} reader;

	char *file_path;
};

struct git_cvar {
	git_cvar *next;
	char *name;
	char *value;
};

/*
 * If you're going to delete something inside this loop, it's such a
 * hassle that you should use the for-loop directly.
 */
#define CVAR_LIST_FOREACH(start, iter) \
	for ((iter) = (start); (iter) != NULL; (iter) = (iter)->next)

void strtolower(char *str);
void strntolower(char *str, int len);

#endif