Skip to content

Commit

Permalink
Fixed FLUID bug - can now override code and header file names from the
Browse files Browse the repository at this point in the history
command-line properly.


git-svn-id: file:///fltk/svn/fltk/trunk@360 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Mar 4, 1999
1 parent 516ed80 commit 2f0f075
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
13 changes: 9 additions & 4 deletions fluid/file.cxx
@@ -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).
//
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 $".
//
21 changes: 15 additions & 6 deletions fluid/fluid.cxx
@@ -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).
//
Expand Down Expand Up @@ -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";

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 $".
//

0 comments on commit 2f0f075

Please sign in to comment.