1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465
|
Change log
1.39
Martin Michlmayr noticed a typo that upsets gcc 4.1, though earlier
versions don't even generate a warning (Grrrr). (Original report at
<http://bugs.debian.org/357184>.) This is fixed. I didn't issue a new
FreeBSD port, because it doesn't change anything functionally. I also
cleaned up the man page a bit, and Tobias Toedter fixed a couple typos in the
man page and the README file. Always troubling to misspell the inventor's
name.
1.38
Michail Vidiassov suggests that a DESTDIR variable be added to the
Makefile to allow staged installs or temporary installs or other stuff.
Setting DESTDIR when making install or deinstall will create a tree
under DESTDIR that contains the full grap install. E.g.,
make DESTDIR=/usr/tmp install
Does something like:
/usr/bin/install -c -d /usr/tmp/usr/local/share/doc/grap || true
/usr/bin/install -c -m 644 README CHANGES COPYRIGHT grap.man
/usr/tmp/usr/local/share/doc/grap
strip grap || true
/usr/bin/install -c -d /usr/tmp/usr/local/bin || true
/usr/bin/install -c -d /usr/tmp/usr/local/man/man1 || true
/usr/bin/install -c -d /usr/tmp/usr/local/share/grap || true
/usr/bin/install -c -d /usr/tmp/usr/local/share/examples/grap || true
/usr/bin/install -c grap /usr/tmp/usr/local/bin
/usr/bin/install -c -m 644 grap.1 /usr/tmp/usr/local/man/man1
/usr/bin/install -c -m 644 grap*.defines /usr/tmp/usr/local/share/grap
/usr/bin/install -c -m 644 examples/*.d examples/example.ms \
examples/*.result examples/Makefile \
/usr/tmp/usr/local/share/examples/grap
There is a possibility of munging the manpage by doing this, but that's
actually pretty difficult, and the modifications below to print install
locations will still print the original (that is DESTDIR-free) install
locations.
Warner Lemberg found a bunch of bad typesetting in the examples, and I
hope much of that is fixed. He also pointed out that configure should
allow installers to place documentation and examples where their system
likes them. I've altered the configuration script to accept these
locations as --with arguments (--help lists them). grap -v or grap -h
(or the long versions: grap --version/grap --help) prints out the
examples/documentation locations and that new behavior is documented in
the manual page. (The locations aren't directly given in the man page,
because the ASCII and postscript versions of the manual are created
before the source tar file is so that grap man pages can be installed
places that don't have doc manual pages).
Fixed a bug where lines acquired the lindescription of the last drawn line.
This was a typo level error that just never got exercised. Thanks to Steve
Blinkhorn for finding it. Steve also points out that thickness
attributes on frames were being ignored. They're not anymore, but
they're of limited usefulness and they don't thicken the ticks. The
easiest way to draw a thick frame with thick ticks is:
.G1
pic linethick=5
frame
.\" ticks statement here
pic linethick=1
draw solid bullet
next at 1,2
next at 3,4
.G2
That draws a thick frame and thin line.
I integrated some changes suggested by Hartmut Henkel to better handle graphing
small numbers. I didn't include his patch exactly, but I think that most of
the functionality has been added. His test cases look the same. If you're
graphing things in the 1e-30 range, you should see autoscaling and not have
your graph stop at 1e-6, assuming that your compiler has <limits>. I really
think it's a bad idea to graph in that domain, as the math with numbers that
small can be really hairy, and grap isn't exactly tuned for numerical analysis.
But I think we do better now.
1.37
Fixed an error handling bug where an error at end of file/line could cause a
core dump. Yuk.
1.36
Joel M. Cook pointed out that
plot "\(bu" at 0, -306
didn't work. grap was requiring a numeric expression before the format
string. I think I've had that discussion before, but I decided to
support the behavior this time. Now both the expression and the format
string are optional. plot at x,y will plot a 0 at x,y. plot "x" at x,y
is exactly equivalent to "x" at x,y in output, but slightly slower.
plot 3 at x,y works as before as does plot 2 "%g of clubs" at x,y
I also modified the grammar to accept the base and wid paramaters to bar
in any order.
1.35
Changes to lex code to compiler under newer versions of lex and
configure code to activate them. Several people pointed out the problem
and I like Bruce Lilly's solution best. Configure bugs are all mine.
Bruce Lilly also noticed that copy statements with a macro and neither an
until nor a filename didn't work as they should. He provided the fix
for that.
Bill Ward pointed out that grap should support gpic's "thickness" just
like the color attributes. So now it does.
And an apology to R. Clayton who sent patches for this very thing that I
lost until after I'd implemented.
1.32: Whoops. Color modifiers were mis parsed in implicit plot statements.
Now things like :
bullet color "blue" at 1, 3
work.
Minor code tweaks to make grap compile under g++ 3.4.2
1.31: In compatibility mode grap will no longer add whitespace around graphs.
I like it, but Yuval Tamir rightly complained.
1.30: Made the undocumented color commands support GNU pic color commands. In
other words added color to grap. Probably the easiest place to see the syntax
is the new example added to the examples file. The changes are on the manual
page, too, but the example sets basically everything that can be set, so it's a
good example.
1.27: A couple compilation bugs reported under later g++ versions by a couple
people have been fixed. Brian Mays caught a clipping bug, and Bruce Lilly also
caught a couple compiler dependencies.
1.26: .lf was appearing outside the PS/PE pairs, so I disabled generation of
those lines.
1.25: Fixed a bug parsing draw/new with no line descriptions. Thanks to
Robert W. Numrich for spotting it.
Cygwin seems to need errno.h to declare errno in grap_lex.l. I added the
machinery to look for it and use it if it's there. I also added a couple
missing semi-colons to grap.y to shut bison up.
Added the clipped and unclipped attributes to allow plot statements to place
strings outside the frame.
Tuned the makefile so you can use pmake in parallel.
1.23: made it possible to disable sprintf and other calls to sprintf(3)
with a user given format string, which is a potential security hole.
Fixed a plot bug I found while disabling that.
1.22: John Heidemann caught a bug with respect to large sizes and size
changes in titles. Those large size changes are now supported. Generally
the groff [] syntax is now used for the embedded \s commans that size
generates. This can be turned off by using -C.
John also wanted to be able to specify string modifiers like size, etc.
on ticks. Now ticks, grids, and plot strings (e.g. in a new or draw
statement) all take string modifiers. grap.defines has been changed to
support and encourage this usage.
A bug where a null graph was output when only a draw statement was given
has been corrected.
sprintf processing has been revamped to more directly follow sprintf
syntax. As a result, a limitation on the number of parameters (10) has
been introduced.
As a result of using string attributes on plotting strings, the name of
the default line has become user-visible. Changing
grap_internal_default via new will change the default lines for the rest
of the graph. It's not encouraged.
1.21: Allow redefinition of keywords as macros. In the process, I
added an undefine keyword to do the obvious: remove a macro.
Added xy_gg macros, too.
Fixed a bug where giving a coordinate name before a parenthesized point
caused a syntax error. Thanks to Kees Zeelenberg for spotting this.
Added an srand function to seed the random number generator, though
there's none documented in Kernighan and Bentley's grap, and a getpid
function to get a (sort of) random number. Don't use this for key
generation. W. Robert Daasc caught this omission.
While I was in there, I discovered that rand was not returning its
full range from [0,1). It does now.
Some keywords that accept strings weren't accepting sprintf, some of
them have been fixed.
Lee Ji Hwan found a bug with large files being read thru macros
causing a core dump. That has been fixed. It was a really
embarrassing coding style error, too...
John Aycock discovered a bug where a line style was ignored on the first
line command executed. It's not ignored anymore.
I also found a bug in the execution order of copy through macros,
although I'm uncertain if a version was ever released with the bug
intact. I think this may have been related to Lee Ji Hwan's bug,
which means it probably hasn't seen the light of day.
-h prints a usage summary. --help is a synonym for -h and --version is a
synonym for -v.
1.20: The big jump reflects both internal changes and visible feature
changes. The class structure in the code has been substantially
revamped, and the code brought into better conformance with the
current state of the C++ world. As of version 1.20, grap no longer
attempts to compile under g++ 2.7.2. grap 1.11 source will remain
available from http://www.lunabase.org/~faber/Vault/software/grap for
those who need it.
One feature change is that troff and pic commands are now placed
correctly in their relative order rather than being collected before
and after the graph. This required specifying more carefully where
the frame generation is placed. Frames are output either immediately
before the first plotted object or after the frame statement, if any.
This change motivated much of the class changes and actually cleaned
them up somewhat.
grap is now *much* more tolerant of variables with the keword names.
Things like
from=1; to = 10
for i from from to to do { ... }
now work. This is due to a sizable rewrite of the tokenizer. In
fact, variables and coordinate spaces can share names. Things like:
for next = 0 to 10 do {
next at next next, next
}
now work (you have to add a couple ticks statements to really see that
example). I'd say we're to the point where obfuscated grap programs
are a possibility.
The only change this necessitated was that if you specify a coordinate
system in an automatic ticks statement, you have to use the on or auto
keyword. See the examples document for an example.
I recoded macros to remove an antiquated construct that was confusing
some non-g++ compilers. A static array was recoded as an STL vector,
with the result that an artificial constraint on the number of
arguments in a macro went away.
Part of the recoding of the tokenizer encoded a large data structure
in a file called grap_tokenizer.cc. The code is striaght-ahead
initialization, but it drives the g++ optimizer stone crazy.
(Optimizing this function is very memory intensive.) By default,
optimization is specifically disabled under g++. You can override
that behavior by specifying --enable-optimize-grap_tokenizer to
./configure. On the machines I use, optimizing this module has
absolutely no effect on performance, and I suggest you don't bother
spending the time optimizing it.
The autoconf and make stuff has been revamped to use GNU make's
automatic makefile generation or BSD pmake's automatic .depend
inclusion, as well as simplifying the distribution creation and
caching all configuration values.
Added some GNU standard Makefile targets to the Makefile.
Fixed some bugs in the manual page.
Ran spell again on the examples. Misspelling Brian Kernighan's name
is bad.
Many additional compatibility changes suggested by Bruce Lilly.
1.11: Strings are now clipped, thanks to John Heidemann for finding the error.
1.10: Cleaned up the automatic tick generation and fixed a bug in
there, too.
Allow reassignment of coordinate system parameters, e.g.,
.G1
coord test
copy "examples/cy_fatal.d"
coord test x 1980,2000
.G2
Default line format now uses the bullet macro if it's defined. The
coord statement now will accept multiple log scale modifiers. The
statement
coord x 1,1000 log x log y
is now legal. x and y are now legal variable names. They used to be
language tokens, and in fact still are, although their scope as tokens
is now limited to coord statements.
Tried to streamline the use of for_each and functors by removing
trivial calls to for_each. Still trying to move code out of grap.y to
make it shorter to compile.
Simplified expression grammar by disallowing logical expressions
outside if statements. I also caught another memory leak here.
Signifying a line break by using new (or draw) now works. So code like
.G1
draw solid
next at 2,4
next at 3,5
new
next at 4,6
next at 5,7
.G2
produces 2 solid line segments. This forced a little rethinking of
the syntax for changing the properties of a line using new/draw. The
implementation is on the man page. If it breaks existing grap
scripts, I'd love to hear about it.
Grids support similar syntax to that of ticks for explicitly
requesting automatic grid generation.
Automatic tock or grid generation can now be requested relative to a
named coordinate system, formerly automatic ticks/grid lines were only
generated for the default coordinate system.
Added the ln function. Why did that take me so long?
Revised and (finally) spell-checked the man page. I also stopped
including the auto-generated manual page in an macros. A text version
of the man page is now installed, but the manual uses the doc macros
exclusively.
Line clipping was added in here, too.
1.06: Added an anonymous donor's TeX defines. Also added the -C
compatibility option for groff and fixed some manpage formatting bugs.
1.05: kromJx@crosswinds.net noticed that numbers like 1. weren't
accepted. They are now. While I was fixing that I noticed that copy
until commands without a macro weren't supported. They are now. Made
a minor change to the examples to test the fixes.
1.03: Added the -M path option to make groff handle grap better. I
also added the GRAP_DEFINES environment variable to change the defines
file. I also added a new source file, grap_parse.cc in an attempt to
break up the monolithic and gigantic grap.y. I had some small
success. In the course of creating grap_parse.cc I think I caught
some memory leaks, too.
1.02: Bruce's error handling code produced a few inconsistencies
(eating the last newline of a file, and adding one befor ethe file. I
think it no longer does that. In addition I took care of a error
placement bug when the error was in a line containing a macro
expansion, and changed the error handling from using char * to using
Strings, like the rest of grap.
Got rid of an error on SunOS (and presumably other architectures)
where -0 labels were printed on auto-generated labels.
Fixed bugs in sprintf when compiled using standard strings.
Fixed a memory leak and general bug with the undocumented color
commands. (There, that'll tell me if anyone reads this!)
1.01: Fixed a compilation bug under RedHat 6.1. Cleaned up autoconf
and tweaked the makefile.
1.0: Incorporated Bruce Lilly's error reporting code. Cleaned up the
documents (including a menton for Bruce in the man page) for v1.0
release. Cleared up a file reading bug.
0.98b: Bruce Lilly reported some bugs and DWP incompatibilities,
mainly with negative numbers in number lists and comma separations in
them. He also compiles in UWIN under NT, which broke autoconf in some
weird ways. The most important of these necessitated adding a check
to ensure that install supports -d.
His test case is in the example file now. He also found some spelling
errors.
The README file now reflects the real state of the world, too. More
kudos to Bruce.
While tinkering with those autoconf changes I found that grap didn't
compile under g++ 2.7.2.1 any more. Good thing that 0.97b wasn't
really released. All is well again.
More fun from Bruce: he's given me patches to make cascding
assignments work and to remove a bug with comments not acting as
separators.
I've also make the order of copy commands more flexible (the until can
go before or after an inline macro, for example) and fixed a bug in
the grammar that made it difficult to put general expressions in
places like the frame size. Expressions can go anywhere now, at the
expense that string comparisons can only appear in if statements.
Those bugs were also spotted by Bruce.
0.97b: Finally have a copy of egcs, so grap will now compile under it
using both the stl and the standard string class. What do you know,
compiling under egcs halves the run time. This is roughly half due to
better egcs compilation and half due to the better performance of the
standard string class.
Moved to a config.h-style grap.h. Smoothed out the header files to
confine as much conditional compilation as possible to grap.h.
The code now uses hash_maps if they're available.
0.95b: bug fix: deleting grap_buffer_state contents twice on error, allow
more than one shift description on ticks, grids, and labels. Thanks to
Anindo Banerjea at ISI for spotting my misimplementation.
Another couple of Bannerjea catches: through is now recognized as a
synonym for thru. "For," "then" and "else" clauses were previously
treated as macros but now have a terminating separator added to them.
The result is that things like
if (x == 3) { y = y + 1 }
x = x + 1
work now. (If the { } is treated as a macro defined and expanded on
the spot, the grap parser sees y = y + 1x = x + 1 and cannot parse the
expression y+1x). The new behavior is both more intuitive and more in
line with previous grap implementations.
More from Anindo: expansion of macro arguments assumed that the only
possible character following a dollar sign was a single digit. This
caused problems both when a non-digit followed and the $ was literal,
and when the intent was to access an argument with an index greater
than 9. Argument expansion now only expands when a $ is followed by 1
or more digits, and includes all the digits in the index.
The frame statement will now accept the default line style before or
after the frame size. I still don't accept things like frame ht 3
solid wid 3 - the specifications of the size must be contiguous.
0.92a: bug fix - string equality check. Small change to Makefile.in
to support default Solaris behavior. Added -v for version info. Some
general internals fiddling (I'd like to call it cleanup, but I think
that's generous).
0.91a: small changes for the RPM
0.9a: Added commands for making bars.
Error reporting is much closer to the correct line now.
Generalized line descriptions for fillable objects.
Circles now take a line description. Added new examples of fillable
objects.
Now using the BSD copyright notice instead of my own half-baked one.
0.8a: alpha release
|