diff options
Diffstat (limited to 'ctok_token.c')
-rw-r--r-- | ctok_token.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ctok_token.c b/ctok_token.c index 7e768f37..a0f6b18d 100644 --- a/ctok_token.c +++ b/ctok_token.c @@ -61,6 +61,24 @@ CODESTARTobjDestruct(ctok_token) ENDobjDestruct(ctok_token) +/* get the rsCStrObj from the token, but do not destruct it. This is meant to + * be used by a caller who passes on the string to some other function. The + * caller is responsible for destructing it. + * rgerhards, 2008-02-20 + */ +rsRetVal +ctok_tokenUnlinkCStr(ctok_token_t *pThis, rsCStrObj **ppCStr) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, ctok_token); + ASSERT(ppCStr != NULL); + + *ppCStr = pThis->pstrVal; + pThis->pstrVal = NULL; + + RETiRet; +} BEGINObjClassInit(ctok_token, 1) /* class, version */ OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, ctok_tokenConstructFinalize); |