# refptr.h

Go to the documentation of this file.

    00001 /***************************************************************************
    00002  $RCSfile: refptr.h,v $
    00003                              -------------------
    00004     cvs         : $Id: refptr.h,v 1.1 2004/12/15 11:11:16 aquamaniac Exp $
    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 GWEN_REFPTR *GWEN_RefPtr_new(void *dp, GWEN_REFPTR_INFO *rpi);
    00070 GWEN_REFPTR *GWEN_RefPtr_dup(const GWEN_REFPTR *rp);
    00071 GWEN_REFPTR *GWEN_RefPtr_copy(const GWEN_REFPTR *rp);
    00072 void GWEN_RefPtr_free(GWEN_REFPTR *rp);
    00079 void *GWEN_RefPtr_GetData(const GWEN_REFPTR *rp);
    00080 void GWEN_RefPtr_SetData(GWEN_REFPTR *rp, void *dp, GWEN_REFPTR_INFO *rpi);
    00088 GWEN_TYPE_UINT32 GWEN_RefPtr_GetFlags(const GWEN_REFPTR *rp);
    00089 void GWEN_RefPtr_SetFlags(GWEN_REFPTR *rp, GWEN_TYPE_UINT32 fl);
    00090 void GWEN_RefPtr_AddFlags(GWEN_REFPTR *rp, GWEN_TYPE_UINT32 fl);
    00091 void GWEN_RefPtr_DelFlags(GWEN_REFPTR *rp, GWEN_TYPE_UINT32 fl);
    00094  /* defgroup */
    00095
    00096
    00097
    00105
    00110 GWEN_REFPTR_INFO *GWEN_RefPtrInfo_new();
    00111 void GWEN_RefPtrInfo_free(GWEN_REFPTR_INFO *rpi);
    00112 void GWEN_RefPtrInfo_Attach(GWEN_REFPTR_INFO *rpi);
    00123 GWEN_TYPE_UINT32 GWEN_RefPtrInfo_GetFlags(const GWEN_REFPTR_INFO *rpi);
    00124 void GWEN_RefPtrInfo_SetFlags(GWEN_REFPTR_INFO *rpi, GWEN_TYPE_UINT32 fl);
    00125 void GWEN_RefPtrInfo_AddFlags(GWEN_REFPTR_INFO *rpi, GWEN_TYPE_UINT32 fl);
    00126 void GWEN_RefPtrInfo_DelFlags(GWEN_REFPTR_INFO *rpi, GWEN_TYPE_UINT32 fl);
    00134 typedef void (*GWEN_REFPTR_INFO_FREE_FN)(void *dp);
    00135 typedef void* (*GWEN_REFPTR_INFO_DUP_FN)(void *dp);
    00143 void GWEN_RefPtrInfo_SetFreeFn(GWEN_REFPTR_INFO *rpi,
    00144                                GWEN_REFPTR_INFO_FREE_FN f);
    00145 void GWEN_RefPtrInfo_SetDupFn(GWEN_REFPTR_INFO *rpi,
    00146                               GWEN_REFPTR_INFO_DUP_FN f);
    00147  /* defgroup */
    00149
    00150  /* defgroup */
    00152
    00153 #ifdef __cplusplus
    00154 }
    00155 #endif
    00156
    00157
    00158 #endif