Commit d478d4eb authored by Thomas Schmitt's avatar Thomas Schmitt

Rough test for compile time and run time libxorriso version mismatches

parent 794fd96f
......@@ -71,6 +71,27 @@ or
*/
#ifdef Xorriso_without_subS
#include <ctype.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <locale.h>
/* The official xorriso options API. "No shortcuts" */
#include "xorriso.h"
#else /* Xorriso_without_subS */
#include <ctype.h>
#include <sys/types.h>
......@@ -142,9 +163,6 @@ or
/* ------------------------------------------------------------------------ */
#ifndef Xorriso_without_subS
#ifndef Xorriso_sfile_externaL
/* @param flag bit0= do not clip of carriage return at line end
*/
......@@ -19897,6 +19915,8 @@ int Xorriso_dialog(struct XorrisO *xorriso, int flag)
int ret,first_round;
char line[2*SfileadrL];
if(!xorriso->dialog)
return(1);
xorriso->is_dialog= 1;
for(first_round= 1;1;first_round= 0) {
if(xorriso->pending_option[0]!=0) {
......@@ -19924,7 +19944,7 @@ int Xorriso_dialog(struct XorrisO *xorriso, int flag)
if(ret<0)
goto ex;
if(ret==3)
break;
goto ex;
xorriso->did_something_useful= 1;
xorriso->no_volset_present= 0; /* Re-enable "No ISO image present." */
}
......@@ -20067,11 +20087,12 @@ ex:;
}
/** Load content startup files into preskin cache */
int Xorriso_read_rc(struct XorrisO *xorriso, int flag)
{
int ret,i,was_failure= 0,fret;
if(xorriso->no_rc)
return(1);
i= xorriso->rc_filename_count-1;
Sfile_home_adr_s(".xorrisorc", xorriso->rc_filenames[i],
sizeof(xorriso->rc_filenames[i]),0);
......@@ -20110,35 +20131,74 @@ int Xorriso_make_return_value(struct XorrisO *xorriso, int flag)
return(exit_value);
}
int Xorriso_program_arg_bsl(struct XorrisO *xorriso, int argc, char ***argv,
int flag)
{
int ret;
if(!(xorriso->bsl_interpretation & 16))
return(1);
ret= Sfile_argv_bsl(argc, argv, 0);
return(ret);
}
char *Xorriso__get_version_text(int flag)
{
return(Xorriso_program_versioN);
}
#endif /* ! Xorriso_without_subS */
#ifdef Xorriso_with_maiN
int main(int argc, char **argv)
{
#else
#define Xorriso_main_program_versioN "0.3.9"
int Xorriso_main(int argc, char **argv)
static int yell_xorriso()
{
fprintf(stderr,
"xorriso %s : RockRidge filesystem manipulator, libburnia project.\n\n",
Xorriso_main_program_versioN);
return(1);
}
#endif /* Xorriso_with_maiN */
int ret,i;
int main(int argc, char **argv)
{
int ret, i;
struct XorrisO *xorriso= NULL;
if(argc<2) {
if(strcmp(Xorriso_main_program_versioN, Xorriso_program_versioN)) {
yell_xorriso();
fprintf(stderr,
"xorriso %s : RockRidge filesystem manipulator, libburnia project.\n\n",
Xorriso_program_versioN);
fprintf(stderr,"usage : %s [options]\n",
argv[0]);
fprintf(stderr," More is told by option -help\n");
"xorriso : FATAL : libxorriso compile time version mismatch. Found %s\n\n",
Xorriso_program_versioN);
exit(4);
}
if(strcmp(Xorriso_program_versioN, Xorriso__get_version_text(0))) {
yell_xorriso();
fprintf(stderr,
"xorriso : FATAL : libxorriso runtime version mismatch. Found %s\n\n",
Xorriso__get_version_text(0));
exit(4);
}
if(argc < 2) {
yell_xorriso();
fprintf(stderr,"usage : %s [options]\n", argv[0]);
fprintf(stderr, " More is told by option -help\n");
exit(2);
}
setlocale(LC_CTYPE, "");
ret= Xorriso_new(&xorriso,argv[0],0);
if(ret<=0) {
ret= Xorriso_new(&xorriso, argv[0], 0);
if(ret <= 0) {
fprintf(stderr,"Creation of XorrisO object failed. (not enough memory ?)\n");
exit(3);
}
......@@ -20147,43 +20207,40 @@ int Xorriso_main(int argc, char **argv)
the normal processing of startup files and arguments.
*/
ret= Xorriso_prescan_args(xorriso,argc,argv,0);
if(ret==0)
if(ret == 0)
goto end_sucessfully;
if(ret<0)
if(ret < 0)
exit(5);
fprintf(stderr,
"xorriso %s : RockRidge filesystem manipulator, libburnia project.\n\n",
Xorriso_program_versioN);
yell_xorriso();
ret= Xorriso_startup_libraries(xorriso, 0);
if(ret<=0)
if(ret <= 0)
exit(4);
Xorriso_process_msg_queues(xorriso, 0);
/* Interpret startup file */
if(!xorriso->no_rc) {
ret= Xorriso_read_rc(xorriso, 0);
if(ret==3)
goto end_sucessfully;
if(ret<=0)
exit(5);
}
ret= Xorriso_read_rc(xorriso, 0);
if(ret == 3)
goto end_sucessfully;
if(ret <= 0)
exit(5);
/* Interpret program arguments */
if(xorriso->bsl_interpretation & 16)
Sfile_argv_bsl(argc, &argv, 0); /* apply Sfile_bsl_interpreter() to args */
ret= Xorriso_program_arg_bsl(xorriso, argc, &argv, 0);
if(ret <= 0)
exit(5);
i= 1;
ret= Xorriso_interpreter(xorriso,argc,argv,&i,2);
if(ret==3)
ret= Xorriso_interpreter(xorriso, argc, argv, &i, 2);
if(ret == 3)
goto end_sucessfully;
if(ret<=0)
if(ret <= 0)
exit(5);
if(xorriso->dialog) {
ret= Xorriso_dialog(xorriso,0);
if(ret<=0)
exit(6);
}
ret= Xorriso_dialog(xorriso, 0);
if(ret <= 0)
exit(6);
end_sucessfully:;
Xorriso_process_msg_queues(xorriso, 0);
if(Xorriso_change_is_pending(xorriso, 0))
......@@ -20191,7 +20248,10 @@ end_sucessfully:;
Xorriso_process_msg_queues(xorriso, 0);
ret= Xorriso_make_return_value(xorriso, 0);
Xorriso_process_errfile(xorriso, 0, "xorriso end", 0, 1);
Xorriso_destroy(&xorriso,1);
Xorriso_destroy(&xorriso, 1);
exit(ret);
}
#endif /* Xorriso_with_maiN */
......@@ -16,6 +16,9 @@
struct XorrisO;
#define Xorriso_program_versioN "0.3.9"
/* --------------------- Fundamental Management ------------------- */
......
......@@ -18,8 +18,6 @@
#ifndef Xorriso_private_includeD
#define Xorriso_private_includeD yes
#define Xorriso_program_versioN "0.3.9"
/** The source code release timestamp */
#include "xorriso_timestamp.h"
#ifndef Xorriso_timestamP
......
#define Xorriso_timestamP "2009.06.23.123147"
#define Xorriso_timestamP "2009.06.23.133210"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment