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

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

?? lc_msg_q.c

?? open source for car navigation in linux
?? C
字號:
/* * Copyright (C) 2002 Ricardo Arroyo <ricardo.arroyo@eresmas.net> * * This code may be used under the terms of Version 2 of the GPL, * read the file COPYING for details. * */#include <stdlib.h>#include <stdio.h>#include <sys/types.h>#include <sys/ipc.h>#include <sys/msg.h>#include <errno.h>#include "lc_syslog.h"#include "lc_debug.h"#include "lc_msg_q.h"/*----------------------------------------------------------------------------*//*  FUNCTION :                                                                *//*               CREATE QUEUE       iCreateQmsg(key_t QKey);                  *//*          .-   returns queue ide (id_c) or -1 if error                      *//*          .-   calls iOpenQmsg, followed by a call to iDelQmsg              *//*               and finally calls iOpenQmsg again. This sequence assures     *//*               the queue is totally empty                                   *//*----------------------------------------------------------------------------*/int iCreateQmsg(key_t QKey){   int id_c;   if (iDebug & DEP_MSGQ)   {      fprintf(stderr,"iCreateQmsg,lQKey=%ld\n",(long)QKey);   }   if ((id_c=msgget(QKey,0666 | IPC_CREAT)) == -1)   {      if (iDebug & DEP_MSGQ)      {         fprintf(stderr,"iCreateQmsg(),msgget error, errno=%d\n",errno);      }   }   else if (iDelQmsg(id_c) == -1)   {      if (iDebug & DEP_MSGQ)      {         fprintf(stderr,"iCreateQmsg(),error in iDelQmsg(id_c=%d)\n",id_c);      }      id_c = -1;   }   else if ((id_c=msgget(QKey,0666 | IPC_CREAT)) == -1)   {      if (iDebug & DEP_MSGQ)      {         fprintf(stderr,"iCreateQmsg(),msgget error, errno=%d\n",errno);      }   }   else   {      if (iDebug & DEP_MSGQ)      {         fprintf(stderr,"iCreateQmsg(),return=%d\n",id_c);      }   }   return(id_c);}/*----------------------------------------------------------------------------*//*  FUNCTION :                                                                *//*               OPEN Queue       iOpenQmsg(key_t QKey);                       *//*          .-   Returns the integer value of the message queue identifier    *//*               asociated to iQKey (queue key) used for queue access         *//*                                                                            *//*          .-   returns -1 in error                                          *//*                                                                            *//*                                                                            *//*----------------------------------------------------------------------------*/int iOpenQmsg( key_t QKey){   int  id_c;   if (iDebug & DEP_MSGQ)   {      fprintf(stderr,"iOpenQmsg(QKey=%d)\n",QKey);   }   id_c = msgget(QKey,0666);   if (iDebug & DEP_MSGQ)   {      fprintf(stderr,"iOpenQmsg() QKey=%d,return=%d,error=%d\n",                     QKey, id_c, (id_c == -1 ? errno : 0));   }   return(id_c);}/*----------------------------------------------------------------------------*//*                                                                            *//*  FUNCTION :                                                                *//*               DELETE QUEUE        iDelQmsg(id_c);                          *//*                                                                            *//*          .-   returns 0 if queue is deleted, -1 if not                     *//*          .-   id_c is the queue identifier returned by iOpenQmsg           *//*                                                                            *//*----------------------------------------------------------------------------*/int iDelQmsg(int id_c){   int res;   struct msqid_ds buff;   if (iDebug & DEP_MSGQ)   {      fprintf(stderr,"iDelQmsg(id_c=%d)\n",id_c);   }   if (id_c == 0)   {      fprintf(stderr,"iDelQmsg(id_c=%d). Queue not deleted\n",id_c);      res = 0;   }   else if ((msgctl(id_c,IPC_STAT,&buff) == -1) && (errno == EINVAL))   {      res = 0; /* queue not exist, not need to be deleted */      if (iDebug & DEP_MSGQ)      {         fprintf(stderr,"iDelQmsg() queue %d not exist\n",id_c);      }   }   else   {      res = msgctl(id_c,IPC_RMID,NULL);   }   if (iDebug & DEP_MSGQ)   {      fprintf(stderr,"iDelQmsg(),return=%d,error=%d\n",res,                      (res == -1 ? errno : 0));   }   return(res);}/*----------------------------------------------------------------------------*//*  FUNCTION :                                                                *//*               SEND MSG NO FREE MEMORY     iSend2QnoFree(id_c,buf,iMsgSize) *//*          .-   Returns 0 = OK                                               *//*                      -1 = error                                            *//*                                                                            *//*          .-   id_c is the identifier returned by iOpenQmsg                 *//*                                                                            *//*          .-   buf is a pointer to a memory area that contains the message  *//*               to send                                                      *//*          .-   iMsgSize is the length of the message (mtext array)          *//*          .-   not deallocates buf memory                                   *//*                                                                            *//*----------------------------------------------------------------------------*/int iSend2QnoFree(int id_c, void *buf, int iMsgSize){   int  res;   if (iDebug & DEP_MSGQ)   {      fprintf(stderr,"iSend2QnoFree(id_c=%d,buf=%ld),MsgSize=%d\n",id_c,(long)buf,iMsgSize);   }   res = msgsnd(id_c, buf, iMsgSize - sizeof(long) ,0);   if (iDebug & DEP_MSGQ)   {      fprintf(stderr,"iSend2QnoFree(),return=%d,error=%d\n",res,                     (res == -1 ? errno : 0));   }   return(res);}/*----------------------------------------------------------------------------*//*  FUNCTION :                                                                *//*               SEND MSG     iSend2Queue (id_c,buf,iMsgSize);                *//*          .-   Returns 0 = OK                                               *//*                      -1 = error                                            *//*                                                                            *//*          .-   id_c is the identifier returned by iOpenQmsg                 *//*                                                                            *//*          .-   buf is a pointer to a memory area that contains the message  *//*               to send                                                      *//*                                                                            *//*          .-   iMsgSize is the length of the message (mtext array)          *//*                                                                            *//*----------------------------------------------------------------------------*/int iSend2Queue(int id_c, void *buf, int iMsgSize){   int  res;   res = iSend2QnoFree(id_c, buf, iMsgSize);   if (res == 0)    {       free (buf);   }   return(res);}/*----------------------------------------------------------------------------*//*  FUNCTION :                                                                *//*               READ QUEUE TYPE MSG  pRecQueueType(id_c, lTypeMsg)           *//*          .-   Returns a pointer to a msgbuf buffer with the receive        *//*               message, if error NULL is returned                           *//*                                                                            *//*          .-   id_c is the identifier returned by iOpenQmsg                 *//*          .-   lTypeMsg is the message type to be read                      *//*                                                                            *//*----------------------------------------------------------------------------*/struct msgbuf* pRecQueueType(int id_c, long lTypeMsg){   int  res;   struct msgbuf *buf;   if (iDebug & DEP_MSGQ)   {      fprintf(stderr,"iRecQueueType(id_c=%d, lTypeMsg=%ld)\n",id_c,lTypeMsg);   }   if ((buf=(struct msgbuf *)malloc(MAX_BUF + sizeof(long))) == NULL)   {      if (iDebug & DEP_MSGQ)      {         fprintf(stderr,"iRecQueueType(), malloc error\n");      }      vLC_syslog(LCLOG_ERR_MALLOC,"iRecQueueType");   }   else if ((res=msgrcv(id_c,buf,MAX_BUF,lTypeMsg,0)) == -1)// msgrcv uses the id_c queue identifier returned by iOpenQmsg//        the 2nd. parameter is a pointer to a msgbuf struct, where msgrcv//        will put all received data//        3rd. parameter is the max_len of buffer buf//        4th. parameter selects the type of message to retrieve//              0    first message in queue//             +n    first message of msg_type "n"//             -n    receive the first message with msg_type of lower absolute value//                   less than or equal to "n"//        5th parameter controls the behavior of function//              0    normal behavior: wait for message and error if message//                   is longer than buf max_len//              MSG_NOERROR truncate message if not fits in buf, an return//                   without error//              IPC_NOWAIT not wait for message and return inmediatly//                   with errno = ENOMSG   {      free(buf);      buf = NULL;      if (iDebug & DEP_MSGQ)      {         fprintf(stderr,"iRecQueueType(),return=%d,error=%d\n",(int)buf,errno);      }   }   else if ((buf=(struct msgbuf *)realloc(buf,sizeof(long)+res)) == NULL)   {      if (iDebug & DEP_MSGQ)      {         fprintf(stderr,"iRecQueueType(), realloc error\n");      }      vLC_syslog(LCLOG_ERR_REALLOC,"iRecQueueType");   }   else   {      // msg read and memory buffer reallocated      if (iDebug & DEP_MSGQ)      {         fprintf(stderr,"iRecQueueType(),return=%d,error=%d\n",(int)buf,0);      }   }   return(buf);}/*----------------------------------------------------------------------------*//*  FUNCTION :                                                                *//*               READ MSG        pRecQueue(id_c);                             *//*          .-   Returns a pointer to a msgbuf buffer with the receive        *//*               message                                                      *//*                                                                            *//*          .-   id_c is the identifier returned by iOpenQmsg                 *//*                                                                            *//*----------------------------------------------------------------------------*/struct msgbuf* pRecQueue(int id_c){   return(pRecQueueType(id_c, -MSG_MAXTYPE));}/*----------------------------------------------------------------------------*//*  FUNCTION :                                                                *//*               READ QUEUE NO WAIT    pRecQueueNwait(id_c, lTypeMsg)         *//*          .-   Returns a pointer to a msgbuf buffer with the receive        *//*               message, if errur NULL is returned                           *//*                                                                            *//*          .-   id_c is the identifier returned by iOpenQmsg                 *//*          .-   lTypeMsg is the message type to be read                      *//*                                                                            *//*----------------------------------------------------------------------------*/struct msgbuf* pRecQueueNwait(int id_c, long lTypeMsg){   int  res;   struct msgbuf *buf;   if (iDebug & DEP_MSGQ)   {      fprintf(stderr,"iRecQueueNwait(id_c=%d, lTypeMsg=%ld)\n",id_c,lTypeMsg);   }   if ((buf=(struct msgbuf *)malloc(MAX_BUF + sizeof(long))) == NULL)   {      if (iDebug & DEP_MSGQ)      {         fprintf(stderr,"iRecQueueNwait(), malloc error\n");      }      vLC_syslog(LCLOG_ERR_MALLOC,"iRecQueueNwait");   }   else if ((res=msgrcv(id_c,buf,MAX_BUF,lTypeMsg,IPC_NOWAIT)) == -1)//      if res == -1 and errno == ENOMSG, no message is in queue   {      free(buf);      buf = NULL;      if (iDebug & DEP_MSGQ)      {         fprintf(stderr,"iRecQueueNwait(),return=%d,error=%d\n",(int)buf,errno);      }   }   else if ((buf=(struct msgbuf *)realloc(buf,sizeof(long)+res)) == NULL)   {      if (iDebug & DEP_MSGQ)      {         fprintf(stderr,"iRecQueueNwait(), realloc error\n");      }      vLC_syslog(LCLOG_ERR_REALLOC,"iRecQueueNWait");   }   else   {      // msg read and memory buffer reallocated      if (iDebug & DEP_MSGQ)      {         fprintf(stderr,"iRecQueueNwait(),return=%d,error=%d\n",(int)buf,0);      }   }   return(buf);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色婷婷av一区二区三区软件| 亚洲欧美色图小说| 5858s免费视频成人| 91麻豆国产福利在线观看| 成人午夜在线播放| a亚洲天堂av| 菠萝蜜视频在线观看一区| 国产91清纯白嫩初高中在线观看 | 99久久国产综合精品女不卡| 福利电影一区二区| 国产成人高清视频| 91猫先生在线| 欧美日韩国产免费| 日韩三级视频在线看| 精品国产欧美一区二区| 久久精品亚洲麻豆av一区二区| 久久久久久综合| 综合久久久久久| 亚洲高清三级视频| 狂野欧美性猛交blacked| 国产在线观看免费一区| eeuss鲁片一区二区三区在线看| 色域天天综合网| 欧美肥妇bbw| 26uuu精品一区二区在线观看| 亚洲国产电影在线观看| 一区二区三区在线视频观看58 | 国产欧美日韩麻豆91| 亚洲欧洲日产国产综合网| 一区二区欧美在线观看| 青青草精品视频| kk眼镜猥琐国模调教系列一区二区| 91福利社在线观看| 久久一区二区视频| 亚洲国产综合色| 国产一区二区三区免费看 | 久久电影国产免费久久电影| 99视频有精品| 精品三级在线看| 亚洲人成在线播放网站岛国| 麻豆国产欧美一区二区三区| 9人人澡人人爽人人精品| 欧美一区二区三区婷婷月色 | 色伊人久久综合中文字幕| 91精品国产综合久久香蕉的特点| 中文字幕电影一区| 免播放器亚洲一区| 欧美三区在线视频| 中文字幕在线不卡| 免费亚洲电影在线| 91免费视频观看| 国产日韩欧美麻豆| 午夜精品久久久久影视| 91污片在线观看| 国产三级久久久| 精品在线免费观看| 欧美久久久一区| 性做久久久久久免费观看欧美| 不卡的av电影在线观看| 国产亚洲1区2区3区| 麻豆一区二区三区| 欧美电影在线免费观看| 亚洲永久免费av| 91啦中文在线观看| 亚洲欧美一区二区视频| 成人性生交大片免费看中文网站| 日韩美女在线视频| 免费成人美女在线观看.| 欧美撒尿777hd撒尿| 亚洲男人的天堂av| 91小宝寻花一区二区三区| 国产精品二三区| 成人av电影在线网| 亚洲欧洲三级电影| 色呦呦国产精品| 亚洲日本在线a| 91麻豆产精品久久久久久 | 色婷婷国产精品久久包臀| 亚洲人成影院在线观看| 不卡av免费在线观看| 亚洲欧美日韩一区二区| 欧美又粗又大又爽| 亚洲亚洲人成综合网络| 欧美吞精做爰啪啪高潮| 天天影视色香欲综合网老头| 5月丁香婷婷综合| 久久成人免费网| 欧美国产禁国产网站cc| 99久久精品免费看国产免费软件| 成人国产在线观看| 欧美国产日韩在线观看| 成人午夜视频在线观看| 综合亚洲深深色噜噜狠狠网站| 91免费版在线看| 亚洲国产精品视频| 欧美一级一区二区| 国产一区二区在线观看免费| 国产精品人妖ts系列视频| 97se亚洲国产综合在线| 亚洲成人动漫精品| 日韩女优av电影在线观看| 成人一区二区三区中文字幕| 亚洲人成影院在线观看| 69久久99精品久久久久婷婷| 精品一区二区在线观看| 中文字幕日韩av资源站| 精品视频一区 二区 三区| 另类调教123区| 中国色在线观看另类| 欧美日韩一区二区三区在线看| 免费久久精品视频| **欧美大码日韩| 日韩视频中午一区| 99riav久久精品riav| 秋霞影院一区二区| 国产精品电影院| 91精品国产综合久久精品麻豆| 成人免费观看男女羞羞视频| 亚洲成人综合网站| 中文字幕一区日韩精品欧美| 欧美久久高跟鞋激| 91首页免费视频| 国产综合成人久久大片91| 亚洲黄色性网站| 国产欧美精品国产国产专区 | 日韩美女视频一区二区| 91精品国产入口| 色综合久久九月婷婷色综合| 国内精品久久久久影院色| 日韩电影一区二区三区| 亚洲日本va午夜在线影院| 久久亚洲精品小早川怜子| 欧美日韩在线精品一区二区三区激情 | 99久久夜色精品国产网站| 久久超碰97人人做人人爱| 日本不卡一区二区| 一二三四社区欧美黄| 成人欧美一区二区三区在线播放| 日韩精品一区国产麻豆| 欧美日韩在线直播| 欧美午夜精品一区| 91美女片黄在线观看91美女| 国产suv精品一区二区883| 国产精品一区二区三区网站| 经典一区二区三区| 美腿丝袜亚洲三区| 日韩不卡一区二区| 亚洲成人一区二区在线观看| 亚洲视频一区二区在线| 国产精品你懂的在线欣赏| 日本一区二区三区在线不卡| 久久综合国产精品| 久久久青草青青国产亚洲免观| 精品国产91久久久久久久妲己| 日韩三级伦理片妻子的秘密按摩| 欧美伦理视频网站| 91精品国产综合久久福利| 51精品国自产在线| 日韩三级视频在线看| 欧美精品一区二区三区在线| 国产亚洲综合性久久久影院| 久久伊人蜜桃av一区二区| 国产婷婷色一区二区三区在线| 国产精品三级电影| 综合久久国产九一剧情麻豆| 依依成人综合视频| 日本一不卡视频| 国产激情一区二区三区桃花岛亚洲| 粉嫩一区二区三区性色av| 99综合电影在线视频| 在线观看视频一区二区欧美日韩| 色妹子一区二区| 在线不卡中文字幕播放| 精品福利一区二区三区免费视频| 国产欧美日韩中文久久| 亚洲精品国产高清久久伦理二区| 亚洲国产色一区| 国产一区三区三区| 91亚洲精华国产精华精华液| 欧美无人高清视频在线观看| 精品乱人伦小说| 《视频一区视频二区| 日本伊人精品一区二区三区观看方式| 国产制服丝袜一区| 91丨porny丨首页| 精品日产卡一卡二卡麻豆| 中文字幕中文乱码欧美一区二区| 亚洲另类中文字| 精品一区二区三区香蕉蜜桃| 成人免费视频一区| 欧美日韩国产乱码电影| 欧美大片在线观看一区| 亚洲欧美在线视频观看| 日韩精品一区第一页| 懂色一区二区三区免费观看| 911精品国产一区二区在线| 欧美激情一区三区| 美洲天堂一区二卡三卡四卡视频| 99久久精品国产麻豆演员表| 精品国产制服丝袜高跟|