obexftp/cache.c File Reference

ObexFTP client API caching layer. More...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
#include <openobex/obex.h>
#include "obexftp.h"
#include "client.h"
#include "object.h"
#include "cache.h"
#include <common.h>

Defines

#define _GNU_SOURCE
#define S_IFDIR   __S_IFDIR
#define S_IFREG   __S_IFREG
#define FREE_NODE(node)

Functions

void cache_purge (cache_object_t **root, const char *path)
 Purge all cache object at/below a given path.
int get_cache_object (const obexftp_client_t *cli, const char *name, char **object, int *size)
 Retrieve an object from the cache.
int put_cache_object (obexftp_client_t *cli, char *name, char *object, int size)
 Store an object in the cache.
void * obexftp_opendir (obexftp_client_t *cli, const char *name)
 Prepare a directory for reading.
int obexftp_closedir (void *dir)
 Close a directory after reading.
stat_entry_tobexftp_readdir (void *dir)
 Read the next entry from an open directory.
stat_entry_tobexftp_stat (obexftp_client_t *cli, const char *name)
 Stat a directory entry.


Detailed Description

ObexFTP client API caching layer.

ObexFTP library - language bindings for OBEX file transfer.

Copyright (c) 2002-2007 Christian W. Zuckschwerdt <zany@triq.net>

ObexFTP is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with ObexFTP. If not, see <http://www.gnu.org/>.


Define Documentation

#define _GNU_SOURCE

#define FREE_NODE ( node   ) 

Value:

do { \
                        if (node->name) \
                                free(node->name); \
                        if (node->content) \
                                free(node->content); \
                        free(node); \
                        } while(0)

#define S_IFDIR   __S_IFDIR

#define S_IFREG   __S_IFREG


Function Documentation

void cache_purge ( cache_object_t **  root,
const char *  path 
)

Purge all cache object at/below a given path.

Methods that need to invalidate cache lines:

int get_cache_object ( const obexftp_client_t cli,
const char *  name,
char **  object,
int *  size 
)

Retrieve an object from the cache.

int obexftp_closedir ( void *  dir  ) 

Close a directory after reading.

The stat entry is a cache object so we do nothing.

void* obexftp_opendir ( obexftp_client_t cli,
const char *  name 
)

Prepare a directory for reading.

stat_entry_t* obexftp_readdir ( void *  dir  ) 

Read the next entry from an open directory.

stat_entry_t* obexftp_stat ( obexftp_client_t cli,
const char *  name 
)

Stat a directory entry.

int put_cache_object ( obexftp_client_t cli,
char *  name,
char *  object,
int  size 
)

Store an object in the cache.


Generated on Sun Sep 2 20:09:53 2007 for ObexFTP by  doxygen 1.5.2