Mention PAM file.
[doldaconnect.git] / daemon / client.h
CommitLineData
d3372da9 1/*
2 * Dolda Connect - Modular multiuser Direct Connect-style client
3 * Copyright (C) 2004 Fredrik Tolf (fredrik@dolda2000.com)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19#ifndef _CLIENT_H
20#define _CLIENT_H
21
22#include <sys/types.h>
23
24#include <utils.h>
25
26#define FILE_REG 0
27#define FILE_DIR 1
28#define FILE_INT 2
29
30#define HASHHASHSIZE 12
31
32struct sharepoint
33{
34 struct sharepoint *prev, *next;
35 char *path;
36 wchar_t *name;
37 int delete;
38};
39
ea637424 40struct hash
41{
42 wchar_t *algo;
43 size_t len;
44 char *buf;
45};
46
d3372da9 47struct hashcache
48{
49 struct hashcache *next, *prev;
50 dev_t dev;
51 ino_t inode;
52 time_t mtime;
53 char tth[24];
54};
55
56struct sharecache
57{
58 struct sharecache *next, *prev, *child, *parent;
59 char *path;
60 wchar_t *name;
61 size_t size;
62 time_t mtime;
63 dev_t dev;
64 ino_t inode;
65 char hashtth[24];
66 union
67 {
68 struct
69 {
70 int type:3;
71 int hastth:1;
72 int found:1;
73 } b;
74 int w;
75 } f;
76 CBCHAIN(share_delete, struct sharecache *);
77};
78
79void clientpreinit(void);
80int clientinit(void);
81int doscan(int quantum);
82int opensharecache(struct sharecache *node);
83struct sharecache *findcache(struct sharecache *parent, wchar_t *name);
84void queuescan(struct sharecache *node);
85char *getfspath(struct sharecache *node);
86struct sharecache *nextscnode(struct sharecache *node);
ea637424 87struct hash *newhash(wchar_t *algo, size_t len, char *hash);
88void freehash(struct hash *hash);
89struct hash *duphash(struct hash *hash);
90struct hash *parsehash(wchar_t *text);
91wchar_t *unparsehash(struct hash *hash);
4f8fc795 92int hashcmp(struct hash *h1, struct hash *h2);
d3372da9 93
94extern struct sharecache *shareroot;
95extern unsigned long long sharesize;
96EGCBCHAIN(sharechangecb, unsigned long long);
97
98#endif