00001 #ifndef CHIRP_ALLOC_H 00002 #define CHIRP_ALLOC_H 00003 00004 #include "chirp_client.h" 00005 #include "link.h" 00006 00007 #include <sys/types.h> 00008 #include <stdio.h> 00009 00010 void chirp_alloc_init( const char *rootpath, INT64_T size ); 00011 void chirp_alloc_flush(); 00012 int chirp_alloc_flush_needed(); 00013 time_t chirp_alloc_last_flush_time(); 00014 00015 INT64_T chirp_alloc_open( const char *path, INT64_T flags, INT64_T mode ); 00016 INT64_T chirp_alloc_close( int fd ); 00017 INT64_T chirp_alloc_pread( int fd, void *buffer, INT64_T length, INT64_T offset ); 00018 INT64_T chirp_alloc_pwrite( int fd, const void *buffer, INT64_T length, INT64_T offset ); 00019 INT64_T chirp_alloc_sread( int fd, void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset ); 00020 INT64_T chirp_alloc_swrite( int fd, const void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset ); 00021 INT64_T chirp_alloc_fstat( int fd, struct chirp_stat *buf ); 00022 INT64_T chirp_alloc_fstatfs( int fd, struct chirp_statfs *buf ); 00023 INT64_T chirp_alloc_fchown( int fd, INT64_T uid, INT64_T gid ); 00024 INT64_T chirp_alloc_fchmod( int fd, INT64_T mode ); 00025 INT64_T chirp_alloc_ftruncate( int fd, INT64_T length ); 00026 INT64_T chirp_alloc_fsync( int fd ); 00027 00028 void * chirp_alloc_opendir( const char *path ); 00029 char * chirp_alloc_readdir( void *dir ); 00030 void chirp_alloc_closedir( void *dir ); 00031 00032 INT64_T chirp_alloc_getfile( const char *path, struct link *link, time_t stoptime ); 00033 INT64_T chirp_alloc_putfile( const char *path, struct link *link, INT64_T length, INT64_T mode, time_t stoptime ); 00034 00035 INT64_T chirp_alloc_getstream( const char *path, struct link *link, time_t stoptime ); 00036 INT64_T chirp_alloc_putstream( const char *path, struct link *link, time_t stoptime ); 00037 00038 INT64_T chirp_alloc_mkfifo( const char *path ); 00039 INT64_T chirp_alloc_unlink( const char *path ); 00040 INT64_T chirp_alloc_rename( const char *path, const char *newpath ); 00041 INT64_T chirp_alloc_link( const char *path, const char *newpath ); 00042 INT64_T chirp_alloc_symlink( const char *path, const char *newpath ); 00043 INT64_T chirp_alloc_readlink( const char *path, char *buf, INT64_T length ); 00044 INT64_T chirp_alloc_mkdir( const char *path, INT64_T mode ); 00045 INT64_T chirp_alloc_rmdir( const char *path ); 00046 INT64_T chirp_alloc_rmall( const char *path ); 00047 INT64_T chirp_alloc_stat( const char *path, struct chirp_stat *buf ); 00048 INT64_T chirp_alloc_lstat( const char *path, struct chirp_stat *buf ); 00049 INT64_T chirp_alloc_statfs( const char *path, struct chirp_statfs *buf ); 00050 INT64_T chirp_alloc_access( const char *path, INT64_T mode ); 00051 INT64_T chirp_alloc_chmod( const char *path, INT64_T mode ); 00052 INT64_T chirp_alloc_chown( const char *path, INT64_T uid, INT64_T gid ); 00053 INT64_T chirp_alloc_lchown( const char *path, INT64_T uid, INT64_T gid ); 00054 INT64_T chirp_alloc_truncate( const char *path, INT64_T length ); 00055 INT64_T chirp_alloc_utime( const char *path, time_t actime, time_t modtime ); 00056 INT64_T chirp_alloc_md5( const char *path, unsigned char digest[16] ); 00057 00058 INT64_T chirp_alloc_lsalloc( const char *path, char *alloc_path, INT64_T *total, INT64_T *inuse ); 00059 INT64_T chirp_alloc_mkalloc( const char *path, INT64_T size, INT64_T mode ); 00060 00061 INT64_T chirp_alloc_file_size( const char *path ); 00062 INT64_T chirp_alloc_fd_size( int fd ); 00063 00064 #endif