• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PutMsg函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PutMsg函数的典型用法代码示例。如果您正苦于以下问题:C++ PutMsg函数的具体用法?C++ PutMsg怎么用?C++ PutMsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PutMsg函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: MsgProgressGrow

 void MsgProgressGrow()
 {
     if (m_stopMsgGrow) return;
     
     PutMsg(this, &Test::MsgProgressGrow);
     PutMsg(this, &Test::MsgProgressGrow);
 }
开发者ID:ixc-software,项目名称:lucksi,代码行数:7,代码来源:iCoreOverload.cpp


示例2: tdev_BeginIO

void tdev_BeginIO(TestDevBase *TestDevBase, struct IORequest *ioreq)
{
	ioreq->io_Error = 0;

	// First we try to do everything "QUICK" = Synchronous
	if (ioreq->io_Flags & IOF_QUICK)
	{
		switch(ioreq->io_Command)
		{
			// These Commands cant be done QUICK (async)
			case CMD_READ:
			case CMD_WRITE:
				PutMsg(TestDevBase->TaskPort, &ioreq->io_Message);
				ioreq->io_Flags &= ~IOF_QUICK;
				return;
			default:
				break;
		}
		// All the rest can be done Sync
		tdev_PerformIO(TestDevBase, ioreq);
		return;
	} else
	{
		PutMsg(TestDevBase->TaskPort, &ioreq->io_Message);
		ioreq->io_Flags &= ~IOF_QUICK;
		return;		
	}
}
开发者ID:cycl0ne,项目名称:poweros_raspi,代码行数:28,代码来源:testdevice.c


示例3: cd_beginio

void cd_beginio (void *ioreq)
{
	struct FSReq *fsreq = ioreq;
	struct CDSB *cdsb;
	struct CDFilp *filp;	
	
	
	fsreq->flags &= ~IOF_QUICK;

	switch (fsreq->cmd)
	{
		case FS_CMD_OPEN:
		case FS_CMD_OPENDIR:
		case FS_CMD_STAT:
		case FS_CMD_MKDIR:
		case FS_CMD_UNLINK:
		case FS_CMD_RMDIR:
		case FS_CMD_FORMAT:
		case FS_CMD_RENAME:
		case FS_CMD_INHIBIT:
		case FS_CMD_UNINHIBIT:
			cdsb = fsreq->unitp;
			PutMsg (cdsb->msgport, &fsreq->msg);
			break;

		case FS_CMD_CLOSE:
		case FS_CMD_CLOSEDIR:
		case FS_CMD_DUP:
		case FS_CMD_READ:
		case FS_CMD_WRITE:
		case FS_CMD_LSEEK:
		case FS_CMD_READDIR:
		case FS_CMD_REWINDDIR:
		case FS_CMD_ISATTY:
		case FS_CMD_CHMOD:
		case FS_CMD_CHOWN:
		case FS_CMD_TRUNCATE:
		case FS_CMD_FSTAT:
			filp = fsreq->filp;
			cdsb = filp->cdsb;
			PutMsg (cdsb->msgport, &fsreq->msg);
			break;
			
		default:
			fsreq->flags |= IOF_QUICK;
			fsreq->rc = -1;
			fsreq->error = ENOSYS;
		
	}
}
开发者ID:cod5,项目名称:kielder,代码行数:50,代码来源:wrapper.c


示例4: DoDragFiles

void DoDragFiles( HWND hwnd )
{
  BOOL     fSuccess;
  PSZ      pFiles[1];
  PSZ      pTargets[1];

  pFiles[0] = szFilePath;
  pTargets[0] = NULL;
 
  if( !DrgDragFiles(hwnd, pFiles, NULL, pTargets, 1,
                   hptrDrag, VK_BUTTON2, bSourceRender, 0L) )
    PutMsg( 2, (ULONG)"DrgDragFiles failed", NULL, NULL );
  else
    PutMsg( 2, (ULONG)"DrgDragFiles OK", NULL, NULL );
}
开发者ID:OS2World,项目名称:DEV-SAMPLES-C-DragInfo,代码行数:15,代码来源:DRAGINFO.C


