gwenhywfar
4.3.1
|
00001 /*************************************************************************** 00002 $RCSfile$ 00003 ------------------- 00004 cvs : $Id$ 00005 begin : Sun Jan 25 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_REFPTR_H 00030 #define GWEN_REFPTR_H 00031 00032 00033 #include <gwenhywfar/types.h> 00034 #include <gwenhywfar/gwenhywfarapi.h> 00035 00036 00037 #define GWEN_REFPTR_FLAGS_AUTODELETE 0x00000001 00038 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00044 typedef struct GWEN_REFPTR_INFO GWEN_REFPTR_INFO; 00045 typedef struct GWEN_REFPTR GWEN_REFPTR; 00046 00047 00055 00063 00064 00069 GWENHYWFAR_API 00070 GWEN_REFPTR *GWEN_RefPtr_new(void *dp, GWEN_REFPTR_INFO *rpi); 00071 GWENHYWFAR_API 00072 GWEN_REFPTR *GWEN_RefPtr_dup(const GWEN_REFPTR *rp); 00073 GWENHYWFAR_API 00074 GWEN_REFPTR *GWEN_RefPtr_copy(const GWEN_REFPTR *rp); 00075 GWENHYWFAR_API 00076 void GWEN_RefPtr_free(GWEN_REFPTR *rp); 00083 GWENHYWFAR_API 00084 void *GWEN_RefPtr_GetData(const GWEN_REFPTR *rp); 00085 GWENHYWFAR_API 00086 void GWEN_RefPtr_SetData(GWEN_REFPTR *rp, void *dp, GWEN_REFPTR_INFO *rpi); 00094 GWENHYWFAR_API 00095 uint32_t GWEN_RefPtr_GetFlags(const GWEN_REFPTR *rp); 00096 GWENHYWFAR_API 00097 void GWEN_RefPtr_SetFlags(GWEN_REFPTR *rp, uint32_t fl); 00098 GWENHYWFAR_API 00099 void GWEN_RefPtr_AddFlags(GWEN_REFPTR *rp, uint32_t fl); 00100 GWENHYWFAR_API 00101 void GWEN_RefPtr_DelFlags(GWEN_REFPTR *rp, uint32_t fl); 00104 /* defgroup */ 00105 00106 00107 00115 00120 GWENHYWFAR_API 00121 GWEN_REFPTR_INFO *GWEN_RefPtrInfo_new(void); 00122 GWENHYWFAR_API 00123 void GWEN_RefPtrInfo_free(GWEN_REFPTR_INFO *rpi); 00124 GWENHYWFAR_API 00125 void GWEN_RefPtrInfo_Attach(GWEN_REFPTR_INFO *rpi); 00136 GWENHYWFAR_API 00137 uint32_t GWEN_RefPtrInfo_GetFlags(const GWEN_REFPTR_INFO *rpi); 00138 GWENHYWFAR_API 00139 void GWEN_RefPtrInfo_SetFlags(GWEN_REFPTR_INFO *rpi, uint32_t fl); 00140 GWENHYWFAR_API 00141 void GWEN_RefPtrInfo_AddFlags(GWEN_REFPTR_INFO *rpi, uint32_t fl); 00142 GWENHYWFAR_API 00143 void GWEN_RefPtrInfo_DelFlags(GWEN_REFPTR_INFO *rpi, uint32_t fl); 00151 typedef void (*GWEN_REFPTR_INFO_FREE_FN)(void *dp); 00152 typedef void* (*GWEN_REFPTR_INFO_DUP_FN)(void *dp); 00160 GWENHYWFAR_API 00161 void GWEN_RefPtrInfo_SetFreeFn(GWEN_REFPTR_INFO *rpi, 00162 GWEN_REFPTR_INFO_FREE_FN f); 00163 GWENHYWFAR_API 00164 void GWEN_RefPtrInfo_SetDupFn(GWEN_REFPTR_INFO *rpi, 00165 GWEN_REFPTR_INFO_DUP_FN f); 00166 00170 /* defgroup */ 00171 /* defgroup */ 00173 00174 #ifdef __cplusplus 00175 } 00176 #endif 00177 00178 00179 #endif