int main() { int monitorNum, value; monitorNum = CreateMonitorRPC("TestMonitor", sizeof("TestMonitor")); PrintfInt("Monitor Number %d\n", sizeof("Monitor Number %d\n"), monitorNum); value = GetMonitorRPC(monitorNum); PrintfInt("Monitor Value %d\n", sizeof("Monitor Value %d\n"), value); DestroyMonitorRPC(monitorNum); Exit(0); }
int main(){ int lockNum, conditionNum; lockNum = CreateLockRPC("ConditionLock", sizeof("ConditionLock")); PrintfInt("Lock Number %d\n", sizeof("Lock Number %d\n"), lockNum); conditionNum = CreateConditionRPC("TestCondition", sizeof("TestCondition")); PrintfInt("Condition Number %d\n", sizeof("Condition Number %d\n"), conditionNum); AcquireRPC(lockNum); WaitRPC(conditionNum, lockNum); PrintfInt("Got signalled from condition %d\n", sizeof("Got signalled from condition %d\n"), conditionNum); ReleaseRPC(lockNum); }
// void CBrdSession::ServiceL(const RMessage& aMessage) void CBrdSession::ServiceL(const RMessage2& aMessage) { CBrdServer *server = (CBrdServer*)Server(); switch (aMessage.Function()) { case EAnvlPrintInt: server->iControl->WriteText(_L("int=%d\n"), aMessage.Int0()); aMessage.Complete(KErrNone); break; case EAnvlPrintStr: { TInt desLen = aMessage.GetDesLength(0); HBufC8* buf=HBufC8::NewL(desLen); TPtr8 bufPtr = buf->Des(); // Message().ReadL(desPtr,bufPtr); aMessage.ReadL(0,bufPtr); PrintStr(bufPtr); aMessage.Complete(KErrNone); delete buf; buf = NULL; } break; case EAnvlPrintfStr: { TInt desLen = aMessage.GetDesLength(0); HBufC8* buf=HBufC8::NewL(desLen); CleanupStack::PushL(buf); TPtr8 bufPtr = buf->Des(); // Message().ReadL(desPtr,bufPtr); aMessage.ReadL(0,bufPtr); desLen = aMessage.GetDesLength(1); HBufC8* buf2=HBufC8::NewL(desLen); CleanupStack::PushL(buf2); TPtr8 bufPtr2 = buf2->Des(); // Message().ReadL(desPtr,bufPtr2); aMessage.ReadL(0,bufPtr2); PrintfStr(bufPtr, bufPtr2); aMessage.Complete(KErrNone); CleanupStack::Pop(); CleanupStack::Pop(); delete buf; buf = NULL; delete buf2; buf2 = NULL; } break; case EAnvlPrintfInt: { TInt desLen = aMessage.GetDesLength(0); HBufC8* buf=HBufC8::NewL(desLen); TPtr8 bufPtr = buf->Des(); // Message().ReadL(desPtr,bufPtr); aMessage.ReadL(0,bufPtr); PrintfInt(bufPtr, aMessage.Int1()); aMessage.Complete(KErrNone); delete buf; buf = NULL; } break; case EAnvlNumberOfSessions: aMessage.Complete(server->NumberOfSessions()); break; default: PanicClient(EPanicUnknownFunction); break; } }
void CfrTil_PrintInt ( ) { PrintfInt ( _DataStack_Pop ( ) ) ; }