diff --git a/INSTALL b/INSTALL index 0fb5790..817ebc4 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1,14 @@ The new build system uses CMake (http://www.cmake.org). It handles all platform differences. +Once all prerequisites are in place, you should be able to build teapot via +``` +mkdir build +cd build +cmake .. +make +``` + In addition to the information in the README.md file on prerequisites, here are some additional guidelines: diff --git a/src/common/wk1.h b/src/common/wk1.h index e2b89e6..5031c04 100644 --- a/src/common/wk1.h +++ b/src/common/wk1.h @@ -1,5 +1,6 @@ #ifndef WK1_H #define WK1_H +/* Functions for reading Lotus 1-2-3 file format. */ #include "sheet.h" diff --git a/src/common/xdr.c b/src/common/xdr.c index 3d0b180..cc94f5c 100644 --- a/src/common/xdr.c +++ b/src/common/xdr.c @@ -1,5 +1,7 @@ /* Notes */ /*{{{C}}}*//*{{{*/ /* +This file contains code to read the legacy binary XDR format for +spreadsheet files, typically written in files with the .tp extension. xdr_enum() is unusable, because enum_t may have a different size than an enum. The construction diff --git a/src/common/xdr.h b/src/common/xdr.h index 1d6199c..2738081 100644 --- a/src/common/xdr.h +++ b/src/common/xdr.h @@ -1,5 +1,6 @@ #ifndef XDR_H #define XDR_H +/* Functions used for reading the legacy XDR binary file format */ /* Thanks to curses. */ #if 0 diff --git a/src/fteapot.fl b/src/fteapot.fl index 3a6bbd3..78f2a8b 100644 --- a/src/fteapot.fl +++ b/src/fteapot.fl @@ -78,6 +78,12 @@ class TeapotTable {open : {public Fl_Table}} {draw_cell(TableContext context, int R, int C, int xx, int yy, int W, int H)} {open return_type void} {code { + // Fl_Table calls this function to draw each visible cell in the table. + // context specifies what part of the table is being drawn; + // R and C give the row and column of the cell in the table; + // xx and yy give the screen coordinates where the cell is to be drawn; + // and W and H give the width and height of the rectangle into which to + // draw. char s[1024]; if (debug_level > 2) printf("DRAW: %i @%i,%i - (%i,%i) %ix%i\\n", @@ -167,13 +173,14 @@ class TeapotTable {open : {public Fl_Table}} if (sc.italic) cellfont |= FL_ITALIC; fl_font(cellfont, 14); - size_t len = printvalue(s, sizeof(s), 0, quote, sc.fform, - sc.precision, cursheet, test); - size_t nlen = len; + size_t ulen = printvalue(s, sizeof(s), 0, quote, sc.fform, + sc.precision, cursheet, test); + ptrdiff_t len = ulen; + ptrdiff_t nlen = len; int ww = 0, hh = 0; fl_measure(s, ww, hh, 0); while (ww > W-6) { - char *dc = mbspos(s+nlen-1, -1); + char *dc = mbspos(s+nlen, -1); nlen = dc - s; s[nlen] = (char)0; ww = 0;