strcache-stubs-generic.cpp revision e9525bea57dc13d82fd3392913aebb33d2cb79e3
20593760b116c90f3e439552763eef632a3bbb17vboxsync * IPRT - String Cache, stub implementation.
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync * Copyright (C) 2009-2010 Oracle Corporation
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/*******************************************************************************
20593760b116c90f3e439552763eef632a3bbb17vboxsync* Header Files *
20593760b116c90f3e439552763eef632a3bbb17vboxsync*******************************************************************************/
20593760b116c90f3e439552763eef632a3bbb17vboxsyncRTDECL(int) RTStrCacheCreate(PRTSTRCACHE phStrCache, const char *pszName)
20593760b116c90f3e439552763eef632a3bbb17vboxsync AssertCompile(sizeof(RTSTRCACHE) == sizeof(RTMEMPOOL));
0c8eec6f5b79d800c3d25b5c0e0d7ad3f867c25cvboxsync AssertCompileNS(NIL_RTSTRCACHE == (RTSTRCACHE)NIL_RTMEMPOOL);
0c8eec6f5b79d800c3d25b5c0e0d7ad3f867c25cvboxsync AssertCompileNS(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));
e9525bea57dc13d82fd3392913aebb33d2cb79e3vboxsyncRTDECL(const char *) RTStrCacheEnterLowerN(RTSTRCACHE hStrCache, const char *pchString, size_t cchString)
e9525bea57dc13d82fd3392913aebb33d2cb79e3vboxsync char *pszRet = (char *)RTMemPoolDupEx((RTMEMPOOL)hStrCache, pchString, cchString, 1);
e9525bea57dc13d82fd3392913aebb33d2cb79e3vboxsyncRTDECL(const char *) RTStrCacheEnterLower(RTSTRCACHE hStrCache, const char *psz)
e9525bea57dc13d82fd3392913aebb33d2cb79e3vboxsync return RTStrCacheEnterLowerN(hStrCache, psz, strlen(psz));
20593760b116c90f3e439552763eef632a3bbb17vboxsyncRTDECL(uint32_t) RTStrCacheRelease(RTSTRCACHE hStrCache, const char *psz)
20593760b116c90f3e439552763eef632a3bbb17vboxsync return RTMemPoolRelease((RTMEMPOOL)hStrCache, (void *)psz);