00001 /* 00002 * $Id: list_lock.h,v 1.7 2003/10/16 18:50:54 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 __LIST_LOCK_H 00018 #define __LIST_LOCK_H 00019 00020 /*****************************************************************************/ 00021 00030 /*****************************************************************************/ 00031 00032 typedef struct 00033 { 00034 int locked; 00035 00036 List *lock_append; 00037 List *lock_prepend; 00038 List *lock_remove; 00039 List *lock_insert_sorted; 00040 00041 List *list; 00042 } ListLock; 00043 00044 /*****************************************************************************/ 00045 00046 EXTERN_C_BEGIN 00047 00048 /*****************************************************************************/ 00049 00050 LIBGIFT_EXPORT 00051 ListLock *list_lock_new (); 00052 LIBGIFT_EXPORT 00053 void list_lock_free (ListLock *lock); 00054 LIBGIFT_EXPORT 00055 void list_lock (ListLock *lock); 00056 LIBGIFT_EXPORT 00057 void list_unlock (ListLock *lock); 00058 LIBGIFT_EXPORT 00059 void list_lock_append (ListLock *lock, void *data); 00060 LIBGIFT_EXPORT 00061 void list_lock_prepend (ListLock *lock, void *data); 00062 LIBGIFT_EXPORT 00063 void list_lock_remove (ListLock *lock, void *data); 00064 LIBGIFT_EXPORT 00065 void list_lock_insert_sorted (ListLock *lock, CompareFunc func, 00066 void *data); 00067 00068 /*****************************************************************************/ 00069 00070 EXTERN_C_END 00071 00072 /*****************************************************************************/ 00073 00074 #endif /* __LIST_LOCK_H */
1.3.7