forked from darkbatcher/picobat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWHATSNEW.tea
executable file
·2566 lines (1644 loc) · 91.1 KB
/
WHATSNEW.tea
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
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{{What's New ?}}
This a list of fixed bugs and improvements made :
{NOTE} : This list is not a complete list of improvements. The changes made before
October 2012 were not included since the version started in this dates used almost
new code.
{{Friday 11st, October 2012}}
- Added welcome screen (Two versions).
- Fixed a parsing bug (The Function Dos9_ParseStream() always returned
NULL).
- Added initialisation routine ( main() ).
- Added support for testing existing files or dirs.
- Added support for current directory.
{{Thursday 6th, December}}
- Added support of end of line.
- Added commutator '/n' to the command line.
- Added support for echoing.
- Sorted code files for a better understandability.
{{Friday 4th, Junuary, 2013}}
- added several commands (TYPE/MORE, CLS, COLOR, TITLE, GOTO).
- added support for english and french.
{{Thursday 11th, February}}
- added api function for file matching (i.e. paths using '*' and '?').
- added function for cross-platform console management.
- added function to extended strings.
{{Wednesday 20th, February}}
- fixed many portabiility issues for api.
- api is now cross-platform.
- Dos9 now works pretty well on linux.
- added lot of support for linux.
- fixed a bug with vars under linux.
- thought about use of dynamic files to easily change language.
- Dos9 runs 'Dos9_Auto.bat' at launch, that initializes Variables to be
Cross-platform.
- Dos9 has now 3 native variables :
-- %DOS9_OS% : The operating system that is currently running
Dos9.
-- %DOS9_VERSION% : The version of the running Dos9.
-- %DOS9_PATH% : The path of Dos9 interpreter.
{{Monday 11th, March}}
- Solve many portability issues (i.e some programs did not work under
Linux).
- Reprogrammed whole Man utility, which has been named "dman" to avoid
confusion on POSIX-compatible Systems.
-- DMan is able to run on several platforms natively.
-- DMan is more simple to use, since it makes it possible to
use links man pages.
- Fixed some bugs on BatMan.
- BatMan is now mainly portable.
- Fixed a bug in delayed variable expansion.
{{Thursday 11th, April}}
- Corrected support of delayed expansion that didn't match to the way
cmd.exe parses it.
- Added support of expression evaluating (might migrate to GNU
LibMathEval soon).
- Added new kind of page support for dMan, it uses now a zip-compressed
file that contains several pages and saves up disk.
- Added a console-side text editor (an alternative to BatMan), GNU Nano.
- Modified nano to highlight batch code.
- Fixed a bug in a parameter for delayed expansion
(cEnableDelayedExpansion was not taken account).
{{Thursday 12th, September}}
- Added UTF-8 support.
- Added different packages :
-- Dos9 Project HLP : A man page viewer.
-- Dos9 Project TEA : A simple, fast and tiny text processor.
-- Dos9 Project DUMP : A hex-dumper.
- Added i18n support (through GNU gettext).
- Added a README file.
{{Tuesday 17th, September}}
- Fixed bug with the message {Error : "..." is not recognized as ...}
message in linux version.
- Fixed bug with the wait() function in that made the program hold
indefinitely.
{{Thursday 16th, October}}
- Changed build architecture. Now, the package can be built through
a single command line, that build all dependencies, i.e.:
${Make -B}
- Added a lock specifier to the structure STREAMLVL that enables to fix
bugs with nested redirection levels. Like those that occured running the
following script:
${IF 1==1 (
ECHO This goes to file2
ECHO This goes to file1 > file 1
ECHO This goes to file2, again
) > file 2}
- Added a kind of old allocated ESTR structure reuser, that avoid reallocating
new estr structures. (Saves up speed).
{{Sunday 27th, October}}
- Some bug fixes, including a bug that appeared with {%~A}.
- Added primary support of {FOR} loops (ie. simple for loop without options).
{{Friday 13th, December}}
- Solved some bugs in libDos9 (a hazardous non initialized var)
- Added support {FOR /F} loops with files as input.
{{Thursday 2nd, January 2014}}
- Corrected {Dos9_ScriptCommand.c} bugs in which the delayed expansion was not executed
even if it was enabled.
- Corrected some manual page
- added some translated pages
- added new {make} system.
- added expressions (both {interger} and {float} mode) for the {SET /A} command.
- added {FOR /F} loop support with string as input.
- added support for top-level blocks.
{{Thursday 14th, January}}
- added final support of {FOR /F} including the use of command outputs as {FOR}
input.
- added {DOS9_SEARCH_NO_CURRENT_DIR} which does not include the pseudo directories
'..' and '.'.
- corrected a compatibility bug with {cmd.exe}: {DIR /b} returned the pseudo directories
'..' and '.'.
- corrected an expansion bug with {%%~a} (and similar var because the interpretor missinterpreted
the command if, for example {%%~ax} was badly expanded if {%%x} was not defined). Now, the choosed varaible
is the largest match defined.
- corrected bug with simple {FOR} processing.
- added partial support of {FOR /R}. (Note: this is provided for compatibility purpose, and that new scripts
should not use theses switches any-more.)
- added version information as a header file, making version management easier.
- added a function to be executed automatically on exit.
- some minor bug fixes.
- some manual pages enhancement.
{{Wednesday 15th, January}}
- fixed a bug that prevented both {FOR /R} and {FOR /D} to be executed the right way.
- fixed a bug with use of {.} in file searches.
{{Friday 17th, January}}
- Fixed a bug that caused some particular redirections to be misinterpreted, particularly,
in blocks {(echo test>NUL)} triggered an error, because the output was interpreted to be
a redirection to file {NUL)}. This has been solved, and both '(' , '|' and '&' operators
are know prioritary.
- Modified version information management. Now version are numbered in the following way:
{YYYY.major.minor[tag]}. Where :
-- {YYYY} : Is the year the version was released.
-- {major} : The major version of {Dos9}.
-- {minor} : The minor version of {Dos9}.
-- {tag} : An optional character, meaning :
--- {d} : Developer version.
--- {b} : Beta version.
- Fixed problem with broken make.
- Enhanced features of {FILELIST*} functions of libDos9. Search is now quicker. It also resulted in
better execution times of the {FOR /R} function (even though still deprecated).
{{Monday 20th, January}}
- Corrected a but that caused line like {:: comment & command} to execute the command
{command}, unlike {cmd.exe}'s behaviour.
- Added {REM} command and comments manual page.
- Fixed broken make that did not build {DUMP} command.
- Added endianness support to {DUMP} command.
- Behaviour of {Dos9} is now the same as {cmd.exe}'s one towards block.
- Fixed a bug that required both {@} and {:} signs to be at first column.
- Fixed a bug that prevented redirection to be executed in a top-level block.
- Added copyright notice to all manual pages.
- Fixed a bug with an added extra space with redirection placed at end of
input line.
{{Thursday 23th, January}}
- Fixed a bug with the {TITLE} command. The {TITLE} command set a title that
was the whole command line (including {TITLE} statement).
- Fixed a bug with the {FILELIST} features. It now works as expected with both
'/' (filesystem root sign) and '[driveletter]:/' with windows.
{{Friday 24th, January}}
- Started working on an enhanced version of {TEA} text preprocessor.
{{Saturday 1st, February}}
- Final version of {TEAv2}. Added support for both {HTML 5}, {HTML 4.01} and
{xHTML}. Others formats have been dropped.
- Fixed a bug with the parsing of command line parameter. If, the final parameter
was enclosed in quotes (simple or double), it resulted in undefined behaviour.
- Fixed a bug that prevented user from include pipes in {FOR /F} command input.
- Enhanced pipe features.
- Fixed a bug that caused the following message
${Error : Unable to release mutex}
@- to be printed at exit, due to an undefined behaviour with {atexit()} function.
{{Friday 7th, February}}
- Fixed a bug of {SET /P} subcommand. The bug caused a SEGFAULT to be raised on
execution.
- Fixed a major bug that prevented command search to be executed normally, it
returned the shortest match available instead of the largest available one.
- Added an error message if the {SET} command is unable to set environment variable.
{{Wednesday 12th, February}}
- Fixed a bug of {SET /P} subcommand, that didn't not removed the carriage return at the
end of the input.
{{Thursday 13th, February}}
- Found a bug that occurs when using {CD} command from inside a batch script, if the path
to the script given is relative, {Dos9} tries to open it in the new current path, and
fail, or execute a different script depending on circumstances. This is to be fixed in next
release (that will include a bunch of improvements, like {CALL}, I hope).
{{Friday 14th, February}}
- Started working in version {2014.0.8}, a version that will include more features, (including use
of intelligent help browsing, and improved command searching (through a own procedure, instead
of what was used previously).
- Fixed a bug with multiple lists in {TEA} html mode.
- Added own function to search files in path. It is not used everywhere though.
{{Friday 21th, February}}
- Added support of new threaded function, through a particular header.
- The issue of uncontrolled sub-threads that continued to be executed was a major concerns, this is
fixed thanks to the new thread functions.
- Solved some errors that occurred when forcing binary input. A few too hopeful assumption were
corrected, so that the interpretor will not fail if a binary file (e.g. randomly generated bytes,
such as executables) is given as batch script, it will just printf a few (or more) errors messages
at the prompt.
{{Monday 24th, February}}
- Solve a bug that prevented correct {%ERROLEVEL%} values from being correctly used, it used to
be ignored when using internal commands.
- Decided of a change in the way to deal with variables, in order to enable more compatibility between
{Dos9} and {CMD.exe}. The changes resides in the way var and special vars are parsed.
@- On the one hand,
to make the difference between the two kind of variables, I decided the only way to denote a special var
(ie. like {%%A}) is to prefix it with two percent. Except for variables like {%0, %1} and so on, which can
be accessed with a single {%} for compatibility purposes. This new conventions provides more stylished script
and prevent name clashes, (ie. unexpected behaviour caused for exemple by the following code) :
${ECHO %1 test%
:: since spaces in variables names are valid, the result can
:: be unexpected depending whether "%1" or "%1 test%" are
:: expanded first.
}
@- On the other, the only way to specify environment variables is the conventionnal way, with single {%}. Note
that this behaviour has also changed, undefined variables will be replaced by a void string (they'll be just stripped
from the output).
@- Finally, in some cases, using {%a} to specify the special variable will work either, but well, it can just happen
on a very few cases, so that it is preferable not to use this notation.
- Changed {Dos9} behaviour towards {%0, ..., %9} variables. Those which are not explicitelly specified at startup will
be filled with an empty string, and will expand to the empty string.
{{Thursday 25th, February}}
- Finalized behaviour change for variables. Singles {%} are now split from the input at parsing, exception made for
the special variables {%0, ..., %9} for which the use of a single percent is still valid (for compatibility purposes)
as stated previously. This prevent users from using single '%' to denote a special var other than these specified
previously.
- Fixed a bug that made {SET /P} subfunction to return inconsistent {%ERRORLEVEL%} codes. In fact, it was
the reverse of normal behaviour, that is :
-- Returning {-1} on error.
-- Returning {0} on success.
- Added an example of batch powered by Dos9, a multifunction caculator using both floating point arithmetics and
integer arithmetics.
{{Thursday 6th, March}}
- Changed the behaviour of the function which decide wether the command is multiline or not. It now correctly handles
parenthesis that are not multiline. For example, the following code used to be expected to continue on next lines :
${echo(some test&if 1 equ 1 echo some other test}
@- However, this behaviour is not actually resolved, indeed, some error might occurs (in some very special case) if the
previous is run. This is still to be fixed.
- Added more compatible version of {ECHO} command. The command now tolerates various non-mainstream syntax (ie. using
other characters than '.' to force print). The following variants are accepted :
${echo!
echo"
echo#
echo$
echo%
echo&
echo'
echo(
echo)
echo*
echo+
echo,
echo-
echo.
echo/
echo[
echo\
echo]
echo^
echo_
echo`}
@- Most of these syntax are however not recommended, because they can cause obvious syntax errors, and are only
provided for compatibility purposes.
@- The characters that were given are those specified by the {ISO-C 90} standard, so that some locale may provide
additional characters.
- Switched to {Autoconf} build system. This allows more standard builds, with {GNU} build toolchain. It can be
compiled through a {*NIX}-shell typing:
${./configure
make}
@- The install target is not supported yet. It also does not use {Automake}, since it is hard to see the point
of writing awful Makefile.am in order to produce a Makefile that can be written by hand.
{{Friday 7th, March}}
- Started to work on a safer block determination. This should not be to difficult to obtain.
- Started to refresh a large part of the core, which includes rewriting what were called modules, and are now
just outdated piece of code. I hope those changes to be functional within a short delay. It is mainly about getting
rid of old and ugly pieces of codes i've been writing about two years ago. Some function have also been transfered to
libDos9, this is limited however, since Dos9 is not stable enough to get it in a whole library.
{{Saturday 8th, March}}
- Added brand new parser, and also, brand new file reader. The new implementations are much more safe and elegant.
Lots of repetitions in the code have be gathered into singles function to make it more maintainable.
- Silenced {Dos9_Jump.c}, but hoping to get it works within a short time.
- Added new string search based that take account of escaped-characters (ie. Characters preceded by '^').
- Lots of bugfixes, particularly with the new parser and reader.
- {Dos9} is much more unstable than it was, but it is to be fixed quickly since new version are easier to maintain.
- Changed behaviour of function than are used to get command-line arguments. It already did line delayed expansion,
but is include now unescaping (ie. removing '^'). Thus some syntax have became valid, such as :
${echo ^!test^!}
@- This will output {!test!}, without expanding the variable, even if {test} is defined.
@- It is also important to note that, syntax with escaping and with quotes are {strictly} equivalent. As an example, take
the following code :
${if foo^ bar equ "foo bar" echo YES}
@- Using, {Dos9}, the code will output {YES}. However, {cmd.exe} will not. It as been chosen to promote the first syntax
since it is more easy to handle and far less tricky than escaping characters with {cmd.exe}, which require an almost
random number of '^' to escape some character.
- Optimised {Dos9_RunBlock()} function.
{{Wednesday 12th, March}}
- Changed behaviour of the thread functions of libDos9. The {THREAD} structure now refers to the thread ID rather than to
a handle to that thread. This new behaviour make it possible to work with thread without left a handle on this thread opened.
It also enables the stack to contain {THREAD} structures on both {*nix} and {windows}.
- Added time-out to the Dos9_WaitForAllThreads function. This is useful in case of deadlocks or in case of thread that does not
terminate.
- Added Dos9_AbortAllThread function, that kills all remaining thread (only those that were launched through Dos9_BeginThread)
- Added Dos9_AbortThread function, that kills a thread.
- fixed a bug in the thread library that sometimes causes Dos9 to wait indefinitely, because function Dos9_WaitForAllThread
and Dos9_EndThread sometimes deadlocked, in a random basis.
- Re-enable {GOTO} function, that works now (even with cross file argument).
- Added {TEXT-ANSI} target to the {tea} text processor. It enables creation of colourized output using ANSI escapes code.
the use of this is native in {*nix} and requires ansicon in {windows}.
- Fixed a bug that caused infinite loop if the file read was no more accessible. It now returns and just prints error message.
- Fixed a bug causing {eof} not to be detected in some circumstances.
- Fixed a bug that caused an error to be printed in the case that a script that was loaded with the {GOTO} command contained
a {CD} command so that the file could not be retrieved because it was kept with a relative path.
{{Thursday 13th, March}}
- Fixed bugs with the run functions. The use of {program \|\| goto error} to perform feature test is avaliable for both windows
and *nix.
- Fixed bugs with {Dos9_SplitPath} command in *nix.
- Added a search in {%PATH%} and {%PATHEXT%} (only in windows) before running any command.
- Added a redirection for command that have {.cmd} or {.bat} as extension. Those files are now executed by a sub process of {Dos9}
instead of being loaded by {cmd.exe}.
- Fixed bug with {Dos9_GetFilePath} function. It prevented executables that were in one of the {%PATH%} directory to be found if a
folder with the same name was in the same directory.
- Fixed bug with the {Dos9_FileExists} function from libDos9. It sometimes returned true for files that where in the path though
not in the current directory.
- Fixed a bug with several encapsulated blocks. The previous parser did not searched for block after a block was solved (this is
is now corrected)
- Improved block support by providing more routines and by making the code more efficient.
- Fixed a bug in {Dos9_ExpandVar} function that was introduced build ago when rules for expansion changed. I'm affraid not to have
seen it before.
- Fixed a bug with {Dos9_EsCpyN} function in libDos9. If the functions with 0 as iSize argument, although the function is expected
to produce a void string, it failed in windows, thanks to microsoft's crt implementation, that throws a SIGSEGV if the last
parameter of {strncpy} is 0.
- Fixed a bug with {FOR} command. The tokenizer did not behave like it is described in the documentation : If several delimiters
were encountered in a raw, they were not skipped.
- Fixed a bug with the {ECHO} command. The prompt line (ie. {DOS9 ...>}) was displayed whenever the {ECHO off} flag was set, on direct
input mode.
- Fixed a bug that caused some commands to print error messages on {FOR} commands. Most notably, the {FIND} command (or at least,
windows's implementation) fails if there is no space at end of line, so it added automatically now.
- Fixed a bug with {SET /A} subcommand. It prefixed variable name with a space, making the result inconsistent.
- Made the hlp to work again, without problem, since version {0.7} and the deep changes made into {Dos9} core to get something more
modern.
{{Sunday 16th, March}}
- Started building a {x64} version of Dos9. I experienced troubles because of the lack of {x64} version of {MinGW}. However, I managed
to get a distribution of mingw-w64, the {MinGW} compiler adapted for {x64}, in the TDM-gcc. The install of {libintl} (and libiconv, on
which libintl depends) must be done by downloading packages from GNU ports, and do some tricks to get it compiled in the x64 version.
This is actually difficult to build, and unstable as a did not perform further tests.
- Started profiling the {Dos9} code base, looking for making {Dos9} more fast. The use of {gprof} has brought several interesting analysis.
On the one hand, I can't get explanation why is {cmd.exe} faster for long files, although if both are run at the same time, {Dos9} perform
about twice as much commands by second. The things to be updated are:
-- {Dos9_EsInit} and {Dos9_EsFree} function are far too expensive. It sometimes consumes {10%} of the global time-run, thus, we removed
parts of code from the {libDos9} library.
-- {Dos9_GetCommandProc} is far too expensive. I'm currently looking for an alternative, such as hash function. I haven't found a good one
yet (however), and i will probably write it by myself.
-- I'm also to optimise the execution times of {Dos9_String.h}. Those functions are almost ubiquitous in the code, so that large parts of
code will benefit from better execution rates. I'm especially targeting {Dos9_SearchChar} and {Dos9_SearchToken}, that account for a large
share (about 10% time execution overall).
@- All those test have be made for normal script optimisation, it was tested from a file that implement {goto}, {if}, {set} and {echo command}.
I also performed some tests on {for} command, as expected, functions that are the most time consuming are not the same. Though, the functions
i listed before were also much more time consuming than they need to be.
- Improved efficiency of {Dos9_String.h} and {Dos9_Estr.c} from the {libDos9} library. Also disabled some piece of code that ran thread in
some functions, that basically made them slow down. {Dos9} now achieve almost equivalent performances in {for} loops (about 100 lines/s less
than {cmd.exe}, without further optimisation), it also reach got execution rates at script level (with about 3250 lines/s while cmd.exe runs
at 2720 lines/s on average). It is surprisingly good because I did not even finished optimisation yet, so much better performances can be expected.
- Fixed a bug of {IF} command. The {lss} comparison operator was interpreted as {leq}.
{{Thursday 20th, March}}
- Started comparisons between {GCC} optimisation levels.
- Fixed a bug introduced in the function {Dos9_SearchLastToken}. It appears that, on windows, the code runs faster using {-O2} than using {-O3}
optimisation switches, this might be caused by processor caching, but however, this should not be expected to have the same effect on variouss
platform however. I ended up optimisation operations there, since the functions used by gprof account for about {70%} of the execution time, so
that I'm not sure it is reliable now. With {gprof} version, i've be able to achieve speeds of about {3700 l/s}, so the result are expected to be
at least double. In fact, by experimenting, I got only about {4000 l/s}, which it the speed of {cmd} on my computer when it consumes about 80%-90%
of the cpu, in random occasion, because cmd.exe's has really random performances. Instead, {Dos9} is limited to approximately {25%}.
{{Saturday 23th, March}}
- Fixed a bug in {Dos9_SearchLastChar} function.
- Fixed a bug with redirection that was not right dealt with. {Dos9} did not check whether several block are in a row on the same line.
- Added some functionalities to the {cmd/hlp.bat} script, which is meant to replace old-fashioned {hlp} manual page viewer. It is basically
designed to act as a manual page manager rather than just a viewer, by providing interfaces to build manual trees, and to get manual tress from the
repositories at {dos9.org} (this is to be implemented later).
- Changed names of the manual-pages subdirectories, they now match up with traditional *NIX-like local names that are widely used. Note that only useful
locales should be implemented (at most one for every language).
{{Tuesday 25th, March}}
- Implemented replacement for old {ENABLE/DISABLEDOS9MODE}. Instead of the variable, {Dos9} provides the {CMDLYCORRECT} options that can be
set through {SETLOCAL}, and that enables more compatibility features for {cmd.exe}.
- Option {CMDLYCORRECT} now affects {FOR} loops: If the option is set, then all blank lines are to be stripped for the output.
- Changed switch to specify part of lines that are not constituted of switches but by text. It is now {//}, a bit like *NIX's {--}.
{{Wednesday 26th, March}}
- Added a short internal documentation to get help for internal functions. These are however much tinier that the full documentation
given in {HLP}. This is voluntary, to fit in the executable.
- First implementation of the {CALL} command is now working. This is somewhat blurred because i've not written the full man page now,
but it seems functional.
- Fixed bug in Makefiles.
- Fixed a file from libDos9 that still used old name {CALLSTACK} instead of stack.
- Found out that in some cases, {tea} breaks unicode sequences by intruding some line feed in the file, This remains to be fixed.
This was actually fixed quickly.
- Fixed a bug that cause {tea} to loop infinitely if a word turned out to be to wide to fit on a single line. This is now fixed and
long words are now split in multiple lines.
- Fixed numerous bugs introduced by use of various encoding in the documentation, that is, some file were not built by {hlp} because
iconv was not able to convert file from erroneous encoding. This has been fixed and all pages builds up well with {hlp}.
- Added a couple of manual pages. It is also combined with new pages and translations.
{{Wednesday 2nd, April}}
- Implemented aliases within Dos9
- Added {ALIAS} command.
- Improved robustness of {Dos9_AddCommandDynamic}.
- Fixed some bugs with {CALL} function that was not really functional. It works much better now, but the features have not been all tested
yet.
- Fixed a bug that caused {%0} not to be set to the correct value by the {CALL} command. Now, the behaviour is the following:
-- if a {label} was given, {%0} contains this label.
-- if no {label} was given, {%0} contains the file name.
{{Tuesday 3rd, April}}
- Updated build system, so that building {Dos9} can allmost be done without user intervention. It's as simple as typing the
following line:
${make}
- Switched to version {2014.0.9}, because {dos9} is becoming pretty develloped now.
{{Monday 7th, April}}
- Fixed numerous bugs on the {GNU/Linux} version. Before that update, it
would have been fairly difficult to make it work. I posted only fixes
for GNU/Linux, but very few incompatibilities can be expected for
BSD based operating systems (and anyway, the only BSD based os i've
got is NetBSD, so that compatibility may not be achieved for other
versions. The major fixes included are :
-- A fix for the {autotools} build system, indeed, the old
{configure.ac} did not appended needed libraries (for
examples, there was confusions for {libintl}, that is included
in {GLibc} on {GNU/linux}). I think i'll consider choosing a
better build systems, because in facts, {autotools} adds endless
complications even for building quite simple code. The most
Annoying drawback is that in fact, you can't use {autoconf}
without using {automake}, otherwise, some bugs are introduced
that you'll never hear of reading the documentation.
Nevertheless, we don't need using {automake} to generate
Makefile that we could write, especially when the output
Makefile is about hundreds of KiB, and is constituted of
almost hacks to make it work with {make}. Thus, it's a bit
like using a program to produce garbage. {autoconf}
provides lots of interesting features, but these advantages are
superseded by its drawbacks. In particular, the fact that it
does not meet the UNIX conception standards (e.g. each program
should do only do one thing, and do it the best), so that the
dependencies between apparently distinct {autotools} programs
make the developer to use all the {autotools} programs.
-- A fix for the {Dos9} code itself. The last revisions of
{Dos9} included a lot of features that had not been tested
on *NIX operating systems. So that numerous incompatibilities
were introduced along source code modification. Mainly, the
{thread} part of {libDos9} had been left totally untested on
real system for versions. I apologize for that, I should not
have been waiting for such a long time to upgrade. So, fixes
in the code that have been made are:
--- Make wrapper around undefined symbols coming
from windows like {stricmp} ({strcasecmp} is used
instead).
--- Fixed bugs from {libDos9/threads}, It caused double
free exception for some errors.
--- Fixed used of {strupr} in {tea}. In fact, the
symbol for {strupr} that was intended to be used on
{GNU/Linux} was used on {Windows} platforms instead.
--- Fixed incompatibilities in {libDos9/file}. In fact,
default routines for *NIX used the functions {fopen}
to check whether a file existed or not. The bug
was introduced because in many *NIX systems,
directories are indeed files that can be opened.
{libDos9} now checks for regular files using the
{lstat} function instead.
--- Fixed incompatibilities with environment variables.
This issue was caused by the fact that environment
variables are case-sensitive for *NIX operating
systems while they are not for Windows systems. In
fact, {Dos9} already capitalized variable names when
variables were set, however, similar feature was not
provided for expansion. This is now fixed.
-- Fixes on other files, (I mean, on files that are not
required in order to make {Dos9} runing). Those fixes include:
--- Changed the name of the {Dos9} executable from
{Dos9} to {dos9}. This change will have no effect on
windows, but it is usual, however, to have command
executable names in lower characters. I may implement
a feature for {GNU/linux} that ignore case for the
command line. However, I now recommend using
uncapitalised characters for command name, if you
need compatibility, of course.
--- Fixed a bug with the translation system. It used
to scan file {dos9/lang/Dos9_Help.c} instead of file
{dos9/lang/Dos9_Lang.c}.
--- Fixed a bug from {Dos9_Auto.bat}, the current
version dit not included the path {%DOS9_PATH%} in
the {%PATH%} variable, that was problematic for *NIX
systems, however, the {Dos9} executable filename
should be looked up by the program itself, rather
than being included in {%PATH%}.
- Changed the way libraries are built. They are now build from within
the current direction, and they are located in {./lib} and headers for
libraries are located in {./include}.
- Fixed a bug in Makefiles that caused the manual pages to be copied
in a wrong directory (ie. {./bin/share/man} instead of
{./bin/share/man/man} that was wrong.
{{Thursday 10th, April}}
- Discovered a strange bug with pipes. This bug appears when input
have several lines, when the pipe is closed, the input is not
restored (or, at least, the input is not split from {stdin}). In
fact, this should not occur since when the pipe is no more redirected,
there is no more input left. This is strange though, as this problem
does not happen with single-lines input that appears to work fairly
good. It appears that this is caused by buffers that are stored
internally in the kernel of the operating systems. A solution that I
might consider is using regular files (instead of pipes) to produce
somewhat of a pipe effect, because I haven't actually found a way to
override the problem.
- Fixed a bug with the {Dos9_ParseOutput} function. It wasn't possible
to specify {2>&1} and {> foo} simultaneously, so, you it was not
possible to specify a redirection for {stdin} and {stdout} with
{truncate} attribute.
{{Monday 14th, April}}
- Added some corrections that make the pipe function quite well on both
{GNU/Linux} and {Windows} architectures (I also tested on {NetBSD} and
it worked pretty well, without further tests however).
- Added a few fixes on languages, and I'm starting adding new messages
for the {file} commands.
- Checked build on NetBSD. I've found out that {Dos9} conforms with
{POSIX.1-2001}. Thus, On some platform, if you want to build if, you
may specify a configuration that defines the {_POSIX_C_SOURCE} macro,
that is, type the configure line :
${./configure CFLAGS='-D_POSIX_C_SOURCE=200112'}
@- However, The NetBSD headers does not conform to {POSIX.1} and
perform wrong function exposures, so that if you use, it, you might
need to specify {_NETBSD_SOURCE} macro.
{{Thursday 17th, April}}
- Added some translation message in the locale.
- Added new manual pages and lots of fixes in the manual pages.
- Added {SHIFT} command. It can be really easy to manage argument, now,
however, I did not preform deep test on the command so that it might still be not reliable.
- Added {/f} switch to {ALIAS} command. This allows user to redefine internal commands and symbols, what was
not possible previously. I decided to let user override internal commands because I found it to be an
interesting thing to hack around, allowing to set up replacement commands for some batch that needs enhanced
compatibility features (although they should not need such compatibility features).
- Fixed a bug in {Dos9_Thread.c}, threads functions were making casts from different pointer sizes, ommiting
the pointed object were different. Thus, writing 8 bytes to a location which was supposed to be 4 bytes long,
depending on the locations of those data in the executable (and hence depending on compilation), it could
cause really dangerous errors, such as stack corruption for example, in some rare cases. This is now fixed,
preventing a rare crash to actually occur.
- This is the final build for at least a few months. I'll be very busy in the next few month, but I hope i'll
be able to submit new fix starting in the summer holidays.
{{Saturday 20th, April}}
- Fixed a bug that caused {Dos9} to crash if either {%PATH%} or {%PATHEXT%} (only for windows) were not in the
command environment.
- Corrected a bug with {tea} in {html} mode. The parser did used to escape the reserved characters {>} and {<}
but did not care of {&}. This bug is corrected, enabling {html} codes to work perfectly well. I hadn't noticed
it until yet because most recent browsers do not care about such errors, preventing error to be easilly
triggered.
- Fixed omission of {ansicon} on the {Dos9_Auto.bat}, which is launched at startup.
{{Saturday 14th, June}}
- Following advices of guys for dostips.org, changed the delimiters and the way quotes are handled:
-- The available delimiters are the following {(space),;(tab)}. This is now fully compatible with {cmd.exe}.
I also introduced functions in order no to take care of some of them ({,;}) since they may be used by some
programs for switches. (The first example I have is {gcc}, and options like:)
${gcc -Wl,import}
-- Changed the way quotes are handled. Quotes have now precedence over conditional operators ({\|&}) and command
blocks ({()}). This enables to make statements more secure using quotes. The new behaviour also conforms to cmd.exe
behaviour. Typically, the following code :
${IF foo==foo echo ") else ("}
@-- was understood differently by {Dos9} and {cmd.exe}. Now, the {") else ("} is considered to be escaped, and is no
more interpreted as a subcommand of {if}, as it did before.
-- Chosen a standard way to handle quotation marks, an to cut parameter. In fact, any delimiter that is between
two quotation marks is ignored. So that parameters are cut on unquoted delimiters, some example of now valid
parameters are :
${"simple quotation"
foo="foo bar"}
@-- and so on and so forth...
@-- If the interpreter finds an unpaired quotation mark, then, the remaining characters are considered to be
between quotation marks. So that, the following examples are equivalent:
${type "some file
type "some file"}
-- behaviour of function to remove quotation marks in parameters have also changed in order to achieve more
compatibility with {cmd.exe}. Basically, the algorithm that {Dos9} follows when removing parameters quotation
marks is:
--- If the parameter begin with a quotation mark, then remove it, otherwise, stop the algorithm at this
step.
--- If the parameter end by a quotation mark, then remove it either. But, do not remove it if the
parameter does not begin with a quotation mark.
- Cancelled the conversion of {Dos9} code to wide char. This was indeed far too hard (it implied modifying almost any
piece of code), and had little advantages (huge incompatibilities between various platform, particularly for non-c99
function that are obviously required in order to make thing working). Thus, I decided to make a wrapper over libC functions
in order to be able to use utf-8 internally. This way, I keep the code like it is, and preserve compatibility with other
platforms (Windows, Linux, NetBSD, DragonFly BSD, OpenBSD) and with POSIX. Moreover, this support for unicode may easily be
removed for platforms that do not handle utf-8, or those that do it natively.
{{Monday 16th, June}}
- Reorganized the source tree for internal commands. Before that, every file of the {command} subdirectory contained several
different commands. I found that is was not really practical for maintaining code, the code is now split in files that contains
each a different internal command.
- Added a functional {/Q} switch to the {RMDIR} command. However, it is supposed to deal with the {/S} switch, which is not
functional yet.
{{Thursday 19th, June}}
- I eventually decided to use the GNU toolchain to compile {Dos9}. I previously expressed lots of criticism toward use of autotools,
but libtool (which is par of the GNU toolchain) is unfortunately the only program that allows developers to deal with libraries
(statically or dynamically linked) in a platform independent way. This is the best solution I have, but if a newer build systems that
enables to make such things emerged, I'd be glad to move to it.
- Changed some source file name because {automake} was complaining about overlapping objects file names. Some of the name are more
logical, but, some are not really.
{{Tuesday 24th, June}}
- Corrected a bug that prevented local variable (eg. like {%1}) to be
used as argument with the {call} command, thanks to Jo15 from
{http://batch.xoo.it|batch.xoo.it} who reported the error.
- Added {local} target to {Makefile} that generates a local
installation of {Dos9} inside the folder {./bin}. It is as simple as
typing
${make local}
- Added macros from the {gnu gettext} package. Also enabled the use of
the --disable-nls switch for configure.
{{Friday 29th, August}}
This is the first time I write something in this file for a long time
now. I've been hacking around Dos9 for a little time now (haaa,
holidays). This is a list of improvements I made during from
24th June to today.
- Changed behaviour of parameter handling routines, valid
delimiter are now ",; " and tab. The way doubles quotes are handled
changed either. An quoted expression may be constituted of an
arbitrary long string that conforms to the following rules :
-- Any delimiter is ignored if it is surrounded by double
quotes.
-- If double quote, is directly preceded or followed by an
string characters that are not delimiter, this string is part of the
parameter.
-- And so on and so forth, until we reach unquoted delimiters
on both sides of the parameter.
@- Moreover, the quotes are removed if their position conform
to the following rules :
-- If a parameter begins with a double quote it will be
removed.
-- If a parameter ends with a double quote and begin with a
double quote, both are removed.
-- Else, keep the line like this.
- Fixed some autotools options, that where never mentioned under
mingw system.
- Fixed incompatibilities with the IF command. Now, the {IF} command
returns errors on case of string used as operators for {GEQ}, {GTR}
{LSS}, {LEQ} comparants. Moreover, the interpretor is able to handle
both hexadecimal, decimal and octal bases. Finally, implemented
comparants for floats (same as integer comparants but prefixed with f),
as a {Dos9} extension.
- Fixed issues of compatibility for the SET command. It is mainly a
matter of quotation marks handling, and typically, the issues for both
SET /p and SET are fixed, while little issue (not for simple /a
assignments of course) still exist for the SET /a command.
- Some fixes for the FOR command, now enabling the use of the three
numeric bases for all the parameters and preventing overflows in FOR /l
loops.
- Modified the FOR command in order to accept filename sets to be
given as input for the FOR /F command. This puts more sense on the
"usebackq" option.
- Added a custom environment within {Dos9} in order to instaure
cross-platform syntax capabilities like use of "=" in variable names
(which is impossible on many systems), to set "=x:" variables for
CD command.
- Corrected a bug with SET command, wich displayed system environment
while it was supposed to display {Dos9} custom environment.
- Corrected a bug that prevented the FOR command from getting command
input under any *nix OS (don't know the actual reason for this, but
I reimplemented the code using the *nix call fork(), which is,
frankly, much more convenient than tricky systems to communicate
between process under windows). The command redirection now works
pretty well on any *nix system.
- Added a Windows specific new CD command, to be compatible with
Windows {cmd.exe} features. The primitive version of CD is still
shipped for *nix operating systems (concept of disk is a huge
non-sense under Unix-like operating systems, because they represent
filesystems like a binariy tree which root is "/", and on which
filesystems and devices are mounted as directories).
- Fixed a bug, that always caused wrong pid to be awaited if the
process was forked on time through FOR /F command (with a command input)
under *nix operating systems, resulting in a mess between commands and
commands outputs.