Bug fixes where I was getting the value from the input field instead of

the global pointer (caused random crashes.)

Now default to no file variable for catgets() mode, and declare and
initialize (as needed) a static _catalog variable when a global file
variable is not provided.  The catalog name is the basename of the
fluid file (no .fl)...


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1084 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet
2000-04-25 01:57:51 +00:00
parent aa102a4595
commit 9e3610c75f
7 changed files with 45 additions and 26 deletions
+12 -10
View File
@@ -1,5 +1,5 @@
//
// "$Id: code.cxx,v 1.9.2.4 2000/04/24 18:22:50 mike Exp $"
// "$Id: code.cxx,v 1.9.2.5 2000/04/25 01:57:51 mike Exp $"
//
// Code output routines for the Fast Light Tool Kit (FLTK).
//
@@ -285,14 +285,16 @@ int write_code(const char *s, const char *t) {
}
write_declare("#include <FL/Fl.H>");
if (i18n_type && i18n_include_input->value()[0]) {
if (i18n_include_input->value()[0] != '<' &&
i18n_include_input->value()[0] != '\"')
write_c("#include \"%s\"\n", i18n_include_input->value());
if (i18n_type && i18n_include[0]) {
if (i18n_include[0] != '<' &&
i18n_include[0] != '\"')
write_c("#include \"%s\"\n", i18n_include);
else
write_c("#include %s\n", i18n_include_input->value());
if (i18n_type == 2)
write_c("extern nl_catd %s;\n", i18n_file_input->value());
write_c("#include %s\n", i18n_include);
if (i18n_type == 2) {
if (i18n_file[0]) write_c("extern nl_catd %s;\n", i18n_file);
else write_c("static nl_catd _catalog = (nl_catd)-1;\n");
}
}
if (t && include_H_from_C)
write_c("#include \"%s\"\n", filename_name(t));
@@ -367,7 +369,7 @@ int write_strings(const char *sfile) {
msgnum = 1;
fprintf(fp, "$ generated by Fast Light User Interface Designer (fluid) version %.4f\n",
FL_VERSION);
fprintf(fp, "$set %s\n", i18n_set_input->value());
fprintf(fp, "$set %s\n", i18n_set);
fputs("$quote \"\n", fp);
for (p = Fl_Type::first; p; p = p->next) {
@@ -397,5 +399,5 @@ void Fl_Type::write_code1() {
void Fl_Type::write_code2() {}
//
// End of "$Id: code.cxx,v 1.9.2.4 2000/04/24 18:22:50 mike Exp $".
// End of "$Id: code.cxx,v 1.9.2.5 2000/04/25 01:57:51 mike Exp $".
//