Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

dsLock.h

Go to the documentation of this file.
00001 /*
00002  * $Id: dsLock.h,v 1.3 2004/09/07 11:52:07 dsamersoff Exp $
00003  * 
00004  */ 
00005 
00006 #ifndef dsLock_h
00007 #define dsLock_h
00008 
00009 #ifdef HAVE_CONFIG_H
00010 # include <config.h>
00011 #endif
00012 
00013 #include <stdio.h>
00014 #include <stdlib.h>
00015 #include <fcntl.h>
00016 
00017 #ifdef HAVE_UNISTD_H
00018 # include <unistd.h>
00019 #endif
00020 
00021 #define F_AUTOLCK  512
00022  
00030 int dsLock(int fd,  int what, int mode = F_AUTOLCK);
00031 
00032 inline int dsLock(FILE *f, int what, int mode = F_AUTOLCK)
00033 {
00034     return dsLock( fileno(f), what, mode );
00035 }
00036 
00037 inline void dsUnLock(int fd)
00038 { 
00039     dsLock(fd, F_SETLK, F_UNLCK);
00040 }
00041 
00042 inline void dsUnLock(FILE *f)
00043 { 
00044     dsLock(f, F_SETLK, F_UNLCK);
00045 }
00046 
00047 
00048 #endif

Generated on Mon May 16 18:26:57 2005 for libdms4 by doxygen1.3-rc2