示例5: PrtMsg

static void PrtMsg( int severity, int msgnum, va_list args1, va_list args2 )
/***************************************************************************/
{
    if( !banner_printed )
        trademark();

    if( FileInfo.file[ERR] == NULL )
        OpenErrFile();
    PutMsg( errout, severity, msgnum, args1 );
    fflush( errout );                       /* 27-feb-90 */
    if( FileInfo.file[ERR] ) {
        //Errfile_Written = TRUE;
        PutMsg( FileInfo.file[ERR], severity, msgnum, args2 );
    }
}
开发者ID:OS2World,项目名称:DEV-ASM-UTIL-JWasm,代码行数:15,代码来源:errmsg.c


示例6: main

int main(int argc, char *argv[]) {

  if (argc != 3) // Test for correct number of arguments
    DieWithUserMessage("Parameter(s)",
        "<Server Address/Name> [<Server Port/Service>]");

  char *server = argv[1];     // First arg: server address/name
  char *service = argv[2]; 

  // Create a connected TCP socket
  int sock = SetupTCPClientSocket(server, service);
  if (sock < 0)
    DieWithUserMessage("SetupTCPClientSocket() failed", "unable to connect");

  FILE *str = fdopen(sock,"r+");
  char buffer[MAXSTRINGLENGTH];
  //while((scanf("%s",buffer) != EOF)){
  while(gets(buffer) && strlen(buffer) != 0){
      int sSize;
      int stringLen = strlen(buffer); // Determine input length
      if((sSize = PutMsg(buffer, stringLen, str)) < 0)
          DieWithSystemMessage("PutMsg() failed");
      //printf("Sending %d-byte..\n",sSize);
      /*
      GetNextMsg(str,buffer,MAXSTRINGLENGTH);
      printf("get echo\n");
      printf("%s\n",buffer);
      */
      memset(buffer,0,sizeof(buffer));
  }
  fclose(str);
  printf("quit.\n");
  return 0;
}
开发者ID:xhbang,项目名称:network-exercise,代码行数:34,代码来源:TCPEchoClient.c


示例7: L_IPC_Startup

// Send an IPC startup
int ASM L_IPC_Startup(
	REG(a0, IPCData *ipc),
	REG(a1, APTR data),
	REG(a2, struct MsgPort *reply))
{
	struct MsgPort *port=0;
	IPCMessage startup;

	// If no message port supplied, create one
	if (!reply) port=reply=CreateMsgPort();

	// Fill out startup message
	startup.msg.mn_ReplyPort=reply;
	startup.command=IPC_STARTUP;
	startup.flags=(ULONG)ipc;
	startup.data=data;

	// Send the startup message
	PutMsg(&ipc->proc->pr_MsgPort,(struct Message *)&startup);

	// Wait for reply back
	WaitPort(reply);
	GetMsg(reply);

	// Delete port if we created one
	if (port) DeleteMsgPort(port);

	// If there's no command port, report failure
	if (startup.command!=IPC_STARTUP) return 0;
	return 1;
}
开发者ID:timofonic,项目名称:dopus5allamigas,代码行数:32,代码来源:ipc.c


示例8: SlowMsg

        void SlowMsg()
        {
            Utils::TimerTicks t;
            t.Sleep(CPollInterval + CMaxLagValue * 3);

            PutMsg(this, &Test::SlowMsg);
        }
开发者ID:ixc-software,项目名称:lucksi,代码行数:7,代码来源:iCoreOverload.cpp


示例9: RegisterARexxFunctionHost

