diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2005-09-19 15:52:43 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2005-09-19 15:52:43 +0000 |
commit | 6c2956163de3be527cc34387ee0bbfdd64a5c4ef (patch) | |
tree | 010cfb576af5217ed8138f737c740b2d798769c3 /parse.c | |
parent | 3e8ba29e5cf041b9056b7a14f0000a9c1557fed0 (diff) | |
download | rsyslog-6c2956163de3be527cc34387ee0bbfdd64a5c4ef.tar.gz rsyslog-6c2956163de3be527cc34387ee0bbfdd64a5c4ef.tar.xz rsyslog-6c2956163de3be527cc34387ee0bbfdd64a5c4ef.zip |
added capability to filter on any property in selector lines
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -152,11 +152,8 @@ rsRetVal parsDelimCStr(rsParsObj *pThis, rsCStrObj **ppCStr, char cDelim, int bT pC = rsCStrGetBufBeg(pThis->pCStr) + pThis->iCurrPos; -printf("after trim leading, len %d - %d, pC: %c, Delim '%c'\n", pThis->iCurrPos, rsCStrLen(pThis->pCStr), - *pC, cDelim); while(pThis->iCurrPos < rsCStrLen(pThis->pCStr) && *pC != cDelim) { - printf("parse[%d,%d]: %c\n", pThis->iCurrPos, rsCStrLen(pThis->pCStr), *pC); if((iRet = rsCStrAppendChar(pCStr, *pC)) != RS_RET_OK) { RSFREEOBJ(pCStr); return(iRet); @@ -221,10 +218,7 @@ rsRetVal parsQuotedCStr(rsParsObj *pThis, rsCStrObj **ppCStr) if((pCStr = rsCStrConstruct()) == NULL) return RS_RET_OUT_OF_MEMORY; -printf("at start of quoted string, len %d - %d, pC: '%c'\n", pThis->iCurrPos, rsCStrLen(pThis->pCStr), - *pC); while(pThis->iCurrPos < rsCStrLen(pThis->pCStr)) { - printf("parse[%d,%d]: '%c'\n", pThis->iCurrPos, rsCStrLen(pThis->pCStr), *pC); if(*pC == '"') { break; /* we are done! */ } else if(*pC == '\\') { @@ -269,6 +263,19 @@ printf("at start of quoted string, len %d - %d, pC: '%c'\n", pThis->iCurrPos, rs return RS_RET_OK; } +/* return the position of the parse pointer + */ +int rsParsGetParsePointer(rsParsObj *pThis) +{ + rsCHECKVALIDOBJECT(pThis, OIDrsPars); + + if(pThis->iCurrPos < rsCStrLen(pThis->pCStr)) + return pThis->iCurrPos; + else + return rsCStrLen(pThis->pCStr) - 1; +} + + /* * Local variables: * c-indent-level: 8 |