"Fossies" - the Fresh Open Source Software Archive 
Member "smbnetfs-0.6.3/src/smbitem.h" (23 Dec 2013, 1946 Bytes) of package /linux/misc/smbnetfs-0.6.3.tar.bz2:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "smbitem.h" see the
Fossies "Dox" file reference documentation.
1 #ifndef __SMBITEM_H__
2 #define __SMBITEM_H__
3
4 #include <time.h>
5
6 enum smbitem_t{
7 SMBITEM_LINK,
8 SMBITEM_HOST,
9 SMBITEM_GROUP
10 };
11
12 enum smbitem_tree_t{
13 SMBITEM_USER_TREE,
14 SMBITEM_SAMBA_TREE
15 };
16
17 enum smbitem_path_t{
18 SMBITEM_UNKNOWN,
19 SMBITEM_SMBNETFS_DIR,
20 SMBITEM_SMBNETFS_LINK,
21 SMBITEM_SMB_NAME,
22 SMBITEM_SMB_SHARE,
23 SMBITEM_SMB_SHARE_ITEM
24 };
25
26 struct smbitem{
27 char *name; // item name
28 enum smbitem_t type; // item type: comp/link/group
29 time_t touch_time; // item touch time
30 int ref_count; // the number of item references
31 union{
32 struct{
33 int is_hidden; // host: is item hidden?
34 struct smbitem *parent_group; // host: pointer parent group
35 };
36 struct{
37 int child_cnt; // group: subitems in group
38 int max_child_cnt; // group: maximum number of smbitems
39 struct smbitem **childs; // group: sorted list of subitems
40 };
41 struct{
42 char *linkpath; // link: link value
43 };
44 };
45 };
46
47 int smbitem_init(void);
48 void smbitem_done(void);
49
50 int smbitem_mkgroup(const char *path,
51 enum smbitem_tree_t tree);
52 int smbitem_mkhost(const char *path,
53 const char *group, int is_hidden,
54 enum smbitem_tree_t tree);
55 int smbitem_mklink(const char *path,
56 const char *linkpath,
57 enum smbitem_tree_t tree);
58
59 struct smbitem * smbitem_getdir(const char *path);
60 struct smbitem * smbitem_get_samba_groups(void);
61 void smbitem_release_dir(struct smbitem *item);
62 void smbitem_delete_obsolete(time_t threshold,
63 enum smbitem_tree_t tree);
64
65 enum smbitem_path_t smbitem_what_is(const char *path);
66 int smbitem_is_name_exist(const char *name);
67 int smbitem_readlink(const char *path, char *buf, size_t size);
68 int smbitem_get_group(const char *host, char *buf, size_t size);
69
70 #endif /* __SMBITEM_H__ */