Fixed FLUID bug - can now override code and header file names from the

command-line properly.


git-svn-id: file:///fltk/svn/fltk/trunk@360 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 1999-03-04 18:10:01 +00:00
parent 516ed80d97
commit 2f0f075d4f
2 changed files with 24 additions and 10 deletions

View File

@ -1,5 +1,5 @@
//
// "$Id: file.cxx,v 1.6 1999/01/07 19:17:13 mike Exp $"
// "$Id: file.cxx,v 1.7 1999/03/04 18:10:00 mike Exp $"
//
// Fluid file routines for the Fast Light Tool Kit (FLTK).
//
@ -311,6 +311,9 @@ static struct {const char* name; int* value;} inttable[] = {
{"snap", &snap}
};
extern int header_file_set;
extern int code_file_set;
extern const char* header_file_name;
extern const char* code_file_name;
@ -393,12 +396,14 @@ static void read_children(Fl_Type *p, int paste) {
goto CONTINUE;
}
if (!strcmp(c,"header_name")) {
header_file_name = strdup(read_word());
if (!header_file_set) header_file_name = strdup(read_word());
else read_word();
goto CONTINUE;
}
if (!strcmp(c,"code_name")) {
code_file_name = strdup(read_word());
if (!code_file_set) code_file_name = strdup(read_word());
else read_word();
goto CONTINUE;
}
@ -587,5 +592,5 @@ void read_fdesign() {
}
//
// End of "$Id: file.cxx,v 1.6 1999/01/07 19:17:13 mike Exp $".
// End of "$Id: file.cxx,v 1.7 1999/03/04 18:10:00 mike Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: fluid.cxx,v 1.13 1999/01/26 21:40:28 mike Exp $"
// "$Id: fluid.cxx,v 1.14 1999/03/04 18:10:01 mike Exp $"
//
// FLUID main entry for the Fast Light Tool Kit (FLTK).
//
@ -148,8 +148,9 @@ void new_cb(Fl_Widget *, void *v) {
modflag = 0;
}
static int compile_only;
static int compile_only = 0;
int header_file_set = 0;
int code_file_set = 0;
const char* header_file_name = ".h";
const char* code_file_name = ".cxx";
@ -347,9 +348,17 @@ void set_filename(const char *c) {
static int arg(int argc, char** argv, int& i) {
if (argv[i][1] == 'c' && !argv[i][2]) {compile_only = 1; i++; return 1;}
if (argv[i][1] == 'o' && !argv[i][2] && i+1 < argc) {
code_file_name = argv[i+1]; i += 2; return 2;}
code_file_name = argv[i+1];
code_file_set = 1;
i += 2;
return 2;
}
if (argv[i][1] == 'h' && !argv[i][2]) {
header_file_name = argv[i+1]; i += 2; return 2;}
header_file_name = argv[i+1];
header_file_set = 1;
i += 2;
return 2;
}
return 0;
}
@ -407,5 +416,5 @@ int main(int argc,char **argv) {
}
//
// End of "$Id: fluid.cxx,v 1.13 1999/01/26 21:40:28 mike Exp $".
// End of "$Id: fluid.cxx,v 1.14 1999/03/04 18:10:01 mike Exp $".
//