This commit is contained in:
35
ase/tgp/tgp.c
Normal file
35
ase/tgp/tgp.c
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <ase/tgp/tgp.h>
|
||||
#include <ase/cmn/mem.h>
|
||||
|
||||
struct ase_tgp_t
|
||||
{
|
||||
ase_mmgr_t mmgr;
|
||||
};
|
||||
|
||||
ase_tgp_t* ase_tgp_open (ase_mmgr_t* mmgr)
|
||||
{
|
||||
ase_tgp_t* tgp;
|
||||
|
||||
if (mmgr == ASE_NULL) mmgr = ase_get_mmgr ();
|
||||
ASE_ASSERT (mmgr != ASE_NULL);
|
||||
|
||||
tgp = ASE_MALLOC (mmgr, ASE_SIZEOF(*tgp));
|
||||
if (tgp == ASE_NULL) return ASE_NULL;
|
||||
|
||||
|
||||
ase_memset (tgp, 0, ASE_SIZEOF(*tgp));
|
||||
ase_memcpy (&tgp->mmgr, mmgr, ASE_SIZEOF(*mmgr));
|
||||
|
||||
|
||||
return tgp;
|
||||
}
|
||||
|
||||
void ase_tgp_close (ase_tgp_t* tgp)
|
||||
{
|
||||
ASE_FREE (&tgp->mmgr, tgp);
|
||||
}
|
||||
|
20
ase/tgp/tgp.h
Normal file
20
ase/tgp/tgp.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef _ASE_TGP_H_
|
||||
#define _ASE_TGP_H_
|
||||
|
||||
#include <ase/cmn/types.h>
|
||||
#include <ase/cmn/macros.h>
|
||||
|
||||
typedef struct ase_tgp_t ase_tgp_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
ase_tgp_t* ase_tgp_open (ase_mmgr_t* mmgr);
|
||||
void ase_tgp_close (ase_tgp_t* tgp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user