本文整理汇总了C++中prterr函数的典型用法代码示例。如果您正苦于以下问题:C++ prterr函数的具体用法?C++ prterr怎么用?C++ prterr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了prterr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkallocdiag
short checkallocdiag(int line,char *file)
{
struct Rmds *md;
char *tmp;
short retval=FALSE;
for(md=Rmd;md!=NULL;md=md->next) if(md->ptr!=NULL)
{
tmp=md->ptr-sizeof(unsigned);
if(*(unsigned *)tmp!=(unsigned)SIGWORD)
{
prterr("Error ALLOC ptr=%p head damaged alloc=%d,%s cur=%d,%s\n",md->ptr,md->line,md->file,line,file);
retval=(-1);
}
tmp+=md->size+sizeof(unsigned);
if(*(unsigned *)tmp!=(unsigned)SIGWORD)
{
prterr("Error ALLOC ptr=%p foot damaged alloc=%d,%s cur=%d,%s\n",md->ptr,md->line,md->file,line,file);
retval=(-1);
}
}
return(retval);
}
示例2: do_preallocate
/* fallocate is basically a no-op unless extending, then a lot like a truncate */
void
do_preallocate(unsigned offset, unsigned length)
{
unsigned end_offset;
int keep_size;
if (length == 0) {
if (!quiet && testcalls > simulatedopcount)
prt("skipping zero length fallocate\n");
log4(OP_SKIPPED, OP_FALLOCATE, offset, length);
return;
}
keep_size = random() % 2;
end_offset = keep_size ? 0 : offset + length;
if (end_offset > biggest) {
biggest = end_offset;
if (!quiet && testcalls > simulatedopcount)
prt("fallocating to largest ever: 0x%x\n", end_offset);
}
/*
* last arg matches fallocate string array index in logdump:
* 0: allocate past EOF
* 1: extending prealloc
* 2: interior prealloc
*/
log4(OP_FALLOCATE, offset, length, (end_offset > file_size) ? (keep_size ? 0 : 1) : 2);
if (end_offset > file_size) {
memset(good_buf + file_size, '\0', end_offset - file_size);
file_size = end_offset;
}
if (testcalls <= simulatedopcount)
return;
if ((progressinterval && testcalls % progressinterval == 0) ||
(debug && (monitorstart == -1 || monitorend == -1 ||
end_offset <= monitorend)))
prt("%lu falloc\tfrom 0x%x to 0x%x (0x%x bytes)\n", testcalls,
offset, offset + length, length);
if (fallocate(fd, keep_size ? FALLOC_FL_KEEP_SIZE : 0, (loff_t)offset, (loff_t)length) == -1) {
prt("fallocate: %x to %x\n", offset, length);
prterr("do_preallocate: fallocate");
report_failure(161);
}
}
示例3: main
void main(int argc,char **argv)
{
short filenum=(-1);
char *warnmessage=NULL;
char *module=NULL,*mtnname=NULL;
module="FINMGT";
mtnname="MTN FINRACT";
if(InitializeSubsystems(argc,argv,module,mtnname))
{
RDAAPPMAINLOOP();
return;
}
MASTER=MaintainMasterNew(module,mtnname);
if(findMaintainMaster(MASTER))
{
warnmessage=Rmalloc(300+RDAstrlen(MASTER->module)+RDAstrlen(mtnname));
sprintf(warnmessage,"Error Maintain Master Definition not found, this process cannot be executed without it's definition [%s] in the [%s.MTN] library.",mtnname,MASTER->module);
ERRORDIALOG("MAINTAIN MASTER NOT FOUND.",warnmessage,NULL,TRUE);
prterr("%s",warnmessage);
if(warnmessage!=NULL) Rfree(warnmessage);
doexit(NULL);
} else {
if((filenum=APPOPNNRDEDITABLE(MASTER->module,MASTER->mainfile,&editable))==(-1))
{
doexit(NULL);
return;
}
SetSupportingWritable(MASTER,MASTER->module,"FINRYR",1,TRUE,&editable);
if(!OPEN_MASTER_FILES(MASTER))
{
doexit(NULL);
return;
}
ryrnum=APPReturnSupportingFileno(MASTER,"FINMGT","FINRYR",1);
MASTER->passkey=READPassKey(filenum);
MASTER->inheritrsrcs=TRUE;
switch(MASTER->start_with)
{
default:
case 0:
finractm(1,NULL);
break;
case 1:
browse_finract(NULL,NULL);
break;
}
}
RDAAPPMAINLOOP();
}
示例4: IMPEXP_FILESEC_IN
static void IMPEXP_FILESEC_IN()
{
IEfile *IMPEXP=NULL;
char *temp1=NULL;
char *temp2=NULL;
temp1=Rmalloc(3+1);
sprintf(temp1,"%s",
"");
temp2=Rmalloc(3+1);
sprintf(temp2,"%s",
"");
#ifdef WIN32
IMPEXP=IMPEXPdefNEW("FILESEC_IN","SECURITY","FILESEC","securityfile.csv",temp1,"\\t","\\r\\n",0,1,1,1,1,0,1,0,temp2,0,NULL);
#endif /* ifdef WIN32 */
#ifndef WIN32
IMPEXP=IMPEXPdefNEW("FILESEC_IN","SECURITY","FILESEC","securityfile.csv",temp1,"\\t","\\r\\n",0,1,1,1,1,0,1,0,temp2,0,NULL);
#endif /* ifndef WIN32 */
if(temp1!=NULL) Rfree(temp1);
if(temp2!=NULL) Rfree(temp2);
if(IMPEXP!=NULL)
{
addIMPEXPfieldADV(IMPEXP,"USER IDENTIFICATION",1,1,15,NULL,1,NULL);
addIMPEXPfieldADV(IMPEXP,"MODULE NAME",1,16,15,NULL,1,NULL);
addIMPEXPfieldADV(IMPEXP,"FILE NAME",1,31,15,NULL,1,NULL);
addIMPEXPfieldADV(IMPEXP,"FIELD SECURITY",10,46,1,NULL,1,NULL);
addIMPEXPfieldADV(IMPEXP,"READ FILE",10,47,1,NULL,1,NULL);
addIMPEXPfieldADV(IMPEXP,"WRITE FILE",10,48,1,NULL,1,NULL);
addIMPEXPfieldADV(IMPEXP,"PRINT FILE",10,49,1,NULL,1,NULL);
addIMPEXPfieldADV(IMPEXP,"DELETE FILE",10,50,1,NULL,1,NULL);
addIMPEXPfieldADV(IMPEXP,"EXPRESSION",14,51,1024,NULL,1,NULL);
if(writeIMPORTbin(module,IMPEXP))
{
if(temp1!=NULL) Rfree(temp1);
temp1=Rmalloc(10+0+110+1);
sprintf(temp1,"IMPORT/EXPORT WRITE ERROR: Module [] Import/Export definition [FILESEC_IN], Can Not Save Import/Export Definition!");
prterr(temp1);
if(errorlist!=NULL)
{
addERRlist(&errorlist,temp1);
}
if(temp1!=NULL) Rfree(temp1);
if(temp2!=NULL) Rfree(temp2);
}
if(IMPEXP!=NULL) free_import(IMPEXP);
}
}
示例5: changeftype
static void changeftype(RDArsrc *r)
{
int type=0;
FINDRSCGETINT(r,"FIELD TYPES",&type);
switch(type)
{
case SCROLLEDTEXT:
case VARIABLETEXT:
case PLAINTEXT:
case DATES:
case TIMES:
case SOCSECNUM:
case PHONE:
case CUSTOMTYPE:
case ZIPCODE:
case EXPENDITURE:
case REVENUE:
case BALANCESHEET:
case BEGINNINGBALANCE:
case OPTIONALFIELDS:
case BOOLNS:
case CHARACTERS:
GSV->value.string_value=NULL;
break;
case SHORTV:
case SSHORTV:
GSV->value.short_value=NULL;
break;
case SCROLLEDLIST:
case LONGV:
case SLONGV:
GSV->value.integer_value=NULL;
break;
case DOLLARS:
case DOLLARS_NOCENTS:
case DECIMALV:
case DOUBLEV:
case SDOUBLEV:
case SDECIMALV:
GSV->value.float_value=NULL;
break;
case BUTTONS:
break;
default:
prterr("Error Unrecognized Field type [%d].",type);
break;
}
}
示例6: DEF_PURGEFLDSEC_RANGE_SCREEN
static void DEF_PURGEFLDSEC_RANGE_SCREEN()
{
RDAdefault *def=NULL;
char *defdir=NULL;
char *temp1=NULL;
def=RDAdefaultNEW("SECURITY","PURGEFLDSEC RANGE SCREEN");
if(def!=NULL)
{
def->input_focus=stralloc("DEFAULTS");
addDefaultFieldCHAR(def,"SELECT [FLDSEC][DELETEFLAG] TRUE",TRUE,10,1);
addDefaultFieldCHAR(def,"SELECT [FLDSEC][DELETEFLAG] FALSE",TRUE,10,1);
addDefaultFieldCHAR(def,"RANGE ON [FLDSEC][USER IDENTIFICATION]",TRUE,10,0);
addDefaultFieldSTRING(def,"FROM [FLDSEC][USER IDENTIFICATION]",TRUE,1,"");
addDefaultFieldSTRING(def,"TO [FLDSEC][USER IDENTIFICATION]",TRUE,1,"");
addDefaultFieldCHAR(def,"RANGE ON [FLDSEC][MODULE NAME]",TRUE,10,0);
addDefaultFieldSTRING(def,"FROM [FLDSEC][MODULE NAME]",TRUE,1,"");
addDefaultFieldSTRING(def,"TO [FLDSEC][MODULE NAME]",TRUE,1,"");
addDefaultFieldCHAR(def,"RANGE ON [FLDSEC][FILE NAME]",TRUE,10,0);
addDefaultFieldSTRING(def,"FROM [FLDSEC][FILE NAME]",TRUE,1,"");
addDefaultFieldSTRING(def,"TO [FLDSEC][FILE NAME]",TRUE,1,"");
addDefaultFieldCHAR(def,"SELECT [FLDSEC][FIELD SECURITY] TRUE",TRUE,10,1);
addDefaultFieldCHAR(def,"SELECT [FLDSEC][FIELD SECURITY] FALSE",TRUE,10,1);
addDefaultFieldCHAR(def,"SELECT [FLDSEC][READ FIELD] TRUE",TRUE,10,0);
addDefaultFieldCHAR(def,"SELECT [FLDSEC][READ FIELD] FALSE",TRUE,10,1);
defdir=Rmalloc(RDAstrlen(CURRENTDIRECTORY)+RDAstrlen(module)+12);
#ifndef WIN32
sprintf(defdir,"%s/rda/%s.DEF",CURRENTDIRECTORY,module);
#endif
#ifdef WIN32
sprintf(defdir,"%s\\rda\\%s.DEF",CURRENTDIRECTORY,module);
#endif
if(writedefaultbin(defdir,def))
{
if(temp1!=NULL) Rfree(temp1);
temp1=Rmalloc(25+8+100+1);
sprintf(temp1,"SCREEN DEFAULT WRITE ERROR: Module [SECURITY] Screen [PURGEFLDSEC RANGE SCREEN], Can Not Save Screen Defaults!");
prterr(temp1);
if(errorlist!=NULL)
{
addERRlist(&errorlist,temp1);
}
if(temp1!=NULL) Rfree(temp1);
}
if(defdir!=NULL) Rfree(defdir);
if(def!=NULL) FreeRDAdefault(def);
}
}
示例7: writefileimage
void
writefileimage()
{
ssize_t iret;
if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) {
prterr("writefileimage: lseek");
report_failure(171);
}
iret = write(fd, good_buf, file_size);
if ((off_t)iret != file_size) {
if (iret == -1)
prterr("writefileimage: write");
else
prt("short write: 0x%x bytes instead of 0x%llx\n",
iret, (unsigned long long)file_size);
report_failure(172);
}
if (lite ? 0 : ftruncate(fd, file_size) == -1) {
prt("ftruncate2: %llx\n", (unsigned long long)file_size);
prterr("writefileimage: ftruncate");
report_failure(173);
}
}
示例8: main
int main(int argc,char **argv)
#endif
{
RDArsrc *mainrsrc=NULL;
int x=0;
int ret_int=0;
if(InitializeSubsystems(argc,argv,module,"MAKE GUI SCREENS"))
{
ShutdownSubsystems();
return(-1);
}
if(XPERT_SETUP==NULL)
{
prterr("ERROR: Make GUI can not load Xpert Setup, exiting abnormally");
ShutdownSubsystems();
return(-1);
}
RDAmkdir("GUI",00770,&ret_int);
RDAmkdir("pixmaps",00770,&ret_int);
RDAmkdir("html",00770,&ret_int);
RDAmkdir("cgi-bin",00770,&ret_int);
MAKE_GUI_SCREENS();
if(argc>1)
{
make_screens(argc,argv);
ShutdownSubsystems();
return(-1);
} else {
mainrsrc=RDArsrcNEW(module,"MAKE GUI SCREENS");
scnlist=makescnlist();
addlstrsrc(mainrsrc,"RESOURCE LIST",&x,TRUE,NULL,scnlist->numlibs,
&scnlist->libs,NULL);
errorlist=APPlibNEW();
addAPPlib(errorlist,"No Errors Detected");
addlstrsrc(mainrsrc,"ERROR LIST",&x,TRUE,NULL,errorlist->numlibs,
&errorlist->libs,NULL);
/*lint -e611 */
addbtnrsrc(mainrsrc,"PRINT ERROR LIST",TRUE,print_list,(void *)printerrorlistcb);
/*lint +e611 */
addbtnrsrc(mainrsrc,"SELECT ALL",TRUE,selectall,NULL);
addbtnrsrc(mainrsrc,"SELECT",TRUE,selectrpt,NULL);
addrfexrsrc(mainrsrc,"QUIT",TRUE,quitfinrpt,NULL);
addbtnrsrc(mainrsrc,"HELP",TRUE,screenhelp,NULL);
addbtnrsrc(mainrsrc,"PRINT RESOURCES",TRUE,printrsrcs,NULL);
APPmakescrn(mainrsrc,TRUE,quitfinrpt,NULL,TRUE);
}
}
示例9: do_punch_hole
void
do_punch_hole(unsigned offset, unsigned length)
{
unsigned end_offset;
int max_offset = 0;
int max_len = 0;
int mode = FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE;
if (length == 0) {
if (!quiet && testcalls > simulatedopcount)
prt("skipping zero length punch hole\n");
log4(OP_SKIPPED, OP_PUNCH_HOLE, offset, length);
return;
}
if (file_size <= (loff_t)offset) {
if (!quiet && testcalls > simulatedopcount)
prt("skipping hole punch off the end of the file\n");
log4(OP_SKIPPED, OP_PUNCH_HOLE, offset, length);
return;
}
end_offset = offset + length;
log4(OP_PUNCH_HOLE, offset, length, 0);
if (testcalls <= simulatedopcount)
return;
if ((progressinterval && testcalls % progressinterval == 0) ||
(fsx_debug && (monitorstart == -1 || monitorend == -1 ||
end_offset <= monitorend))) {
prt("%lu punch\tfrom 0x%x to 0x%x, (0x%x bytes)\n", testcalls,
offset, offset+length, length);
}
if (fallocate(fd, mode, (loff_t)offset, (loff_t)length) == -1) {
prt("%punch hole: %x to %x\n", offset, length);
prterr("do_punch_hole: fallocate");
report_failure(161);
}
max_offset = offset < file_size ? offset : file_size;
max_len = max_offset + length <= file_size ? length :
file_size - max_offset;
memset(good_buf + max_offset, '\0', max_len);
}
示例10: main
void main(int argc,char **argv)
{
short filenum=(-1);
char *module=NULL,*mtnname=NULL;
module="LVEMGT";
mtnname="MTN LVEMSTR";
if(InitializeSubsystems(argc,argv,module,mtnname))
{
RDAAPPMAINLOOP();
return;
}
MASTER=MaintainMasterNew(module,mtnname);
if(findMaintainMaster(MASTER))
{
ERRORDIALOG("MAINTAIN MASTER NOT FOUND.","The Maintain Master function wasn't found.",NULL,TRUE);
prterr("Error Maintain Master Definition not found, this process can not be executed without it's definition [%s] in the [%s.MTN] library.",mtnname,MASTER->module);
doexit(NULL);
} else {
if((filenum=APPOPNNRDEDITABLE(MASTER->module,MASTER->mainfile,&editable))==(-1))
{
doexit(NULL);
return;
}
if(!OPEN_MASTER_FILES(MASTER))
{
doexit(NULL);
return;
}
dscnum=APPReturnSupportingFileno(MASTER,MASTER->module,"LVEDSC",1);
lvetyp=APPReturnSupportingFileno(MASTER,MASTER->module,"LVETPMS",1);
MASTER->passkey=READPassKey(filenum);
MASTER->inheritrsrcs=FALSE;
switch(MASTER->start_with)
{
default:
case 0:
lvemstm(1,NULL);
break;
case 1:
browse_mst(NULL,NULL);
break;
}
}
RDAAPPMAINLOOP();
}
示例11: main
void main(int argc,char **argv)
{
short filenum=(-1);
if(InitializeSubsystems(argc,argv,"POSTRK","MTN POSPER"))
{
RDAAPPMAINLOOP();
return;
}
MASTER=MaintainMasterNew("POSTRK","MTN POSPER");
if(findMaintainMaster(MASTER))
{
ERRORDIALOG("MAINTAIN MASTER NOT FOUND.","The Maintain Master function wasn't found.",NULL,TRUE);
prterr("Error Maintain Master Definition not found, this process cannot be executed without it's definition [%s] in the [%s.MTN] library.","MTN POSPER",MASTER->module);
doexit(NULL);
} else {
if((filenum=APPOPNNRDEDITABLE(MASTER->module,MASTER->mainfile,
&editable))==(-1))
{
doexit(NULL);
return;
}
SetSupportingWritable(MASTER,"PAYROLL","PAYJMST",1,TRUE,&editable);
SetSupportingWritable(MASTER,MASTER->module,"POSMSTR",1,TRUE,&editable);
if(!OPEN_MASTER_FILES(MASTER))
{
doexit(NULL);
return;
}
jmstnum=APPReturnSupportingFileno(MASTER,"PAYROLL","PAYJMST",1);
msrnum=APPReturnSupportingFileno(MASTER,MASTER->module,"POSMSTR",1);
MASTER->passkey=READPassKey(filenum);
MASTER->inheritrsrcs=TRUE;
switch(MASTER->start_with)
{
default:
case 0:
posperm(1,NULL);
break;
case 1:
browse_posper(NULL,NULL);
break;
}
}
RDAAPPMAINLOOP();
}
示例12: DEF_MSG_GATEWAY_DEFINE_LIST
static void DEF_MSG_GATEWAY_DEFINE_LIST()
{
RDAdefault *def=NULL;
char *defdir=NULL;
char *temp1=NULL;
def=RDAdefaultNEW("UTILITIES","MSG-GATEWAY DEFINE LIST");
if(def!=NULL)
{
def->input_focus=stralloc("DEFAULTS");
addDefaultFieldINT(def,"KEY LIST",TRUE,13,0);
addDefaultFieldSHORT(def,"CARRIER POSITION",TRUE,7,1);
addDefaultFieldSHORT(def,"CARRIER LENGTH",TRUE,7,40);
addDefaultFieldSHORT(def,"TYPE POSITION",TRUE,7,0);
addDefaultFieldSHORT(def,"TYPE LENGTH",TRUE,7,0);
addDefaultFieldSHORT(def,"DELETEFLAG POSITION",TRUE,7,0);
addDefaultFieldSHORT(def,"DELETEFLAG LENGTH",TRUE,7,0);
addDefaultFieldSHORT(def,"MAIL-TO-GATEWAY FORMULA POSITION",TRUE,7,6);
addDefaultFieldSHORT(def,"MAIL-TO-GATEWAY FORMULA LENGTH",TRUE,7,80);
addDefaultFieldSHORT(def,"MSG-GATEWAY TYPE DESCRIPTION POSITION",TRUE,7,5);
addDefaultFieldSHORT(def,"MSG-GATEWAY TYPE DESCRIPTION LENGTH",TRUE,7,5);
defdir=Rmalloc(RDAstrlen(CURRENTDIRECTORY)+RDAstrlen(module)+12);
#ifndef WIN32
sprintf(defdir,"%s/rda/%s.DEF",CURRENTDIRECTORY,module);
#endif
#ifdef WIN32
sprintf(defdir,"%s\\rda\\%s.DEF",CURRENTDIRECTORY,module);
#endif
if(writedefaultbin(defdir,def))
{
if(temp1!=NULL) Rfree(temp1);
temp1=Rmalloc(23+9+100+1);
sprintf(temp1,"SCREEN DEFAULT WRITE ERROR: Module [UTILITIES] Screen [MSG-GATEWAY DEFINE LIST], Can Not Save Screen Defaults!");
prterr(temp1);
if(errorlist!=NULL)
{
addERRlist(&errorlist,temp1);
}
if(temp1!=NULL) Rfree(temp1);
}
if(defdir!=NULL) Rfree(defdir);
if(def!=NULL) FreeRDAdefault(def);
}
}
示例13: DB_MSGGATEWAY
void DB_MSGGATEWAY()
{
DBsort *sort=NULL;
short x=(-1);
char same=FALSE;
char *temp1=NULL;
sort=DBsortNEW("UTILITIES","MSG-GATEWAY",0);
if(sort!=NULL)
{
addDBfield(sort,"CARRIER",1,40);
addDBfield(sort,"TYPE",7,2);
addDBfield(sort,"DELETEFLAG",10,1);
addDBfield(sort,"MAIL-TO-GATEWAY FORMULA",14,4000);
addDBkey(sort,"MSG-GATEWAY KEY 1");
addDBkeypart(sort,1,"CARRIER");
addDBkeypart(sort,1,"TYPE");
addDBkey(sort,"MSG-GATEWAY KEY 2");
addDBkeypart(sort,2,"TYPE");
addDBkeypart(sort,2,"CARRIER");
same=CompareDATABASE(sort);
if(same==FALSE)
{
MergeDATABASE(sort);
SetupFileDefinition(sort);
x=CHANGE_DATABASE_FILE(sort->module,sort->engine,sort->filename,sort->nofields,sort->fields,sort->nokeys,sort->keys,sort->servername);
if(x==(-1))
{
if(temp1!=NULL) Rfree(temp1);
temp1=Rmalloc(11+9+77+1);
sprintf(temp1,"DATABASE FILE WRITE ERROR: Module [UTILITIES] Screen [MSG-GATEWAY], Can Not Save Database File!");
prterr(temp1);
if(errorlist!=NULL)
{
addERRlist(&errorlist,temp1);
}
if(temp1!=NULL) Rfree(temp1);
} else {
CLSNRD(x);
}
}
if(sort!=NULL) ADVFreeDBsort(sort,FALSE);
}
}
示例14: diagRfree
void diagRfree(void *tmp,int line,char *file)
{
char *adjptr;
struct Rmds *md;
checkallocdiag(line,file);
for(md=Rmd;md!=NULL;md=md->next) if((void *)md->ptr==tmp) break;
if(md==NULL)
{
prterr("Error in diagRfree freeing pointer not allocated with RDA at line [%d] program [%s].",line,file);
free(tmp);
return;
}
adjptr=(char *)tmp;
adjptr-=sizeof(unsigned);
md->ptr=NULL;
free(adjptr);
}
示例15: prterr
char *xstralloc(char *d,int line,char *file)
{
char *temp;
if(diagmisc && !diagallocx)
{
prterr("DIAG xstralloc String Allocated at line [%d] program [%s].",line,file);
}
if(isEMPTY(d)) return(NULL);
if(diagallocx && diagmisc)
{
temp=(char *)xRmalloc(RDAstrlen(d)+1,line,file);
} else {
temp=(char *)Rmalloc(RDAstrlen(d)+1);
}
strcpy(temp,d);
return(temp);
}