smbnetfs  0.6.3
About: SMBNetFS is a Linux/FreeBSD filesystem that allow you to use samba/microsoft network in the same manner as the network neighborhood in Microsoft Windows.
  Fossies Dox: smbnetfs-0.6.3.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

smbitem.h
Go to the documentation of this file.
1 #ifndef __SMBITEM_H__
2 #define __SMBITEM_H__
3 
4 #include <time.h>
5 
6 enum smbitem_t{
10 };
11 
15 };
16 
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__ */
void smbitem_done(void)
Definition: smbitem.c:204
int smbitem_mklink(const char *path, const char *linkpath, enum smbitem_tree_t tree)
Definition: smbitem.c:331
void smbitem_delete_obsolete(time_t threshold, enum smbitem_tree_t tree)
Definition: smbitem.c:523
int smbitem_get_group(const char *host, char *buf, size_t size)
Definition: smbitem.c:676
int smbitem_is_name_exist(const char *name)
Definition: smbitem.c:610
int smbitem_mkgroup(const char *path, enum smbitem_tree_t tree)
Definition: smbitem.c:212
smbitem_t
Definition: smbitem.h:6
@ SMBITEM_HOST
Definition: smbitem.h:8
@ SMBITEM_GROUP
Definition: smbitem.h:9
@ SMBITEM_LINK
Definition: smbitem.h:7
int smbitem_init(void)
Definition: smbitem.c:188
smbitem_path_t
Definition: smbitem.h:17
@ SMBITEM_SMBNETFS_LINK
Definition: smbitem.h:20
@ SMBITEM_SMB_SHARE
Definition: smbitem.h:22
@ SMBITEM_SMB_SHARE_ITEM
Definition: smbitem.h:23
@ SMBITEM_UNKNOWN
Definition: smbitem.h:18
@ SMBITEM_SMBNETFS_DIR
Definition: smbitem.h:19
@ SMBITEM_SMB_NAME
Definition: smbitem.h:21
struct smbitem * smbitem_get_samba_groups(void)
Definition: smbitem.c:404
int smbitem_mkhost(const char *path, const char *group, int is_hidden, enum smbitem_tree_t tree)
Definition: smbitem.c:256
void smbitem_release_dir(struct smbitem *item)
Definition: smbitem.c:513
smbitem_tree_t
Definition: smbitem.h:12
@ SMBITEM_USER_TREE
Definition: smbitem.h:13
@ SMBITEM_SAMBA_TREE
Definition: smbitem.h:14
struct smbitem * smbitem_getdir(const char *path)
Definition: smbitem.c:431
enum smbitem_path_t smbitem_what_is(const char *path)
Definition: smbitem.c:540
int smbitem_readlink(const char *path, char *buf, size_t size)
Definition: smbitem.c:625
struct smbitem ** childs
Definition: smbitem.h:39
time_t touch_time
Definition: smbitem.h:29
struct smbitem * parent_group
Definition: smbitem.h:34
char * name
Definition: smbitem.h:27
int child_cnt
Definition: smbitem.h:37
char * linkpath
Definition: smbitem.h:42
int ref_count
Definition: smbitem.h:30
int max_child_cnt
Definition: smbitem.h:38
int is_hidden
Definition: smbitem.h:33
enum smbitem_t type
Definition: smbitem.h:28