~pbxt-core/pbxt/2.0

« back to all changes in this revision

Viewing changes to src/filesys_xt.h

  • Committer: Paul McCullagh
  • Date: 2010-05-03 12:43:05 UTC
  • mfrom: (831.2.21 1.5-trunk)
  • Revision ID: paul.mccullagh@primebase.org-20100503124305-ifpcfm7234cx4371
Merged with 1.5 trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
 * XT_FT_HEAP - File not on disk, only in RAM
70
70
 * XT_FT_REWRITE_FLUSH - Standard file with re-write flushing
71
71
 */
72
 
typedef enum XTFileType { XT_FT_NONE, XT_FT_STANDARD, XT_FT_MEM_MAP, XT_FT_HEAP, XT_FT_REWRITE_FLUSH };
 
72
enum XTFileType { XT_FT_NONE, XT_FT_STANDARD, XT_FT_MEM_MAP, XT_FT_HEAP, XT_FT_REWRITE_FLUSH };
73
73
 
74
74
xtBool                  xt_fs_exists(char *path);
75
75
xtBool                  xt_fs_delete(struct XTThread *self, char *path);
109
109
#define FILE_MAP_LOCK_TYPE                              xt_rwlock_type
110
110
#define FILE_MAP_INIT_LOCK(s, i)                xt_init_rwlock_with_autoname(s, i)
111
111
#define FILE_MAP_FREE_LOCK(s, i)                xt_free_rwlock(i)       
112
 
#define FILE_MAP_READ_LOCK(i, o)                xt_slock_rwlock_ns(i)
113
 
#define FILE_MAP_WRITE_LOCK(i, o)               xt_xlock_rwlock_ns(i)
114
 
#define FILE_MAP_UNLOCK(i, o)                   xt_unlock_rwlock_ns(i)
 
112
#define FILE_MAP_READ_LOCK(i, o)                do { xt_slock_rwlock_ns(i); (void) (o); } while(0)
 
113
#define FILE_MAP_WRITE_LOCK(i, o)               do { xt_xlock_rwlock_ns(i); (void) (o); } while(0)
 
114
#define FILE_MAP_UNLOCK(i, o)                   do { xt_unlock_rwlock_ns(i); (void) (o); } while(0)
115
115
#elif defined(FILE_MAP_USE_XSMUTEX)
116
116
#define FILE_MAP_LOCK_TYPE                              XTMutexXSLockRec
117
117
#define FILE_MAP_INIT_LOCK(s, i)                xt_xsmutex_init_with_autoname(s, i)
140
140
#if defined(RR_FLUSH_USE_PTHREAD_RW)
141
141
#define RR_FLUSH_LOCK_TYPE                              xt_rwlock_type
142
142
#define RR_FLUSH_INIT_LOCK(s, i)                xt_init_rwlock_with_autoname(s, i)
143
 
#define RR_FLUSH_FREE_LOCK(s, i)                xt_free_rwlock(i)       
144
 
#define RR_FLUSH_READ_LOCK(i, o)                xt_slock_rwlock_ns(i)
145
 
#define RR_FLUSH_WRITE_LOCK(i, o)               xt_xlock_rwlock_ns(i)
146
 
#define RR_FLUSH_UNLOCK(i, o)                   xt_unlock_rwlock_ns(i)
 
143
#define RR_FLUSH_FREE_LOCK(s, i)                xt_free_rwlock(i)
 
144
#define RR_FLUSH_READ_LOCK(i, o)                do { xt_slock_rwlock_ns(i); (void) (o); } while(0)
 
145
#define RR_FLUSH_WRITE_LOCK(i, o)               do { xt_xlock_rwlock_ns(i); (void) (o); } while(0)
 
146
#define RR_FLUSH_UNLOCK(i, o)                   do { xt_unlock_rwlock_ns(i); (void) (o); } while(0)
147
147
#elif defined(RR_FLUSH_USE_XSMUTEX)
148
148
#define RR_FLUSH_LOCK_TYPE                              XTMutexXSLockRec
149
149
#define RR_FLUSH_INIT_LOCK(s, i)                xt_xsmutex_init_with_autoname(s, i)