Rough test for compile time and run time libxorriso version mismatches

This commit is contained in:
Thomas Schmitt 2009-06-23 13:31:46 +00:00
parent 86cfd2e967
commit cbc30b11b1
4 changed files with 110 additions and 49 deletions

View File

@ -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 <ctype.h>
#include <sys/types.h> #include <sys/types.h>
@ -142,9 +163,6 @@ or
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
#ifndef Xorriso_without_subS
#ifndef Xorriso_sfile_externaL #ifndef Xorriso_sfile_externaL
/* @param flag bit0= do not clip of carriage return at line end /* @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; int ret,first_round;
char line[2*SfileadrL]; char line[2*SfileadrL];
if(!xorriso->dialog)
return(1);
xorriso->is_dialog= 1; xorriso->is_dialog= 1;
for(first_round= 1;1;first_round= 0) { for(first_round= 1;1;first_round= 0) {
if(xorriso->pending_option[0]!=0) { if(xorriso->pending_option[0]!=0) {
@ -19924,7 +19944,7 @@ int Xorriso_dialog(struct XorrisO *xorriso, int flag)
if(ret<0) if(ret<0)
goto ex; goto ex;
if(ret==3) if(ret==3)
break; goto ex;
xorriso->did_something_useful= 1; xorriso->did_something_useful= 1;
xorriso->no_volset_present= 0; /* Re-enable "No ISO image present." */ 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 Xorriso_read_rc(struct XorrisO *xorriso, int flag)
{ {
int ret,i,was_failure= 0,fret; int ret,i,was_failure= 0,fret;
if(xorriso->no_rc)
return(1);
i= xorriso->rc_filename_count-1; i= xorriso->rc_filename_count-1;
Sfile_home_adr_s(".xorrisorc", xorriso->rc_filenames[i], Sfile_home_adr_s(".xorrisorc", xorriso->rc_filenames[i],
sizeof(xorriso->rc_filenames[i]),0); sizeof(xorriso->rc_filenames[i]),0);
@ -20110,35 +20131,74 @@ int Xorriso_make_return_value(struct XorrisO *xorriso, int flag)
return(exit_value); 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 */ #endif /* ! Xorriso_without_subS */
#ifdef Xorriso_with_maiN #ifdef Xorriso_with_maiN
#define Xorriso_main_program_versioN "0.3.9"
static int yell_xorriso()
{
fprintf(stderr,
"xorriso %s : RockRidge filesystem manipulator, libburnia project.\n\n",
Xorriso_main_program_versioN);
return(1);
}
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int ret, i;
#else
int Xorriso_main(int argc, char **argv)
{
#endif /* Xorriso_with_maiN */
int ret,i;
struct XorrisO *xorriso= NULL; struct XorrisO *xorriso= NULL;
if(argc<2) { if(strcmp(Xorriso_main_program_versioN, Xorriso_program_versioN)) {
yell_xorriso();
fprintf(stderr, fprintf(stderr,
"xorriso %s : RockRidge filesystem manipulator, libburnia project.\n\n", "xorriso : FATAL : libxorriso compile time version mismatch. Found %s\n\n",
Xorriso_program_versioN); Xorriso_program_versioN);
fprintf(stderr,"usage : %s [options]\n", exit(4);
argv[0]); }
fprintf(stderr," More is told by option -help\n"); 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); exit(2);
} }
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");
ret= Xorriso_new(&xorriso,argv[0],0); ret= Xorriso_new(&xorriso, argv[0], 0);
if(ret<=0) { if(ret <= 0) {
fprintf(stderr,"Creation of XorrisO object failed. (not enough memory ?)\n"); fprintf(stderr,"Creation of XorrisO object failed. (not enough memory ?)\n");
exit(3); exit(3);
} }
@ -20147,43 +20207,40 @@ int Xorriso_main(int argc, char **argv)
the normal processing of startup files and arguments. the normal processing of startup files and arguments.
*/ */
ret= Xorriso_prescan_args(xorriso,argc,argv,0); ret= Xorriso_prescan_args(xorriso,argc,argv,0);
if(ret==0) if(ret == 0)
goto end_sucessfully; goto end_sucessfully;
if(ret<0) if(ret < 0)
exit(5); exit(5);
fprintf(stderr, yell_xorriso();
"xorriso %s : RockRidge filesystem manipulator, libburnia project.\n\n",
Xorriso_program_versioN);
ret= Xorriso_startup_libraries(xorriso, 0); ret= Xorriso_startup_libraries(xorriso, 0);
if(ret<=0) if(ret <= 0)
exit(4); exit(4);
Xorriso_process_msg_queues(xorriso, 0); Xorriso_process_msg_queues(xorriso, 0);
/* Interpret startup file */ /* Interpret startup file */
if(!xorriso->no_rc) { ret= Xorriso_read_rc(xorriso, 0);
ret= Xorriso_read_rc(xorriso, 0); if(ret == 3)
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 */
i= 1;
ret= Xorriso_interpreter(xorriso,argc,argv,&i,2);
if(ret==3)
goto end_sucessfully; goto end_sucessfully;
if(ret<=0) if(ret <= 0)
exit(5); exit(5);
if(xorriso->dialog) { /* Interpret program arguments */
ret= Xorriso_dialog(xorriso,0); ret= Xorriso_program_arg_bsl(xorriso, argc, &argv, 0);
if(ret<=0) if(ret <= 0)
exit(6); exit(5);
} i= 1;
ret= Xorriso_interpreter(xorriso, argc, argv, &i, 2);
if(ret == 3)
goto end_sucessfully;
if(ret <= 0)
exit(5);
ret= Xorriso_dialog(xorriso, 0);
if(ret <= 0)
exit(6);
end_sucessfully:; end_sucessfully:;
Xorriso_process_msg_queues(xorriso, 0); Xorriso_process_msg_queues(xorriso, 0);
if(Xorriso_change_is_pending(xorriso, 0)) if(Xorriso_change_is_pending(xorriso, 0))
@ -20191,7 +20248,10 @@ end_sucessfully:;
Xorriso_process_msg_queues(xorriso, 0); Xorriso_process_msg_queues(xorriso, 0);
ret= Xorriso_make_return_value(xorriso, 0); ret= Xorriso_make_return_value(xorriso, 0);
Xorriso_process_errfile(xorriso, 0, "xorriso end", 0, 1); Xorriso_process_errfile(xorriso, 0, "xorriso end", 0, 1);
Xorriso_destroy(&xorriso,1); Xorriso_destroy(&xorriso, 1);
exit(ret); exit(ret);
} }
#endif /* Xorriso_with_maiN */

View File

@ -16,6 +16,9 @@
struct XorrisO; struct XorrisO;
#define Xorriso_program_versioN "0.3.9"
/* --------------------- Fundamental Management ------------------- */ /* --------------------- Fundamental Management ------------------- */

View File

@ -18,8 +18,6 @@
#ifndef Xorriso_private_includeD #ifndef Xorriso_private_includeD
#define Xorriso_private_includeD yes #define Xorriso_private_includeD yes
#define Xorriso_program_versioN "0.3.9"
/** The source code release timestamp */ /** The source code release timestamp */
#include "xorriso_timestamp.h" #include "xorriso_timestamp.h"
#ifndef Xorriso_timestamP #ifndef Xorriso_timestamP

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.06.23.123147" #define Xorriso_timestamP "2009.06.23.133210"