本文整理汇总了C++中ReplyMsg函数的典型用法代码示例。如果您正苦于以下问题:C++ ReplyMsg函数的具体用法?C++ ReplyMsg怎么用?C++ ReplyMsg使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ReplyMsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sendtocon
int sendtocon(char *pekare, int size)
{
struct IntuiMessage *mymess;
struct NiKMess *nikmess;
int aborted = FALSE, paused=FALSE;
ULONG signals,conwritesig = 1L << conwriteport->mp_SigBit,
conreadsig = 1L << conreadport->mp_SigBit,windsig = 1L << NiKwind->UserPort->mp_SigBit,
nikomnodesig = 1L << nikomnodeport->mp_SigBit;
char console = 1, tecken;
conwritereq->io_Command=CMD_WRITE;
conwritereq->io_Data=(APTR)pekare;
conwritereq->io_Length=size;
SendIO((struct IORequest *)conwritereq);
while(console)
{
signals = Wait(conwritesig | conreadsig | windsig | nikomnodesig);
if(signals & conwritesig) {
console=0;
if(WaitIO((struct IORequest *)conwritereq)) printf("Error console\n");
}
if(signals & conreadsig) {
if((tecken=congettkn()) == 3) {
if(console) {
AbortIO((struct IORequest *)conwritereq);
WaitIO((struct IORequest *)conwritereq);
}
aborted=TRUE;
console=0;
putstring("^C\n\r",-1,0);
} else if((tecken==' ' && (Servermem->inne[nodnr].flaggor & MELLANSLAG)) || tecken==19) paused=TRUE;
else if(tecken && typeaheadbuftkn<50) {
typeaheadbuf[typeaheadbuftkn++]=tecken;
typeaheadbuf[typeaheadbuftkn]=0;
}
}
if(signals & windsig) {
mymess=(struct IntuiMessage *)GetMsg(NiKwind->UserPort);
ReplyMsg((struct Message *)mymess);
cleanup(OK,"");
}
if(signals & nikomnodesig) {
while(nikmess = (struct NiKMess *) GetMsg(nikomnodeport)) {
handleservermess(nikmess);
ReplyMsg((struct Message *)nikmess);
}
if(carrierdropped()) aborted = TRUE;
}
}
if(paused && gettekn()==3)
{
putstring("^C\n\r",-1,0);
return(TRUE);
}
return(aborted);
}
示例2: config_paths_cleanup
// Clean up
void config_paths_cleanup(config_path_data *data)
{
if (data)
{
// AppWindow
RemoveAppWindow(data->appwindow);
// Close window
CloseConfigWindow(data->window);
// Free list
Att_RemList(data->path_list,0);
// Close cx library
/*#ifdef __amigaos4__
DropInterface((struct Interface *)ICommodities);
#endif
CloseLibrary(data->cxbase);*/
// Free port
if (data->appport)
{
struct Message *msg;
// Flush it
while ((msg=GetMsg(data->appport))) ReplyMsg(msg);
// Delete it
DeleteMsgPort(data->appport);
}
// Free data
FreeVec(data);
}
}
示例3: rexx_exit
void rexx_exit (void)
{
if (ARexxPort) {
struct RexxMsg *msg;
gui_rexx_s *gui = &gui_rexx[ON_EXIT];
if (gui->port[0] && gui->cmd_on[0]) {
if (ADDRESS(gui->port, gui->cmd_on) != RC_OK) {
write_log ("%s:%s:%s\n", gui->port,
gui->cmd_on,
RESULT);
}
gui->port[0] = '\0';
}
Forbid ();
while ((msg = (struct RexxMsg*)GetMsg (ARexxPort))) {
msg->rm_Result1 = RC_ERROR;
msg->rm_Result2 = 0;
ReplyMsg ((void*)msg);
}
DeletePort (ARexxPort);
Permit ();
ARexxPort = NULL;
}
#ifdef __amigaos4__
if (IRexxSys) {
DropInterface ((struct Interface *)IRexxSys);
IRexxSys = NULL;
}
#endif
if (RexxSysBase) {
CloseLibrary ((void*)RexxSysBase);
RexxSysBase = NULL;
}
}
示例4: util_RemNamedObject
BOOL util_RemNamedObject(pUtility UtilBase, struct NamedObject *object, struct Message *message)
{
Forbid();
struct NameSpace *ns = SYSTEM(object)->no_Nos.nos_NameSpace;
if (ns == NULL)
{
if (message != NULL)
{
message->mn_Node.ln_Name = NULL;
ReplyMsg(message);
}
Permit();
return TRUE;
}
if (message == NULL)
{
if (SYSTEM(object)->no_Non.non_UseCount != 1)
{
Permit();
return TRUE;
}
}
SYSTEM(object)->no_Nos.nos_NameSpace = NULL;
ObtainSemaphore(&ns->ns_Semaphore);
Remove(&SYSTEM(object)->no_Non.non_Node);
if (message != NULL)
{
SYSTEM(object)->no_Nos.nos_RemoveMsg = message;
message->mn_Node.ln_Name = (STRPTR)object;
}
ReleaseSemaphore(&ns->ns_Semaphore);
Permit();
return ReleaseNamedObject(object);
}
示例5: DevBeginIO
void AXB_REG_FUNC DevBeginIO(AXB_REG(struct IOStdReq *ior,a1),
AXB_REG(struct DevBase *db,a6))
{
struct ExBase *eb = (struct ExBase *)db;
D(("DevBeginIO\n"));
ior->io_Error = 0;
ior->io_Flags &= ~IOF_QUICK;
switch(ior->io_Command)
{
case CMD_READ:
case CMD_WRITE:
/* forward message to worker process */
PutMsg(eb->eb_WorkerPort, &ior->io_Message);
break;
case CMD_RESET:
case CMD_UPDATE:
case CMD_CLEAR:
case CMD_STOP:
case CMD_START:
case CMD_FLUSH:
case CMD_INVALID:
default:
ior->io_Error = IOERR_NOCMD;
ReplyMsg(&ior->io_Message);
break;
}
}
示例6: L_ReplyFreeMsg
// Reply or free a message
void LIBFUNC L_ReplyFreeMsg(REG(a0, struct Message *msg))
{
if (msg)
{
if (msg->mn_ReplyPort) ReplyMsg(msg);
else FreeVec(msg);
}
}
示例7: HandleEvents
/*******************
** HandleEvents **
*******************/
VOID HandleEvents(struct Window *win, UBYTE *buffer, LONG bufsize)
{
struct IntuiMessage *imsg;
struct MsgPort *port = win->UserPort;
BOOL terminated = FALSE;
WORD written;
struct InputEvent ie ={0,};
ie.ie_Class = IECLASS_RAWKEY;
while (!terminated)
{
if ((imsg = (struct IntuiMessage *)GetMsg(port)) != NULL)
{
switch (imsg->Class)
{
case IDCMP_REFRESHWINDOW:
BeginRefresh(win);
EndRefresh(win, TRUE);
break;
case IDCMP_RAWKEY:
ie.ie_Code = imsg->Code;
ie.ie_Qualifier = imsg->Qualifier;
printf("rawkey: code=$%04x, qual=$%04x\n",
ie.ie_Code, ie.ie_Qualifier);
ie.ie_EventAddress = imsg->IAddress;
written = MapRawKey(&ie, buffer, bufsize, NULL);
if (written == -1)
printf("Buffer owerflow !!\n");
else if (written)
{
printf("Map:");
Write(Output(), buffer, written);
printf("\n");
}
if (ie.ie_Code == 197)
terminated = TRUE;
break;
} /* switch (imsg->Class) */
ReplyMsg((struct Message *)imsg);
} /* if ((imsg = GetMsg(port)) != NULL) */
else
{
Wait(1L << port->mp_SigBit);
}
} /* while (!terminated) */
return;
} /* HandleEvents() */
示例8: handler
void SAVEDS handler(void)
{
struct Process *me = (struct Process *)FindTask(NULL);
struct startMsg *smsg;
struct MsgPort *port;
BOOL res = FALSE;
ENTER();
WaitPort(&me->pr_MsgPort);
smsg = (struct startMsg *)GetMsg(&me->pr_MsgPort);
#if defined(__amigaos4__)
port = AllocSysObject(ASOT_PORT, TAG_DONE);
#else
port = CreateMsgPort();
#endif
if(port != NULL)
res = localSendRexxMsg(port, smsg->port, smsg->cmd);
smsg->res = res;
ReplyMsg((struct Message *)smsg);
if(res == TRUE)
{
struct RexxMsg *rxmsg;
WaitPort(port);
rxmsg = (struct RexxMsg *)GetMsg(port);
DeleteArgstring((APTR)rxmsg->rm_Args[0]);
DeleteRexxMsg(rxmsg);
}
if(port != NULL)
{
#if defined(__amigaos4__)
FreeSysObject(ASOT_PORT, port);
#else
DeleteMsgPort(port);
#endif
}
ObtainSemaphore(&OpenURLBase->libSem);
OpenURLBase->rexx_use--;
ReleaseSemaphore(&OpenURLBase->libSem);
#if !defined(__amigaos4__)
// all systems except OS4 should leave this function in forbidden state
Forbid();
#endif
LEAVE();
}
示例9: Sys_Thread_Trampoline
static void Sys_Thread_Trampoline()
{
struct SysThread *thread;
thread = FindTask(0)->tc_UserData;
thread->entrypoint(thread->argument);
Forbid();
ReplyMsg(&thread->msg);
}
示例10: gettekn
char gettekn(void)
{
struct IntuiMessage *mymess;
struct NiKMess *nikmess;
ULONG signals,conreadsig=1L << conreadport->mp_SigBit,windsig=1L << NiKwind->UserPort->mp_SigBit,
nikomnodesig = 1L << nikomnodeport->mp_SigBit;
char tkn=0,tmp[51];
if(typeaheadbuftkn)
{
tkn=typeaheadbuf[0];
strcpy(tmp,&typeaheadbuf[1]);
strcpy(typeaheadbuf,tmp);
typeaheadbuftkn--;
}
else
{
while(!tkn)
{
signals=Wait(conreadsig | windsig | nikomnodesig);
if(signals & conreadsig)
tkn=congettkn();
if(signals & windsig)
{
mymess=(struct IntuiMessage *)GetMsg(NiKwind->UserPort);
ReplyMsg((struct Message *)mymess);
cleanup(OK,"");
}
if(signals & nikomnodesig)
{
while(nikmess = (struct NiKMess *) GetMsg(nikomnodeport))
{
handleservermess(nikmess);
ReplyMsg((struct Message *)nikmess);
}
if(carrierdropped()) tkn = '\n';
}
}
}
return(tkn);
}
示例11: commonsendrexx
int commonsendrexx(int komnr,int hasarg) {
char rexxCmd[1081];
struct RexxMsg *nikrexxmess, *mess;
sendrexxrc = -5;
if(!hasarg) {
sprintf(rexxCmd, "NiKom:rexx/ExtKom%d %d %d", komnr, nodnr, inloggad);
} else {
sprintf(rexxCmd, "NiKom:rexx/ExtKom%d %d %d %s", komnr, nodnr, inloggad, argument);
}
if(!(nikrexxmess = (struct RexxMsg *) CreateRexxMsg(
rexxport, "nik", rexxport->mp_Node.ln_Name))) {
LogEvent(SYSTEM_LOG, ERROR, "Couldn't allocate a RexxMsg.");
return -5;
}
if(!(nikrexxmess->rm_Args[0] =
(STRPTR)CreateArgstring(rexxCmd,strlen(rexxCmd)))) {
DeleteRexxMsg(nikrexxmess);
LogEvent(SYSTEM_LOG, ERROR, "Couldn't allocate a rexx ArgString.");
return -5;
}
nikrexxmess->rm_Action = RXCOMM | RXFB_TOKEN;
if(!SafePutToPort((struct Message *)nikrexxmess, "REXX")) {
LogEvent(SYSTEM_LOG, ERROR, "Can't launch ARexx script, REXX port not found.");
return -5;
}
for(;;) {
mess = (struct RexxMsg *)WaitPort(rexxport);
while(mess = (struct RexxMsg *)GetMsg(rexxport)) {
if(mess->rm_Node.mn_Node.ln_Type == NT_REPLYMSG) {
DeleteArgstring(nikrexxmess->rm_Args[0]);
if(nikrexxmess->rm_Result1) {
LogEvent(SYSTEM_LOG, WARN, "Error return code %d from ARexx script: '%s'",
nikrexxmess->rm_Result1, rexxCmd);
SendString("\r\n\nError executing ARexx script.\r\n\n");
}
DeleteRexxMsg(nikrexxmess);
if(!rxlinecount) {
rxlinecount=TRUE;
radcnt = 0;
}
return sendrexxrc;
}
handleRexxCommand(mess->rm_Args[0], mess);
ReplyMsg((struct Message *)mess);
}
}
if(carrierdropped()) return(-8);
return(sendrexxrc);
}
示例12: reply_async_request
STATIC VOID reply_async_request(struct x11_staticdata *xsd, void *primary_retval, int success)
{
xsd->hostclipboard_readstate = HOSTCLIPBOARDSTATE_IDLE;
REQ_SUCCESS(xsd->hostclipboardmsg) = success;
REQ_RETVAL(xsd->hostclipboardmsg) = (char *)primary_retval;
ReplyMsg(xsd->hostclipboardmsg);
xsd->hostclipboardmsg = NULL;
/* In case messages were sent, while an async request was in progress */
Signal(xsd->hostclipboardmp->mp_SigTask, 1L << xsd->hostclipboardmp->mp_SigBit);
}
示例13: arexx_handle
int arexx_handle(void)
{
int retval = 0;
struct RexxMsg *msg;
while ((msg = (struct RexxMsg *)GetMsg(arexx_port)))
{
arexx_message(msg);
ReplyMsg((struct Message*)msg);
}
return retval;
}
示例14: FlushUnit
VOID FlushUnit (struct DevUnit *unit, UBYTE last_queue, BYTE error, struct MyBase *base) {
struct IORequest *request;
UBYTE i;
struct Opener *opener, *tail;
/* Abort queued requests */
for (i = 0; i <= last_queue; i++) {
while ((request = (APTR)GetMsg (unit->request_ports [i])) != NULL) {
request->io_Error = IOERR_ABORTED;
ReplyMsg ((APTR)request);
}
}
#if 1
opener = (APTR)unit->openers.mlh_Head;
tail = (APTR)&unit->openers.mlh_Tail;
/* Flush every opener's read queue */
while (opener != tail) {
while ((request = (APTR)GetMsg (&opener->read_port)) != NULL) {
request->io_Error = error;
ReplyMsg ((APTR)request);
}
opener = (APTR)opener->node.mln_Succ;
}
#else
opener = request->ios2_BufferManagement;
while ((request = (APTR)GetMsg (&opener->read_port)) != NULL) {
request->io_Error = IOERR_ABORTED;
ReplyMsg ((APTR)request);
}
#endif
/* Return */
return;
}
示例15: util_ReleaseNamedObject
BOOL util_ReleaseNamedObject(pUtility UtilBase, struct NamedObject *object)
{
if (!object) return TRUE;
Forbid();
SYSTEM(object)->no_Non.non_UseCount--;
if (SYSTEM(object)->no_Non.non_UseCount == 0)
{
if (SYSTEM(object)->no_Nos.nos_RemoveMsg != NULL) ReplyMsg(SYSTEM(object)->no_Nos.nos_RemoveMsg);
}
Permit();
return TRUE;
}