strcache-stubs-generic.cpp revision 20593760b116c90f3e439552763eef632a3bbb17
20593760b116c90f3e439552763eef632a3bbb17vboxsync * IPRT - String Cache, stub implementation.
20593760b116c90f3e439552763eef632a3bbb17vboxsync * Copyright (C) 2009 Sun Microsystems, Inc.
20593760b116c90f3e439552763eef632a3bbb17vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
20593760b116c90f3e439552763eef632a3bbb17vboxsync * available from http://www.virtualbox.org. This file is free software;
20593760b116c90f3e439552763eef632a3bbb17vboxsync * you can redistribute it and/or modify it under the terms of the GNU
20593760b116c90f3e439552763eef632a3bbb17vboxsync * General Public License (GPL) as published by the Free Software
20593760b116c90f3e439552763eef632a3bbb17vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
20593760b116c90f3e439552763eef632a3bbb17vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
20593760b116c90f3e439552763eef632a3bbb17vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
20593760b116c90f3e439552763eef632a3bbb17vboxsync * The contents of this file may alternatively be used under the terms
20593760b116c90f3e439552763eef632a3bbb17vboxsync * of the Common Development and Distribution License Version 1.0
20593760b116c90f3e439552763eef632a3bbb17vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20593760b116c90f3e439552763eef632a3bbb17vboxsync * VirtualBox OSE distribution, in which case the provisions of the
20593760b116c90f3e439552763eef632a3bbb17vboxsync * CDDL are applicable instead of those of the GPL.
20593760b116c90f3e439552763eef632a3bbb17vboxsync * You may elect to license modified versions of this file under the
20593760b116c90f3e439552763eef632a3bbb17vboxsync * terms and conditions of either the GPL or the CDDL or both.
20593760b116c90f3e439552763eef632a3bbb17vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
20593760b116c90f3e439552763eef632a3bbb17vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
20593760b116c90f3e439552763eef632a3bbb17vboxsync * additional information or have any questions.
20593760b116c90f3e439552763eef632a3bbb17vboxsync/*******************************************************************************
20593760b116c90f3e439552763eef632a3bbb17vboxsync* Header Files *
20593760b116c90f3e439552763eef632a3bbb17vboxsync*******************************************************************************/
20593760b116c90f3e439552763eef632a3bbb17vboxsyncRTDECL(int) RTStrCacheCreate(PRTSTRCACHE phStrCache, const char *pszName)
20593760b116c90f3e439552763eef632a3bbb17vboxsync AssertCompile(sizeof(RTSTRCACHE) == sizeof(RTMEMPOOL));
20593760b116c90f3e439552763eef632a3bbb17vboxsync AssertCompile(NIL_RTSTRCACHE == (RTSTRCACHE)NIL_RTMEMPOOL);
20593760b116c90f3e439552763eef632a3bbb17vboxsync AssertCompile(RTSTRCACHE_DEFAULT == (RTSTRCACHE)RTMEMPOOL_DEFAULT);
20593760b116c90f3e439552763eef632a3bbb17vboxsync return RTMemPoolCreate((PRTMEMPOOL)phStrCache, pszName);
20593760b116c90f3e439552763eef632a3bbb17vboxsyncRTDECL(const char *) RTStrCacheEnterN(RTSTRCACHE hStrCache, const char *pchString, size_t cchString)
20593760b116c90f3e439552763eef632a3bbb17vboxsync return (const char *)RTMemPoolDupEx((RTMEMPOOL)hStrCache, pchString, cchString, 1);
20593760b116c90f3e439552763eef632a3bbb17vboxsyncRTDECL(const char *) RTStrCacheEnter(RTSTRCACHE hStrCache, const char *psz)
20593760b116c90f3e439552763eef632a3bbb17vboxsync return RTStrCacheEnterN(hStrCache, psz, strlen(psz));
20593760b116c90f3e439552763eef632a3bbb17vboxsyncRTDECL(uint32_t) RTStrCacheRelease(RTSTRCACHE hStrCache, const char *psz)
20593760b116c90f3e439552763eef632a3bbb17vboxsync return RTMemPoolRelease((RTMEMPOOL)hStrCache, (void *)psz);