source.h 824 Bytes
Newer Older
Jack Moffitt's avatar
Jack Moffitt committed
1
2
3
#ifndef __SOURCE_H__
#define __SOURCE_H__

4
5
#include "config.h"
#include "yp.h"
Michael Smith's avatar
Michael Smith committed
6
7
#include "format.h"

Jack Moffitt's avatar
Jack Moffitt committed
8
9
typedef struct source_tag
{
10
    client_t *client;
Jack Moffitt's avatar
Jack Moffitt committed
11
12
13
14
	connection_t *con;
	http_parser_t *parser;
	
	char *mount;
Michael Smith's avatar
Michael Smith committed
15
16
17
18

    /* If this source drops, try to move all clients to this fallback */
    char *fallback_mount;

Michael Smith's avatar
Michael Smith committed
19
	struct _format_plugin_tag *format;
Jack Moffitt's avatar
Jack Moffitt committed
20
21
22
23
24

	avl_tree *client_tree;
	avl_tree *pending_tree;

	rwlock_t *shutdown_rwlock;
25
26
27
	ypdata_t *ypdata[MAX_YP_DIRECTORIES];
	int	num_yp_directories;
	long	listeners;
Jack Moffitt's avatar
Jack Moffitt committed
28
29
} source_t;

30
source_t *source_create(client_t *client, connection_t *con, http_parser_t *parser, const char *mount, format_type_t type);
Jack Moffitt's avatar
Jack Moffitt committed
31
32
33
34
35
36
37
38
source_t *source_find_mount(const char *mount);
int source_compare_sources(void *arg, void *a, void *b);
int source_free_source(void *key);
void *source_main(void *arg);

#endif