/** * Construct a rsPars object. */ rsRetVal rsParsConstruct(rsParsObj **ppThis) { rsParsObj *pThis; assert(ppThis != NULL); if((pThis = (rsParsObj*) calloc(1, sizeof(rsParsObj))) == NULL) return RS_RET_OUT_OF_MEMORY; rsSETOBJTYPE(pThis, OIDrsPars); *ppThis = pThis; return RS_RET_OK; }
rsRetVal cstrConstruct(cstr_t **ppThis) { DEFiRet; cstr_t *pThis; CHKmalloc(pThis = (cstr_t*) malloc(sizeof(cstr_t))); rsSETOBJTYPE(pThis, OIDrsCStr); pThis->pBuf = NULL; pThis->iBufSize = 0; pThis->iStrLen = 0; *ppThis = pThis; finalize_it: RETiRet; }