[r109]: branches / smbnetfs-0.3 / src / smbitem.h Maximize Restore History

Download this file

smbitem.h    52 lines (42 with data), 1.3 kB

 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
#ifndef __SMBITEM_H__
#define __SMBITEM_H__
#include <time.h>
#include "list.h"
#include "splice.h"
#define USER_TREE 0x01
#define SAMBA_TREE 0x02
#define JOINED_TREE ( USER_TREE | SAMBA_TREE )
typedef enum{
SMBITEM_LINK,
SMBITEM_COMP,
SMBITEM_GROUP
} smbitem_type;
typedef enum{
SI_UNKNOWN,
SI_SMBNETFS_DIR,
SI_SMBNETFS_LINK,
SI_SMB_ROOT,
SI_SMB_NAME,
SI_SMB_SHARE,
SI_SMB_SHARE_ITEM
} path_type;
typedef struct{
LIST entries;
int ref_count; // the number of item references
time_t change_time; // item modification time
smbitem_type type; // item type: comp/link/group
hstring name; // pointer to item name and its hash
hstring link; // pointer to link and its hash
char data[0]; // internal data
} smbitem;
int mkgroup(const char *path, int flag);
int mkhost(const char *path, int flag);
int mklink(const char *path, const char *link, int flag);
int getdir(SPLICE *splice, const char *path, int flag);
void DeleteSmbItemArray(SPLICE *splice);
void RequestSmbItem(smbitem *item);
void ReleaseSmbItem(smbitem* item);
void DeleteOldSmbItem(time_t threshold, int flag);
path_type GetSmbUrlType(const char *smb_url);
path_type GetPathType(const char *path, char *buf, size_t buf_len);
#endif /* __SMBITEM_H__ */