亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ss_msg.c

?? 中國石油二期加油站IC系統后臺通訊軟件
?? C
?? 第 1 頁 / 共 5 頁
字號:
#ifdef ANSI
PUBLIC S16 SRemPstMsg
(
Data *dataPtr,              /* pointer to data */
Buffer *mBuf
)
#else
PUBLIC S16 SRemPstMsg(dataPtr, mBuf)
Data *dataPtr;              /* pointer to data */
Buffer *mBuf;               /* message buffer */
#endif
{
    SsMsgInfo *minfo;
    Buffer *tmp;
    Buffer *last;

    TRC1(SRemPstMsg)

#if (ERRCLASS & ERRCLS_INT_PAR)
    /* check data pointer */
    if (dataPtr == NULLP)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS244, ERRZERO, "SRemPstMsg : Null Buffer");
        RETVALUE(RFAILED);
    }
    /* check message buffer */
    if (mBuf == NULLP)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS245, ERRZERO, "SRemPstMsg : Null Buffer");
        RETVALUE(RFAILED);
    }
    if (mBuf->b_datap->db_type != SS_M_PROTO)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS246, ERRZERO, "SRemPstMsg : Incorrect\
                                                   buffer type");
        RETVALUE(RFAILED);
    }
#endif

    /* get the SsMsgInfo */
    minfo = (SsMsgInfo*) mBuf->b_rptr;

    if (!(last = minfo->endptr))
        RETVALUE(ROKDNA);

    /* read databyte into dataPtr and decrement write ptr */
    *dataPtr = *--last->b_wptr;

    /* if all data is exhausted, release the blk */
    if (last->b_rptr == last->b_wptr)
    {
        for (tmp = mBuf; tmp->b_cont != last;)
            tmp = tmp->b_cont;
        tmp->b_cont = NULLP;
        (Void) SPutDBuf(minfo->region, minfo->pool, last);

        /* update endptr */
        if (mBuf->b_cont)
            minfo->endptr = tmp;
        else
            minfo->endptr = NULLP;
    }
    /* update SsMsgInfo */
    minfo->len--;

    RETVALUE(ROK);
}


/*
*
*       Fun:   SRemPreMsgMult
*
*       Desc:  This function copies and then removes consecutive bytes of
*              data from the beginning of a message.
*
*       Ret:   ROK      - ok
*              ROKDNA   - ok, data not available
*              RFAILED  - failed, general (optional)
*
*       Notes: if message is empty: message is unchanged. return is ok,
*              data not available.
*
*              if the destination buffer is NULL, data is not copied.
*
*              if message is not empty: data is removed from front of
*              message, data is returned by destination pointer. message
*              length is decremented. return is ok.
*
*              the first byte of data read from the message will be placed
*              in the destination buffer first (i.e. this was the first byte
*              of the message), the last byte of data read from the message
*              will be placed in the destination buffer last.
*
*       File:  ss_msg.c
*
*/

#ifdef ANSI
PUBLIC S16 SRemPreMsgMult
(
Data *dst,                  /* destination */
MsgLen cnt,                 /* count */
Buffer *mBuf
)
#else
PUBLIC S16 SRemPreMsgMult(dst, cnt, mBuf)
Data *dst;                  /* destination */
MsgLen cnt;                 /* count */
Buffer *mBuf;               /* message buffer */
#endif
{
    SsMsgInfo *minfo;
    Buffer *tmp;
    MsgLen numBytes;

    TRC1(SRemPreMsgMult)

#if (ERRCLASS & ERRCLS_INT_PAR)
    /* check count */
    if (cnt <= 0)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS247, ERRZERO, "SRemPreMsgMult:Invalid\
                                                   count");
        RETVALUE(RFAILED);
    }
    /* check message buffer */
    if (!mBuf)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS248, ERRZERO, "SRemPreMsgMult:Null Buffer");
        RETVALUE(RFAILED);
    }
    if (mBuf->b_datap->db_type != SS_M_PROTO)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS249, ERRZERO, "SRemPreMsgMult : Incorrect\
                                                   buffer type");
        RETVALUE(RFAILED);
    }
