Back to index

avfs  1.0.1
Defines | Functions
namespace.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define NSF_NOCASE   (1 << 0) /* for case-insensitive key comparisons */

Functions

struct namespaceav_namespace_new ()
struct entryav_namespace_lookup (struct namespace *ns, struct entry *parent, const char *name)
struct entryav_namespace_lookup_all (struct namespace *ns, struct entry *prev, const char *name)
struct entryav_namespace_resolve (struct namespace *ns, const char *path)
char * av_namespace_getpath (struct entry *ent)
void av_namespace_set (struct entry *ent, void *data)
void * av_namespace_get (struct entry *ent)
char * av_namespace_name (struct entry *ent)
struct entryav_namespace_next (struct entry *ent)
struct entryav_namespace_subdir (struct namespace *ns, struct entry *ent)
struct entryav_namespace_parent (struct entry *ent)
void av_namespace_setflags (struct entry *ent, int setflags, int resetflags)
struct entryav_namespace_nth (struct namespace *ns, struct entry *parent, unsigned int n)

Define Documentation

#define NSF_NOCASE   (1 << 0) /* for case-insensitive key comparisons */

Definition at line 9 of file namespace.h.


Function Documentation

void* av_namespace_get ( struct entry ent)

Definition at line 342 of file namespace.c.

{
    void *data;
    
    AV_LOCK(namespace_lock);
    data = ent->data;
    AV_UNLOCK(namespace_lock);

    return data;
}

Here is the caller graph for this function:

char* av_namespace_getpath ( struct entry ent)

Definition at line 317 of file namespace.c.

{
    char *path;

    AV_LOCK(namespace_lock);
    path = getpath(ent);
    AV_UNLOCK(namespace_lock);

    return path;
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct entry* av_namespace_lookup ( struct namespace ns,
struct entry parent,
const char *  name 
) [read]

Definition at line 252 of file namespace.c.

{
    struct entry *ent;

    AV_LOCK(namespace_lock);
    if(name == NULL) {
        ent = prev->parent;
        av_ref_obj(ent);
    }
    else
        ent = lookup_name(ns, prev, name, strlen(name));
    AV_UNLOCK(namespace_lock);

    return ent;
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct entry* av_namespace_lookup_all ( struct namespace ns,
struct entry prev,
const char *  name 
) [read]

Definition at line 269 of file namespace.c.

{
    if(name != NULL) {
        if(strcmp(name, ".") == 0) {
            av_ref_obj(prev);
            return prev;
        }
        if(strcmp(name, "..") == 0)
            name = NULL;
    }
    
    return av_namespace_lookup(ns, prev, name);
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* av_namespace_name ( struct entry ent)

Definition at line 353 of file namespace.c.

{
    return av_strdup(ent->name);
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct namespace* av_namespace_new ( ) [read]

Definition at line 167 of file namespace.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct entry* av_namespace_next ( struct entry ent) [read]

Definition at line 367 of file namespace.c.

{
    struct entry *rent;

    AV_LOCK(namespace_lock);
    rent = current_entry(subdir_head(ent->ns, ent->parent), ent->child.next);
    av_ref_obj(rent);
    AV_UNLOCK(namespace_lock);

    return rent;
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct entry* av_namespace_nth ( struct namespace ns,
struct entry parent,
unsigned int  n 
) [read]

Definition at line 405 of file namespace.c.

{
    struct list_head *ptr;
    struct list_head *head;
    struct entry *ent = NULL;

    AV_LOCK(namespace_lock);
    head = subdir_head(ns, parent);
    for(ptr = head->next; ptr != head; ptr = ptr->next) {
       if(n == 0) {
           ent = list_entry(ptr, struct entry, child);
           av_ref_obj(ent);
           break;
       }
       n--;
    }
    AV_UNLOCK(namespace_lock);

    return ent;
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct entry* av_namespace_parent ( struct entry ent) [read]

Definition at line 393 of file namespace.c.

{
    struct entry *parent;

    AV_LOCK(namespace_lock);
    parent = ent->parent;
    av_ref_obj(parent);
    AV_UNLOCK(namespace_lock);

    return parent;
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct entry* av_namespace_resolve ( struct namespace ns,
const char *  path 
) [read]

Definition at line 284 of file namespace.c.

{
    struct entry *ent;
    const char *s;
    
    AV_LOCK(namespace_lock);
    ent = NULL;
    while(*path) {
        struct entry *next;

        for(s = path; *s && *s != '/'; s++);
        next = lookup_name(ns, ent, path, s - path);
        av_unref_obj(ent);
        ent = next;
        for(path = s; *path == '/'; path++);
    }
    AV_UNLOCK(namespace_lock);

    return ent;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void av_namespace_set ( struct entry ent,
void *  data 
)

Definition at line 335 of file namespace.c.

{
    AV_LOCK(namespace_lock);
    ent->data = data;
    AV_UNLOCK(namespace_lock);
}

Here is the caller graph for this function:

void av_namespace_setflags ( struct entry ent,
int  setflags,
int  resetflags 
)

Definition at line 328 of file namespace.c.

{
    AV_LOCK(namespace_lock);
    ent->flags = (ent->flags | setflags) & ~resetflags;
    AV_UNLOCK(namespace_lock);
}

Here is the caller graph for this function:

struct entry* av_namespace_subdir ( struct namespace ns,
struct entry ent 
) [read]

Definition at line 379 of file namespace.c.

{
    struct entry *rent;
    struct list_head *head;

    AV_LOCK(namespace_lock);
    head = subdir_head(ns, ent);
    rent = current_entry(head, head->next);
    av_ref_obj(rent);
    AV_UNLOCK(namespace_lock);

    return rent;
}

Here is the call graph for this function:

Here is the caller graph for this function: