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.c File Reference
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include "common.h"
#include "smbitem.h"
Include dependency graph for smbitem.c:

Go to the source code of this file.

Data Structures

struct  trees


static struct smbitemsmbitem_new_host (const char *name, int is_hidden)
static struct smbitemsmbitem_new_group (const char *name)
static struct smbitemsmbitem_new_link (const char *name, const char *linkpath)
static void smbitem_delete_item (struct smbitem *item)
static void smbitem_aquire_item (struct smbitem *item)
static void smbitem_release_item (struct smbitem *item)
static void smbitem_delete_obsolete_items (struct smbitem *group, time_t threshold)
static int smbitem_find_in_group_wl (struct smbitem *group, const char *name, size_t name_len, int first)
static int smbitem_find_in_group (struct smbitem *group, const char *name, int first)
static int smbitem_insert_to_group (struct smbitem *group, struct smbitem *item, int pos)
int smbitem_init (void)
void smbitem_done (void)
int smbitem_mkgroup (const char *path, enum smbitem_tree_t tree)
int smbitem_mkhost (const char *path, const char *group, int is_hidden, enum smbitem_tree_t tree)
int smbitem_mklink (const char *path, const char *linkpath, enum smbitem_tree_t tree)
struct smbitemsmbitem_get_samba_groups (void)
struct smbitemsmbitem_getdir (const char *path)
void smbitem_release_dir (struct smbitem *item)
void smbitem_delete_obsolete (time_t threshold, enum smbitem_tree_t tree)
static const char * smbitem_get_path_end (const char *path)
enum smbitem_path_t smbitem_what_is (const char *path)
int smbitem_is_name_exist (const char *name)
int smbitem_readlink (const char *path, char *buf, size_t size)
int smbitem_get_group (const char *host, char *buf, size_t size)


static struct trees trees = { NULL, NULL }
static pthread_mutex_t m_smbitem = PTHREAD_MUTEX_INITIALIZER

Function Documentation

◆ smbitem_aquire_item()

static void smbitem_aquire_item ( struct smbitem item)

Definition at line 69 of file smbitem.c.

References smbitem::ref_count.

Referenced by smbitem_get_samba_groups(), smbitem_getdir(), and smbitem_mkhost().

◆ smbitem_delete_item()

static void smbitem_delete_item ( struct smbitem item)

Definition at line 65 of file smbitem.c.

Referenced by smbitem_release_item().

◆ smbitem_delete_obsolete()

void smbitem_delete_obsolete ( time_t  threshold,
enum smbitem_tree_t  tree 

◆ smbitem_delete_obsolete_items()

static void smbitem_delete_obsolete_items ( struct smbitem group,
time_t  threshold 

◆ smbitem_done()

void smbitem_done ( void  )

Definition at line 204 of file smbitem.c.

References m_smbitem, trees::samba, smbitem_release_item(), and trees::user.

Referenced by main().

◆ smbitem_find_in_group()

static int smbitem_find_in_group ( struct smbitem group,
const char *  name,
int  first 

◆ smbitem_find_in_group_wl()

static int smbitem_find_in_group_wl ( struct smbitem group,
const char *  name,
size_t  name_len,
int  first 

◆ smbitem_get_group()

int smbitem_get_group ( const char *  host,
char *  buf,
size_t  size 

◆ smbitem_get_path_end()

static const char* smbitem_get_path_end ( const char *  path)

Definition at line 535 of file smbitem.c.

Referenced by smbitem_readlink().

◆ smbitem_get_samba_groups()

◆ smbitem_getdir()

◆ smbitem_init()

int smbitem_init ( void  )

Definition at line 188 of file smbitem.c.

References m_smbitem, trees::samba, smbitem_new_group(), smbitem_release_item(), and trees::user.

Referenced by main().

◆ smbitem_insert_to_group()

static int smbitem_insert_to_group ( struct smbitem group,
struct smbitem item,
int  pos 

◆ smbitem_is_name_exist()

int smbitem_is_name_exist ( const char *  name)

Definition at line 610 of file smbitem.c.

References m_smbitem, smbitem::name, trees::samba, smbitem_find_in_group(), and trees::user.

◆ smbitem_mkgroup()

◆ smbitem_mkhost()

◆ smbitem_mklink()

◆ smbitem_new_group()

static struct smbitem* smbitem_new_group ( const char *  name)

◆ smbitem_new_host()

static struct smbitem* smbitem_new_host ( const char *  name,
int  is_hidden 

◆ smbitem_new_link()

static struct smbitem* smbitem_new_link ( const char *  name,
const char *  linkpath 

◆ smbitem_readlink()

int smbitem_readlink ( const char *  path,
char *  buf,
size_t  size 

◆ smbitem_release_dir()

void smbitem_release_dir ( struct smbitem item)

◆ smbitem_release_item()

◆ smbitem_what_is()

Variable Documentation

◆ m_smbitem

◆ trees

struct trees trees = { NULL, NULL }

Definition at line 1 of file smbitem.c.