#endif

    /* get the SsMsgInfo */
    minfo = (SsMsgInfo*) mBuf->b_rptr;

    /* check if data present */
    if (minfo->len < cnt)
        RETVALUE(ROKDNA);
    else
        minfo->len -= cnt;

    while (cnt)
    {
        /* get the first SS_M_DATA blk */
        tmp = mBuf->b_cont;

        /* determine the number of bytes to be copy */
        numBytes = MIN(cnt, tmp->b_wptr - tmp->b_rptr);

        /* decrement cnt */
        cnt -= numBytes;

        /* move data into dst */
        if (dst != NULLP)
        {
            while (numBytes--)
                *dst++ = *tmp->b_rptr++;
        }

        if (tmp->b_rptr == tmp->b_wptr)
        {
            mBuf->b_cont = tmp->b_cont;
            (Void) SPutDBuf(minfo->region, minfo->pool, tmp);
        }
    }
    /* update SsMsgInfo */
    if (!minfo->len)
        minfo->endptr = NULLP;

    RETVALUE(ROK);
}

/*
*
*       Fun:   SRemPstMsgMult
*
*       Desc:  This function copies and then removes consecutive bytes of
*              data from the end of a message.
*
*       Ret:   ROK      - ok
*              ROKDNA   - ok, data not available
*              RFAILED  - failed, general (optional)
*
*       Notes: if message is empty: message is unchanged. return is ok,
*              data not available.
*
*              if the destination buffer is NULL, data is not copied.
*
*              if message is not empty: data is removed from front of
*              message, data is returned by destination pointer. message
*              length is decremented. return is ok.
*
*              the first byte of data read from the message will be placed
*              in the destination buffer first (i.e. this was the last byte
*              of the message), the last byte of data read from the message
*              will be placed in the destination buffer last.
*
*       File:  ss_msg.c
*
*/

#ifdef ANSI
PUBLIC S16 SRemPstMsgMult
(
Data *dst,                  /* destination */
MsgLen cnt,                 /* count */
Buffer *mBuf
)
#else
PUBLIC S16 SRemPstMsgMult(dst, cnt, mBuf)
Data *dst;                  /* destination */
MsgLen cnt;                 /* count */
Buffer *mBuf;               /* message buffer */
#endif
{
    SsMsgInfo *minfo;
    Buffer *tmp;
    Buffer *prev;
    MsgLen count;
    MsgLen numBytes;
    Data *cptr;

    TRC1(SRemPstMsgMult)

#if (ERRCLASS & ERRCLS_INT_PAR)
    /* check count */
    if (cnt <= 0)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS250, ERRZERO, "SRemPstMsgMult:Invalid\
                                                   count");
        RETVALUE(RFAILED);
    }
    /* check message buffer */
    if (mBuf == NULLP)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS251, ERRZERO, "SRemPstMsgMult:Null Buffer");
        RETVALUE(RFAILED);
    }
    if (mBuf->b_datap->db_type != SS_M_PROTO)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS252, ERRZERO, "SRemPstMsgMult : Incorrect\
                                                   buffer type");
        RETVALUE(RFAILED);
    }
#endif

    /* get the SsMsgInfo */
    minfo = (SsMsgInfo*) mBuf->b_rptr;

    /* check if data present */
    if (minfo->len < cnt)
        RETVALUE(ROKDNA);
    else
    {
        minfo->len -= cnt;
        count = minfo->len;
        prev = mBuf;
        tmp = mBuf->b_cont;
    }

    /* determine blk containing offset, and prev node */
    FIND_OFFSET_AND_PREV(prev, tmp, count)

    if (dst != NULLP)
        dst += cnt;

    while (cnt)
    {
        numBytes = MIN(cnt, (tmp->b_wptr - tmp->b_rptr - count));

        tmp->b_wptr -= numBytes;

        cnt -= numBytes;

        /* copy data */
        cptr = tmp->b_wptr;
        if (dst != NULLP)
        {
            while (numBytes--)
                *--dst = *cptr++;
        }

        if (tmp->b_rptr == tmp->b_wptr)
        {
            prev->b_cont = tmp->b_cont;
            (Void) SPutDBuf(minfo->region, minfo->pool, tmp);
            tmp = prev;
        }
        prev = tmp;
        tmp = tmp->b_cont;

        count = 0;
    }
    if (mBuf == prev)
        minfo->endptr = NULLP;
    else
        minfo->endptr = prev;

    RETVALUE(ROK);
}

