diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-07-01 18:03:10 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-07-06 20:28:20 +0200 |
| commit | f09e17c3c564e8310125a10c03397cbf473ff643 (patch) | |
| tree | 8d0fd4a28e3686c33aaa140d07ddba26ab28bdc2 /fluid/file.cxx | |
| parent | b0e0c355edaa2e23148cb0260ada907aec930f05 (diff) | |
Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files
- update .fl files and generated files accordingly
- replace 'http://www.fltk.org' URL's with 'https://...'
- replace bug report URL 'str.php' with 'bugs.php'
- remove trailing whitespace
- fix other whitespace errors flagged by Git
- add and/or fix missing or wrong standard headers
- convert tabs to spaces in all source files
The only relevant code changes are in the fluid/ folder where
some .fl files and other source files were used to generate
the '$Id' headers and footers.
Diffstat (limited to 'fluid/file.cxx')
| -rw-r--r-- | fluid/file.cxx | 80 |
1 files changed, 37 insertions, 43 deletions
diff --git a/fluid/file.cxx b/fluid/file.cxx index 65c4131bb..dd2ef345c 100644 --- a/fluid/file.cxx +++ b/fluid/file.cxx @@ -1,6 +1,4 @@ // -// "$Id$" -// // Fluid file routines for the Fast Light Tool Kit (FLTK). // // You may find the basic read_* and write_* routines to @@ -14,11 +12,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include <stdio.h> @@ -171,7 +169,7 @@ static int hexdigit(int x) { } -static int read_quoted() { // read whatever character is after a \ . +static int read_quoted() { // read whatever character is after a \ . int c,d,x; switch(c = fgetc(fin)) { case '\n': lineno++; return -1; @@ -182,7 +180,7 @@ static int read_quoted() { // read whatever character is after a \ . case 'r' : return('\r'); case 't' : return('\t'); case 'v' : return('\v'); - case 'x' : /* read hex */ + case 'x' : /* read hex */ for (c=x=0; x<3; x++) { int ch = fgetc(fin); d = hexdigit(ch); @@ -190,7 +188,7 @@ static int read_quoted() { // read whatever character is after a \ . c = (c<<4)+d; } break; - default: /* read octal */ + default: /* read octal */ if (c<'0' || c>'7') break; c -= '0'; for (x=0; x<2; x++) { @@ -208,9 +206,9 @@ static int read_quoted() { // read whatever character is after a \ . // This will skip all comments (# to end of line), and evaluate // all \xxx sequences and use \ at the end of line to remove the newline. // A word is any one of: -// a continuous string of non-space chars except { and } and # -// everything between matching {...} (unless wantbrace != 0) -// the characters '{' and '}' +// a continuous string of non-space chars except { and } and # +// everything between matching {...} (unless wantbrace != 0) +// the characters '{' and '}' static char *buffer; static int buflen; @@ -233,9 +231,9 @@ const char *read_word(int wantbrace) { // skip all the whitespace before it: for (;;) { x = getc(fin); - if (x < 0 && feof(fin)) { // eof + if (x < 0 && feof(fin)) { // eof return 0; - } else if (x == '#') { // comment + } else if (x == '#') { // comment do x = getc(fin); while (x >= 0 && x != '\n'); lineno++; continue; @@ -257,9 +255,9 @@ const char *read_word(int wantbrace) { x = getc(fin); if (x<0) {read_error("Missing '}'"); break;} else if (x == '#') { // embedded comment - do x = getc(fin); while (x >= 0 && x != '\n'); - lineno++; - continue; + do x = getc(fin); while (x >= 0 && x != '\n'); + lineno++; + continue; } else if (x == '\n') lineno++; else if (x == '\\') {x = read_quoted(); if (x<0) continue;} else if (x == '{') nesting++; @@ -312,7 +310,7 @@ extern const char* code_file_name; int write_file(const char *filename, int selected_only) { if (!open_write(filename)) return 0; write_string("# data file for the Fltk User Interface Designer (fluid)\n" - "version %.4f",FL_VERSION); + "version %.4f",FL_VERSION); if(!include_H_from_C) write_string("\ndo_not_include_H_from_C"); if(use_FL_COMMAND) @@ -322,11 +320,11 @@ int write_file(const char *filename, int selected_only) { write_string("\ni18n_include %s", i18n_include); switch (i18n_type) { case 1 : /* GNU gettext */ - write_string("\ni18n_function %s", i18n_function); + write_string("\ni18n_function %s", i18n_function); break; case 2 : /* POSIX catgets */ if (i18n_file[0]) write_string("\ni18n_file %s", i18n_file); - write_string("\ni18n_set %s", i18n_set); + write_string("\ni18n_set %s", i18n_set); break; } } @@ -487,7 +485,7 @@ static void read_children(Fl_Type *p, int paste) { } Fl_Type::current = p; - + CONTINUE:; } } @@ -612,35 +610,31 @@ void read_fdesign() { } else if (!strcmp(name,"class")) { if (!strcmp(value,"FL_BEGIN_GROUP")) { - group = widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Group"); - Fl_Type::current = group; + group = widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Group"); + Fl_Type::current = group; } else if (!strcmp(value,"FL_END_GROUP")) { - if (group) { - Fl_Group* g = (Fl_Group*)(group->o); - g->begin(); - g->forms_end(); - Fl_Group::current(0); - } - group = widget = 0; - Fl_Type::current = window; + if (group) { + Fl_Group* g = (Fl_Group*)(group->o); + g->begin(); + g->forms_end(); + Fl_Group::current(0); + } + group = widget = 0; + Fl_Type::current = window; } else { - for (int i = 0; class_matcher[i]; i += 2) - if (!strcmp(value,class_matcher[i])) { - value = class_matcher[i+1]; break;} - widget = (Fl_Widget_Type*)Fl_Type_make(value); - if (!widget) { - printf("class %s not found, using Fl_Button\n", value); - widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Button"); - } + for (int i = 0; class_matcher[i]; i += 2) + if (!strcmp(value,class_matcher[i])) { + value = class_matcher[i+1]; break;} + widget = (Fl_Widget_Type*)Fl_Type_make(value); + if (!widget) { + printf("class %s not found, using Fl_Button\n", value); + widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Button"); + } } } else if (widget) { if (!widget->read_fdesign(name, value)) - printf("Ignoring \"%s: %s\"\n", name, value); + printf("Ignoring \"%s: %s\"\n", name, value); } } } - -// -// End of "$Id$". -// |
