Back to index

avfs  1.0.1
Functions
default.c File Reference
#include "internal.h"

Go to the source code of this file.

Functions

static void default_destroy (struct avfs *avfs)
static int default_lookup (ventry *ve, const char *name, void **newp)
static void default_putent (ventry *ve)
static int default_copyent (ventry *ve, void **resp)
static int default_getpath (ventry *ve, char **resp)
static int default_access (ventry *ve, int amode)
static int default_readlink (ventry *ve, char **bufp)
static int default_symlink (const char *path, ventry *newve)
static int default_unlink (ventry *ve)
static int default_rmdir (ventry *ve)
static int default_mknod (ventry *ve, avmode_t mode, avdev_t dev)
static int default_mkdir (ventry *ve, avmode_t mode)
static int default_rename (ventry *ve, ventry *newve)
static int default_link (ventry *ve, ventry *newve)
static int default_open (ventry *ve, int flags, avmode_t mode, void **resp)
static int default_close (vfile *vf)
static avssize_t default_read (vfile *vf, char *buf, avsize_t nbyte)
static avssize_t default_write (vfile *vf, const char *buf, avsize_t nbyte)
static int default_readdir (vfile *vf, struct avdirent *buf)
static int default_getattr (vfile *vf, struct avstat *buf, int attrmask)
static int default_setattr (vfile *vf, struct avstat *buf, int attrmask)
static int default_truncate (vfile *vf, avoff_t length)
static avoff_t get_size (vfile *vf)
static avoff_t default_lseek (vfile *vf, avoff_t offset, int whence)
void av_default_avfs (struct avfs *avfs)

Function Documentation

void av_default_avfs ( struct avfs avfs)

Definition at line 196 of file default.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int default_access ( ventry *  ve,
int  amode 
) [static]

Definition at line 64 of file default.c.

{
    return -EINVAL;
}

Here is the caller graph for this function:

static int default_close ( vfile *  vf) [static]

Definition at line 114 of file default.c.

{
    return 0;
}

Here is the caller graph for this function:

static int default_copyent ( ventry *  ve,
void **  resp 
) [static]

Definition at line 46 of file default.c.

{
    char *path = (char *) ve->data;
    
    *resp =  (void *) av_strdup(path);
    
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void default_destroy ( struct avfs avfs) [static]

Definition at line 11 of file default.c.

{
}

Here is the caller graph for this function:

static int default_getattr ( vfile *  vf,
struct avstat buf,
int  attrmask 
) [static]

Definition at line 135 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static int default_getpath ( ventry *  ve,
char **  resp 
) [static]

Definition at line 55 of file default.c.

{
    char *path = (char *) ve->data;
    
    *resp =  av_strdup(path);

    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int default_link ( ventry *  ve,
ventry *  newve 
) [static]

Definition at line 104 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static int default_lookup ( ventry *  ve,
const char *  name,
void **  newp 
) [static]

Definition at line 15 of file default.c.

{
    char *path = (char *) ve->data;
    
    if(path == NULL)
       path = av_strdup(name);
    else if(name == NULL || strcmp(name, "..") == 0) {
       char *s;
       s = strrchr(path, AV_DIR_SEP_CHAR);
       if(s == NULL) {
           av_free(path);
           path = NULL;
       }
       else 
           *s = '\0';
    }
    else if(strcmp(name, ".") != 0)
       path = av_stradd(path, AV_DIR_SEP_STR, name, NULL);
    
    *newp = path;

    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static avoff_t default_lseek ( vfile *  vf,
avoff_t  offset,
int  whence 
) [static]

Definition at line 163 of file default.c.

{
    avoff_t res;

    switch(whence) {
    case AVSEEK_SET:
       res = offset;
       break;
       
    case AVSEEK_CUR:
       res = vf->ptr + offset;
       break;
       
    case AVSEEK_END:
       res = get_size(vf);
       if(res < 0)
           return res;

       res = res + offset;
       break;
       
    default:
        return -EINVAL;
    }

    if(res < 0)
        return -EINVAL;

    vf->ptr = res;

    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int default_mkdir ( ventry *  ve,
avmode_t  mode 
) [static]

Definition at line 94 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static int default_mknod ( ventry *  ve,
avmode_t  mode,
avdev_t  dev 
) [static]

Definition at line 89 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static int default_open ( ventry *  ve,
int  flags,
avmode_t  mode,
void **  resp 
) [static]

Definition at line 109 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static void default_putent ( ventry *  ve) [static]

Definition at line 39 of file default.c.

{
    char *path = (char *) ve->data;

    av_free(path);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static avssize_t default_read ( vfile *  vf,
char *  buf,
avsize_t  nbyte 
) [static]

Definition at line 119 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static int default_readdir ( vfile *  vf,
struct avdirent buf 
) [static]

Definition at line 130 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static int default_readlink ( ventry *  ve,
char **  bufp 
) [static]

Definition at line 69 of file default.c.

{
    return -EINVAL;
}

Here is the caller graph for this function:

static int default_rename ( ventry *  ve,
ventry *  newve 
) [static]

Definition at line 99 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static int default_rmdir ( ventry *  ve) [static]

Definition at line 84 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static int default_setattr ( vfile *  vf,
struct avstat buf,
int  attrmask 
) [static]

Definition at line 140 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static int default_symlink ( const char *  path,
ventry *  newve 
) [static]

Definition at line 74 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static int default_truncate ( vfile *  vf,
avoff_t  length 
) [static]

Definition at line 145 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static int default_unlink ( ventry *  ve) [static]

Definition at line 79 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static avssize_t default_write ( vfile *  vf,
const char *  buf,
avsize_t  nbyte 
) [static]

Definition at line 124 of file default.c.

{
    return -ENOSYS;
}

Here is the caller graph for this function:

static avoff_t get_size ( vfile *  vf) [static]

Definition at line 150 of file default.c.

{
    int res;
    struct avfs *avfs = vf->mnt->avfs;
    struct avstat stbuf;

    res = avfs->getattr(vf, &stbuf, AVA_SIZE);
    if(res < 0)
       return res;

    return stbuf.size;
}

Here is the caller graph for this function: