Commit Graph

378 Commits

Author SHA1 Message Date
Thomas Jensen
4c656727ec
Add advance_next32() function to 'unicode' module to encapsulate the escape handling logic #1 2021-02-13 11:01:55 +01:00
Thomas Jensen
5dad2d1137
Add unicode-awareness in box removal functionality #1 2021-02-13 11:01:55 +01:00
Thomas Jensen
c41a4e881e
Extract some duplicate code in boxes.c into new function analyze_line_ascii() #1 2021-02-13 11:01:54 +01:00
Thomas Jensen
a579da13a5
Unicode-enable regex processing by introducing PCRE2 #1 #67 2021-02-13 11:01:54 +01:00
Thomas Jensen
6a3d0e715c
Apply new code format from CLion 2021-02-13 11:01:54 +01:00
Thomas Jensen
53e7782b5f
Remove unused function nspaces32() from tools module #1 2021-02-13 11:01:54 +01:00
Thomas Jensen
91d1971cca
Fix handling of colored whitespace #1 2021-02-13 11:01:53 +01:00
Thomas Jensen
eeeacf2949
First successful box with unicode and ansi sequences #1
Existing test cases all green
2021-02-13 11:01:37 +01:00
Thomas Jensen
865432a2da
Merge line_t.vischar into line_t.len #1
This has become possible/necessary because the full truth about multi-byte
characters and/or escape sequences lives only in line_t.mbtext.
2021-02-13 11:01:37 +01:00
Thomas Jensen
a6a5898341
Unicode-enable the reading of input #1 2021-02-13 11:01:27 +01:00
Thomas Jensen
f2ddb6d6df
Support unicode in expand_tabs_into() of tools.c
Declare ucs4_t character constants in boxes.h
Start unicode support in boxes.c #1
2021-02-13 10:54:26 +01:00
Thomas Jensen
f536d45f7a
Apply new code format from CLion 2021-02-13 10:54:26 +01:00
Thomas Jensen
dcd2328c77
Double line buffer size because we expect more MBCS input #1 2021-02-13 10:54:18 +01:00
Thomas Jensen
07b634a16c
Rename LINE_MAX macro to LINE_MAX_BYTES 2021-01-22 18:47:16 +01:00
Ben Dimbeck
c9db55ae88 Honour indent for visible characters
(Fixes the test suite)
2020-07-17 20:58:59 +02:00
Ben Dimbeck
2356251a27 Do not count ANSI sequences towards line length
This allows the usage of boxes with basic ANSI SGR colors and formating.

The change was made as a quick hack for myself, so it ended up not super-clean.

The problem here is that before, boxes only had a concept of line->len that would store both the
width of the line and the number of bytes contained since they were assumed to be the same. Now,
there are visible and invisble characters - sometimes the code needs to work with the visible line
length and sometimes with the byte count.

Because of that, at this point the code could use some refactoring to make it a little more
obvious which line length (visible or bytes) is being used at a given time.

So, if anybody feels like cleaning up the mess I introduced - that would be appreciated.

Works with `lolcat -f`

Tested on:
 + debian: xterm, gnome-terminal, terminator, locally and via ssh
 + win64/cygwin: compiled and tested locally and via ssh
 + win64/putty: connected to debian server