void RegisterARexxFunctionHost(int add) {
  struct RexxMsg *mess;
  struct MsgPort *rexxmastport;
  if(!(mess=(struct RexxMsg *)AllocMem(sizeof(struct RexxMsg),
                                       MEMF_CLEAR | MEMF_PUBLIC))) {
    cleanup(EXIT_ERROR, "Out of memory.");
  }
  mess->rm_Node.mn_Node.ln_Type = NT_MESSAGE;
  mess->rm_Node.mn_Length = sizeof(struct RexxMsg);
  mess->rm_Node.mn_ReplyPort=rexxport;
  mess->rm_Action = add ? RXADDFH : RXREMLIB;
  mess->rm_Args[0] = "NIKOMREXXHOST";
  mess->rm_Args[1] = 0L;
  Forbid();
  rexxmastport = (struct MsgPort *)FindPort("REXX");
  if(rexxmastport) {
    PutMsg((struct MsgPort *)rexxmastport,(struct Message *)mess);
  }
  Permit();
  if(rexxmastport == NULL) {
    FreeMem(mess, sizeof(struct RexxMsg));
    if(add) {
      cleanup(EXIT_ERROR, "Can't find port 'REXX' (ARexx master server)");
    }
    return;
  }
  WaitPort(rexxport);
  GetMsg(rexxport);
  FreeMem(mess, sizeof(struct RexxMsg));
}
开发者ID:punktniklas,项目名称:NiKom,代码行数:30,代码来源:Startup.c


示例10: TellWBTaskToCloseWindows

ULONG TellWBTaskToCloseWindows(struct IntuitionBase *IntuitionBase)
{
    DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: currenttask <%s>\n",
                            FindTask(NULL)->tc_Node.ln_Name));

    if( GetPrivIBase(IntuitionBase)->WorkBenchMP != NULL )
    {
        struct IntuiMessage *imsg;

        if ((imsg = AllocIntuiMessage(NULL)))
        {
            /* Setup our message */
            imsg->ExecMessage.mn_ReplyPort = GetPrivIBase(IntuitionBase)->IntuiReplyPort;
            imsg->Class     	    	   = IDCMP_WBENCHMESSAGE;
            imsg->Code      	    	   = WBENCHCLOSE;

            DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: Send Msg\n"));
            /* Sends it to the handler asynchron */
            PutMsg( GetPrivIBase(IntuitionBase)->WorkBenchMP,
                    &imsg->ExecMessage);
            DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: done\n"));
            return(TRUE);
        }
        else
        {
            DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: no memory\n"));
        }
    }
    else
    {
        DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: no Workbench port\n"));
    }
    return(FALSE);
}
开发者ID:michalsc,项目名称:AROS,代码行数:34,代码来源:wbtasktalk.c


示例11: m_timer

	AutotrainerSipCall::AutotrainerSipCall(iCore::MsgThread &thread,
		iLogW::ILogSessionCreator &logCreator,
		boost::function<void (T *)> deleter,
		Utils::SafeRef<IRemoteParticipant> remoteParticipant,
		const Commands &commands) :
		iCore::MsgObject(thread),
		m_timer(this, &T::OnTimeout),
		m_log(logCreator.CreateSession(CallName(), true)),
		m_infoTag(m_log->RegisterRecordKind(L"Info", true)),
		m_deleter(deleter),
		m_callDeleted(false),
		m_commands(commands),
		m_remoteParticipant(remoteParticipant)
	{
		// Incoming call

		ESS_ASSERT(!m_commands.empty());

		if (m_log->LogActive(m_infoTag))
		{
			*m_log << m_infoTag << "Created." << iLogW::EndRecord;
		}

		m_remoteParticipant->LinkUser(this);
		
		CreateMedia();

		PutMsg(this, &T::OnCommand);
	}
开发者ID:ixc-software,项目名称:lucksi,代码行数:29,代码来源:AutotrainerSipCall.cpp


示例12: iomanager_beginio

void iomanager_beginio (void *ioreq)
{
	struct IOMReq *iomreq = ioreq;
			
	iomreq->flags &= ~IOF_QUICK;
	PutMsg (iomanager_msgport, &iomreq->msg); 
}
开发者ID:cod5,项目名称:kielder,代码行数:7,代码来源:wrapper.c


示例13: stop_engine

