⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ipc.h

📁 一个功能全面的电子邮件客户端
💻 H
字号:
/* TradeClient <http://tradeclient.sourceforge.net> * $Id: ipc.h,v 1.12 2001/03/20 20:12:34 ttabner Exp $ * * Copyright (C) 1999-2000 Bynari Inc. * Copyright (C) 2001 Project TradeClient * * LGPL * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Library General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library * General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */#ifndef _TRADE_IPC_#define _TRADE_IPC_#include <sys/types.h>#include <sys/ipc.h>#include <sys/sem.h>#include <sys/msg.h>#include <sys/wait.h>#include "ipc-protocol.h"#include "status.h"#ifndef MSGMAX/* * Hopefully this is small enough to not cause problems on other platforms. * For some reason, Linux doesn't define this even though is says it's supposed to! */#define MSGQ_MAXSIZE         (3*1024)#else#define MSGQ_MAXSIZE         MSGMAX#endiftypedef struct _ipcmsgqueue_ {  long mtype ;  char mtext[MSGQ_MAXSIZE] ;} IPCMsgBuf ;/* Semaphore functions */int initSem( void ) ;int deInitSem( int semID ) ;int lockSem( int sem ) ;int unlockSem( int sem ) ;/* Message Queue Functions */int initMsgQ( void ) ;int deInitMsgQ( int q ) ;/* High level queue functions */char *recvMsg( int mqd, int to, int wait ) ;int sendMsg( qMsg *msg ) ;/* Free the memory used by a qMsg block as well as the qMsg block */int freeQMsg( qMsg *msg ) ;/* Free the memory used by a qStream block.  This function calls freeQMsg() */int freeQStream( qStream *stream ) ;/* Low level queue functions */int readMsgQ( int mqd, qPayload *payload, unsigned char *buffer, long msgType, int wait ) ;int writeMsgQ( int mqd, qPayload *payload, unsigned char *buffer, int length, long msgType ) ;/* This is used to add & remove packets on our linked list */int addStreamPacket( qStream *packet ) ;qStream *extractStreamPacket( qStream *packet ) ;/* Reconstructs a data stream from our linked list */char *buildStream( pid_t pid ) ;/* Dispatch protocol and data packets alike */char *dispatchMsgPacket( qStream *packet, char *buffer ) ;/* Process protcol packets */int processProtocolPacket( qStream *packet ) ;/* Process data packets */char *processDataPacket( qStream *packet ) ;#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -