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

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

?? ss_queue.c

?? 中國石油二期加油站IC系統后臺通訊軟件
?? C
?? 第 1 頁 / 共 3 頁
字號:
/********************************************************************20**
 
     Name:     System Services -- Queueing
 
     Type:     C source file
 
     Desc:     Source code for System Services queuing functions.
 
     File:     ss_queue.c
 
     Sid:      ss_queue.c 1.3  -  10/14/98 14:17:28
 
     Prg:      bsr
  
*********************************************************************21*/



/* header include files (.h) */

#include "envopt.h"        /* environment options */
#include "envdep.h"        /* environment dependent */
#include "envind.h"        /* environment independent */

#include "gen.h"           /* general layer */
#include "ssi.h"           /* system services */

#include "ss_err.h"        /* errors */
#include "ss_dep.h"        /* implementation-specific */
#include "ss_queue.h"      /* queues */
#include "ss_task.h"       /* tasking */
#include "ss_strm.h"       /* STREAMS */
#include "ss_msg.h"        /* messaging */
#include "ss_mem.h"        /* memory management interface */
#include "ss_gen.h"        /* general */



/* header/extern include files (.x) */

#include "gen.x"           /* general layer */
#include "ssi.x"           /* system services */

#include "ss_dep.x"        /* implementation-specific */
#include "ss_queue.x"      /* queues */
#include "ss_task.x"       /* tasking */
#include "ss_timer.x"      /* timers */
#include "ss_strm.x"       /* STREAMS */
#include "ss_msg.x"        /* messaging */
#include "ss_mem.x"        /* memory management interface */
#include "ss_drvr.x"       /* driver tasks */
#include "ss_gen.x"        /* general */


  
/*
*
*       Fun:   SInitQueue
*
*       Desc:  This function initializes a queue.
*
*       Ret:   ROK      - ok
*              RFAILED  - failed, general (optional)
*
*       Notes: no assumptions are made about the previous state
*              of the queue.
*
*              queue size is set to zero.
*
*       File:  ss_queue.c
*
*/
#ifdef ANSI
PUBLIC S16 SInitQueue
(
Queue *q               /* queue */
)
#else
PUBLIC S16 SInitQueue(q)
Queue *q;              /* queue */
#endif
{
    TRC1(SInitQueue)

#if (ERRCLASS & ERRCLS_INT_PAR)
    /* check queue pointer */
    if (q == NULLP)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS380, ERRZERO, "Null Ptr");
        RETVALUE(RFAILED);
    }
#endif
    q->head     = NULLP;
    q->tail     = NULLP;
    q->crntSize = 0;

    RETVALUE(ROK);

} /* end of SInitQueue */

  
/*
*
*       Fun:   SFlushQueue
*
*       Desc:  This function will release all of the data or message
*              buffers on the specified queue.
*
*       Ret:   ROK      - ok
*              RFAILED  - failed, general (optional)
*
*       Notes: if queue is empty: no action is taken.
*
*              if queue is not empty: all buffers in queue are returned
*              to memory. queue length is set to zero.
*
*              if dequeud buffer is a message buffer, all data buffers
*              associated with the message buffer are returned to memory
*
*       File:  ss_queue.c
*
*/
#ifdef ANSI
PUBLIC S16 SFlushQueue
(
Queue *q                    /* queue */
)
#else
PUBLIC S16 SFlushQueue(q)
Queue *q;                   /* queue */
#endif
{
    Buffer *tBuf;
    Buffer *mBuf;
    SsMsgInfo *minfo;

    TRC1(SFlushQueue)

#if (ERRCLASS & ERRCLS_INT_PAR)
    /* check queue */
    if (q == NULLP)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS381, ERRZERO, "Null Q Ptr");
        RETVALUE(RFAILED);
    }