/*
*
*       Fun:   SExamMsg
*
*       Desc:  This function copies one byte of data from a message
*              without modifying the message.
*
*       Ret:   ROK      - ok
*              ROKDNA   - ok, data not available
*              RFAILED  - failed, general (optional)
*
*       Notes: index is 0 based and indicates location in message
*
*              if index is less than the length of the message:
*              message is unchanged and data is examined at specified
*              index and returned via pointer to data. message length
*              is unchanged. return is ok.
*
*              if index is greater than or equal to
*              the length of the message: message is unchanged and 0
*              is returned via pointer to data. return is ok, data
*              not available.
*
*       File:  ss_msg.c
*
*/


#ifdef ANSI
PUBLIC S16 SExamMsg
(
Data *dataPtr,              /* pointer to data */
Buffer *mBuf,               /* message buffer */
MsgLen idx
)
#else
PUBLIC S16 SExamMsg(dataPtr, mBuf, idx)
Data *dataPtr;              /* pointer to data */
Buffer *mBuf;               /* message buffer */
MsgLen idx;                 /* index */
#endif
{
    SsMsgInfo *minfo;
    Buffer *tmp;

    TRC1(SExamMsg)

#if (ERRCLASS & ERRCLS_INT_PAR)
    /* check data pointer */
    if (!dataPtr)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS253, ERRZERO, "SExamMsg : Null Buffer");
        RETVALUE(RFAILED);
    }
    /* check message buffer */
    if (!mBuf)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS254, ERRZERO, "SExamMsg : Null Buffer");
        RETVALUE(RFAILED);
    }
    /* check index */
    if (idx < 0)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS255, ERRZERO, "SExamMsg : Invalid Index");
        RETVALUE(RFAILED);
    }
    if (mBuf->b_datap->db_type != SS_M_PROTO)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS256, ERRZERO, "SExamMsg : Incorrect buffer\
                                                   type");
        RETVALUE(RFAILED);
    }
#endif

    /* get the SsMsgInfo */
    minfo = (SsMsgInfo*) mBuf->b_rptr;

    if (minfo->len <= idx)
    {
        RETVALUE(ROKDNA);
    }

    /* get the first SS_M_DATA blk */
    tmp = mBuf->b_cont;

    /* determine offset */
    FIND_OFFSET(tmp, idx)

    *dataPtr = *(tmp->b_rptr + idx);

    RETVALUE(ROK);
}

/*
*
*       Fun:   SFndLenMsg
*
*       Desc:  This function determines the length of data within
*              a message.
*
*       Ret:   ROK      - ok
*              RFAILED  - failed, general (optional)
*
*       Notes: length of message is determined, message is unchanged
*              and length is returned via pointer to length. return is ok.
*
*       File:  ss_msg.c
*
*/
#ifdef ANSI
PUBLIC S16 SFndLenMsg
(
REG1 Buffer *mBuf,          /* message buffer */
MsgLen *lngPtr
)
#else
PUBLIC S16 SFndLenMsg(mBuf, lngPtr)
REG1 Buffer *mBuf;          /* message buffer */
MsgLen *lngPtr;             /* pointer to length */
#endif
{
    SsMsgInfo *minfo;

    TRC1(SFndLenMsg)

#if (ERRCLASS & ERRCLS_INT_PAR)
    /* check message buffer */
    if (mBuf == NULLP)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS257, ERRZERO, "SFndLenMsg : Null Buffer");
        RETVALUE(RFAILED);
    }
    /* check length pointer */
    if (lngPtr == NULLP)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS258, ERRZERO, "SFndLenMsg : Null Buffer");
        RETVALUE(RFAILED);
    }
    if (mBuf->b_datap->db_type != SS_M_PROTO)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS259, ERRZERO, "SFndLenMsg : Incorrect\
                                                   buffer type");
        RETVALUE(RFAILED);
    }