void   stop_engine(engine_t e)
{
	assert(e);
/*	
	mutex_lock(e->mtx);
	e->status = 0;
	//强制唤醒所有等待在完成队列上的线程 
	struct block_queue *queue = 0;
	/*唤醒所有等待在完成队列的线程* /
	while(queue = LIST_POP(struct block_queue *,e->block_thread_queue))
	{
		BLOCK_QUEUE_FORCE_WAKEUP(queue);
	}	
	mutex_unlock(e->mtx);
*/
	mutex_lock(e->mtx);
	e->status = 0;
	//强制唤醒所有等待在完成队列上的线程 
	MsgQueue_t msgQ = 0;
	/*唤醒所有等待在完成队列的线程*/
	while(msgQ = LIST_POP(MsgQueue_t,e->block_thread_queue))
	{
		//发送一个0消息
		void *tmp = 0;
		PutMsg(msgQ,&tmp,sizeof(tmp));
	}	
	mutex_unlock(e->mtx);
}
开发者ID:gezidan,项目名称:KendyNet-linux-mutithread,代码行数:28,代码来源:Engine.c


示例14: dllKillLibrary

int dllKillLibrary(char *portname)
{
    dll_tMessage msg,*reply;
    struct MsgPort *myport;
    struct MsgPort *dllport;

    bug("[DynLink] %s('%s')\n", __PRETTY_FUNCTION__, portname);

    if(!(myport=CreateMsgPort()))
        exit(0L);       //Arghh
    
    bzero(&msg, sizeof(msg));

    msg.dllMessageType=DLLMTYPE_Kill;

    msg.Message.mn_ReplyPort = myport;

    if((dllport=FindPort(portname)))
    {
        PutMsg(dllport, (struct Message *)&msg);
        /*WaitPort(myport);*/
        while(!(reply=(dll_tMessage *)GetMsg(myport)))
        {
            Delay(2);
            if(FindPort(portname)!=dllport)
                break;
        }
    }

    DeleteMsgPort(myport);

    return (dllport?1:0);
}
开发者ID:DanielGibson,项目名称:dhewm3,代码行数:33,代码来源:dll.c


示例15: put_event

int put_event(engine_t e,st_io *io)
{
	assert(e);
	assert(io);
	/*
	mutex_lock(e->mtx);
	struct block_queue *EventQ = LIST_POP(struct block_queue*,e->block_thread_queue);
	if(!EventQ)
	{
		//没有等待的线程,先缓冲事件
		LIST_PUSH_BACK(e->buffering_event_queue,io);
		io = 0;
	}
	mutex_unlock(e->mtx);	
	if(io)
		BLOCK_QUEUE_PUSH(EventQ,io);
	*/
	//printf("putevent\n");
	mutex_lock(e->mtx);
	MsgQueue_t msgQ = LIST_POP(MsgQueue_t,e->block_thread_queue);
	if(!msgQ)
	{
		//没有等待的线程,先缓冲事件
		LIST_PUSH_BACK(e->buffering_event_queue,io);
		io = 0;		
	}
	mutex_unlock(e->mtx);
	if(io)
		PutMsg(msgQ,&io,sizeof(io));
	
	return 0;
}
开发者ID:gezidan,项目名称:KendyNet-linux-mutithread,代码行数:32,代码来源:Engine.c


示例16: start_proxy_thread

/*
 * Start proxy thread
 */
static int start_proxy_thread (void)
{
    int result = -1;
    struct MsgPort *replyport = CreateMsgPort();
    struct Process *p;

    if (replyport) {
	p = myCreateNewProcTags (NP_Name,	(ULONG) "E-UAE semaphore proxy",
				 NP_Priority,		10,
				 NP_StackSize,		2048,
				 NP_Entry,	(ULONG) proxy_thread_main,
				 TAG_DONE);
	if (p) {
	    /* Send startup message */
	    struct Message msg;
	    msg.mn_ReplyPort = replyport;
	    msg.mn_Length    = sizeof msg;
	    PutMsg (&p->pr_MsgPort, (struct Message*)&msg);
	    WaitPort (replyport);

	    proxy_thread = p;

	    atexit (stop_proxy_thread);

	    result = 0;
	}
	DeleteMsgPort (replyport);
    }
    return result;
}
开发者ID:CrashSerious,项目名称:PiUAE,代码行数:33,代码来源:thread.c