#endif

    tBuf = q->head;
    while (tBuf != NULLP)
    {
        mBuf = tBuf->b_next;
        if (tBuf->b_datap->db_type == SS_M_PROTO)
            SPutMsg(tBuf);
        else
        {
            minfo = (SsMsgInfo *) tBuf->b_rptr;
            SPutDBuf(minfo->region, minfo->pool, tBuf);
        }
        tBuf = mBuf;
    }
    q->crntSize = 0;
    q->head     = NULLP;
    q->tail     = NULLP;

    RETVALUE(ROK);

} /* end of SFlushQueue */

  
/*
*
*       Fun:   SCatQueue
*
*       Desc:  This function will concatenate the two specified queues
*              into one queue.
*
*       Ret:   ROK     - ok
*              RFAILED - failed, general (optional)
*
*       Notes: if order equals Q1Q2: all buffers attached to queue 2 are
*              moved to the end of queue 1. queue 2 is set to empty.
*              queue 1 length is increased by length of queue 2. queue
*              2 length is set to zero. return is ok.
*
*              if order equals Q2Q1: all buffers attached to queue 2 are
*              moved to the front of queue 1. queue 2 is set to empty.
*              queue 1 length is increased by length of queue 2. queue
*              2 length is set to zero. return is ok.
*
*       File:  ss_queue.c
*
*/
#ifdef ANSI
PUBLIC S16 SCatQueue
(
Queue *q1,                  /* queue 1 */
Queue *q2,                  /* queue 2 */
Order order                 /* order */
)
#else
PUBLIC S16 SCatQueue(q1, q2, order)
Queue *q1;                  /* queue 1 */
Queue *q2;                  /* queue 2 */
Order order;                /* order */
#endif
{
    TRC1(SCatQueue)

#if (ERRCLASS & ERRCLS_INT_PAR)
    if (q1 == NULLP)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS382, ERRZERO, "Null Q1 Ptr");
        RETVALUE(RFAILED);
    }

    if (q2 == NULLP)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS383, ERRZERO, "Null Q2 Ptr");
        RETVALUE(RFAILED);
    }

    if ((order != Q1Q2) && (order != Q2Q1))
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS384, ERRZERO, "Invalid queue order");
        RETVALUE(RFAILED);
    }

#endif /* ERRCLASS */

    if (q1->crntSize == 0)
    {
        q1->head       = q2->head;
        q1->tail       = q2->tail;
        q1->crntSize   = q2->crntSize;

        q2->head       = NULLP;
        q2->tail       = NULLP;
        q2->crntSize   = 0;

        RETVALUE(ROK);
    }

    if (q2->crntSize == 0)
    {
        RETVALUE(ROK);
    }

    switch (order)
    {
    case Q1Q2:
        {
            q1->tail->b_next = q2->head;
            q2->head->b_prev = q1->tail;
            q1->tail         = q2->tail;

            break;
        }

    case Q2Q1:
        {
            q2->tail->b_next = q1->head;
            q1->head->b_prev = q2->tail;
            q1->head         = q2->head;

            break;
        }
    default:
        RETVALUE(RFAILED);
    }

    q1->crntSize  += q2->crntSize;

    q2->head       = NULLP;
    q2->tail       = NULLP;
    q2->crntSize   = 0;

    RETVALUE(ROK);

} /* end of SCatQueue */


  
/*
*
*       Fun:   SFndLenQueue
*
*       Desc:  This function determines the length of a queue.
*
*       Ret:   ROK      - ok
*              RFAILED  - failed
*
*       Notes: length of queue is determined, queue is unchanged
*              and length is returned via pointer to length.
*              
*       File:  ss_queue.c
*
*/
#ifdef ANSI
PUBLIC S16 SFndLenQueue
(
Queue *q,                   /* queue */
QLen  *lngPtr               /* pointer to length */
)
#else
PUBLIC S16 SFndLenQueue(q, lngPtr)
Queue *q;                   /* queue */
QLen  *lngPtr;              /* pointer to length */
#endif
{
    TRC1(SFndLenQueue)

#if (ERRCLASS & ERRCLS_INT_PAR)
    /* check queue */
    if (q == NULLP)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS385, ERRZERO, "Null Q Ptr");
        RETVALUE(RFAILED);
    }
    /* check length */
    if (lngPtr == NULLP)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS386, ERRZERO, "Null Q Len Ptr");
        RETVALUE(RFAILED);
    }
#endif

    *lngPtr = q->crntSize;

    RETVALUE(ROK);

} /* end of SFndLenQueue */


