本文整理汇总了C++中MSG1函数的典型用法代码示例。如果您正苦于以下问题:C++ MSG1函数的具体用法?C++ MSG1怎么用?C++ MSG1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MSG1函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write_ulong
void write_ulong(unsigned long num,unsigned long cum,unsigned long dat,
const char *fn,const char *fnn)
/* write num to "fnn" add ':' & cum if cum <>0, then move "fnn" to "fn" */
{
int fd;
fd = open_trunc(fnn);
if (fd == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_CREATE,fnn));
substdio_fdbuf(&ssnum,write,fd,numbuf,sizeof(numbuf));
if (substdio_put(&ssnum,strnum,fmt_ulong(strnum,num)) == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_WRITE,fnn));
if (substdio_puts(&ssnum,":") == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_WRITE,fnn));
if (substdio_put(&ssnum,strnum,fmt_ulong(strnum,cum)) == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_WRITE,fnn));
if (dat) {
if (substdio_puts(&ssnum,":") == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_WRITE,fnn));
if (substdio_put(&ssnum,strnum,fmt_ulong(strnum,dat)) == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_WRITE,fnn));
}
if (substdio_puts(&ssnum,"\n") == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_WRITE,fnn));
if (substdio_flush(&ssnum) == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_FLUSH,fnn));
if (fsync(fd) == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_SYNC,fnn));
if (close(fd) == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_CLOSE,fnn));
wrap_rename(fnn,fn);
}
示例2: thzclos
int thzclos(Process *proc, port_ent *peptr, int elem_no)
{
//Process *sptr;
cp *cpp;
//Cnxt *cnp;
//IPh *IPptr;
//IPh *nextIP;
cpp = (cp *)peptr -> cpptr;
if (peptr -> ret_code == 2)
return(2);
if (cpp -> elem_list[elem_no].closed)
return(1);
if (proc->trace) MSG1("%s Close\n",proc -> procname);
thziclos(proc, cpp, elem_no);
cpp -> elem_list[elem_no].closed = TRUE;
if (proc->trace) MSG1("%s Close end\n", proc -> procname);
return(0);
}
示例3: do_get
static void do_get(const char *action)
{
unsigned long u;
struct stat st;
char ch;
int r;
unsigned int pos;
int fd;
if (!flagget)
strerr_die2x(100,FATAL,MSG(ERR_NOT_AVAILABLE));
hdr_subject(MSG(SUB_GET_MSG));
hdr_ctboundary();
copy(&qq,"text/top",flagcd);
pos = str_len(ACTION_GET);
if (!case_starts(action,ACTION_GET))
pos = str_len(ALT_GET);
if (action[pos] == '.' || action [pos] == '_') pos++;
scan_ulong(action + pos,&u);
stralloc_copys(&line,"archive/");
stralloc_catb(&line,strnum,fmt_ulong(strnum,u / 100));
stralloc_cats(&line,"/");
stralloc_catb(&line,strnum,fmt_uint0(strnum,(unsigned int) (u % 100),2));
stralloc_0(&line);
fd = open_read(line.s);
if (fd == -1)
if (errno != error_noent)
strerr_die2sys(111,FATAL,MSG1(ERR_OPEN,line.s));
else
copy_act("text/get-bad");
else {
if (fstat(fd,&st) == -1)
copy_act("text/get-bad");
else if (!(st.st_mode & 0100))
copy_act("text/get-bad");
else {
showsend("get");
substdio_fdbuf(&sstext,read,fd,textbuf,sizeof(textbuf));
qmail_puts(&qq,"> ");
for (;;) {
r = substdio_get(&sstext,&ch,1);
if (r == -1) strerr_die2sys(111,FATAL,MSG1(ERR_READ,line.s));
if (r == 0) break;
qmail_put(&qq,&ch,1);
if (ch == '\n') qmail_puts(&qq,"> ");
}
qmail_puts(&qq,"\n");
}
close(fd);
}
copybottom(0);
qmail_to(&qq,target.s);
}
示例4: switch
SCF_STATE CAM_SM::PowerUp_STC_CheckCoin(s_scf_event const *e) {
switch (e->sig) {
case SCF_STATE_ENTRY_SIG:
{
ENTRY;
MSG0("PowerUp_STC_CheckCoin-SCF_STATE_ENTRY_SIG\n");
OstTraceFiltStatic0(TRACE_DEBUG, "PowerUp_STC_CheckCoin-SCF_STATE_ENTRY_SIG", (&mENSComponent));
// Get coin value
pIspctlCom->queuePE(Sensor_Tuning_Status_e_Coin_SubBlock_Status_Byte0,0);
pIspctlCom->readQueue();
return 0;
}
case EVT_ISPCTL_LIST_INFO_SIG:
{
MSG0("PowerUp_STC_CheckCoin-EVT_ISPCTL_LIST_INFO_SIG\n");
OstTraceFiltStatic0(TRACE_DEBUG, "PowerUp_STC_CheckCoin-EVT_ISPCTL_LIST_INFO_SIG", (&mENSComponent));
if (e->type.ispctlInfo.info_id != ISP_READLIST_DONE) break;
//#if defined (OSI_DEBUG)
for(t_uint16 i=0; i < e->type.ispctlInfo.number_of_pe; i++) {
MSG4(" PE[%d] 0x%X (%s) = 0x%lX\n", i, e->type.ispctlInfo.Listvalue[i].pe_addr, pSensor->GetPeName(e->type.ispctlInfo.Listvalue[i].pe_addr), e->type.ispctlInfo.Listvalue[i].pe_data );
//OstTraceFiltStatic4(TRACE_DEBUG, " PE[%d] 0x%X (%s) = 0x%lX", (&mENSComponent), i, e->type.ispctlInfo.Listvalue[i].pe_addr, CXp70::GetPeName(e->type.ispctlInfo.Listvalue[i].pe_addr), e->type.ispctlInfo.Listvalue[i].pe_data );
}
//#endif
if( (Coin_te)e->type.ispctlInfo.Listvalue[0].pe_data == iStatusCoin) {
// Coin state has not changed yet
if(iStatusCoinRetriesCount>=10) {
MSG0("***** Coin state unchanged, too many attempts *****\n");
OstTraceFiltStatic0(TRACE_DEBUG, "***** Coin state unchanged, too many attempts *****", (&mENSComponent));
DBC_ASSERT(0);
return 0;
}
MSG1(" Coin state unchanged (state=%d) => try again\n", (int)iStatusCoin);
OstTraceFiltStatic1(TRACE_DEBUG, "Coin state unchanged (state=%d) => try again", (&mENSComponent), (int)iStatusCoin);
iStatusCoinRetriesCount++;
pIspctlCom->queuePE(Sensor_Tuning_Status_e_Coin_SubBlock_Status_Byte0,0);
pIspctlCom->readQueue();
}
else {
// Coin state changed => we can read the block ID value
iStatusCoin = (Coin_te) e->type.ispctlInfo.Listvalue[0].pe_data;
MSG1(" Coin state unchanged (state=%d) => read Block ID value\n", (int)iStatusCoin);
OstTraceFiltStatic1(TRACE_DEBUG, "Coin state unchanged (state=%d) => read Block ID value", (&mENSComponent), (int)iStatusCoin);
iStatusCoinRetriesCount = 0;
SCF_TRANSIT_TO(&CAM_SM::PowerUp_STC_ReadId);
}
return 0;
}
case SCF_STATE_EXIT_SIG:
{
EXIT;
return 0;
}
default: break;
}
return SCF_STATE_PTR(&COM_SM::SHARED_ControlingISPState_Boot);
}
示例5: f_close
void f_close(void)
{
if (substdio_flush(&ss) == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_FLUSH,dirplus.s));
if (fsync(ss.fd) == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_SYNC,dirplus.s));
if (close(ss.fd) == -1) /* NFS stupidity */
strerr_die2sys(111,FATAL,MSG1(ERR_CLOSE,dirplus.s));
keyaddtime();
}
示例6: IN0
WRAPPER_OPENMAX_API OMX_ERRORTYPE OpenMax_Proxy::doSpecificEventHandler_cb(OMX_EVENTTYPE _event, OMX_U32 nData1, OMX_U32 nData2, OMX_BOOL &deferredEvent)
//*************************************************************************************************************
{
IN0("\n");
switch ((unsigned int)_event)
{
case OMX_EventCmdComplete:
if (nData1 == OMX_CommandStateSet)
{ //Only idle and executing are trapped!
MSG3("OMX_EventCmdComplete %s.%s(%s)\n", GetComponentName(), GetStringOmxCommand(nData1), GetStringOmxState(nData2) );
}
else // encapsulate OMX_EventPortSettingsChanged & OMX_EventBufferFlag
MSG3("OMX_EventCmdComplete %s.%s(%d)\n", GetComponentName(), GetStringOmxCommand(nData1), (int)nData2);
break;
case OMX_EventError:
MSG1("OMX_EventError %ld\n", nData1); break;
case OMX_EventMark:
MSG0("OMX_EventMark\n"); break;
case OMX_EventPortSettingsChanged:
MSG1("OMX_EventPortSettingsChanged(%d)\n", (int)nData1); break;
case OMX_EventBufferFlag:
if(nData2 == OMX_BUFFERFLAG_EOS)
{
MSG1("OMX_EventBufferFlag('EOS') on port %ld\n", nData1);
}
else
MSG2("OMX_EventBufferFlag(%ld) on port %ld\n", nData2, nData1);
break;
case OMX_EventResourcesAcquired:
MSG0("OMX_EventResourcesAcquired\n"); break;
case OMX_EventComponentResumed:
MSG0("OMX_EventComponentResumed\n"); break;
case OMX_EventDynamicResourcesAvailable:
MSG0("OMX_EventDynamicResourcesAvailable\n"); break;
case OMX_EventPortFormatDetected:
MSG0("OMX_EventPortFormatDetected\n"); break;
case OMX_EventIndexSettingChanged:
MSG0("OMX_EventIndexSettingChanged\n"); break;
case OMX_EventCmdReceived:
if (nData1 == OMX_CommandStateSet)
{ //Only idle and executing are trapped!
MSG3("OMX_EventCmdReceived %s.%s(%s)\n", GetComponentName(), GetStringOmxCommand(nData1), GetStringOmxState(nData2) );
}
else
MSG3("OMX_EventCmdReceived %s.%s(%ld)\n", GetComponentName(), GetStringOmxCommand(nData1), (long)nData2);
break;
default:
MSG3("unknown OMX_Event(%d, %d, %d)\n", _event, (int)nData1, (int)nData2); break;
}
// Don't send any more this command because it duplicate OMX_EventBufferFlag messages
//((OpenMax_Component*)&mENSComponent)->eventHandler(_event, nData1, nData2) ;
OUT0("\n");
return OMX_ErrorNone;
}
示例7: close_proper
void close_proper(substdio *ss,const char *s,const char *sn)
/* flush,sync,close,move sn->s) */
{
if (substdio_flush(ss) == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_FLUSH,s));
if (flagsync)
if (fsync(ss->fd) == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_SYNC,s));
if (close(ss->fd) == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_CLOSE,s));
wrap_rename(sn,s);
}
示例8: stralloc_0
const char *get_from(const char *adr, /* target address */
const char *act) /* action */
/* If we captured a from line, it will be from the subscriber, except */
/* when -S is used when it's usually from the subscriber, but of course */
/* could be from anyone. The matching to stored data is required only */
/* to support moderated lists, and in cases where a new -sc is issued */
/* because an old one was invalid. In this case, we read through the */
/* from file trying to match up a timestamp with that starting in */
/* *(act+3). If the time stamp matches, we compare the target address */
/* itself. act + 3 must be a legal part of the string returns pointer to*/
/* fromline, NULL if not found. Since the execution time from when to */
/* storage may differ, we can't assume that the timestamps are in order.*/
{
int fd;
const char *fl;
unsigned int pos;
unsigned long thistime;
unsigned long linetime;
if (!flagstorefrom) return 0;
if (fromline.len) { /* easy! We got it in this message */
stralloc_0(&fromline);
return fromline.s;
} /* need to recover it from DIR/from */
fl = 0;
(void) scan_ulong(act+3,&thistime);
if ((fd = open_read("from")) == -1) {
if (errno == error_noent)
return 0;
else
strerr_die2sys(111,FATAL,MSG1(ERR_READ,"from"));
}
substdio_fdbuf(&sstext,read,fd,textbuf,(int) sizeof(textbuf));
for (;;) {
if (getln(&sstext,&fromline,&match,'\n') == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_READ,"from"));
if (!match) break;
fromline.s[fromline.len - 1] = (char) 0;
/* now:time addr\0fromline\0 read all. They can be out of order! */
pos = scan_ulong(fromline.s,&linetime);
if (linetime != thistime) continue;
if (!str_diff(fromline.s + pos + 1,adr)) {
pos = str_len(fromline.s);
if (pos < fromline.len) {
fl = fromline.s + pos + 1;
break;
}
}
}
close(fd);
return fl;
}
示例9: ASYNC_IN0
/*
* Size method
*/
void fileio::size(const char* aFileName, t_uint32* aSizePtr)
{
ASYNC_IN0("");
FILE* theFile = NULL;
// Sanity check
if( aFileName == NULL || aSizePtr == NULL)
{
// bad parameter
MSG2("Bad parameter: aFileName=%p, aSizePtr=%p\n", aFileName, aSizePtr);
response.fileIoResponse(FILE_IO_BAD_PARAMETER);
ASYNC_OUT0("");
return;
}
// Open the file
MSG1("Opening file '%s' for reading\n", aFileName);
theFile = fopen( aFileName, "rb");
if(theFile==NULL)
{
// could not open the file
MSG1("File '%s' open failed\n", aFileName);
response.fileIoResponse(FILE_IO_OPEN_FAILED);
ASYNC_OUT0("");
return;
}
// Seek to end of file
MSG1("Seeking to end of file '%s'\n", aFileName);
if( fseek( theFile, 0, SEEK_END) != 0)
{
// seek failed
MSG0("Seek failed");
MSG1("Closing file '%s'\n", aFileName);
fclose(theFile);
response.fileIoResponse(FILE_IO_SEEK_FAILED);
ASYNC_OUT0("");
return;
}
// Retrieve file size
*aSizePtr = (t_uint32)ftell(theFile);
MSG2("File '%s' size %ld\n", aFileName, *aSizePtr);
// File size sucessfully retrieved
MSG1("Closing file '%s'\n", aFileName);
fclose(theFile);
response.fileIoResponse(FILE_IO_OK);
ASYNC_OUT0("");
return;
}
示例10: linkdotdir
void linkdotdir(const char *dash,const char *slash)
{
stralloc_copy(&dotplus,&dot);
stralloc_cats(&dotplus,dash);
stralloc_0(&dotplus);
dirplusmake(slash);
if (flags['e' - 'a'])
if (unlink(dotplus.s) == -1)
if (errno != error_noent)
strerr_die2sys(111,FATAL,MSG1(ERR_DELETE,dotplus.s));
if (symlink(dirplus.s,dotplus.s) == -1)
strerr_die2sys(111,FATAL,MSG1(ERR_CREATE,dotplus.s));
keyaddtime();
}
示例11: ASYNC_IN0
/*
* NMF callback
*/
void CTuningLoaderManager::response(t_tuningloader_error aErr)
{
ASYNC_IN0("\n");
OstTraceFiltStatic0(TRACE_FLOW, "Entry CTuningLoaderManager::response", (mTraceObject));
s_scf_event event;
if(aErr==TUNING_LOADER_OK) {
// NMF operation done: prepare COM_SM event
MSG0("NMF operation completed\n");
OstTraceFiltStatic0(TRACE_DEBUG, "NMF operation completed", (mTraceObject));
event.sig = TUNING_LOADER_OPERATION_DONE_SIG;
event.type.tuningLoaderEvent.error = TUNING_LOADER_OK;
}
else {
// NMF operation failed: prepare COM_SM event
MSG1("NMF operation failed: err=%d\n", aErr);
OstTraceFiltStatic1(TRACE_ERROR, "NMF operation failed: err=%d", (mTraceObject), aErr);
// Note: here the function iNmfSyncIntf.errorCode2String() cannot be called
// as CTuningLoaderManager::response callback is called in the context of the ENS
// Wrapper which has no reference to iNmfErrorIntf
event.sig = TUNING_LOADER_OPERATION_FAILED_SIG;
event.type.tuningLoaderEvent.error = aErr;
}
iSM->ProcessEvent(&event);
ASYNC_OUT0("\n");
OstTraceFiltStatic0(TRACE_FLOW, "Exit CTuningLoaderManager::response", (mTraceObject));
}
示例12: IN0
void CFlashSequencer::sigTimer() {
IN0("\n");
cam_flashSeq_atom_t const *pSeq = NULL;
if (i32_remSteps > 0) { // Some flash action still to be done
switch (curSeq) {
default:
case NONE_SEQ:
DBGT_ERROR("CFlashSequencer::sigTimer - Error: NONE_SEQ cannot be ticked.\n");
OstTraceFiltStatic0(TRACE_ERROR, "CFlashSequencer::sigTimer - Error: NONE_SEQ cannot be ticked.", (mTraceObject));
break;
case RED_EYE_REMOVAL_SEQ:
pSeq = &a_RER_sequence[sizeof(a_RER_sequence) / sizeof(cam_flashSeq_atom_t) - i32_remSteps];
break;
case PRIVACY_SEQ:
pSeq = &a_PI_sequence[sizeof(a_PI_sequence) / sizeof(cam_flashSeq_atom_t) - i32_remSteps];
break;
}
if (NULL != pSeq) {
doAtom(pSeq);
}
i32_remSteps--;
} else { // End of sequence: call the user back if requested, and clean the request.
MSG1("CFlashSequencer::sigTimer - Sequence %d completed.\n", curSeq);
curSeq = NONE_SEQ;
if (mpClbk != NULL) {
mpClbk(mctxtHnd);
mpClbk = NULL;
mctxtHnd = NULL;
}
}
OUT0("\n");
}
示例13: IN0
void openmax_processor::setParam(t_sint32 portIndex, t_sint32 fifoSize, t_sint32 direction, t_sint32 buffSupplierType, t_sint32 correspondingPortIndex, t_sint32 width, t_sint32 height, t_sint32 colorFormat, t_sint32 stride)
//*************************************************************************************************************
{ //DEfault initialisation of the ports
IN0("\n");
MSG4("portIndex %ld, fifoSize %ld, direction %ld, buffSupplierType%ld\n", portIndex, fifoSize, direction, buffSupplierType);
MSG4("correspondingPortIndex %ld, width %ld, height %ld, colorFormat %ld\n", correspondingPortIndex, width, height, colorFormat);
MSG1("stride %ld\n", stride);
if(portIndex >= (int)GetNbPorts()) // Sanity check
{
MSG0("ERROR in setParam OMX_ErrorBadParameter\n");
OUTR(" Error", OMX_ErrorBadParameter);
return;
}
portInformation*pInfo= GetPortInfo(portIndex);
if (pInfo)
{
pInfo->fifoSize = fifoSize;
pInfo->width = width;
pInfo->height = height;
pInfo->colorFormat = (OMX_COLOR_FORMATTYPE)colorFormat;
pInfo->omxPortIndex = portIndex;
pInfo->stride = stride;
pInfo->direction = (OMX_DIRTYPE) direction;
pInfo->bufferSupplier= buffSupplierType;
pInfo->omxPortIndex = correspondingPortIndex;
}
OUT0("\n");
}
示例14: IN0
/*
* This function launches the loading of the flash tuning data
*/
TuningLoaderMgrError_t CTuningLoaderManager::loadFlashTuningData(const t_flash_info* pFlashInfo)
{
IN0("\n");
OstTraceFiltStatic0(TRACE_FLOW, "Entry CTuningLoaderManager::loadFlashTuningData", (mTraceObject));
// Check if constructed
if(iNmfInstance == NULL) {
MSG0("Instance not constructed\n");
OstTraceFiltStatic0(TRACE_ERROR, "Instance not constructed", (mTraceObject));
OUTR(" ",TUNING_LOADER_MGR_NOT_CONSTRUCTED);
OstTraceFiltStatic1(TRACE_FLOW, "Exit CTuningLoaderManager::loadFlashTuningData (%d)", (mTraceObject), TUNING_LOADER_MGR_NOT_CONSTRUCTED);
return TUNING_LOADER_MGR_NOT_CONSTRUCTED;
}
// Aguments sanity check
if( pFlashInfo == NULL)
{
MSG1("Bad argument: pFlashInfo=%p\n", pFlashInfo);
OstTraceFiltStatic1(TRACE_ERROR, "Bad argument: pFlashInfo=0x%x", (mTraceObject), (t_uint32)pFlashInfo);
OUTR(" ",TUNING_LOADER_MGR_BAD_ARGUMENT);
OstTraceFiltStatic1(TRACE_FLOW, "Exit CTuningLoaderManager::loadFlashTuningData (%d)", (mTraceObject), TUNING_LOADER_MGR_BAD_ARGUMENT);
return TUNING_LOADER_MGR_BAD_ARGUMENT;
}
// Send command to NMF
MSG0("Send 'loadFlashTuning' command to NMF\n");
OstTraceFiltStatic0(TRACE_DEBUG, "Send 'loadFlashTuning' command to NMF", (mTraceObject));
iNmfQueryIntf.loadFlashTuning(*pFlashInfo);
OUTR(" ",TUNING_LOADER_MGR_OK);
OstTraceFiltStatic1(TRACE_FLOW, "Exit CTuningLoaderManager::loadFlashTuningData (%d)", (mTraceObject), TUNING_LOADER_MGR_OK);
return TUNING_LOADER_MGR_OK;
}
示例15: frm
void frm(const char *slash)
{
dirplusmake(slash);
if (unlink(dirplus.s) == -1)
if (errno != error_noent)
strerr_die2sys(111,FATAL,MSG1(ERR_DELETE,dirplus.s));
}