fslock.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003                              -------------------
00004     cvs         : $Id$
00005     begin       : Wed Mar 24 2004
00006     copyright   : (C) 2004 by Martin Preuss
00007     email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00028 
00029 #ifndef GWEN_FSLOCK_H
00030 #define GWEN_FSLOCK_H
00031 
00047 
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051 
00052 
00053 #include <gwenhywfar/gwenhywfarapi.h>
00054 #include <gwenhywfar/types.h>
00055 #include <gwenhywfar/list1.h>
00056 #include <gwenhywfar/list2.h>
00057 
00058 
00059 typedef struct GWEN_FSLOCK GWEN_FSLOCK;
00060 GWEN_LIST_FUNCTION_LIB_DEFS(GWEN_FSLOCK, GWEN_FSLock, GWENHYWFAR_API)
00061 GWEN_LIST2_FUNCTION_LIB_DEFS(GWEN_FSLOCK, GWEN_FSLock, GWENHYWFAR_API)
00062 
00063 
00064 typedef enum {
00065   GWEN_FSLock_TypeUnknown=0,
00066   GWEN_FSLock_TypeFile,
00067   GWEN_FSLock_TypeDir
00068 } GWEN_FSLOCK_TYPE;
00069 
00070 
00071 typedef enum {
00072   GWEN_FSLock_ResultOk=0,
00073   GWEN_FSLock_ResultError,
00074   GWEN_FSLock_ResultTimeout,
00075   GWEN_FSLock_ResultBusy,
00076   GWEN_FSLock_ResultNoLock,
00077   GWEN_FSLock_ResultUserAbort
00078 } GWEN_FSLOCK_RESULT;
00079 
00080 
00081 #include <gwenhywfar/db.h>
00082 #include <gwenhywfar/gui.h>
00083 
00084 
00085 GWENHYWFAR_API
00086 GWEN_FSLOCK *GWEN_FSLock_new(const char *fname, GWEN_FSLOCK_TYPE t);
00087 GWENHYWFAR_API
00088 void GWEN_FSLock_free(GWEN_FSLOCK *fl);
00089 
00090 GWENHYWFAR_API
00091 void GWEN_FSLock_Attach(GWEN_FSLOCK *fl);
00092 
00101 GWENHYWFAR_API
00102 GWEN_FSLOCK_RESULT GWEN_FSLock_Lock(GWEN_FSLOCK *fl, int timeout, uint32_t gid);
00103 
00108 GWENHYWFAR_API
00109 GWEN_FSLOCK_RESULT GWEN_FSLock_Unlock(GWEN_FSLOCK *fl);
00110 
00111 
00112 GWENHYWFAR_API
00113 const char *GWEN_FSLock_GetName(const GWEN_FSLOCK *fl);
00114 
00115 #ifdef __cplusplus
00116 }
00117 #endif
00118  /* defgroup */
00120 
00121 #endif
00122 
00123 
00124 
00125 
00126 
00127 
00128 
Generated on Mon Jul 5 22:51:13 2010 for gwenhywfar by  doxygen 1.6.3