summaryrefslogtreecommitdiff
path: root/src/FYBA/FYLI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/FYBA/FYLI.cpp')
-rw-r--r--src/FYBA/FYLI.cpp69
1 files changed, 46 insertions, 23 deletions
diff --git a/src/FYBA/FYLI.cpp b/src/FYBA/FYLI.cpp
index 5814574..bbc169f 100644
--- a/src/FYBA/FYLI.cpp
+++ b/src/FYBA/FYLI.cpp
@@ -151,7 +151,8 @@ short LI_OpenInit(LC_FILADM *pFil)
if (fil[strlen(fil)-1] == ' ')
{
LC_Error(120,"(LI_OpenInit)",pFil->pszNavn);
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return 0;
}
// Opprett katalogen
@@ -173,7 +174,8 @@ short LI_OpenInit(LC_FILADM *pFil)
if (fwrite(pFil,sizeof(*pFil),1,pF) != 1) {
LC_Error(112,"(LI_OpenInit)","");
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return 0;
}
fclose(pF);
@@ -260,7 +262,8 @@ short LI_OpenRead(LC_FILADM *pFil)
if (fread(pGrt,sizeof(*pGrt),1,pF) != 1) { /* Les */
UT_SNPRINTF(err().tx,LC_ERR_LEN," %s : %ld",pFil->pszNavn,linje);
LC_Error(111,"(LI_OpenRead): ",err().tx);
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return 0;
}
}
fclose(pF);
@@ -275,7 +278,8 @@ short LI_OpenRead(LC_FILADM *pFil)
if (! feof(pF)) {
UT_SNPRINTF(err().tx,LC_ERR_LEN," %ld",lSnr);
LC_Error(111,"(LI_OpenRead): ",err().tx);
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return 0;
}
fclose(pF);
@@ -286,7 +290,8 @@ short LI_OpenRead(LC_FILADM *pFil)
if (fread(&bt,sizeof(bt),1,pF) != 1) { /* Les */
UT_SNPRINTF(err().tx,LC_ERR_LEN," %s : %ld",pFil->pszNavn,linje);
LC_Error(111,"(LI_OpenRead): ",err().tx);
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return 0;
}
LI_PutBt(pFil,linje,bt);
}
@@ -298,7 +303,8 @@ short LI_OpenRead(LC_FILADM *pFil)
if (fread(&Boks,sizeof(Boks),1,pF) != 1) { /* Les */
UT_SNPRINTF(err().tx,LC_ERR_LEN," %s : %ld",pFil->pszNavn,linje);
LC_Error(111,"(LI_OpenRead): ",err().tx);
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return 0;
}
if (Boks.dMaxAust != (double)LONG_MAX) {
@@ -440,7 +446,8 @@ void LI_Close(LC_FILADM *pFil,short s_stat)
for (lGrNr=0; lGrNr<pFil->lAntGr; lGrNr++) {
if (fwrite(LI_GetGrt(pFil,lGrNr),sizeof (LC_GRTAB_LINJE),1,pF) != 1) {
LC_Error(112,"(LI_Close)","");
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return;
}
}
fclose(pF);
@@ -451,7 +458,8 @@ void LI_Close(LC_FILADM *pFil,short s_stat)
flag = LI_GetBt(pFil,lGrNr);
if (fwrite(&flag,sizeof flag,1,pF) != 1) {
LC_Error(112,"(LI_Close)","");
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return;
}
}
fclose(pF);
@@ -462,7 +470,8 @@ void LI_Close(LC_FILADM *pFil,short s_stat)
lGrNr = LI_GetSnr(pFil,lSnr);
if (fwrite(&lGrNr,sizeof lGrNr,1,pF) != 1) {
LC_Error(112,"(LI_Close)","");
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return;
}
}
fclose(pF);
@@ -476,13 +485,15 @@ void LI_Close(LC_FILADM *pFil,short s_stat)
Boks.dMaxAust = (double)LONG_MAX;
if (fwrite(&Boks,sizeof (LC_BOKS),1,pF) != 1) {
LC_Error(112,"(LI_Close)","");
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return;
}
} else {
if (fwrite(&(pRL->Boks),sizeof (LC_BOKS),1,pF) != 1) {
LC_Error(112,"(LI_Close)","");
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return;
}
}
}
@@ -557,7 +568,8 @@ static FILE *LI_OpenIdxFil(LC_FILADM *pFil, const char *pszNavn, const char *psz
UT_strerror(szError,256,ierr);
UT_SNPRINTF(err().tx,LC_ERR_LEN," %s - %s",fil,szError);
LC_Error(6,"(LI_OpenIdxFil)",err().tx);
- exit(2);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return 0;
}
/* Posisjoner hvis nødvendig */
@@ -804,12 +816,14 @@ void LI_PutSnr(LC_FILADM *pFil,long lSnr,long lGrNr)
} else {
UT_SNPRINTF(err().tx,LC_ERR_LEN,"%ld",lSnr);
LC_Error(61,"(LI_PutSnr): ",err().tx);
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return;
}
} else {
LC_Error(75,"(LI_PutSnr): ","");
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return;
}
}
}
@@ -849,7 +863,8 @@ LC_GRTAB_LINJE * LI_GetGrt(LC_FILADM *pFil,long linje)
UT_SNPRINTF(err().tx,LC_ERR_LEN," %s : %ld",pFil->pszNavn,linje);
LC_Error(111,"(LI_GetGrt): ",err().tx);
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return 0;
return NULL;
}
@@ -891,7 +906,8 @@ LC_GRTAB_LINJE * LI_AppGrt(LC_FILADM *pFil,long linje)
} else {
LC_Error(75,"(LI_PutGrt): ",err().tx);
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return 0;
}
return NULL;
@@ -932,7 +948,8 @@ unsigned long LI_GetBt(LC_FILADM *pFil,long linje)
UT_SNPRINTF(err().tx,LC_ERR_LEN," %s : %ld",pFil->pszNavn,linje);
LC_Error(111,"(LI_GetBt): ",err().tx);
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return 0;
return 0L;
}
@@ -976,7 +993,8 @@ void LI_PutBt(LC_FILADM *pFil,long linje,unsigned long bt_val)
} else {
LC_Error(75,"(LI_PutBt): ",err().tx);
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return;
}
}
@@ -1398,7 +1416,8 @@ void LI_SaveAdm(LC_FILADM *pFil)
pFil->ulPid = 0;
if (fwrite(pFil,sizeof(*pFil),1,pF) != 1) {
LC_Error(112,"(LI_SaveAdm)","");
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return;
}
fclose(pF);
@@ -1547,7 +1566,8 @@ static short LI_ReadAdm(LC_FILADM *pFil)
if (fwrite(pFil,sizeof(*pFil),1,pF) != 1)
{
LC_Error(112,"(LI_ReadAdm)","");
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return 0;
}
// Stenger filen
@@ -1631,7 +1651,8 @@ void LI_WriteRb(LC_FILADM *pFil, UT_INT64 n64FilPos,
if (sSkrivefeil == UT_TRUE) {
UT_SNPRINTF(err().tx,LC_ERR_LEN," %s : %lld",pFil->pszNavn,n64FilPos);
LC_Error(74,"(LI_WriteRb): ",err().tx);
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return;
}
pFil->pBase->n64FilPosRb = _ftelli64(pF);
@@ -1727,7 +1748,8 @@ void LI_ReadRb(LC_FILADM *pFil, UT_INT64 n64FilPos,
UT_SNPRINTF(err().tx,LC_ERR_LEN," %s : %lld",pFil->pszNavn,n64FilPos);
LC_Error(73,"(LI_ReadRb): ",err().tx);
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return;
}
pFil->pBase->n64FilPosRb = _ftelli64(pF);
@@ -1799,7 +1821,8 @@ void LI_ReadCoordRb(LC_FILADM *pFil, UT_INT64 n64FilPos, unsigned long ulGiLen,
if (sLesefeil == UT_TRUE) {
UT_SNPRINTF(err().tx,LC_ERR_LEN," %s : %lld",pFil->pszNavn,n64FilPos);
LC_Error(73,"(LI_ReadCoordRb): ",err().tx);
- exit(99);
+ fprintf(stderr,"Error: The library used to stop the program execution here\n");
+ return;
}
pFil->pBase->n64FilPosRb = _ftelli64(pF);