/*
*
*       Fun:   SExamQueue
*
*       Desc:  This function examines the queue at the desired index.
*
*       Ret:   ROK      - ok
*              ROKDNA   - ok, data not available
*              RFAILED  - failed 
*
*       Notes: index is 0 based and indicates location in queue.
*
*              if queue is empty: pointer to buffer is set to null and
*              return is ok, data not available. queue length is unchanged.
*
*              if queue is not empty: pointer to buffer is set to indexed
*              buffer in queue. return is ok. queue length is unchanged.
*
*       File:  ss_queue.c
*
*/
#ifdef ANSI
PUBLIC S16 SExamQueue
(
Buffer **bufPtr,            /* pointer to buffer */
Queue  *q,                  /* queue */
QLen   idx                  /* index */
)
#else
PUBLIC S16 SExamQueue(bufPtr, q, idx)
Buffer **bufPtr;            /* pointer to buffer */
Queue  *q;                  /* queue */
QLen   idx;                 /* index */
#endif
{
    Buffer *tmpBuf;
    QLen   i;

    TRC1(SExamQueue)

#if (ERRCLASS & ERRCLS_INT_PAR)
    /* check buffer pointer */
    if (bufPtr == NULLP)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS387, ERRZERO, "Null Buf Ptr");
        RETVALUE(RFAILED);
    }

    /* check index */
    if ((S32)idx < 0)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS388, ERRZERO, "-ve index ");
        RETVALUE(RFAILED);
    }

    /* check queue */
    if (q == NULLP)
    {
        SSLOGERROR(ERRCLS_INT_PAR, ESS389, ERRZERO, "Null Q Ptr");
        RETVALUE(RFAILED);
    }
#endif /* ERRCLASS */

    if (idx >= q->crntSize)
    {
        *bufPtr = NULLP;
        RETVALUE(ROKDNA);
    }

    if (idx == 0)
    {
        *bufPtr = q->head;
    } else if (idx == q->crntSize -1)
    {
        *bufPtr = q->tail;
    } else
    {
        tmpBuf = q->head;
        for (i = 0; i < idx; i++)
        {
            tmpBuf = tmpBuf->b_next;
        }
        *bufPtr = tmpBuf;
    }

    RETVALUE(ROK);

} /* end of SExamQueue */


