Main Page | Class List | File List | Class Members | File Members | Related Pages

gi_share.h

Go to the documentation of this file.
00001 /* 00002 * $Id: gi_share.h,v 1.1.2.4 2004/04/10 00:57:42 jasta Exp $ 00003 * 00004 * Copyright (C) 2001-2003 giFT project (gift.sourceforge.net) 00005 * 00006 * This program is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU General Public License as published by the 00008 * Free Software Foundation; either version 2, or (at your option) any 00009 * later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, but 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * General Public License for more details. 00015 */ 00016 00017 #ifndef __GI_SHARE_H 00018 #define __GI_SHARE_H 00019 00020 /*****************************************************************************/ 00021 00036 /*****************************************************************************/ 00037 00038 /* duplicate here because this file may be used without protocol.h */ 00039 #ifndef LIBGIFTPROTO_EXPORT 00040 # define LIBGIFTPROTO_EXPORT /* nothing */ 00041 #endif 00042 00043 /*****************************************************************************/ 00044 00045 struct gi_protocol; 00046 00047 /*****************************************************************************/ 00048 00049 #include "gi_share_hash.h" 00050 00051 /*****************************************************************************/ 00052 00058 struct gi_file_share 00059 { 00063 GiPath *root; 00066 GiPath *path; 00067 GiPath *hpath; 00068 char *mime; 00070 time_t mtime; 00072 off_t size; 00078 unsigned int ref; 00083 GiDataset *meta; 00084 GiDataset *hash; 00085 GiDataset *udata; 00090 struct gi_protocol *p; 00093 }; 00094 00095 typedef struct gi_file_share GiShare; 00096 00097 /*****************************************************************************/ 00098 00099 EXTERN_C_BEGIN 00100 00101 /*****************************************************************************/ 00102 00107 LIBGIFTPROTO_EXPORT 00108 bool gi_share_init (GiShare *share, const char *path); 00109 00115 LIBGIFTPROTO_EXPORT 00116 void gi_share_finish (GiShare *share); 00117 00118 /*****************************************************************************/ 00119 00128 LIBGIFTPROTO_EXPORT 00129 GiShare *gi_share_new (const char *path); 00130 00136 LIBGIFTPROTO_EXPORT 00137 GiShare *gi_share_newex (struct gi_protocol *p, 00138 const char *root, size_t root_len, 00139 const char *path, const char *mime, off_t size, 00140 time_t mtime); 00141 00147 LIBGIFTPROTO_EXPORT 00148 void gi_share_free (GiShare *share); 00149 00150 /*****************************************************************************/ 00151 00160 LIBGIFTPROTO_EXPORT 00161 unsigned int gi_share_ref (GiShare *share); 00162 00170 LIBGIFTPROTO_EXPORT 00171 unsigned int gi_share_unref (GiShare *share); 00172 00173 /*****************************************************************************/ 00174 00189 LIBGIFTPROTO_EXPORT 00190 GiPath *gi_share_get_hpath (GiShare *share); 00191 00192 /*****************************************************************************/ 00193 00200 LIBGIFTPROTO_EXPORT 00201 GiPath *gi_share_set_path (GiShare *share, const char *path); 00202 00211 LIBGIFTPROTO_EXPORT 00212 GiPath *gi_share_set_root (GiShare *share, const char *root, size_t len); 00213 00221 LIBGIFTPROTO_EXPORT 00222 char *gi_share_set_mime (GiShare *share, const char *mime); 00223 00224 /*****************************************************************************/ 00225 00240 LIBGIFTPROTO_EXPORT 00241 bool gi_share_set_meta (GiShare *share, const char *key, const char *value); 00242 00246 LIBGIFTPROTO_EXPORT 00247 char *gi_share_get_meta (GiShare *share, const char *key); 00248 00252 LIBGIFTPROTO_EXPORT 00253 void gi_share_clear_meta (GiShare *share); 00254 00258 LIBGIFTPROTO_EXPORT 00259 void gi_share_foreach_meta (GiShare *share, GiDatasetForeachFn func, void *udata); 00260 00261 /*****************************************************************************/ 00262 00278 LIBGIFTPROTO_EXPORT 00279 void *gi_share_set_udata (GiShare *share, const char *proto, void *udata); 00280 00285 LIBGIFTPROTO_EXPORT 00286 void *gi_share_get_udata (GiShare *share, const char *proto); 00287 00288 /*****************************************************************************/ 00289 00295 LIBGIFTPROTO_EXPORT 00296 bool gi_share_complete (GiShare *share); 00297 00298 /*****************************************************************************/ 00299 00300 EXTERN_C_END 00301 00302 /*****************************************************************************/ 00303 00304 #endif /* __GI_SHARE_H */

Generated on Sun Aug 22 08:11:13 2004 by doxygen 1.3.7