Fixes ascii-boxes/boxes#65
2020-07-17 20:58:59 +02:00
Thomas Jensen
7ef0b3517f
Replace some misleading angle brackets with quotes #67 2020-02-02 14:14:49 +01:00
Thomas Jensen
b6a4dc71fe
Add basic support for tags #23
Currently, tags can be added to the config file, and displayed in the design information.
They are not really understood, though, so no query-by-tag or anything yet.
2019-05-25 14:54:18 +02:00
Thomas Jensen
b5ad008925
Properly escape shapes in detailed box design information 2019-05-21 21:32:29 +02:00
Thomas Jensen
ac20738a04
Change header text on usage help 2019-05-19 15:10:11 +02:00
Thomas Jensen
8d68f9adb0 Remove some compile warnings on current MinGW 2019-03-29 18:29:20 +01:00
Thomas Jensen
416ae729e8
Eliminate new compiler warning on Linux 2019-02-28 21:35:10 +01:00
Thomas Jensen
ae96f13797
Apply -q to box creation 2019-02-28 21:29:34 +01:00
Thomas Jensen
22829896f8 Add git hash to version info 2019-02-20 22:33:31 +01:00
Thomas Jensen
447d9815d8
Uncomment regexec() declaration in regexp.h to avoid compiler warning 2019-02-20 22:26:56 +01:00
Thomas Jensen
f9193eb4b3 Replace CPP style comments with C style comments 2019-02-20 11:04:09 +01:00
Thomas Jensen
cd134cbb2f
Include stdlib.h in tools.c to avoid compiler warning 2019-02-19 22:16:11 +01:00
Thomas Jensen
7932bd032e
Add lexer %option noinput to avoid compiler warning 2019-02-19 22:15:19 +01:00
Thomas Jensen
7da5fc91f4
Improve error message for invalid box size on osx #54 2019-02-19 22:02:23 +01:00
Thomas Jensen
056a497cc8
Improve handling of partial lines
When boxes is fed text selected in a visual editor, this often means that
the final line of input text has no terminating newline (it's a "partial
line"). This caused an extra blank line to appear in the editor after
running boxes. #57
This commit changes the behavior of boxes so that a newline is only added
at the very end of the output, if there also was one at the very end of
the input.
2019-02-17 14:28:20 +01:00
Thomas Jensen
2196f10a57
Remove rcsid tags from source files 2019-02-15 21:32:36 +01:00
Thomas Jensen
7d98227583
Change source file header to plain GPLv2 headers 2019-02-15 21:24:31 +01:00
Thomas Jensen
5a6df32738
Respect given outfile on box removal #55 2019-02-14 22:03:23 +01:00
Thomas Jensen
022cdd17c8
Change website references to https 2019-02-14 21:41:11 +01:00
Thomas Jensen
25b9e7ac58 Add undocumented option -q, use it for -l 2019-02-08 13:00:52 +01:00
Stephen M. Cameron
e631886c56 Fix some compiler warnings:
boxes.c:1024:31: warning: format ‘%d’ expects argument of type ‘int’,
but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

Signed-off-by: Stephen M. Cameron <stephenmcameron@gmail.com>
2017-10-22 14:00:45 +02:00
Santiago Castro
d981796d6d Fix broken Markdown headings 2017-04-19 14:46:59 +02:00
Thomas Jensen
014843c3aa Remove -ansi from CFLAGS (patch by @fxcoudert in #38) 2017-03-14 13:26:38 +01:00
Thomas Jensen
96686d03e7 Add missing header to parser.y (patch by @fxcoudert in #38) 2017-03-14 13:25:30 +01:00
Yu-Jie Lin
d5795402d5 Close files and initialize variable as per cppcheck errors (#28) 2017-01-08 13:12:26 +01:00
Scyptnex
4576f966af fixes a bug with strtol on mac 2017-01-06 14:22:58 +01:00
Thomas Jensen
d5ddb5665f Some iso-8859-1 characters accidentally got converted to utf-8, revert that conversion 2016-01-05 22:45:27 +01:00
Thomas Jensen
af85c0c255 Evaluate new 'designer' keyword and show it in box design information output #22 2016-01-05 22:39:11 +01:00
Salvatore Bonaccorso
b3327c558d Properly quote argument to echo containging # in Makefile
lex.yy.c did not include config.h since the argument to echo was treated
as comment, so just an empty line was prepended.

Closes: #15
2015-07-24 10:19:24 +02:00
Thomas Jensen
90f967adb3 Remove obsolete revision histories from source file headers 2015-01-11 23:15:48 +01:00
Thomas Jensen
a60d74eb02 Apply patch by Salvatore Bonaccorso to fix FTBFS on GNU/kFreeBSD and GNU/Hurd 2015-01-11 22:23:25 +01:00
Thomas Jensen
0a58a24763 Apply patch by Jakub Hrozek to eliminate a compilation warning on Fedora 2015-01-10 22:35:08 +01:00
Mike Meyer
1a2cf93965 Allow user to add flags to CFLAGS and LDFLAGS
To build on Mac OS X: `make CFLAGS_ADDTL=-m32 LDFLAGS_ADDTL=-m32`
2014-10-20 16:32:53 -04:00
Thomas Jensen
f6c6a175b0 Updated error message format in getopt.c for win32 test case compatibility 2014-10-09 23:37:45 +02:00
Thomas Jensen
001eaeeb57 Consolidated separated Makefiles for Unix and Win32 into one 2014-10-07 23:57:44 +02:00
Thomas Jensen
2dccdbcc0d Moved boxes sources from RCS to git 2014-08-27 22:41:48 +02:00
Thomas Jensen
92a5770124 Added support for --help and -? options, which do the same as -h
(This feature was requested by Raphael Wimmer).
2006-08-28 15:53:46 +00:00
Thomas Jensen
b80e352569 Undo of previous version
Added include string.h and stdlib.h, removed all manual extern declarations
2006-07-23 16:28:13 +00:00
Thomas Jensen
4274b625b2 Undo of previous version
Added include string.h and removed manual extern declarations for strncpy()
2006-07-23 16:15:55 +00:00
Thomas Jensen
cff897f7d6 Removed unsigned modifier from a pointer declaration in order to clear a warning
which appeared on some Linuxes (reported by Andreas Heiduk)
2006-07-23 16:11:39 +00:00
Thomas Jensen
c37a33617f Applied patch by Christoph Dreyer to support unexpansion of leading tabs
Added ability to retain leading tabs in their original positions
Mending a box with -m now implies -k false
2006-07-22 19:40:40 +00:00
Thomas Jensen
b83ec23f56 Fix: Renamed yylineno to tjlineno to enable compilation on certain
flexes (reported by Andreas Heiduk)
2006-07-22 19:30:55 +00:00
Thomas Jensen
3089111594 Changed expand_tabs_into() so that it records the original tab positions in a line
Added tabbify_indent() to restore original leading tabs after box processing
2006-07-22 19:27:15 +00:00
Thomas Jensen
0803e5ca0a Applied patch by Christoph Dreyer to support unexpansion of leading tabs
Added ability to retain existing tabs
2006-07-22 19:19:26 +00:00
Thomas Jensen
0a06325655 Fix: Renamed yylineno to tjlineno to enable compilation on certain
flexes (reported by Andreas Heiduk)
Added tabexp to opt_t
Added tabpos and tabpos_len to line_t for advanced tab handling
2006-07-22 19:15:52 +00:00
Thomas Jensen
6f11b40d19 Changed expand_tabs_into() signature in order to support advanced tab handling
Added tabbify_indent()
2006-07-22 19:11:07 +00:00
Thomas Jensen
c925545c13 The file boxes.h is now managed by the top level Makefile only
Added rcslocks target to check lock status
Small usability enhancements
2006-07-22 19:07:21 +00:00
Thomas Jensen
03685e42c1 Small usability enhancements 2006-07-22 19:04:30 +00:00
Thomas Jensen
148ebfb4c3 Several small changes which may help clear some warnings on Debian 2006-07-22 19:02:24 +00:00
Thomas Jensen
3d99016b51 Added extern declaration of strncpy() to myregsub(), hoping this will clear some warnings on Debian 2006-07-22 19:01:10 +00:00
Thomas Jensen
38a62dec74 Added target rcslocks 2006-07-12 21:28:38 +00:00
Thomas Jensen
f8df42aa6a Updated email and web addresses in comment header etc.
Applied patch by Elmar Loos that adds -m option for mending a box
Changed a few more things to make the box mending patch work in
connection with all the other boxes options
2006-07-12 05:49:50 +00:00
Thomas Jensen
9eaecc9b3e Updated email and web addresses in comment header
Added new member 'mend' to opt_t (for option -m, mend box)
2006-07-12 05:44:12 +00:00
Thomas Jensen
b37c06c874 Updated email and web addresses in comment header 2006-07-12 05:41:52 +00:00
Thomas Jensen
21594c1f50 Updated email and web addresses in comment header
Added trim_only flag to output_input() function, used for box mending
2006-07-12 05:28:58 +00:00
Thomas Jensen
3f8bdab8f2 Updated email and web addresses in comment header 2006-07-12 05:25:27 +00:00
Thomas Jensen
40a1bb3487 Updated world wide web link in comment header 2006-07-12 05:20:26 +00:00
Thomas Jensen
74288d1d4a Removed -traditional flag from CFLAGS definition
Updated email and web addresses
2006-07-08 08:47:58 +00:00
Thomas Jensen
dab5f12459 Applied patch by Andreas Heiduk to facilitate compilation with
present-day flexes
2006-07-07 07:24:17 +00:00
Thomas Jensen
9eed60977d Added cld member to command line option struct (-c option) 2000-04-01 18:28:18 +00:00
Thomas Jensen
07d7260497 Added -c option (simple comment definition) 2000-04-01 18:27:17 +00:00
Thomas Jensen
06eac718d2 Minor change to make boxes compile on DEC/OSF, too (S_ISDIR) 2000-03-21 14:26:31 +00:00
Thomas Jensen
55d74f3c38 Added Makefile.Win32 and misc/* to snap generation commands 2000-03-17 23:51:43 +00:00
Thomas Jensen
4d48f2c8ef Port to Win32 platform based on patches by Ron Aaron
Changes only affect Win32 version. Win32 behavior differs from the UNIX
platforms in the way the config file is searched and the config file
name (boxes.cfg).
2000-03-17 23:44:26 +00:00
Thomas Jensen
980a056d33 Added vim autocommand to set syntax highlighting to C 2000-03-17 23:43:13 +00:00
Thomas Jensen
555f640f56 Moved config.h into ORIG_HDRCL group, so it appears in the change log Web
page
1999-11-08 10:55:13 +00:00
Thomas Jensen
85d76ebb6a Bugfix: For non-empty left box sides, spaces belonging to "empty" shape
lines were not properly removed in some cases
1999-11-08 10:51:41 +00:00
Thomas Jensen
3f2f687128 Bugfix: Horizontal box parts were not correctly detected if the west box
side was empty (reported: Tobias Buchal)
Bugfix: boxes could hang in detect_horiz() due to goeast/west confusion
1999-11-07 17:46:26 +00:00
Thomas Jensen
532bd941b3 Eliminated use of PATH_MAX in order to ease porting
Restructured infile/outfile code to eliminate need for access() function
and improve readability
Added file type check before reading config file. boxes used to generate
a weird error message if the config file is a directory
1999-09-10 19:21:05 +00:00
Thomas Jensen
a5119027eb Added concat_strings() function prototype from Joe Zbiciak's patches 1999-08-31 15:38:42 +00:00
Thomas Jensen
fc2a00f0dc Applied Joe Zbiciak's patches to remove all snprintf()s and variants
Replaced snprintf() calls with calls to concat_strings() in the process
1999-08-31 15:37:01 +00:00
Thomas Jensen
b84e9ed503 Applied Joe Zbiciak's patches to remove all snprintf()s and variants
Added concat_strings() function and changed yyerror() in the process
1999-08-31 15:35:13 +00:00
Thomas Jensen
2535f9f8f5 Bugfix: Changed empty #elif to #else (thanks Tommy Williams)
Port to i386/FreeBSD by Tommy Williams
1999-08-25 13:38:37 +00:00
Thomas Jensen
d3a64d0677 Removed const from 2nd parameter of justify_line() function 1999-08-22 11:36:45 +00:00
Thomas Jensen
70ba492f26 Bugfix: no-input-check must take place before indentation computation 1999-08-22 11:34:46 +00:00
Thomas Jensen
21ad76c0af Renamed file from boxes.h to boxes.h.in
VERSION and GLOBALCONF values are now put in by top level Makefile
1999-08-21 23:37:23 +00:00
Thomas Jensen
fcba4e3d7b boxes.h is now generated from boxes.h.in by top level Makefile
Added -Wall -W to CFLAGS and removed .c.o rule
1999-08-21 23:35:44 +00:00
Thomas Jensen
97c7109f5d Added usage of system-wide config file (GLOBALCONF from boxes.h)
Moved config file selection code into it own function (get_config_file())
1999-08-21 23:33:03 +00:00
Thomas Jensen
72d3fb1b54 Removed case insensitivity option (-i) from flex call. Now done in lexer.l. 1999-08-21 16:10:41 +00:00
Thomas Jensen
ca9ff78bff Removed newline check from empty_line() function 1999-08-21 16:09:33 +00:00
Thomas Jensen
a275847b4f Bugfix: justify_line() still didn't work right. It should now. (This time I
discovered that indentmode=="text" was confusing it. Arghh!)
1999-08-21 16:04:24 +00:00
Thomas Jensen
2d293cb89d Bugfix: When matching vertical side shape lines, ignore empty shape lines 1999-08-21 16:03:31 +00:00
Thomas Jensen
0f2a1703ce Updated usage information
Updated quickinfo (-l -d) with killblank default value
Made indentation computation into a function of its own (get_indent())
Bugfix: REVERSION code may change indentation -> recompute if necessary
1999-08-21 15:55:42 +00:00
Thomas Jensen
52120808f5 Removed check for empty sample block, which is also done in lexer.l 1999-08-21 15:53:58 +00:00
Thomas Jensen
f180fca44c Moved contents of YY_USER_INIT definition into a separate function which
is now called by YY_USER_INIT (better readability)
1999-08-20 19:51:12 +00:00
Thomas Jensen
0e8079c81c Declared yyerrcnt to be static
Added YY_USER_INIT macro to set the input buffer size to the config file
size (plus a bit). This is supposed to be a workaround for the REJECT
problem.
1999-08-18 18:23:41 +00:00
Thomas Jensen
f6c4f01f4e Added Linux defines. Now compiles nicely on (my) Linux. 1999-08-18 18:23:06 +00:00
Thomas Jensen
a6d4809f08 Added LEX_SDELIM macro (valid string delimiter characters)
Added prototype for chg_strdelims()
1999-08-18 15:42:46 +00:00
Thomas Jensen
f5b5d4572a Added %options never-interactive and caseless
Added code for DELIMITER statements
Rewrote string rules to deal with delimiter statements
1999-08-18 15:40:10 +00:00
Thomas Jensen
52816696e6 Added new tokens YCHGDEL and YDELWORD
Added code for DELIMITER statements
1999-08-18 15:38:44 +00:00
Thomas Jensen
3a59866e97 Bugfix: justify_line() still didn't work right. It should now. (Man, I got
a strong sense of dja vu! Weird ...)
1999-08-18 15:37:09 +00:00
Thomas Jensen
721c4c4e55 Bugfix: justify_line() still didn't work right. It should now. 1999-08-16 18:30:32 +00:00
Thomas Jensen
2fa54261ea Added output of total number of designs for -l 1999-08-16 18:29:39 +00:00
Thomas Jensen
2a629b4075 Changed SAMPLE block syntax to get rid of all the quoting sh*t in SAMPLE
blocks. Samples now look authentic even in the config file. Very simple now.
Added new token YENDSAMPLE in the process.
1999-08-16 16:29:25 +00:00
Thomas Jensen
291158afc2 Implemented new SAMPLE block syntax
Replaced states SAMPLE1 and SAMPLE2 with new state SAMPLE - this is now
much simpler code
1999-08-16 16:28:03 +00:00
Thomas Jensen
83cafeab4f Incremented beta version number to 5
Added maxshapeheight member to design_t struct
1999-08-14 19:31:23 +00:00
Thomas Jensen
e86c17d62d Added GNU GPL disclaimer 1999-08-14 19:30:01 +00:00
Thomas Jensen
8c15ac84ed Added anz_shapespec variable to count non-deepempty user-specified shapes
(must at least be 1)
Moved yylex declaration to lexer.h, where it belongs
Bugfix: bison and yacc seem to differ in the way action code is treated
which is associated with an error token. Since bison calls the action
routine whenever a token is skipped while recovering, added skipping
variable to ensure that only one "skipping to next design" message is
printed. That was not necessary before. %-/
Removed existence check from corner_check() routine (obsolete).
Added code to generate required shapes which were not specified by the user
Clean-up in shape_def rule (use freeshape() and some more)
1999-08-14 19:19:25 +00:00
Thomas Jensen
de25edcfc0 Added findshape(), genshape(), freeshape(), and isdeepempty() functions
Added on_side() back in with a few changes
Changed empty_side() to use isdeepempty() -> much simpler code
1999-08-14 19:11:53 +00:00
Thomas Jensen
4deed5e8f5 Added genshape(), freeshape(), and findshape() prototypes
Added on_side() prototype back again
Added isdeepempty() prototype
Changed first parameter of empty_side() prototype
1999-08-14 19:08:34 +00:00
Thomas Jensen
64ed11f10c Added GNU GPL disclaimer
Added yylex() declaration to please compiler
1999-08-14 19:06:26 +00:00
Thomas Jensen
b0ba6c4baf Given regexp stuff its own Makefile in regexp.
Major Makefile overhaul, maily implementation of new directory structure
and consolidation of file macros
Use more GNU make features
1999-08-13 23:55:03 +00:00
Thomas Jensen
13154120e5 Bugfix: cut&paste error in in strisyes() and strisno(). Thanks Warren Seltzer 1999-08-13 23:54:24 +00:00
Thomas Jensen
ce8c0a295e Initial revision 1999-08-13 20:56:09 +00:00
Thomas Jensen
d8e0a00674 Removed functions iscorner(), on_side(), shapecmp(), both_on_side(), and
shape_distance() - nobody was using them anyway.
1999-07-23 16:38:02 +00:00
Thomas Jensen
995355b81e Added GNU GPL disclaimer
Removed prototypes of iscorner(), on_side(), shapecmp(), both_on_side(),
and shape_distance() - nobody was using those anyway.
1999-07-23 16:36:33 +00:00
Thomas Jensen
315d02d9d7 Added GNU GPL disclaimer 1999-07-23 16:16:40 +00:00
Thomas Jensen
affdb49a66 Added quickinfo mode to list_styles(). Called with -l and -d together. 1999-07-23 16:15:48 +00:00
Thomas Jensen
ad568aee53 Added computation of height of highest shape in design (maxshapeheight)
Options -l and -d together now call quickinfo mode -> parse only 1 design
1999-07-23 16:14:17 +00:00
Thomas Jensen
cc8471f243 Added GNU GPL disclaimer
Added include config.h
1999-07-22 12:28:25 +00:00
Thomas Jensen
c1b40f4cb6 Added GNU GPL disclaimer
Renamed parser.h include to lexer.h (same file)
Added include config.h
1999-07-22 12:27:16 +00:00
Thomas Jensen
8c5e619934 Initial revision 1999-07-22 12:26:10 +00:00
Thomas Jensen
6725de9617 Added GNU GPL disclaimer
Renamed y.tab.h include to parser.h (same file)
Renamed parser.h include to lexer.h (same file)
Added config.h include
1999-07-22 12:21:14 +00:00
Thomas Jensen
657bcd2d5f Bugfix: Empty box sides were still counted when -s was specified (so
-s x5 would get you only three lines).
1999-07-21 16:53:17 +00:00
Thomas Jensen
c31bfcbb9d Added GNU GPL disclaimer
Bugfix: When doing the line justification in output_box(), the padding
was counted as part of the modifyable inner part of the box instead of
the fixed box itself, which resulted in strange bugs (tricky one).
1999-07-21 16:50:48 +00:00
Thomas Jensen
171a21b198 Added GNU GPL disclaimer
Does not kill leading/trailing blank lines anymore when !opt.killblank
Added include config.h
1999-07-20 18:57:16 +00:00
Thomas Jensen
80846a69d1 Added GNU GPL disclaimer
Removed include boxes.h
Added prototypes for strisyes() and strisno()
1999-07-20 18:56:15 +00:00
Thomas Jensen
7101272dfa Added GNU GPL disclaimer
Added functions strisyes() and strisno()
Added config.h and shape.h include statements
1999-07-20 18:55:20 +00:00
Thomas Jensen
f0c4f546d6 Bugfix: REPLACE "^" with "a" caused a hangup. Now automatically declaring
matches which have a length of zero to be of scope "once".
1999-07-20 18:51:41 +00:00
Thomas Jensen
3a6fef29c6 Added GNU GPL disclaimer
Now evaluating date command from SNAPFILE only once
Changed order of files in snapshot archive (who cares)
1999-07-20 18:49:58 +00:00
Thomas Jensen
6a4a46ffdd Added GNU GPL disclaimer
Updated beta version number :-)
Added killblank member to global options
1999-07-20 18:48:46 +00:00
Thomas Jensen
0d0c2325b7 Added GNU GPL disclaimer
Added -k option (kill leading/trailing blank lines on removal yes/no)
Bugfix: REPLACE and indentation conflict. Now applying regexp substitutions
only after indentation was already handled.
1999-07-20 18:45:29 +00:00
Thomas Jensen
e081e6d3af Removed --yacc option from bison call
Added logpage target to generate the chronologically sorted global change
log in HTML format. This requires a Perl script (create_changelog.pl).
Added config.h to dependencies and stuff
Removed special targets for yacc and lex files. Thanks to Andreas Heiduk,
it is now possible to compile all files with -W -Wall and no extra defines.
Moved regexp library to a subdirectory regexp
Some modifications on the source file macros which now differentiate
between files which are listed in the HTML change log and files which aren't.
1999-07-12 18:28:53 +00:00
Thomas Jensen
c761f463e0 Added include "config.h" to top of file 1999-07-12 18:16:36 +00:00
Thomas Jensen
f0ad8c73dc Renamed file from parser.h to lexer.h 1999-07-03 16:12:19 +00:00
Thomas Jensen
3baafb88f2 Added begin_speedmode() which is called by parser.y
Added state SPEEDMODE for fast skipping of designs
Introduced definitions for PWORD, PBOX, and PWHITE (whitespace)
Added %options nounput and noyywrap for easier compilation/linking
1999-07-02 11:58:15 +00:00
Thomas Jensen
dcaccc130c Some minor changes to please compiler
Communication of speed mode to lexer
Bugfix: Forgot to check for opt.l before calling YYACCEPT
1999-07-02 11:54:52 +00:00
Thomas Jensen
bc4f97a31b Added parser.h header file for lexer-parser communication
Moved from yacc to GNU "bison --yacc"
No longer linking with flex library
Activated -Wall -W for parser.y
Removed -DYY_NO_UNPUT from lexer compilation (now done via file option)
1999-07-02 11:50:35 +00:00
Thomas Jensen
66e1c2b429 Initial revision 1999-07-02 11:47:11 +00:00
Thomas Jensen
529c3f1f65 Added [lcr] "shorthand" to -a option 1999-06-30 12:37:25 +00:00
Thomas Jensen
27c41667ef Removed DEF_DESIGN macro, because it now defaults to first design
Removed some porting code, hoping for autoconf future
Added PARSER_DEBUG and LEXER_DEBUG macros
1999-06-30 12:19:12 +00:00
Thomas Jensen
bce140bf46 Removed entire select_design stuff, because the parser now return much
smaller data structures. The first design pointed to by designs is always
the one we need (except for ops on *all* designs).
The first design in config file is now default design (no DEF_DESIGN anymore).
1999-06-30 12:16:38 +00:00
Thomas Jensen
d8f249e53f Now parsing only those designs which will be needed later on
Checks formerly done in boxes.c now done here (no valid designs etc.)
1999-06-30 12:13:47 +00:00
Thomas Jensen
3640421283 Replaced DEBUG macro with LEXER_DEBUG, which is now activated in boxes.h
New tokens to, with, global, once
Added LEX_MAX_WARN macro to limit number of lex errors printed per design
Replaced exit()s with return YUNREC where errors are not fatal
1999-06-28 18:37:38 +00:00
Thomas Jensen
93793ba1a2 Unified appearance of error messages, which are now all based on yyerror()
Eliminated duplicate code by introducing intermediate rules
New tokens YTO, YWITH, and YRXPFLAG to reduce strcasecmp() usage
New token YUNREC for integration of lexer into error handling
Some code restructuring and rule renaming for better consistency
Added out-of-memory-checks to many strdup()s and such
1999-06-28 18:32:51 +00:00
Thomas Jensen
ef582a464c Added macro SNAPFILE for boxes-SNAP-date +%Y%m%d
Added target rcstest
Now builds optimized code by default
Added debug target for non-optimized code w/ debugging info
1999-06-28 12:21:34 +00:00
Thomas Jensen
5717471559 Moved parser init and cleanup from main() to parser.y
Some further cleanup in main()
1999-06-28 12:19:29 +00:00
Thomas Jensen
9020675926 Added tokens YBOX and YEND (thus, BOX and END are no longer YKEYWORDs)
Added #define FILE_LEXER_L around #include boxes.h to please compiler
1999-06-28 12:17:46 +00:00
Thomas Jensen
884e18072d Added error handling. Now skips to next design on error.
Replaced DEBUG macro with PARSER_DEBUG, which is now activated in boxes.h
Added rule first_rule, which performs init and cleanup formerly done in main()
Introduced symbols YBOX and YEND
1999-06-28 12:15:47 +00:00
Thomas Jensen
b3fb4bade2 Commented out regerror() protoype which is now exported by tools.h 1999-06-25 18:53:51 +00:00
Thomas Jensen
b51b8e108a Added empty_side() prototype 1999-06-25 18:52:59 +00:00
Thomas Jensen
0038f52681 Added empty_side() function from boxes.c
Removed #include regexp.h
1999-06-25 18:52:28 +00:00
Thomas Jensen
6e23417d1f Removed empty_side() prototype (now in shape.h)
Added indentmode and justify members to command line options struct
1999-06-25 18:51:04 +00:00
Thomas Jensen
e9f3b88ef9 Bugfix: Mixed up SW and NE in padding calculation (tricky, that one)
Added indent mode command line option for grammar overrides
Moved empty_side() to shape.c after small change in signature
Added text-in-block justification (j) to alignment option (-a)
1999-06-25 18:46:39 +00:00
Thomas Jensen
93763e64ec Added initialization of mmok to please compiler
Changed parameters of empty_side() calls to comply with new signature
1999-06-25 18:45:33 +00:00
Thomas Jensen
1996a361ed Added output_box() function 1999-06-25 18:45:12 +00:00
Thomas Jensen
0c9f7cb04f Added justify_line() function for alignment of lines inside the text block
Cleaned up hfill calculation in output_box()
Changed parameters of empty_side() calls to comply with new signature
1999-06-25 18:42:50 +00:00
Thomas Jensen
26e3a95bbe Added remove.o and generate.o
Introduced implicit rule .c.o, simplifying commands for most sources
1999-06-23 19:35:17 +00:00
Thomas Jensen
d983743471 Added output_box() from boxes.c 1999-06-23 19:23:55 +00:00
Thomas Jensen
f8774543a9 Now exporting anz_designs, input, and empty_side()
Added #include regexp.h back
1999-06-23 19:21:15 +00:00
Thomas Jensen
e88470677d Removed snprintf() and vsnprintf() prototypes (why were they in anyway?)
along with stdarg.h include
Exported input global data and empty_side() function
Declared non-exported functions static
Moved horiz_precalc(), vert_precalc(), horiz_assemble(), vert_assemble(),
horiz_generate(), vert_generate(), generate_box() and output_box() to a
new file generate.c
Moved best_match(), hmm(), detect_horiz(), detect_design(), remove_box()
and output_input() to a new file remove.c
1999-06-23 19:17:27 +00:00
Thomas Jensen
79555dbf29 Initial revision 1999-06-23 19:14:53 +00:00
Thomas Jensen
16ecdbb777 Initial revision 1999-06-23 18:52:54 +00:00
Thomas Jensen
0202a4edab Moved some data structures and macros related to shapes to shape.h
Added #ifdef DEBUG around __TJ() macro for convenience
1999-06-23 12:33:49 +00:00
Thomas Jensen
5ffccab2b7 Improvements on design detection (could still be better though)
Moved iscorner(), on_side(), isempty(), shapecmp(), both_on_side(),
shape_distance(), empty_side(), highest(), and widest() as well as
some data structures and macros related to shapes to new file shape.c
1999-06-23 12:31:26 +00:00
Thomas Jensen
b73a59a3e0 Added tools.o and shape.o
Change in snapshot target directory (download)
Added GENSRC, HSSRC, ORIGSRC, ALLSRC, and ALLOBJ macros for more order
1999-06-23 12:27:50 +00:00
Thomas Jensen
b5630aa4dc Initial revision 1999-06-23 12:26:59 +00:00
Thomas Jensen
77e0ce8550 Initial revision 1999-06-23 11:19:30 +00:00
Thomas Jensen
20b4ff599b Removed #pragma ident string and added version comment instead 1999-06-22 12:12:05 +00:00
Thomas Jensen
46844f8983 DEBUGging is now activated in boxes.h
Moved MAX_TABSTOP, LINE_MAX macros to boxes.h
Moved BMAX, strrstr, btrim(), yyerror(), expand_tabs_into(), regerror(),
empty_line() to a new file tools.c, added #include tools.h
Some cleanup in main()
Declared style_sort() helper function static
Renamed strrstr() to my_strnrstr() (now defined in tools.c)
Default design is now defined by DEF_DESIGN macro
Moved struct opt_t to boxes.h
Bugfix: segfaulted if shape was bigger than input when detecting design
Bugfix: Padding was not removed when box was removed
Bugfix: Forgot null byte when removing west box side
Changed select_design(), because default design value now set in process_commandline()
1999-06-22 12:03:33 +00:00
Thomas Jensen
3f8cdd1803 Added DEF_DESIGN (default design name)
Added opt_t and opt global variable from boxes.c
Moved BFREE macro and yyerror() and empty_line() prototypes to tools.h
Added LINE_MAX and MAX_TABSTOP macros from boxes.c
Added #define DEBUG and REGEXP_DEBUG. This will centrally activate
debugging.
1999-06-22 12:01:24 +00:00
Thomas Jensen
43e877f2f9 Added #undef DEBUG, because DEBUGging is now activated in boxes.h
Added #include tools.h
1999-06-22 12:00:05 +00:00
Thomas Jensen
e0b1b6f9bb Added code for padding handling (-p)
Added BMAX macro (returns maximum of two values)
1999-06-20 14:20:29 +00:00
Thomas Jensen
a95cc59dff Added padding member to design struct 1999-06-20 14:19:31 +00:00
Thomas Jensen
7d265b2273 Adden YPADDING and YNUMBER tokens plus code for padding blocks 1999-06-20 14:18:51 +00:00
Thomas Jensen
d1079fdf7f Added "padding" keyword and recogintion of numbers (YNUMBER) 1999-06-20 14:17:58 +00:00
Thomas Jensen
56de91b3c8 Removed #pragma ident "string"
Changed VERSION to 1.0 beta
Added line_t and empty_line() prototype
1999-06-17 19:08:50 +00:00
Thomas Jensen
c4cfb92c8a Moved line_t to boxes.h
empty_line() now also considers \r and \n whitespace
Added empty_side() function
Added handling of empty box sides in output_box()
1999-06-17 19:07:06 +00:00
Thomas Jensen
5cd3e9f898 Bugfix: Sample block analysis didn't handle empty blocks 1999-06-17 19:05:46 +00:00
Thomas Jensen
80fb0649a8 Added detection of empty sample blocks (we don't want that)
Added detection of duplicate sample blocks
1999-06-17 19:04:45 +00:00
Thomas Jensen
f3bdc853b3 Removed a stray debug message
Move apply_substitutions() regexp handling function up in file
Use apply_substitutions() in read_input() routine also
Moved "extern int yyparse()" prototype to start of file
1999-06-15 12:07:39 +00:00
Thomas Jensen
cda91cdbef Added Reverse pattern 1999-06-14 12:13:41 +00:00
Thomas Jensen
42d3d8f4f6 Added YREVERSE token
Added code for regexp reversion
1999-06-14 12:13:01 +00:00
Thomas Jensen
6756a85171 Added struct members for regexp reversion code
Renamed current_reprule to current_rule, now used for both directions
1999-06-14 12:11:54 +00:00
Thomas Jensen
c033fef722 Bugfix: best_match() box side detection used numw instead of nume
Added apply_substitutions() routine for central regexp handling
Added regexp reversion code for box removal
Unified use of current_re[pv]rule
Added a few comments and debugging code
1999-06-14 12:08:49 +00:00
Thomas Jensen
9ebc20ebc0 Some error message clean-up
Regular expression substituions on input text only if *drawing* a box,
not if the box is to be removed (requires other substitutions, TODO).
Added code for box design auto-detection when removing a box.
1999-06-13 15:28:31 +00:00
Thomas Jensen
02b697659e Don't adjust indentation after removing a box unless something was
removed on the west side
East Padding made dynamic, i.e. dependant on the east side size
1999-06-04 18:13:26 +00:00
Thomas Jensen
498bd9c12a Added snap target for automatic snapshot publication 1999-06-04 12:15:37 +00:00
Thomas Jensen
c0b7322493 a few fixes related to box removal (as expected) 1999-06-03 19:24:14 +00:00
Thomas Jensen
4a01a9254b *** empty log message *** 1999-06-03 18:54:33 +00:00
Thomas Jensen
5971b0994b lots of fixes
Added remove box functionality, which remains to be tested
1999-06-03 18:54:05 +00:00
Thomas Jensen
a53d558f8f Added rcsid using #pragma ident 1999-04-12 18:16:52 +00:00
Thomas Jensen
3722111e95 Added missing '$' to rcs id string, changed from #ident to char 1999-04-12 18:13:20 +00:00
Thomas Jensen
34d7cf0022 Removed code related to OFFSET blocks (obsolete) 1999-04-09 13:32:55 +00:00
Thomas Jensen
2164de8d0d Added checks for duplicate design names
Added checks for valid design names (no extended ASCII or ctrl chars)
Removed all code related to OFFSET blocks (obsolete)
1999-04-09 13:31:54 +00:00