/*
*
*       Fun:   SAddQueue
*
*       Desc:  This function inserts a bufer into the queue before 
*              the desired index.
*
*       Ret:   ROK     - ok
*              RFAILED - failed
*              ROKDNA  - failed - specified index not available
*
*       Notes: index is 0 based and indicates location in queue.
*
*              if queue is empty: buffer is placed in the queue.
*              queue length is incremented.
*
*              if queue is not empty: if index is less than the queue length, 
*              buffer is inserted before the desired index;
*              otherwise, buffer is placed behind all other buffers in queue.
*              queue length is incremented.
*
*       File:  ss_queue.c
*
*/
#ifdef ANSI
PUBLIC S16 SAddQueue
(
Buffer *mBuf,                /* buffer */
Queue  *q,                   /* queue */
QLen   idx                   /* index */
)
#else
PUBLIC S16 SAddQueue(mBuf, q, idx)
Buffer *mBuf;                /* buffer */
Queue  *q;                   /* queue */
QLen   idx;                  /* index */
#endif
{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区电影在线播| 日韩电影一区二区三区四区| 6080国产精品一区二区| 色又黄又爽网站www久久| av亚洲精华国产精华| 国产成人午夜99999| 国产夫妻精品视频| 国产一区二区不卡在线| 国产suv精品一区二区6| 成人99免费视频| 99在线热播精品免费| 成人ar影院免费观看视频| 粉嫩aⅴ一区二区三区四区| 成人18视频在线播放| 91福利国产精品| 欧美午夜影院一区| 91精品国产综合久久小美女| 欧美日韩国产一级| 日韩欧美激情在线| 国产女同性恋一区二区| 中文字幕亚洲一区二区av在线 | 日本欧美久久久久免费播放网| 午夜亚洲国产au精品一区二区| 偷拍一区二区三区| 国产一区二区影院| 99久久国产综合精品女不卡| 欧洲激情一区二区| 日韩欧美精品在线| 亚洲三级在线观看| 日韩—二三区免费观看av| 国产在线精品免费| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 午夜免费欧美电影| 国产精品亚洲专一区二区三区| jiyouzz国产精品久久| 欧美日韩成人综合在线一区二区| 精品久久久久av影院 | 色94色欧美sute亚洲线路二| 91精品国产综合久久精品性色| 久久久综合视频| 亚洲欧美偷拍三级| 激情文学综合插| 色呦呦网站一区| 51久久夜色精品国产麻豆| 国产欧美日韩另类一区| 午夜精品视频一区| 99久久国产免费看| 久久这里只有精品6| 一区二区三区自拍| 91福利在线导航| 欧美成人乱码一区二区三区| 亚洲欧美日韩国产成人精品影院 | 国产精品国产三级国产普通话蜜臀 | 亚洲福利视频一区| 高清在线观看日韩| 制服丝袜亚洲播放| 伊人性伊人情综合网| 国产乱码一区二区三区| 欧美午夜精品一区二区三区| 欧美激情艳妇裸体舞| 蜜臀av国产精品久久久久| 色综合久久久久久久久久久| 国产性做久久久久久| 老司机免费视频一区二区| 欧美日韩精品福利| 亚洲精品日产精品乱码不卡| 国产69精品久久久久777| 欧美xxx久久| 三级精品在线观看| 欧美区视频在线观看| 亚洲一区二区在线观看视频| 一道本成人在线| 亚洲激情自拍偷拍| 色狠狠桃花综合| 亚洲第一电影网| 不卡电影一区二区三区| 国产农村妇女毛片精品久久麻豆| 极品美女销魂一区二区三区| 欧美大片在线观看一区二区| 久久99国产精品免费网站| 日韩欧美久久久| 国产精品资源在线| 日本一区二区三区电影| 成人国产精品免费观看动漫| 亚洲欧美在线另类| 91香蕉国产在线观看软件| 亚洲免费在线观看视频| 欧美三级视频在线播放| 午夜av电影一区| 91精品婷婷国产综合久久竹菊| 婷婷开心激情综合| 日韩欧美电影在线| 国产一区二区剧情av在线| 国产精品成人免费精品自在线观看| 成人av免费网站| 亚洲一区二三区| 日韩精品一区二区三区在线| 国产91精品久久久久久久网曝门| 欧美国产亚洲另类动漫| 日本乱人伦一区| 日韩中文字幕91| 欧美激情中文不卡| 欧美日韩国产在线观看| 激情丁香综合五月| 亚洲日韩欧美一区二区在线| 欧美精品一卡两卡| 国产精品亚洲一区二区三区妖精| 亚洲码国产岛国毛片在线| 精品美女被调教视频大全网站| av亚洲精华国产精华精华| 日韩精品成人一区二区三区| 久久久不卡影院| 在线观看视频一区二区欧美日韩| 一区二区三区国产精品| 欧美一区二区三区四区久久| 美女任你摸久久| 亚洲三级久久久| 91精品在线麻豆| 国产一区二区电影| 一区二区三区在线视频观看 | 国产99久久久国产精品| 亚洲欧美福利一区二区| 欧美日本在线播放| 韩日av一区二区| 亚洲欧美一区二区三区国产精品 | 欧美国产欧美综合| 91精品国产乱码久久蜜臀| 国产在线视频精品一区| 国产精品久线在线观看| 欧美色精品在线视频| 激情五月激情综合网| 欧美aⅴ一区二区三区视频| 日本一区二区成人| 欧美电影一区二区| 成人av电影免费在线播放| 国产精品久久久久久久久果冻传媒 | 亚洲成av人片一区二区三区 | 欧美男女性生活在线直播观看 | 久久综合国产精品| 日本道色综合久久| 国内久久精品视频| 亚洲一区在线免费观看| 亚洲视频免费看| 日韩精品一区二区三区在线观看 | 亚洲电影中文字幕在线观看| 精品三级av在线| 在线一区二区三区| 成人在线一区二区三区| 福利电影一区二区| 久久精品国产秦先生| 亚洲一区成人在线| 国产精品的网站| 久久综合九色综合97婷婷| 久久九九99视频| 欧美一区午夜视频在线观看| 一本大道av一区二区在线播放| 国产一区二三区| 美女在线观看视频一区二区| 亚洲欧洲成人精品av97| 亚洲视频资源在线| 国产日韩欧美综合一区| 日韩免费一区二区| 欧美人xxxx| 在线视频一区二区免费| 欧美日韩国产成人在线91| 日本精品免费观看高清观看| 91性感美女视频| 成人综合日日夜夜| 国产成人福利片| 国产一区二区三区黄视频| 免费成人结看片| 日韩不卡手机在线v区| 日本欧美一区二区三区乱码 | 天天射综合影视| 亚洲gay无套男同| 亚洲高清免费观看| 亚洲午夜免费视频| 五月激情综合婷婷| 秋霞国产午夜精品免费视频 | 日韩欧美一区在线观看| 91精品欧美综合在线观看最新| 91国产丝袜在线播放| 在线视频欧美区| 欧美日韩国产中文| 日韩一区国产二区欧美三区| 欧美日韩国产一级| 国产精品美女www爽爽爽| 国产精品久久二区二区| 一区二区三区日本| 亚洲不卡在线观看| 麻豆精品久久精品色综合| 天堂影院一区二区| 高清成人免费视频| 日本精品一区二区三区高清| 欧美三级在线播放| 欧美久久久久久蜜桃| 精品国产一区二区国模嫣然| 国产拍欧美日韩视频二区| 亚洲欧美色图小说| 麻豆成人久久精品二区三区红|