示例17: uae_start_thread

int uae_start_thread (void *(*f) (void *), void *arg, uae_thread_id *foo)
{
    struct MsgPort *replyport = CreateMsgPort();

    if (replyport) {
	*foo = (struct Task *)myCreateNewProcTags (NP_Output,		   Output (),
						   NP_Input,		   Input (),
						   NP_Name,	   (ULONG) "UAE thread",
						   NP_CloseOutput,	   FALSE,
						   NP_CloseInput,	   FALSE,
						   NP_StackSize,	   16384,
						   NP_Entry,	   (ULONG) do_thread,
						   TAG_DONE);

	if(*foo) {
	    struct startupmsg msg;

	    msg.msg.mn_ReplyPort = replyport;
	    msg.msg.mn_Length    = sizeof msg;
	    msg.func             = f;
	    msg.arg              = arg;
	    PutMsg (&((struct Process*)*foo)->pr_MsgPort, (struct Message*)&msg);
	    WaitPort (replyport);
	}
	DeleteMsgPort (replyport);
    }

    return *foo!=0;
}
开发者ID:CrashSerious,项目名称:PiUAE,代码行数:29,代码来源:thread.c


示例18: main

int main()
{
	Port a;
	MCB m;
	word timeout = OneSec*5;
	word start, end;
	word e;

	a = NewPort();

	forever
	{
		InitMCB(&m,MsgHdr_Flags_preserve,a,NullPort,1); /* IOCTimeout */
		m.Timeout = timeout;

		start = _cputime(); /* times in centiseconds */
		e = PutMsg(&m);
		end = _cputime();

		if ((end - start) > ((timeout/10000) + 500) || (end - start) < 0)
		{
			printf("PutMsg TIMEOUT ERROR returned %lx - ", e);
			IOdebug("PutMsg TIMEOUT ERROR 500 != %x centisecs\n",end-start);
		}
		printf("Timeout in %ld centisecs\n",end-start);
	}
}
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:27,代码来源:testport.c


示例19: PutMsg

 void TcpSocketEmul::ConnectToHost(const Utils::HostInf &host)
 {
     m_connected = true;
     PutMsg(this, 
            &T::OnConnectToHost, 
            shared_ptr<Utils::HostInf>(new Utils::HostInf(host)));
 }
开发者ID:ixc-software,项目名称:lucksi,代码行数:7,代码来源:TcpSocketEmul.cpp


示例20: PingFunc

VOID __saveds PingFunc( VOID )
{
    struct MsgPort *ClientPort, *ReplyPort;
	struct Library *SysBase;
    BlankMsg PingMsg;

	SysBase = *( struct Library ** )4L;

	if( ReplyPort = CreateMsgPort())
	{
		PingMsg.bm_Mess.mn_ReplyPort = ReplyPort;
		PingMsg.bm_Mess.mn_Length = sizeof( BlankMsg );
		PingMsg.bm_Type = BM_PING;
		/* Stealthimania, to alleviate processing at the blanker */
		PingMsg.bm_Mess.mn_Node.ln_Name = ( UBYTE * )( &Blanking );

		for( ;; )
		{
			if( SetSignal( 0L, SIGBREAKF_CTRL_C ) & SIGBREAKF_CTRL_C )
				break;

			if( ClientPort = FindPort( "GarshneClient" ))
			{
				PingMsg.bm_Flags = 0L;
				PutMsg( ClientPort, ( struct Message * )( &PingMsg ));
				WaitPort( ReplyPort );
				GetMsg( ReplyPort );
			}
		}
		DeletePort( ReplyPort );
	}
}
开发者ID:samskivert,项目名称:garshneblanker,代码行数:32,代码来源:module.c



注:本文中的PutMsg函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PutPixel函数代码示例发布时间:2022-05-30
下一篇:
C++ PutModule函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap