Esempio n. 1
0
//............................................................................
static int custParserFun(QSpyRecord * const qrec) {
    static uint32_t mpool1;
    int ret = 1;                              // perform standard QSPY parsing
    switch (qrec->rec) {
        case QS_QF_MPOOL_INIT: {                    // example record to parse
            if (mpool1 == 1U) {                                   // MPool[1]?
                mpool1 = (uint32_t)QSpyRecord_getUint64(qrec,QS_OBJ_PTR_SIZE);
            }
            else {
                ++mpool1;
            }
            break;
        }
        case QS_QF_MPOOL_GET: {                     // example record to parse
            int nFree;
            uint32_t mpool;
            (void)QSpyRecord_getUint32(qrec, QS_TIME_SIZE);
            mpool = (uint32_t)QSpyRecord_getUint64(qrec, QS_OBJ_PTR_SIZE);
            nFree = (int)QSpyRecord_getUint32(qrec, QF_MPOOL_CTR_SIZE);
            (void)QSpyRecord_getUint32(qrec, QF_MPOOL_CTR_SIZE);       // nMin
            if (QSpyRecord_OK(qrec) && (mpool == mpool1)) {       // MPool[1]?
                SetDlgItemInt(GAME::l_hWnd, IDC_MPOOL0, nFree, FALSE);
                ret = 0;                // don't perform standard QSPY parsing
            }
            break;
        }
    }
    return ret;
}
Esempio n. 2
0
File: bsp.cpp Progetto: dgu123/qpcpp
//............................................................................
static int custParserFun(QSpyRecord * const qrec) {
    int ret = 1; // perform standard QSPY parsing
    switch (qrec->rec) {
        case QP::QS_QF_MPOOL_GET: { // example record to parse
            int nFree;
            (void)QSpyRecord_getUint32(qrec, QS_TIME_SIZE);
            (void)QSpyRecord_getUint64(qrec, QS_OBJ_PTR_SIZE);
            nFree = (int)QSpyRecord_getUint32(qrec, QF_MPOOL_CTR_SIZE);
            (void)QSpyRecord_getUint32(qrec, QF_MPOOL_CTR_SIZE); // nMin
            if (QSpyRecord_OK(qrec)) {
                Gui::instance()->m_epoolLabel->setText(QString::number(nFree));
                ret = 0; // don't perform standard QSPY parsing
            }
            break;
        }
    }
    return ret;
}