亚洲欧美第一页_禁久久精品乱码_粉嫩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国产精品一区二区| 亚洲国产高清aⅴ视频| 偷窥国产亚洲免费视频| 国产91精品一区二区麻豆网站| 欧美日韩在线播放三区四区| 中文字幕高清不卡| 国产在线日韩欧美| 91精品麻豆日日躁夜夜躁| 专区另类欧美日韩| 成人高清视频在线观看| 欧美sm极限捆绑bd| 欧美bbbbb| 欧美疯狂性受xxxxx喷水图片| 亚洲男女毛片无遮挡| 高清视频一区二区| 久久久亚洲午夜电影| 奇米精品一区二区三区在线观看| 欧美在线高清视频| 亚洲精品国产一区二区精华液 | 欧洲日韩一区二区三区| 国产午夜精品一区二区三区四区| 日韩电影一区二区三区四区| 99re在线精品| 中文字幕一区二区三区四区不卡 | 欧美极品美女视频| 久久99精品一区二区三区| 精品视频999| 五月天激情综合| 欧美日本高清视频在线观看| 亚洲一区二区在线观看视频| 欧洲精品在线观看| 亚洲自拍欧美精品| 欧美亚一区二区| 亚洲成人777| 欧美高清视频不卡网| 欧美aⅴ一区二区三区视频| 欧美一区二区网站| 国产最新精品精品你懂的| 欧美精品一区二区三区久久久| 另类小说欧美激情| 国产欧美日韩精品一区| 不卡的看片网站| 一区二区三区小说| 欧美日韩国产一二三| 日韩不卡免费视频| 久久久亚洲高清| 国产不卡视频在线观看| 亚洲日本青草视频在线怡红院| 色老头久久综合| 日韩福利电影在线| 久久理论电影网| 一本久久a久久精品亚洲| 亚洲成人黄色小说| 日韩欧美aaaaaa| 成人精品国产免费网站| 亚洲另类春色国产| 日韩欧美成人激情| 成人少妇影院yyyy| 一区二区激情视频| 欧美精品一区二区三区视频| 97精品电影院| 蜜桃视频一区二区| 亚洲日本一区二区| 亚洲精品在线网站| 色猫猫国产区一区二在线视频| 午夜成人免费视频| 中文字幕精品综合| 欧美日韩国产成人在线91| 韩国视频一区二区| 有码一区二区三区| 久久精品亚洲一区二区三区浴池| 91丨porny丨户外露出| 另类专区欧美蜜桃臀第一页| 自拍av一区二区三区| ww亚洲ww在线观看国产| 欧美视频一区在线观看| 高清不卡在线观看av| 无码av中文一区二区三区桃花岛| 欧美国产精品一区| 日韩免费看网站| 欧美日本高清视频在线观看| 成人a免费在线看| 国产在线麻豆精品观看| 日韩精品电影在线| 亚洲天堂免费看| 国产色91在线| 26uuu精品一区二区三区四区在线| 欧美少妇一区二区| 97久久久精品综合88久久| 精品一区二区影视| 日韩精品一级二级 | 久久久久久久久久电影| 精品视频999| 91久久一区二区| 懂色av一区二区三区免费看| 精品一区二区久久| 蜜臀久久99精品久久久久久9 | 99精品视频一区二区| 狠狠久久亚洲欧美| 男女男精品视频| 日韩中文字幕不卡| 午夜在线成人av| 亚洲18女电影在线观看| 一区二区三区四区五区视频在线观看| 亚洲精品在线网站| 欧美一卡二卡在线观看| 欧美日韩激情一区二区| 欧美性猛交xxxxxxxx| 色偷偷88欧美精品久久久| 成人av在线资源网站| 成人少妇影院yyyy| 99久久夜色精品国产网站| 丁香婷婷综合激情五月色| 国内偷窥港台综合视频在线播放| 婷婷久久综合九色国产成人| 五月婷婷色综合| 日本va欧美va瓶| 另类欧美日韩国产在线| 免费看精品久久片| 国产在线播放一区三区四| 国产在线精品国自产拍免费| 国产不卡在线视频| 99国产精品99久久久久久| 成人美女视频在线观看| 国产suv精品一区二区6| www.久久久久久久久| 色伊人久久综合中文字幕| 欧美性生活影院| 日韩三级高清在线| 久久久久九九视频| 亚洲欧美激情插| 日本vs亚洲vs韩国一区三区| 韩国中文字幕2020精品| 成人免费毛片app| 精品视频色一区| 亚洲精品一区二区在线观看| 欧美韩国日本综合| 一二三区精品福利视频| 日本午夜精品一区二区三区电影| 久久99精品久久只有精品| 成人一区二区视频| 欧美三区在线观看| 精品国产一区二区精华| 中文字幕一区免费在线观看| 亚洲第一久久影院| 粉嫩av一区二区三区粉嫩| 91黄色在线观看| 久久夜色精品国产欧美乱极品| 国产精品卡一卡二| 美女免费视频一区二区| 不卡的电视剧免费网站有什么| 欧美在线一区二区三区| 亚洲精品一区在线观看| 亚洲一区二区欧美日韩| 国产精品一区二区久久不卡| 日本久久电影网| 久久久综合激的五月天| 亚洲成人精品影院| 成人综合婷婷国产精品久久蜜臀 | 精品欧美乱码久久久久久1区2区| 国产精品美女久久久久久久网站| 日韩二区在线观看| 色猫猫国产区一区二在线视频| 精品国产乱码久久久久久牛牛| 亚洲欧美日韩在线播放| 国产一区二区三区高清播放| 欧美裸体bbwbbwbbw| 国产精品入口麻豆九色| 麻豆精品视频在线观看视频| 欧美最新大片在线看| 国产精品美日韩| 国产福利一区在线| 日韩精品中文字幕在线一区| 亚洲一区二区影院| 一本色道久久综合亚洲精品按摩| 久久久久久97三级| 久久69国产一区二区蜜臀| 欧美日韩在线直播| 夜夜精品视频一区二区| www.欧美日韩国产在线| 欧美激情一区二区三区全黄 | 亚洲国产精品久久久久秋霞影院| 粉嫩一区二区三区性色av| 久久人人97超碰com| 亚洲1区2区3区4区| 欧美日韩你懂的| 亚洲v中文字幕| 欧美日韩精品欧美日韩精品| 亚洲免费在线视频| 色av综合在线| 亚洲国产va精品久久久不卡综合| 91理论电影在线观看| 亚洲男人的天堂在线aⅴ视频| 99久久777色| 亚洲另类春色国产| 欧美日韩卡一卡二| 亚洲第一在线综合网站| 欧美日本乱大交xxxxx|