Lines Matching refs:pCache

34 PVBOXSERVICEVEPROPCACHEENTRY vboxServicePropCacheFindInternal(PVBOXSERVICEVEPROPCACHE pCache, const char *pszName, uint32_t uFlags);
35 PVBOXSERVICEVEPROPCACHEENTRY vboxServicePropCacheInsertEntryInternal(PVBOXSERVICEVEPROPCACHE pCache, const char *pszName);
39 PVBOXSERVICEVEPROPCACHEENTRY vboxServicePropCacheFindInternal(PVBOXSERVICEVEPROPCACHE pCache, const char *pszName, uint32_t uFlags)
41 AssertPtrReturn(pCache, NULL);
50 if (RT_SUCCESS(RTCritSectEnter(&pCache->CritSect)))
52 RTListForEach(&pCache->NodeHead, pNodeIt, VBOXSERVICEVEPROPCACHEENTRY, NodeSucc)
60 RTCritSectLeave(&pCache->CritSect);
67 PVBOXSERVICEVEPROPCACHEENTRY vboxServicePropCacheInsertEntryInternal(PVBOXSERVICEVEPROPCACHE pCache, const char *pszName)
69 AssertPtrReturn(pCache, NULL);
85 int rc = RTCritSectEnter(&pCache->CritSect);
88 /*rc =*/ RTListAppend(&pCache->NodeHead, &pNode->NodeSucc);
89 rc = RTCritSectLeave(&pCache->CritSect);
148 * @param pCache Pointer to the cache.
151 int VBoxServicePropCacheCreate(PVBOXSERVICEVEPROPCACHE pCache, uint32_t uClientId)
153 AssertPtrReturn(pCache, VERR_INVALID_POINTER);
156 RTListInit(&pCache->NodeHead);
157 pCache->uClientID = uClientId;
158 return RTCritSectInit(&pCache->CritSect);
168 * @param pCache The property cache.
173 int VBoxServicePropCacheUpdateEntry(PVBOXSERVICEVEPROPCACHE pCache,
176 AssertPtrReturn(pCache, VERR_INVALID_POINTER);
178 PVBOXSERVICEVEPROPCACHEENTRY pNode = vboxServicePropCacheFindInternal(pCache, pszName, 0);
180 pNode = vboxServicePropCacheInsertEntryInternal(pCache, pszName);
185 rc = RTCritSectEnter(&pCache->CritSect);
196 rc = RTCritSectLeave(&pCache->CritSect);
210 * @param pCache The property cache.
216 int VBoxServicePropCacheUpdate(PVBOXSERVICEVEPROPCACHE pCache, const char *pszName, const char *pszValueFormat, ...)
218 AssertPtrReturn(pCache, VERR_INVALID_POINTER);
221 Assert(pCache->uClientID);
237 PVBOXSERVICEVEPROPCACHEENTRY pNode = vboxServicePropCacheFindInternal(pCache, pszName, 0);
240 int rc = RTCritSectEnter(&pCache->CritSect);
244 pNode = vboxServicePropCacheInsertEntryInternal(pCache, pszName);
263 rc = vboxServicePropCacheWritePropF(pCache->uClientID, pNode->pszName, pNode->fFlags, pszValue);
265 pCache, pNode->pszName, pszValue, pNode->fFlags, rc);
282 rc = vboxServicePropCacheWritePropF(pCache->uClientID, pNode->pszName,
285 pCache, pNode->pszName, pNode->pszValue, pNode->fFlags, rc);
298 RTCritSectLeave(&pCache->CritSect);
302 pCache, pszName, rc);
315 * @param pCache The property cache.
322 int VBoxServicePropCacheUpdateByPath(PVBOXSERVICEVEPROPCACHE pCache, const char *pszValue, uint32_t fFlags, const char *pszPathFormat, ...)
324 AssertPtrReturn(pCache, VERR_INVALID_POINTER);
329 if (RT_SUCCESS(RTCritSectEnter(&pCache->CritSect)))
346 RTListForEach(&pCache->NodeHead, pNodeIt, VBOXSERVICEVEPROPCACHEENTRY, NodeSucc)
351 rc = VBoxServicePropCacheUpdate(pCache, pNodeIt->pszName, pszValue);
358 RTCritSectLeave(&pCache->CritSect);
367 * @param pCache The property cache.
369 int VBoxServicePropCacheFlush(PVBOXSERVICEVEPROPCACHE pCache)
371 AssertPtrReturn(pCache, VERR_INVALID_POINTER);
375 if (RT_SUCCESS(RTCritSectEnter(&pCache->CritSect)))
377 RTListForEach(&pCache->NodeHead, pNodeIt, VBOXSERVICEVEPROPCACHEENTRY, NodeSucc)
379 rc = vboxServicePropCacheWritePropF(pCache->uClientID, pNodeIt->pszName,
384 RTCritSectLeave(&pCache->CritSect);
393 * @param pCache The property cache.
395 void VBoxServicePropCacheDestroy(PVBOXSERVICEVEPROPCACHE pCache)
397 AssertPtrReturnVoid(pCache);
398 Assert(pCache->uClientID);
401 int rc = RTCritSectEnter(&pCache->CritSect);
404 PVBOXSERVICEVEPROPCACHEENTRY pNode = RTListGetFirst(&pCache->NodeHead, VBOXSERVICEVEPROPCACHEENTRY, NodeSucc);
407 PVBOXSERVICEVEPROPCACHEENTRY pNext = RTListNodeIsLast(&pCache->NodeHead, &pNode->NodeSucc)
415 rc = vboxServicePropCacheWritePropF(pCache->uClientID, pNode->pszName,
429 RTCritSectLeave(&pCache->CritSect);
433 RTCritSectDelete(&pCache->CritSect);