本文整理汇总了C++中PutMsg函数的典型用法代码示例。如果您正苦于以下问题:C++ PutMsg函数的具体用法?C++ PutMsg怎么用?C++ PutMsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PutMsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MsgProgressGrow
void MsgProgressGrow()
{
if (m_stopMsgGrow) return;
PutMsg(this, &Test::MsgProgressGrow);
PutMsg(this, &Test::MsgProgressGrow);
}
示例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;
}
}
示例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;
}
}
示例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 );
}
示例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 );
}
}
示例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;
}
示例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;
}
示例8: SlowMsg
void SlowMsg()
{
Utils::TimerTicks t;
t.Sleep(CPollInterval + CMaxLagValue * 3);
PutMsg(this, &Test::SlowMsg);
}
示例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));
}
示例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);
}
示例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);
}
示例12: iomanager_beginio
void iomanager_beginio (void *ioreq)
{
struct IOMReq *iomreq = ioreq;
iomreq->flags &= ~IOF_QUICK;
PutMsg (iomanager_msgport, &iomreq->msg);
}
示例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);
}
示例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);
}
示例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;
}