本文整理汇总了C++中SysErrMsg函数的典型用法代码示例。如果您正苦于以下问题:C++ SysErrMsg函数的具体用法?C++ SysErrMsg怎么用?C++ SysErrMsg使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SysErrMsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ErrMsg
void ErrorHandler::ReadErrorMsg(const char *ArcName,const char *FileName)
{
#ifndef SILENT
ErrMsg(ArcName,St(MErrRead),FileName);
SysErrMsg();
#endif
}
示例2: Log
void ErrorHandler::GeneralErrMsg(const char *Msg)
{
#ifndef SILENT
Log(NULL,"%s",Msg);
SysErrMsg();
#endif
}
示例3: ErrMsg
void ErrorHandler::WriteErrorMsg(const char *ArcName,const wchar *ArcNameW,const char *FileName,const wchar *FileNameW)
{
#ifndef SILENT
ErrMsg(ArcName,St(MErrWrite),FileName);
SysErrMsg();
#endif
}
示例4: ErrMsg
void ErrorHandler::WriteErrorMsg(string sParfileName, const char *ArcName,const char *FileName)
{
#ifndef SILENT
ErrMsg(sParfileName, ArcName,St(MErrWrite),FileName);
SysErrMsg(sParfileName);
#endif
}
示例5: SysErrMsg
void ErrorHandler::WriteErrorFAT(const wchar *FileName)
{
SysErrMsg();
uiMsg(UIERROR_NTFSREQUIRED,FileName);
#if !defined(SILENT) && !defined(SFX_MODULE) || defined(RARDLL)
Exit(RARX_WRITE);
#endif
}
示例6: Log
void ErrorHandler::OpenErrorMsg(const char *ArcName,const char *FileName)
{
#ifndef SILENT
Log(ArcName && *ArcName ? ArcName:NULL,St(MCannotOpen),FileName);
Alarm();
SysErrMsg();
#endif
}
示例7: SysErrMsg
void ErrorHandler::WriteErrorFAT(const char *FileName,const wchar *FileNameW)
{
#if !defined(SILENT) && !defined(SFX_MODULE)
SysErrMsg();
ErrMsg(NULL,St(MNTFSRequired),FileName);
#endif
#if !defined(SILENT) && !defined(SFX_MODULE) || defined(RARDLL)
Throw(RARX_WRITE);
#endif
}
示例8: va_start
void ErrorHandler::GeneralErrMsg(const wchar *fmt,...)
{
va_list arglist;
va_start(arglist,fmt);
wchar Msg[1024];
vswprintf(Msg,ASIZE(Msg),fmt,arglist);
uiMsg(UIERROR_GENERALERRMSG,Msg);
SysErrMsg();
va_end(arglist);
}
示例9: SysErrMsg
void ErrorHandler::WriteErrorFAT(string sParfileName, const char *FileName)
{
#if !defined(SILENT) && !defined(SFX_MODULE)
SysErrMsg(sParfileName);
ErrMsg(sParfileName, NULL,St(MNTFSRequired),FileName);
#endif
#if !defined(SILENT) && !defined(SFX_MODULE) || defined(RARDLL)
Throw(WRITE_ERROR);
#endif
}
示例10: uiMsg
void ErrorHandler::CloseError(const wchar *FileName)
{
if (!UserBreak)
{
uiMsg(UIERROR_FILECLOSE,FileName);
SysErrMsg();
}
#if !defined(SILENT) || defined(RARDLL)
Exit(RARX_FATAL);
#endif
}
示例11: main
int main (int argc, char *argv[])
{
char * inputfile; // job dispatch file
FILE * inputliststream;
PcbPtr inputqueue = NULL; // input queue buffer
PcbPtr currentprocess = NULL; // current process
// PcbPtr process = NULL; // working pcb pointer
int timer = 0; // dispatcher timer
// 0. Parse command line
if (argc == 2) inputfile = argv[1];
else PrintUsage (stderr, argv[0]);
// 1. Initialize dispatcher queue;
// (already initialised in assignments above)
// 2. Fill dispatcher queue from dispatch list file;
if (!(inputliststream = fopen(inputfile, "r"))) { // open it
SysErrMsg("could not open dispatch list file: ", inputfile);
exit(2);
}
PcbPtr nextPCB;
while (!feof(inputliststream)) {
// put processes into input_queue
nextPCB = createnullPcb();
if(fscanf(inputliststream, "%d, %d, %d, %d, %d, %d, %d, %d",
&(nextPCB->arrivaltime),
&(nextPCB->priority),
&(nextPCB->remainingcputime),
&(nextPCB->mbytes),
&(nextPCB->req.printers),
&(nextPCB->req.scanners),
&(nextPCB->req.modems),
&(nextPCB->req.cds) )!= 8){
free(nextPCB);
continue;
}
nextPCB->status = PCB_INITIALIZED;
inputqueue = enqPcb(inputqueue, nextPCB);
}
// 3. Start dispatcher timer;
// (already set to zero above)
// 4. While there's anything in the queue or there is a currently running process:
while (inputqueue || currentprocess ) {
if(currentprocess){
(currentprocess->remainingcputime) -= 1;
if(currentprocess->remainingcputime == 0){
// if(prevprocess == NULL){
// // this would have to be the first/only process, or head of the queue
// // that would mean the last process added would be the previous process
// nextPCB->next = currentprocess->next;
// }else {
// prevprocess->next = currentprocess->next;
// }
//send SIGINT to terminate process
terminatePcb(currentprocess);
free(currentprocess);
currentprocess = NULL;
}
}
if (!currentprocess && inputqueue && inputqueue->arrivaltime <= timer){
currentprocess = deqPcb(&inputqueue);
if(currentprocess) startPcb(currentprocess);
}
sleep(1);
timer++;
}
// 5. Exit
exit (0);
}
示例12: main
int main (int argc, char *argv[])
{
char * inputfile; // job dispatch file
FILE * inputliststream;
PcbPtr inputqueue = NULL; // input queue buffer
PcbPtr currentprocess = NULL; // current process
PcbPtr process = NULL; // working pcb pointer
int timer = 0; // dispatcher timer
// 0. Parse command line
if (argc == 2) inputfile = argv[1];
else PrintUsage (stderr, argv[0]);
// 1. Initialize dispatcher queue;
// (already initialised in assignments above)
// 2. Fill dispatcher queue from dispatch list file;
if (!(inputliststream = fopen(inputfile, "r"))) { // open it
SysErrMsg("could not open dispatch list file:", inputfile);
exit(2);
}
while (!feof(inputliststream)) { // put processes into input_queue
process = createnullPcb();
if (fscanf(inputliststream,"%d, %d, %d, %d, %d, %d, %d, %d",
&(process->arrivaltime), &(process->priority),
&(process->remainingcputime), &(process->mbytes),
&(process->req.printers), &(process->req.scanners),
&(process->req.modems), &(process->req.cds)) != 8) {
free(process);
continue;
}
process->status = PCB_INITIALIZED;
inputqueue = enqPcb(inputqueue, process);
}
// 3. Start dispatcher timer;
// (already set to zero above)
// 4. While there's anything in the queue or there is a currently running process:
while(inputqueue != NULL || currentprocess != NULL){//begin while
// i. If a process is currently running;
if(currentprocess != NULL){//begin if
// a. Decrement process remainingcputime;
currentprocess->remainingcputime--;
// b. If times up:
if(currentprocess->remainingcputime <=0){//begin if1
// A. Send SIGINT to the process to terminate it;
currentprocess = terminatePcb(currentprocess);
// B. Free up process structure memory
free(currentprocess);
printf("Successful");
}//end if1
}//end if
// ii. If no process now currently running &&
// dispatcher queue is not empty &&
// arrivaltime of process at head of queue is <= dispatcher timer:
if(currentprocess == NULL && inputqueue != NULL && inputqueue->arrivaltime <= timer){//begin if
// a. Dequeue process and start it (fork & exec)
// b. Set it as currently running process;
process = deqPcb(&inputqueue);
currentprocess = startPcb(process);
}//end if
// iii. sleep for one second;
sleep(1);
// iv. Increment dispatcher timer;
timer++;
// v. Go back to 4.
continue;
}//end while
// 5. Exit
exit (0);
}
示例13: while
char *FmtStr( char *buff, const char *fmt, va_list args )
{
char *ptr;
unsigned len;
long val;
address addr;
char *res;
sym_handle *sym;
char save_buff[UTIL_LEN + 1];
while( *fmt != NULLCHAR ) {
if( *fmt != '%' ) {
*buff = *fmt;
++buff;
} else {
++fmt;
switch( *fmt ) {
case 'c':
val = va_arg( args, int );
*buff++ = val;
break;
case 's':
ptr = va_arg( args, char * );
buff = StrCopy( ptr, buff );
break;
case 't':
ptr = va_arg( args, char * );
len = va_arg( args, unsigned );
memcpy( buff, ptr, len );
buff += len;
break;
case 'l':
addr = va_arg( args, address );
buff = StrAddr( &addr, buff, TXT_LEN ); // nyi - overflow?
res = LineAddr( &addr, save_buff, sizeof( save_buff ) );
if( res != NULL ) {
*buff++ = '(';
buff = StrCopy( save_buff, buff );
*buff++ = ')';
}
break;
case 'A':
addr = va_arg( args, address );
buff = UniqStrAddr( &addr, buff, TXT_LEN ); // nyi - overflow?
break;
case 'a':
addr = va_arg( args, address );
buff = StrAddr( &addr, buff, TXT_LEN ); // nyi - overflow?
break;
case 'p':
addr = va_arg( args, address );
buff = AddrToIOString( &addr, buff, TXT_LEN ); // nyi - overflow?
break;
case 'e':
val = va_arg( args, unsigned );
buff = SysErrMsg( val, buff );
break;
case 'U':
buff = CnvULongDec( va_arg( args, unsigned long), buff, TXT_LEN );
break;
case 'd':
val = va_arg( args, int );
buff = CnvLongDec( val, buff, TXT_LEN );
break;
case 'u':
val = va_arg( args, unsigned );
buff = CnvULongDec( val, buff, TXT_LEN );
break;
case '%':
*buff++ = '%';
break;
case 'o':
val = va_arg( args, long );
if( val < 0 ) {
*buff++ = '-';
val = -val;
} else {
*buff++ = '+';
}
buff = AddHexSpec( buff );
buff = CnvULongHex( val, buff, TXT_LEN );
break;
case 'S':
sym = va_arg( args, sym_handle * );
buff += SymName( sym, NULL, SN_SOURCE, buff, TXT_LEN );
break;
}
}
++fmt;
}
*buff = NULLCHAR;
return( buff );
}
示例14: main
int main (int argc, char *argv[])
{
char * inputfile; // job dispatch file
FILE * inputliststream;
PcbPtr inputqueue = NULL; // input queue buffer
PcbPtr rrqueue = NULL; // round-robin queue
PcbPtr currentprocess = NULL; // current process
PcbPtr process = NULL; // working pcb pointer
int timer = 0; // dispatcher timer
int quantum = QUANTUM; // current time-slice quantum
// 0. Parse command line
if (argc == 2) inputfile = argv[1];
else PrintUsage (stderr, argv[0]);
// 1. Initialize dispatcher queue;
// (already initialised in assignments statements above above)
// 2. Fill dispatcher queue from dispatch list file;
if (!(inputliststream = fopen(inputfile, "r"))) { // open it
SysErrMsg("could not open dispatch list file:", inputfile);
exit(2);
}
while (!feof(inputliststream)) { // put processes into input_queue
// your code goes here
// don't forget to initialize the PCB status
// and put PCB on the queue
}
// 3. Start dispatcher timer;
// (already set to zero above)
// 4. While there's anything in any of the queues or there is a currently running process:
while (inputqueue || rrqueue || currentprocess ) {// i'll give you this outer loop, now do the rest
// i. Unload any pending processes from the input queue:
// While (head-of-input-queue.arrival-time <= dispatcher timer)
// dequeue process from input queue and enqueue on RR queue
// ii. If a process is currently running;
// a. Decrement process remainingcputime;
// b. If times up:
// A. Send SIGINT to the process to terminate it;
// B. Free up process structure memory
// c. else if other processes are waiting in RR queue:
// A. Send SIGTSTP to suspend it;
// B. Enqueue it back on RR queue;
// iii. If no process currently running && RR queue is not empty
// a. Dequeue process from RR queue
// b. If already started but suspended, restart it (send SIGCONT to it)
// else start it (fork & exec)
// c. Set it as currently running process;
// iv. sleep for quantum;
// v. Increment dispatcher timer;
// vi. Go back to 4.
}
// 5. Exit
exit (0);
}
示例15: main
int main (int argc, char *argv[])
{
char * inputfile; // job dispatch file
FILE * inputliststream;
PcbPtr inputqueue = NULL; // input queue buffer
PcbPtr inputqueue_tail = NULL;
PcbPtr curr = NULL; // for creating queue
PcbPtr currentprocess = NULL; // current process
PcbPtr process = NULL; // working pcb pointer
int timer = 0; // dispatcher timer
char buffer[75]; // for reading current line of file
int notNeeded[3]; // for storing the unneeded arguements of input line
// 0. Parse command line
if (argc == 2) inputfile = argv[1];
else PrintUsage (stderr, argv[0]);
// 1. Initialize dispatcher queue;
// (already initialised in assignments above)
// 2. Fill dispatcher queue from dispatch list file;
if (!(inputliststream = fopen(inputfile, "r"))) { // open it
SysErrMsg("could not open dispatch list file:", inputfile);
exit(2);
}
inputqueue = createnullPcb();
curr = inputqueue;
while (!feof(inputliststream)) { // put processes into input_queue
// your code goes here
// don't forget to initialize the PCB status
// and put PCB on the queue
// MH DONE
curr->next = malloc(sizeof(Pcb));
curr->args[0] = DEFAULT_PROCESS;
curr->args[1] = NULL;
fgets(buffer,sizeof(buffer),inputliststream);
sscanf(buffer,
"%d, %d, %d, %d",
&curr->arrivaltime,
&curr->priority,
&curr->remainingcputime,
&curr->mbytes
);
curr = curr->next;
}
inputqueue_tail = curr;
// 3. Start dispatcher timer;
// (already set to zero above)
// 4. While there's anything in the queue or there is a currently running process:
while (inputqueue || currentprocess ) {// i'll give you this outer loop, now do the rest
/*
i. If a process is currently running;
a. Decrement process remainingcputime;
b. If times up:
A. Send SIGINT to the process to terminate it;
B. Free up process structure memory
ii. If no process currently running &&
dispatcher queue is not empty &&
arrivaltime of process at head of queue is <= dispatcher timer:
a. Dequeue process and start it (fork & exec)
b. Set it as currently running process;
iii. sleep for one second;
iv. Increment dispatcher timer;
v. Go back to 4.
*/
//If a process is currently running;
if(currentprocess)
{
//a. Decrement process remainingcputime;
currentprocess->remainingcputime = currentprocess->remainingcputime - 1;
// b. If times up:
if(currentprocess->remainingcputime == 0 )
//A. Send SIGINT to the process to terminate it;
//B. Free up process structure memory
if(terminatePcb(currentprocess)!=NULL)
free(currentprocess);
}
/*
ii. If no process currently running &&
dispatcher queue is not empty &&
arrivaltime of process at head of queue is <= dispatcher timer:
a. Dequeue process and start it (fork & exec)
//.........这里部分代码省略.........