#endif

    /* get the SsMsgInfo */
    minfo = (SsMsgInfo*) mBuf->b_rptr;

    /* read length */
    *lngPtr = minfo->len;

    RETVALUE(ROK);
}

/*
*
*       Fun:   SSegMsg
*
*       Desc:  This function will segment one specified message into two
*              messages.
*
*       Ret:   ROK     - ok
*              ROKDNA  - ok, data not available
*              RFAILED - failed, general (optional)
*              ROUTRES - failed, out of resources (optional)
*
*       Notes: message 1 is the original message.
*
*              message 2 is the new message.
*
*              index is 0 based and indicates location in message 1
*              from which message 2 will be created.
*
*              if index is equal to 0: message 2 is created and all data
*              attached to message 1 is moved to message 2. message 1
*              is not returned to memory. return is ok.
*
*              if index is not equal to 0 and less than the length of
*              the message minus 1: message 2 is created, all data
*              attached to message 1 from index (inclusive) is moved to
*              message 2. message 1 contains data from index 0 to index
*              minus 1. return is ok.
*
*              if index is not equal to 0 and greater than or equal to
*              the length of the message minus 1: message 1 is unchanged.
*              message 2 is set to null. return is ok, data not available.
*
*       File:  ss_msg.c
*
*/


#ifdef ANSI
PUBLIC S16 SSegMsg
(
Buffer *mBuf1,              /* message 1 */
MsgLen idx,                 /* index */
Buffer **mBuf2
)
#else
PUBLIC S16 SSegMsg(mBuf1, idx, mBuf2)
Buffer *mBuf1;              /* message 1 */
MsgLen idx;                 /* index */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美高清在线视频| 欧美日韩和欧美的一区二区| 精一区二区三区| 亚洲成人免费av| 蜜桃av一区二区三区电影| 日韩主播视频在线| 国内精品伊人久久久久av影院| 免费黄网站欧美| 国内成人免费视频| 色综合久久天天| 777午夜精品免费视频| 精品国产乱码久久久久久浪潮| 久久综合九色欧美综合狠狠| 亚洲视频一二区| 美腿丝袜一区二区三区| 处破女av一区二区| 欧美日韩一区二区欧美激情| 久久综合九色综合97婷婷| 亚洲欧美另类久久久精品| 蜜臀久久99精品久久久久久9 | 久久er精品视频| 高清在线观看日韩| 日韩欧美一二区| 亚洲自拍偷拍网站| 国产成人av福利| 欧美精品欧美精品系列| 亚洲人xxxx| 成人午夜伦理影院| 久久综合九色综合97婷婷| 性感美女极品91精品| 91视频精品在这里| 国产清纯在线一区二区www| 麻豆精品视频在线观看视频| 欧美亚洲高清一区二区三区不卡| 亚洲国产成人私人影院tom | 日韩亚洲欧美一区| 免费高清视频精品| 久久草av在线| 色婷婷精品大视频在线蜜桃视频 | 午夜在线电影亚洲一区| 在线观看www91| 亚洲第一久久影院| 欧美日韩久久不卡| 人禽交欧美网站| 欧美大片在线观看| 久久99精品久久久久| 久久综合九色欧美综合狠狠| 国产一区激情在线| 中文乱码免费一区二区| 99久久国产免费看| 天堂一区二区在线| 精品国偷自产国产一区| 国产不卡高清在线观看视频| 一区二区三区四区蜜桃| 欧美区视频在线观看| 久久99精品国产麻豆婷婷洗澡| 久久蜜桃一区二区| 94-欧美-setu| 美女视频黄频大全不卡视频在线播放| 欧美r级在线观看| av成人动漫在线观看| 日韩—二三区免费观看av| 欧美精品一区二区三区蜜臀| 99国产精品视频免费观看| 一区二区三区丝袜| 精品久久五月天| 欧美人妖巨大在线| jlzzjlzz国产精品久久| 美腿丝袜亚洲三区| 亚洲一区在线视频观看| 国产精品欧美综合在线| 欧美刺激午夜性久久久久久久| 色综合久久六月婷婷中文字幕| 国产精品1区二区.| 日韩高清不卡在线| 午夜婷婷国产麻豆精品| 国产精品丝袜在线| xfplay精品久久| 亚洲精品在线观看视频| 欧美群妇大交群中文字幕| 欧美色综合影院| 欧美视频一区二区三区| 欧美亚洲尤物久久| 91老师国产黑色丝袜在线| 播五月开心婷婷综合| 成人深夜在线观看| 成人综合在线观看| 波多野结衣中文字幕一区| 亚洲乱码国产乱码精品精可以看 | 一区av在线播放| 亚洲精品成人在线| 一区二区三区在线视频观看58| 亚洲色图丝袜美腿| 亚洲国产毛片aaaaa无费看| 伊人一区二区三区| 肉色丝袜一区二区| 久久精品72免费观看| 成人av资源站| 日本黄色一区二区| 日韩欧美一级在线播放| 26uuu精品一区二区| 一区在线中文字幕| 亚洲图片有声小说| 国产盗摄女厕一区二区三区| 国产91露脸合集magnet| 91官网在线免费观看| 日韩午夜电影在线观看| 国产精品久久三| 午夜精品久久久久久久久| 日本大胆欧美人术艺术动态 | 国产午夜精品一区二区| 亚洲精品乱码久久久久久| 麻豆成人综合网| 欧美写真视频网站| 国产精品久久久久久久午夜片| 一区二区免费在线播放| 成人小视频免费观看| 欧美性感一类影片在线播放| 欧美成人福利视频| 亚洲二区在线视频| 一本色道综合亚洲| 中文字幕+乱码+中文字幕一区| 美女一区二区三区在线观看| 色综合激情久久| 亚洲欧洲日本在线| 99久久国产综合色|国产精品| 国产色产综合色产在线视频 | 久久综合久久综合久久| 亚洲国产综合视频在线观看| 色综合久久久久综合体桃花网| 国产精品无码永久免费888| 韩国视频一区二区| 精品成人一区二区三区四区| 精品制服美女丁香| www激情久久| 国产精品资源在线看| 精品欧美乱码久久久久久 | 欧美电影在线免费观看| 国产美女一区二区三区| 久久成人精品无人区| 欧美性猛片aaaaaaa做受| 日韩中文字幕91| 久久影院电视剧免费观看| 成人国产精品免费观看视频| 国产精品情趣视频| 色激情天天射综合网| 午夜精品久久一牛影视| 久久精品人人做人人综合| 成人av在线网| 五月婷婷久久丁香| 精品国产精品网麻豆系列| 9i看片成人免费高清| 亚洲国产成人av好男人在线观看| 欧美精品色一区二区三区| 国产精品 欧美精品| 亚洲成人午夜电影| 中文欧美字幕免费| 日韩视频免费观看高清完整版 | 欧美激情一区二区三区四区 | 国产精品久久毛片av大全日韩| 在线一区二区视频| 成人黄色软件下载| 久久精品理论片| 亚洲国产中文字幕在线视频综合| 久久精品免视看| 精品999久久久| 日韩一区二区三区av| 欧美日韩三级视频| 欧美在线free| 91成人免费网站| 91高清视频在线| 日本韩国一区二区| 色一区在线观看| 91国产视频在线观看| 91毛片在线观看| 欧美性大战xxxxx久久久| 日本精品裸体写真集在线观看| 色综合一个色综合亚洲| 99久久er热在这里只有精品66| 成人h版在线观看| 91蜜桃免费观看视频| 欧美日韩一区久久| 日韩欧美国产小视频| 久久亚洲精品小早川怜子| 国产色一区二区| 亚洲精品免费视频| 日本午夜精品一区二区三区电影 | 精品国产百合女同互慰| 亚洲精品在线免费播放| 国产精品久久看| 午夜视频在线观看一区| 国产在线不卡一卡二卡三卡四卡| 国产一区二区电影| 一本大道久久a久久精品综合| 7777精品伊人久久久大香线蕉 | 久久99日本精品| 成人午夜私人影院| 91麻豆精品国产91久久久久| 亚洲色图清纯唯美| 亚洲.国产.中文慕字在线|