00001 00002 /*--------------------------------------------------------------------------- 00003 00004 File name : filelock.h 00005 Author : Nicolas Devillard 00006 Created on : Sept 2000 00007 Description : file locking routines. 00008 00009 *--------------------------------------------------------------------------*/ 00010 00011 /* 00012 $Id: filelock.h,v 1.1 2003/09/03 12:50:47 amodigli Exp $ 00013 $Author: amodigli $ 00014 $Date: 2003/09/03 12:50:47 $ 00015 $Revision: 1.1 $ 00016 */ 00017 00018 #ifndef _FILELOCK_H_ 00019 #define _FILELOCK_H_ 00020 00021 /*--------------------------------------------------------------------------- 00022 Includes 00023 ---------------------------------------------------------------------------*/ 00024 00025 #include <stdio.h> 00026 #include <stdlib.h> 00027 #include <string.h> 00028 #include <unistd.h> 00029 00030 00031 /*--------------------------------------------------------------------------- 00032 Function ANSI prototypes 00033 ---------------------------------------------------------------------------*/ 00034 00035 00036 /*-------------------------------------------------------------------------*/ 00070 /*--------------------------------------------------------------------------*/ 00071 00072 00073 long get_lock(char * filename); 00074 00075 00076 00077 /*-------------------------------------------------------------------------*/ 00087 /*--------------------------------------------------------------------------*/ 00088 00089 void release_lock(char * filename); 00090 00091 00092 /*-------------------------------------------------------------------------*/ 00115 /*--------------------------------------------------------------------------*/ 00116 00117 FILE * fopen_lock(char * filename, char * mode, int timeout); 00118 00119 00120 /*-------------------------------------------------------------------------*/ 00133 /*--------------------------------------------------------------------------*/ 00134 00135 void fclose_lock(FILE * f, char * filename); 00136 00137 #endif
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001