You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
(20) |
Nov
(42) |
Dec
(32) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(10) |
Feb
(42) |
Mar
(53) |
Apr
(121) |
May
(98) |
Jun
(110) |
Jul
(110) |
Aug
(88) |
Sep
(123) |
Oct
(321) |
Nov
(172) |
Dec
(607) |
2008 |
Jan
(376) |
Feb
(52) |
Mar
(26) |
Apr
(60) |
May
(42) |
Jun
(120) |
Jul
(181) |
Aug
(318) |
Sep
(265) |
Oct
(225) |
Nov
(92) |
Dec
(103) |
2009 |
Jan
(202) |
Feb
(191) |
Mar
(102) |
Apr
(235) |
May
(169) |
Jun
(122) |
Jul
(178) |
Aug
(87) |
Sep
(102) |
Oct
(69) |
Nov
(71) |
Dec
(101) |
2010 |
Jan
(55) |
Feb
(139) |
Mar
(99) |
Apr
(101) |
May
(112) |
Jun
(65) |
Jul
(31) |
Aug
(50) |
Sep
(94) |
Oct
(101) |
Nov
(95) |
Dec
(103) |
2011 |
Jan
(139) |
Feb
(136) |
Mar
(80) |
Apr
(59) |
May
(34) |
Jun
(37) |
Jul
(66) |
Aug
(51) |
Sep
(29) |
Oct
(100) |
Nov
(49) |
Dec
(92) |
2012 |
Jan
(53) |
Feb
(147) |
Mar
(113) |
Apr
(60) |
May
(39) |
Jun
(164) |
Jul
(143) |
Aug
(84) |
Sep
(127) |
Oct
(91) |
Nov
(97) |
Dec
(103) |
2013 |
Jan
(162) |
Feb
(139) |
Mar
(106) |
Apr
(23) |
May
(80) |
Jun
(73) |
Jul
(39) |
Aug
(27) |
Sep
(38) |
Oct
(54) |
Nov
(95) |
Dec
(195) |
2014 |
Jan
(113) |
Feb
(46) |
Mar
(22) |
Apr
(18) |
May
(136) |
Jun
(145) |
Jul
(86) |
Aug
(70) |
Sep
(169) |
Oct
(216) |
Nov
(58) |
Dec
(19) |
2015 |
Jan
|
Feb
(5) |
Mar
(7) |
Apr
(15) |
May
(22) |
Jun
(18) |
Jul
(4) |
Aug
(2) |
Sep
(3) |
Oct
(21) |
Nov
(24) |
Dec
(1) |
2016 |
Jan
|
Feb
(7) |
Mar
(1) |
Apr
(19) |
May
(10) |
Jun
(31) |
Jul
(24) |
Aug
(41) |
Sep
(12) |
Oct
(19) |
Nov
|
Dec
|
2017 |
Jan
(12) |
Feb
(15) |
Mar
(12) |
Apr
(8) |
May
(25) |
Jun
(8) |
Jul
(18) |
Aug
(4) |
Sep
(11) |
Oct
(25) |
Nov
(7) |
Dec
(11) |
2018 |
Jan
(2) |
Feb
(13) |
Mar
(28) |
Apr
(53) |
May
(5) |
Jun
(6) |
Jul
(13) |
Aug
(23) |
Sep
(10) |
Oct
(14) |
Nov
(33) |
Dec
(116) |
2019 |
Jan
(46) |
Feb
(112) |
Mar
(38) |
Apr
(23) |
May
(10) |
Jun
(2) |
Jul
(18) |
Aug
(4) |
Sep
(11) |
Oct
(15) |
Nov
(15) |
Dec
(17) |
2020 |
Jan
(6) |
Feb
(12) |
Mar
(41) |
Apr
(36) |
May
(7) |
Jun
(18) |
Jul
(5) |
Aug
(6) |
Sep
(6) |
Oct
(8) |
Nov
(13) |
Dec
(9) |
2021 |
Jan
(1) |
Feb
(42) |
Mar
(37) |
Apr
(16) |
May
(25) |
Jun
(4) |
Jul
(14) |
Aug
(5) |
Sep
|
Oct
(15) |
Nov
(29) |
Dec
(11) |
2022 |
Jan
(10) |
Feb
(1) |
Mar
(8) |
Apr
(16) |
May
(46) |
Jun
(37) |
Jul
(36) |
Aug
(10) |
Sep
(15) |
Oct
(6) |
Nov
(6) |
Dec
(68) |
2023 |
Jan
(27) |
Feb
(18) |
Mar
(7) |
Apr
(21) |
May
(12) |
Jun
(8) |
Jul
(16) |
Aug
(16) |
Sep
(2) |
Oct
(8) |
Nov
(3) |
Dec
(17) |
2024 |
Jan
(27) |
Feb
(9) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <or...@us...> - 2024-03-15 16:33:03
|
Revision: 12796 http://sourceforge.net/p/oorexx/code-0/12796 Author: orexx Date: 2024-03-15 16:32:59 +0000 (Fri, 15 Mar 2024) Log Message: ----------- 20240315 Supply new location for the ReailDiagramGenerator tool. Modified Paths: -------------- docs/trunk/tools/RailRoadDiagrams/RailDiagramGenerator-readme.txt Modified: docs/trunk/tools/RailRoadDiagrams/RailDiagramGenerator-readme.txt =================================================================== --- docs/trunk/tools/RailRoadDiagrams/RailDiagramGenerator-readme.txt 2024-03-14 17:17:19 UTC (rev 12795) +++ docs/trunk/tools/RailRoadDiagrams/RailDiagramGenerator-readme.txt 2024-03-15 16:32:59 UTC (rev 12796) @@ -1,7 +1,10 @@ The ooRexx project uses a free tool "RailDiagramGenerator" for creating its -syntax diagrams from ebnf. It is located at: <https://www.bottlecaps.de/rr/ui>. +syntax diagrams from ebnf. +OUTDATED (20240315) It is located at: <https://www.bottlecaps.de/rr/ui>. +It is located at (20240315): <https://rr.red-dove.com/ui> + Those books that use syntax diagrams store them in: ${book}/en-US/images - *.ebnf: these are text files that contain the syntax definitions |
From: <or...@us...> - 2024-03-14 17:17:22
|
Revision: 12795 http://sourceforge.net/p/oorexx/code-0/12795 Author: orexx Date: 2024-03-14 17:17:19 +0000 (Thu, 14 Mar 2024) Log Message: ----------- 20240314 Rename the indexes HASOBJECTLOCK to HASSCOPELOCK and OBJECTLOCKCOUNT to SCOPELOCKCOUNT Modified Paths: -------------- main/trunk/interpreter/RexxClasses/CoreClasses.orx main/trunk/interpreter/concurrency/Activity.cpp main/trunk/interpreter/memory/GlobalNames.h Modified: main/trunk/interpreter/RexxClasses/CoreClasses.orx =================================================================== --- main/trunk/interpreter/RexxClasses/CoreClasses.orx 2024-03-14 15:58:34 UTC (rev 12794) +++ main/trunk/interpreter/RexxClasses/CoreClasses.orx 2024-03-14 17:17:19 UTC (rev 12795) @@ -4093,8 +4093,8 @@ if tmpOption='F' then -- full information mb~append("A", adjLeft(ap,4), " ") -- Attribute pool (variable dictionary) - mb~append("L", adjLeft(str(traceObj["OBJECTLOCKCOUNT"]),3), " ") -- L ... lock reserve count - isTrue=str(traceObj["HASOBJECTLOCK"]) + mb~append("L", adjLeft(str(traceObj["SCOPELOCKCOUNT"]),3), " ") -- L ... lock reserve count + isTrue=str(traceObj["HASSCOPELOCK"]) if isTrue='?' then mb~append(isTrue) -- indicates that value is not present else Modified: main/trunk/interpreter/concurrency/Activity.cpp =================================================================== --- main/trunk/interpreter/concurrency/Activity.cpp 2024-03-14 15:58:34 UTC (rev 12794) +++ main/trunk/interpreter/concurrency/Activity.cpp 2024-03-14 17:17:19 UTC (rev 12795) @@ -3110,8 +3110,8 @@ { traceObject -> put(new_integer(variableDictionaryNr), GlobalNames::ATTRIBUTEPOOL); // Rexx users relate better if using ATTRIBUTE traceObject -> put(activation->isGuarded() ? TheTrueObject : TheFalseObject, GlobalNames::ISGUARDED ); - traceObject -> put(new_integer(activation ? activation->getReserveCount() : 0), GlobalNames::OBJECTLOCKCOUNT); - traceObject -> put(activation->isObjectScopeLocked() ? TheTrueObject : TheFalseObject, GlobalNames::HASOBJECTLOCK); + traceObject -> put(new_integer(activation ? activation->getReserveCount() : 0), GlobalNames::SCOPELOCKCOUNT); + traceObject -> put(activation->isObjectScopeLocked() ? TheTrueObject : TheFalseObject, GlobalNames::HASSCOPELOCK); } return traceObject; } Modified: main/trunk/interpreter/memory/GlobalNames.h =================================================================== --- main/trunk/interpreter/memory/GlobalNames.h 2024-03-14 15:58:34 UTC (rev 12794) +++ main/trunk/interpreter/memory/GlobalNames.h 2024-03-14 17:17:19 UTC (rev 12795) @@ -259,12 +259,12 @@ GLOBAL_NAME(TOTALSECONDS, "TOTALSECONDS") GLOBAL_NAME(ATTRIBUTEPOOL, "ATTRIBUTEPOOL") // TraceObject: a counter (number) -GLOBAL_NAME(HASOBJECTLOCK, "HASOBJECTLOCK") // TraceObject: .true/.false (isObjectScopeLocked) +GLOBAL_NAME(HASSCOPELOCK, "HASSCOPELOCK") // TraceObject: .true/.false (isObjectScopeLocked) GLOBAL_NAME(INTERPRETER, "INTERPRETER") // TraceObject: a counter (number) GLOBAL_NAME(INVOCATION, "INVOCATION") // TraceObject: a counter (number) GLOBAL_NAME(ISGUARDED, "ISGUARDED") // TraceObject: .true/.false (method definition) -GLOBAL_NAME(OBJECTLOCKCOUNT, "OBJECTLOCKCOUNT") // TraceObject: a counter (number, reserveCount) GLOBAL_NAME(OPTION, "OPTION") // TraceObject: option at creation time +GLOBAL_NAME(SCOPELOCKCOUNT, "SCOPELOCKCOUNT") // TraceObject: a counter (number, reserveCount) GLOBAL_NAME(THREAD, "THREAD") // TraceObject: a counter (number, activity) GLOBAL_NAME(TRACELINE, "TRACELINE") // TraceObject: a trace line string GLOBAL_NAME(TRACEOBJECT, "TRACEOBJECT") // TraceObject: class name |
From: <or...@us...> - 2024-03-14 15:58:39
|
Revision: 12794 http://sourceforge.net/p/oorexx/code-0/12794 Author: orexx Date: 2024-03-14 15:58:34 +0000 (Thu, 14 Mar 2024) Log Message: ----------- 20240314 Fix the testbinary trace related test cases. Modified Paths: -------------- test/trunk/ooRexx/API/oo/tests/ioExitTrace.rex Modified: test/trunk/ooRexx/API/oo/tests/ioExitTrace.rex =================================================================== --- test/trunk/ooRexx/API/oo/tests/ioExitTrace.rex 2024-02-13 16:28:55 UTC (rev 12793) +++ test/trunk/ooRexx/API/oo/tests/ioExitTrace.rex 2024-03-14 15:58:34 UTC (rev 12794) @@ -5,7 +5,7 @@ */ /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2008-2019 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2008-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -42,10 +42,11 @@ trap = .SayTrap~new .error~destination(trap) - +tmpArr=.array~new; .traceObject~collector=tmpArr -- adjust for TraceObject TRACE ALL call trace OFF - +.traceObject~collector=.nil -- stop collecting +if trap~line<>"NOT RECEIVED" then return tmpArr[1]~traceLine return trap~line ::class sayTrap @@ -64,3 +65,4 @@ ::method activate class .error~destination(self~new) ::method lineout + |
From: P.O. J. <per...@ka...> - 2024-02-13 18:12:03
|
Unless Erich or Rick can fix this in the near time I suggest to comment out or otherwise disabling these test groups until there is time to fix them properly, at the moment all test runs for all platforms are failing, making it impossible to detect other problems. Hälsningar/Regards/Grüsse, P.O. Jonsson per...@ka... <mailto:per...@ka...> > Am 13.02.2024 um 17:28 schrieb orexx--- via Oorexx-svn <oor...@li... <mailto:oor...@li...>>: > > Revision: 12793 > http://sourceforge.net/p/oorexx/code-0/12793 <http://sourceforge.net/p/oorexx/code-0/12793> > Author: orexx > Date: 2024-02-13 16:28:55 +0000 (Tue, 13 Feb 2024) > Log Message: > ----------- > 20240213 Undoing change. It seems that not the TraceObject instance gets returned, but its objectName (a string) instead. Can only work again on this at the end of March (leaving for four weeks now), so anybody taking this problem on would be highly appreciated! > > Modified Paths: > -------------- > test/trunk/ooRexx/API/oo/ProcessRexxStart.testGroup > test/trunk/ooRexx/API/oo/RexxStart.testGroup > > Modified: test/trunk/ooRexx/API/oo/ProcessRexxStart.testGroup > =================================================================== > --- test/trunk/ooRexx/API/oo/ProcessRexxStart.testGroup 2024-02-12 18:08:57 UTC (rev 12792) > +++ test/trunk/ooRexx/API/oo/ProcessRexxStart.testGroup 2024-02-13 16:28:55 UTC (rev 12793) > @@ -241,8 +241,7 @@ > tester = .ProcessTester~new > tester~exitType = "DLL" > tester~ioExit = "SKIP" > --- self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) > - self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))~makeString) > + self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) > tester~ioExit = "DEBUG" > self~assertEquals("NOT RECEIVED", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) > > > Modified: test/trunk/ooRexx/API/oo/RexxStart.testGroup > =================================================================== > --- test/trunk/ooRexx/API/oo/RexxStart.testGroup 2024-02-12 18:08:57 UTC (rev 12792) > +++ test/trunk/ooRexx/API/oo/RexxStart.testGroup 2024-02-13 16:28:55 UTC (rev 12793) > @@ -245,7 +245,7 @@ > tester = .InvocationTester~new > tester~exitType = "DLL" > tester~ioExit = "SKIP" > - self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))~makeString) > + self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) > tester~ioExit = "DEBUG" > self~assertEquals("NOT RECEIVED", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) > > > > > _______________________________________________ > Oorexx-svn mailing list > Oor...@li... <mailto:Oor...@li...> > https://lists.sourceforge.net/lists/listinfo/oorexx-svn |
From: <or...@us...> - 2024-02-13 16:28:58
|
Revision: 12793 http://sourceforge.net/p/oorexx/code-0/12793 Author: orexx Date: 2024-02-13 16:28:55 +0000 (Tue, 13 Feb 2024) Log Message: ----------- 20240213 Undoing change. It seems that not the TraceObject instance gets returned, but its objectName (a string) instead. Can only work again on this at the end of March (leaving for four weeks now), so anybody taking this problem on would be highly appreciated! Modified Paths: -------------- test/trunk/ooRexx/API/oo/ProcessRexxStart.testGroup test/trunk/ooRexx/API/oo/RexxStart.testGroup Modified: test/trunk/ooRexx/API/oo/ProcessRexxStart.testGroup =================================================================== --- test/trunk/ooRexx/API/oo/ProcessRexxStart.testGroup 2024-02-12 18:08:57 UTC (rev 12792) +++ test/trunk/ooRexx/API/oo/ProcessRexxStart.testGroup 2024-02-13 16:28:55 UTC (rev 12793) @@ -241,8 +241,7 @@ tester = .ProcessTester~new tester~exitType = "DLL" tester~ioExit = "SKIP" --- self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) - self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))~makeString) + self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) tester~ioExit = "DEBUG" self~assertEquals("NOT RECEIVED", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) Modified: test/trunk/ooRexx/API/oo/RexxStart.testGroup =================================================================== --- test/trunk/ooRexx/API/oo/RexxStart.testGroup 2024-02-12 18:08:57 UTC (rev 12792) +++ test/trunk/ooRexx/API/oo/RexxStart.testGroup 2024-02-13 16:28:55 UTC (rev 12793) @@ -245,7 +245,7 @@ tester = .InvocationTester~new tester~exitType = "DLL" tester~ioExit = "SKIP" - self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))~makeString) + self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) tester~ioExit = "DEBUG" self~assertEquals("NOT RECEIVED", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) |
From: <or...@us...> - 2024-02-12 18:08:59
|
Revision: 12792 http://sourceforge.net/p/oorexx/code-0/12792 Author: orexx Date: 2024-02-12 18:08:57 +0000 (Mon, 12 Feb 2024) Log Message: ----------- 20240212 Adjust for TraceObject instances instead of strings. Modified Paths: -------------- test/trunk/ooRexx/API/oo/ProcessRexxStart.testGroup test/trunk/ooRexx/API/oo/RexxStart.testGroup Modified: test/trunk/ooRexx/API/oo/ProcessRexxStart.testGroup =================================================================== --- test/trunk/ooRexx/API/oo/ProcessRexxStart.testGroup 2024-02-12 17:57:24 UTC (rev 12791) +++ test/trunk/ooRexx/API/oo/ProcessRexxStart.testGroup 2024-02-12 18:08:57 UTC (rev 12792) @@ -1,7 +1,7 @@ #!/usr/bin/env rexx /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2008-2022 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2008-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -241,7 +241,8 @@ tester = .ProcessTester~new tester~exitType = "DLL" tester~ioExit = "SKIP" - self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) +-- self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) + self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))~makeString) tester~ioExit = "DEBUG" self~assertEquals("NOT RECEIVED", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) Modified: test/trunk/ooRexx/API/oo/RexxStart.testGroup =================================================================== --- test/trunk/ooRexx/API/oo/RexxStart.testGroup 2024-02-12 17:57:24 UTC (rev 12791) +++ test/trunk/ooRexx/API/oo/RexxStart.testGroup 2024-02-12 18:08:57 UTC (rev 12792) @@ -1,7 +1,7 @@ #!/usr/bin/env rexx /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2008-2022 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2008-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -245,7 +245,7 @@ tester = .InvocationTester~new tester~exitType = "DLL" tester~ioExit = "SKIP" - self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) + self~assertEquals(" 47 *-* call trace OFF", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))~makeString) tester~ioExit = "DEBUG" self~assertEquals("NOT RECEIVED", tester~callRexxStart(self~resolveTestProgram('tests/ioExitTrace.rex'), .array~new(0))) |
From: <or...@us...> - 2024-02-12 17:57:26
|
Revision: 12791 http://sourceforge.net/p/oorexx/code-0/12791 Author: orexx Date: 2024-02-12 17:57:24 +0000 (Mon, 12 Feb 2024) Log Message: ----------- 20240212 Adjust for TraceObject instances instead of strings. Modified Paths: -------------- test/trunk/ooRexx/base/keyword/TRACE.testGroup Modified: test/trunk/ooRexx/base/keyword/TRACE.testGroup =================================================================== --- test/trunk/ooRexx/base/keyword/TRACE.testGroup 2024-02-12 17:38:21 UTC (rev 12790) +++ test/trunk/ooRexx/base/keyword/TRACE.testGroup 2024-02-12 17:57:24 UTC (rev 12791) @@ -1,7 +1,7 @@ #!/usr/bin/env rexx /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2023 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2023-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -207,7 +207,7 @@ address 'invalid' '' address 'invalid' with output normal trace off - self~assertTraceOutput(.resources~address, t, start) + self~assertTraceOutput(.resources~address, makeStringArray(t), start) ::resource address end " ::end" 1 *-* address @@ -229,7 +229,7 @@ arg arg 1 a . trace off - self~assertTraceOutput(.resources~arg, t, start) + self~assertTraceOutput(.resources~arg, makeStringArray(t), start) ::resource arg end " ::end" 1 *-* arg @@ -249,7 +249,7 @@ call left 'abc', 1 call on user 123 trace off - self~assertTraceOutput(.resources~call, t, start) + self~assertTraceOutput(.resources~call, makeStringArray(t), start) ::resource call end " ::end" 1 *-* call left 'abc', 1 @@ -274,7 +274,7 @@ do item over 'a', 'b' end trace off - self~assertTraceOutput(.resources~do, t, start) + self~assertTraceOutput(.resources~do, makeStringArray(t), start) ::resource do end " ::end" 1 *-* do @@ -331,7 +331,7 @@ start = .line; trace i drop (list) trace off - self~assertTraceOutput(.resources~drop, t, start) + self~assertTraceOutput(.resources~drop, makeStringArray(t), start) ::resource drop end " ::end" 1 *-* drop (list) @@ -342,7 +342,7 @@ ::method test_trace_exit t = .TraceOutput~destination(.ArrayStream~new) .Routine~new("trace_exit", "trace i; exit 99")~call - self~assertTraceOutput(.resources~exit, t, 0) + self~assertTraceOutput(.resources~exit, makeStringArray(t), 0) ::resource exit end " ::end" 1 *-* exit 99 @@ -360,7 +360,7 @@ m = .Method~new("", "expose (list); ::options trace i") self~setMethod("trace_expose", m, "OBJECT") -- give access to object variables self~trace_expose - self~assertTraceOutput(.resources~expose, t, 0) + self~assertTraceOutput(.resources~expose, makeStringArray(t), 0) ::resource expose end " ::end" >I> Method "TRACE_EXPOSE" with scope "TRACE.TESTGROUP" in package "". @@ -378,7 +378,7 @@ forward message 'trace_forward' to (self) class (self~class) arguments (1, 2) continue forward message 'trace_forward_ret' array ('a', , 'b') continue trace off - self~assertTraceOutput(.resources~forward, t, start) + self~assertTraceOutput(.resources~forward, makeStringArray(t), start) -- all keywords TO, MESSAGE, CLASS, ARGUMENTS, and ARRAY are traced -- with >K>, and the return value is traced with >>> @@ -418,7 +418,7 @@ guard on guard off when v trace off - self~assertTraceOutput(.resources~guard, t, start) + self~assertTraceOutput(.resources~guard, makeStringArray(t), start) ::resource guard end " ::end" 1 *-* guard on @@ -440,7 +440,7 @@ else nop trace off - self~assertTraceOutput(.resources~if, t, start) + self~assertTraceOutput(.resources~if, makeStringArray(t), start) ::resource if end " ::end" 1 *-* if .true @@ -464,7 +464,7 @@ start = .line; trace i interpret 'a = 1' trace off - self~assertTraceOutput(.resources~interpret, t, start) + self~assertTraceOutput(.resources~interpret, makeStringArray(t), start) ::resource interpret end " ::end" 1 *-* interpret 'a = 1' @@ -484,7 +484,7 @@ iterate end trace off - self~assertTraceOutput(.resources~iterate, t, start) + self~assertTraceOutput(.resources~iterate, makeStringArray(t), start) ::resource iterate end " ::end" 1 *-* do 2 @@ -504,7 +504,7 @@ leave end trace off - self~assertTraceOutput(.resources~leave, t, start) + self~assertTraceOutput(.resources~leave, makeStringArray(t), start) ::resource leave end " ::end" 1 *-* do 2 @@ -522,7 +522,7 @@ loop i = 3 to 1 by -1 until i = 2 end trace off - self~assertTraceOutput(.resources~loop, t, start) + self~assertTraceOutput(.resources~loop, makeStringArray(t), start) ::resource loop end " ::end" 1 *-* loop 2 @@ -568,7 +568,7 @@ nop -- but they are traced when ... nop /* ... trailing a clause */ trace off - self~assertTraceOutput(.resources~nop, t, start) + self~assertTraceOutput(.resources~nop, makeStringArray(t), start) ::resource nop end " ::end" 3 *-* nop @@ -584,7 +584,7 @@ numeric form scientific numeric fuzz 0 trace off - self~assertTraceOutput(.resources~numeric, t, start) + self~assertTraceOutput(.resources~numeric, makeStringArray(t), start) ::resource numeric end " ::end" 1 *-* numeric digits (digits() + 1) @@ -604,7 +604,7 @@ start = .line; trace i options "string" trace off - self~assertTraceOutput(.resources~options, t, start) + self~assertTraceOutput(.resources~options, makeStringArray(t), start) ::resource options end " ::end" 1 *-* options "string" @@ -618,7 +618,7 @@ start = .line; trace i parse value 1 2 3 with x y . trace off - self~assertTraceOutput(.resources~parse, t, start) + self~assertTraceOutput(.resources~parse, makeStringArray(t), start) ::resource parse end " ::end" 1 *-* parse value 1 2 3 with x y . @@ -645,7 +645,7 @@ return a + 1 end: trace off - self~assertTraceOutput(.resources~procedure, t, start) + self~assertTraceOutput(.resources~procedure, makeStringArray(t), start) ::resource procedure end " ::end" 1 *-* a = 1 @@ -676,7 +676,7 @@ pull a . c pull a trace off - self~assertTraceOutput(.resources~pull_push_queue, t, start) + self~assertTraceOutput(.resources~pull_push_queue, makeStringArray(t), start) ::resource pull_push_queue end " ::end" 1 *-* push "1 2 3" @@ -706,7 +706,7 @@ p: raise user 999 array (1, 2) description "desc" return 1 end: trace off - self~assertTraceOutput(.resources~raise, t, start) + self~assertTraceOutput(.resources~raise, makeStringArray(t), start) --@@bug: "raise user 999 return 1" should trace >K> RETURN instead of RESULT --@@bug: "raise user 999 exit 1" should trace >K> EXIT instead of RESULT @@ -744,7 +744,7 @@ do i = 1 to 10 while t~items < 5 call SysSleep 0.001 -- wait for the REPLY thread to finish end - self~assertTraceOutput(.resources~reply, t, trace_reply_start) + self~assertTraceOutput(.resources~reply, makeStringArray(t), trace_reply_start) ::resource reply end " ::end" 1 *-* reply 1 @@ -763,7 +763,7 @@ say 1 || 2 trace off .Output~destination - self~assertTraceOutput(.resources~say, t, start) + self~assertTraceOutput(.resources~say, makeStringArray(t), start) ::resource say end " ::end" 1 *-* say 1 || 2 @@ -793,7 +793,7 @@ otherwise nop end trace off - self~assertTraceOutput(.resources~select, t, start) + self~assertTraceOutput(.resources~select, makeStringArray(t), start) -- @@bug #1850 but may well be intentional: -- END is traced when flow goes through OTHERWISE, but @@ -845,7 +845,7 @@ signal value "LBL2"; lbl2: signal on user 999 name user999 trace off - self~assertTraceOutput(.resources~signal, t, start) + self~assertTraceOutput(.resources~signal, makeStringArray(t), start) ::resource signal end " ::end" 1 *-* signal lbl1; @@ -862,7 +862,7 @@ t = .TraceOutput~destination(.ArrayStream~new) start = .line; trace i trace off - self~assertTraceOutput(.resources~trace, t, start) + self~assertTraceOutput(.resources~trace, makeStringArray(t), start) ::resource trace end " ::end" 1 *-* trace off @@ -874,7 +874,7 @@ start = .line; trace i use arg a = .nil trace off - self~assertTraceOutput(.resources~use, t, start) + self~assertTraceOutput(.resources~use, makeStringArray(t), start) ::resource use end " ::end" 1 *-* use arg a = .nil @@ -894,7 +894,7 @@ i = 1 a = a.i.i.i.i trace off - self~assertTraceOutput(.resources~compound, t, start) + self~assertTraceOutput(.resources~compound, makeStringArray(t), start) ::resource compound end " ::end" 1 *-* a. = '' @@ -917,7 +917,7 @@ t = .TraceOutput~destination(.ArrayStream~new) .Routine~new("trace_other_entrypoint", "::options trace i")~call - self~assertTraceOutput(.resources~entrypoint, t, 0) + self~assertTraceOutput(.resources~entrypoint, makeStringArray(t), 0) ::resource entrypoint end " ::end" >I> Routine "trace_other_entrypoint" in package "trace_other_entrypoint". @@ -929,7 +929,7 @@ start = .line; trace i 1~reverse trace off - self~assertTraceOutput(.resources~message, t, start) + self~assertTraceOutput(.resources~message, makeStringArray(t), start) ::resource message end " ::end" 1 *-* 1~reverse @@ -943,7 +943,7 @@ start = .line; trace i a = rexx:Array trace off - self~assertTraceOutput(.resources~namespace, t, start) + self~assertTraceOutput(.resources~namespace, makeStringArray(t), start) ::resource namespace end " ::end" 1 *-* a = rexx:Array @@ -963,7 +963,7 @@ use arg >v. return end: - self~assertTraceOutput(.resources~reference, t, start) + self~assertTraceOutput(.resources~reference, makeStringArray(t), start) ::resource reference end " ::end" 1 *-* call r >a. @@ -1083,6 +1083,7 @@ nnn *-* call trace "off" -- stop all tracing */ self~assertSame(4, t~items, "unexpected TRACE ?A output" t) + t=makeStringArray(t) self~assertSame("+++ *-* +++ Interactive *-*", - t[1]~word(1) t[2]~word(2) t[3]~subWord(1, 2) t[4]~word(2), - "unexpected TRACE ?A output" t) @@ -1098,6 +1099,7 @@ -- with no expressions, the expected TRACE ?R output is the same as -- above TRACE ?A output self~assertSame(4, t~items, "unexpected TRACE ?R output" t) + t=makeStringArray(t) self~assertSame("+++ *-* +++ Interactive *-*", - t[1]~word(1) t[2]~word(2) t[3]~subWord(1, 2) t[4]~word(2), - "unexpected TRACE ?R output" t) @@ -1124,6 +1126,7 @@ >A> "off" */ self~assertSame(11, t~items, "unexpected TRACE ?I output" t) + t=makeStringArray(t) self~assertSame("+++ *-* >V> >L> >A> >F> >A> +++ Interactive *-* >L> >A>", - t[1]~word(1) t[2]~word(2) t[3]~word(1) t[4]~word(1) t[5]~word(1) t[6]~word(1) - t[7]~word(1) t[8]~subWord(1, 2) t[9]~word(2) t[10]~word(1) t[11]~word(1), - @@ -1142,7 +1145,7 @@ nop /* 7 */ trace off -- ignore entry trace output +++ "platform METHOD /path/to/TRACE.testGroup" - self~assertTraceOutput(.resources~trace_numeric_debug, t~section(2), start) + self~assertTraceOutput(.resources~trace_numeric_debug, makeStringArray(t)~section(2), start) ::resource trace_numeric_debug end " ::end" 1 *-* nop /* 1 */ @@ -1169,5 +1172,12 @@ raise notready return self[line] +::routine makeStringArray -- turn array of TraceObject instances in an array of strings + use arg inArray + outArray=.array~new + do traceObj over inArray + outArray~append(traceObj~makeString) + end + return outArray ::options all syntax error condition failure condition |
From: <or...@us...> - 2024-02-12 17:38:23
|
Revision: 12790 http://sourceforge.net/p/oorexx/code-0/12790 Author: orexx Date: 2024-02-12 17:38:21 +0000 (Mon, 12 Feb 2024) Log Message: ----------- 20240212 Remove outdated statement. Modified Paths: -------------- test/trunk/ooRexx/base/directives/OPTIONS.testGroup Modified: test/trunk/ooRexx/base/directives/OPTIONS.testGroup =================================================================== --- test/trunk/ooRexx/base/directives/OPTIONS.testGroup 2024-02-12 17:37:44 UTC (rev 12789) +++ test/trunk/ooRexx/base/directives/OPTIONS.testGroup 2024-02-12 17:38:21 UTC (rev 12790) @@ -589,7 +589,6 @@ do traceObj over trace traceAsString~append(traceObj~makeString) end - -- self~assertSameList(traceExpected, trace, .Array~of("expected:")~appendAll(traceExpected)~~append("actual:")~appendAll(trace)~toString) self~assertSameList(traceExpected, traceAsString, .Array~of("expected:")~appendAll(traceExpected)~~append("actual:")~appendAll(traceAsString)~toString) -- [bugs:#1581] trace "all" crashes when the scope of a method is NIL |
From: <or...@us...> - 2024-02-12 17:37:46
|
Revision: 12789 http://sourceforge.net/p/oorexx/code-0/12789 Author: orexx Date: 2024-02-12 17:37:44 +0000 (Mon, 12 Feb 2024) Log Message: ----------- 20240212 Adjust for TraceObject instances instead of strings. Modified Paths: -------------- test/trunk/ooRexx/base/runtime.objects/environmentEntries.testGroup Modified: test/trunk/ooRexx/base/runtime.objects/environmentEntries.testGroup =================================================================== --- test/trunk/ooRexx/base/runtime.objects/environmentEntries.testGroup 2024-02-12 17:31:58 UTC (rev 12788) +++ test/trunk/ooRexx/base/runtime.objects/environmentEntries.testGroup 2024-02-12 17:37:44 UTC (rev 12789) @@ -1,7 +1,7 @@ #!/usr/bin/env rexx /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2007-2022 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2007-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -157,8 +157,12 @@ .Error~destination thirdLabel: line3 = .line -- only these two lines of trace output should have been captured + arrayStreamAsStringArray=.array~new + do traceObj over arrayStream + arrayStreamAsStringArray~append(traceObj~makeString) + end self~assertSameList(( - - line1~format(6) "*-* label:", line3~format(6) "*-* thirdLabel:"), arrayStream) + line1~format(6) "*-* label:", line3~format(6) "*-* thirdLabel:"), arrayStreamAsStringArray) -- back to default .Error~destination |
From: <or...@us...> - 2024-02-12 17:32:01
|
Revision: 12788 http://sourceforge.net/p/oorexx/code-0/12788 Author: orexx Date: 2024-02-12 17:31:58 +0000 (Mon, 12 Feb 2024) Log Message: ----------- 20240212 Adjust for TraceObject instances instead of strings. Modified Paths: -------------- test/trunk/ooRexx/base/directives/OPTIONS.testGroup Modified: test/trunk/ooRexx/base/directives/OPTIONS.testGroup =================================================================== --- test/trunk/ooRexx/base/directives/OPTIONS.testGroup 2024-02-12 13:25:25 UTC (rev 12787) +++ test/trunk/ooRexx/base/directives/OPTIONS.testGroup 2024-02-12 17:31:58 UTC (rev 12788) @@ -1,7 +1,7 @@ #!/usr/bin/env rexx /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2007-2022 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2007-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -584,8 +584,14 @@ ' >I> Routine "R" in package "".', - ' 4 *-* lbl:', - ' >I> Method "M" with scope "C" in package "".') - self~assertSameList(traceExpected, trace, .Array~of("expected:")~appendAll(traceExpected)~~append("actual:")~appendAll(trace)~toString) + traceAsString=.array~new + do traceObj over trace + traceAsString~append(traceObj~makeString) + end + -- self~assertSameList(traceExpected, trace, .Array~of("expected:")~appendAll(traceExpected)~~append("actual:")~appendAll(trace)~toString) + self~assertSameList(traceExpected, traceAsString, .Array~of("expected:")~appendAll(traceExpected)~~append("actual:")~appendAll(traceAsString)~toString) + -- [bugs:#1581] trace "all" crashes when the scope of a method is NIL ::method test_options_trace_all_with_floating_method -- we redirect 'trace all' output to an Array @@ -613,9 +619,9 @@ -- check a few things -- the floating method's (missing) name is displayed as *UNNAMED* - self~assertTrue(trace[trace~last]~contains("*UNNAMED*")) + self~assertTrue(trace[trace~last]~makeString~contains("*UNNAMED*")) -- the floating method's scope is displayed as ".NIL" - self~assertTrue(trace[trace~last]~contains('".NIL"')) + self~assertTrue(trace[trace~last]~makeString~contains('".NIL"')) ::class ArrayStream subclass OutputStream |
From: <or...@us...> - 2024-02-12 13:25:27
|
Revision: 12787 http://sourceforge.net/p/oorexx/code-0/12787 Author: orexx Date: 2024-02-12 13:25:25 +0000 (Mon, 12 Feb 2024) Log Message: ----------- 20240212 MT trace, cf. https://sourceforge.net/p/oorexx/feature-requests/825/ Modified Paths: -------------- main/trunk/interpreter/RexxClasses/CoreClasses.orx main/trunk/interpreter/concurrency/Activity.cpp main/trunk/interpreter/concurrency/Activity.hpp main/trunk/interpreter/execution/RexxActivation.cpp main/trunk/interpreter/execution/RexxActivation.hpp main/trunk/interpreter/execution/VariableDictionary.cpp main/trunk/interpreter/execution/VariableDictionary.hpp main/trunk/interpreter/memory/GlobalNames.h main/trunk/interpreter/runtime/InterpreterInstance.cpp main/trunk/interpreter/runtime/InterpreterInstance.hpp Modified: main/trunk/interpreter/RexxClasses/CoreClasses.orx =================================================================== --- main/trunk/interpreter/RexxClasses/CoreClasses.orx 2024-02-01 18:16:20 UTC (rev 12786) +++ main/trunk/interpreter/RexxClasses/CoreClasses.orx 2024-02-12 13:25:25 UTC (rev 12787) @@ -3979,3 +3979,164 @@ s=result -- fetch & save the returned instance end return s -- return singleton instance + + +/** This class maintains trace information meant to support debugging and analyzing +* execution traces. The makeString method will return a string that will be formatted +* according to the current setting of the OPTION class attribute. If the COLLECTOR +* class attribute is not .nil then the traceObject will be appended to it. +* +*/ +::class "TraceObject" subclass StringTable public + +---------------------- class level ---------------------- +::method activate class + expose option collector counter + self~activate:super + option ='N' -- normal (makeString returns the TRACELINE entry) + collector=.nil -- no appending to the collector will take place + counter =0 -- value will be used to number the TraceObject instances + +::method new class -- a new instance gets requested + expose option collector counter + dt = .dateTime~new -- take the current date and time + forward class (super) continue -- let the superclass do the job + newObj = result -- fetch freshly created object + newObj["TIMESTAMP"]=dt + newObj["OPTION"] =option + counter += 1 + newObj["NR"] =counter + if \collector~isNil then -- collector exists, append traceObject + collector~append(newObj) + return newObj -- return the new object + +::attribute collector class -- .nil or an object that does understand APPEND(object) + +::attribute counter get class -- we only allow get access + +::attribute option set class + expose option + parse upper arg o +1 -- extract first letter + pos=pos(o,"NTSFP") -- option letter in hand? (Normal, Thread, Standard, Full, Profiling) + if pos>0 then -- valid option, use it + option=o + else -- unknown option, raise condition + raise syntax 93.914 array (1, '"N" (normal), "T" (thread), "S" (standard), "F" (full) or "P" (profiling)', arg(1)) + +::attribute option get class + +::method setMakeString class -- allow replacing the predefined makeStringImpl method + use strict arg newMethod + self~setMethod("makeStringImpl",newMethod) -- replace the makeStringImpl method with the new one + +::method unsetMakeString class -- allow replacing the predefined makeStringImpl method + use strict arg + self~unsetMethod("makeStringImpl") -- remove any set makeStringImpl method + + +/** Create the traceline string, if option: +* 'N' ... just return the traceline (default) + +* 'T' ... inserts the thread in the trace prefix after the second character ... thread + +* 'S' ... return prefix [T1 I1 ] ... thread, invocation + for a method statement: +* [T1 I1 G L1 *] ... thread, invocation, guarded/unguarded, lockcount, hasObjectLock +* 'F' ... return prefix [R1 T1 I1 ]... interpreter, thread, invocation + for a method statement: +* [R1 T1 I1 G A1 L1 *] ... interpreter, thread, invocation, guarded/unguarded, attribute pool, lockcount, hasObjectLock +* 'P' ... will cause ooRexx to not forward the traceObject (this option is meant for profiling); + if set while makeString gets invoked via a Rexx program, then makeString will + format the traceline with the option in effect of creating the TraceObject (if still + 'P', then use 'N' formating) +*/ +::method makeStringImpl class -- the formatting method + expose option + use strict arg traceObj + + tmpOption=option -- get current option + + if tmpOption='P' then -- currently profiling/probing, use original option if not 'P' + do + oriOption=str(traceObj["OPTION"]) -- get original option, if also 'P', then use 'N' formatting + if oriOption='?' then -- OPTION entry does not exist, resort to 'N' formatting + tmpOption='N' -- if no option available, format as normal + else -- if original option is P as well then format as normal, otherwise as original option + tmpOption=(oriOption='P')~?('N',oriOption) + end + + if tmpOption='N' then return str(traceObj["TRACELINE"]) + + if tmpOption='T' then + do + parse value traceObj~traceline with line 7 prefix rest + return line prefix~insert(traceObj["THREAD"],2) rest + end + + mb = .MutableBuffer~new -- for performance reasons + mb~append("[") + if tmpOption='F' then -- full information + mb~append("R", adjLeft(str(traceObj["INTERPRETER"]),3), " ") -- R_exx interpreter instance + + mb~append("T", adjLeft(str(traceObj["THREAD"]) ,3), " ") -- T_hread/activity + mb~append("I", adjLeft(str(traceObj["INVOCATION"]),4) ) -- I_nvocation/activation + ap=traceObj["ATTRIBUTEPOOL"] + if \ap~isNil then -- an object's variable dictionary in hand, we are in a method + do + mb~append(" ") + isTrue=str(traceObj["ISGUARDED"]) + if isTrue='?' then + mb~append(isTrue) -- ? (if not set), else G_uarded or U_unguarded + else + mb~append(isTrue~?("G","U"), " ") -- G_uarded or U_unguarded + + if tmpOption='F' then -- full information + mb~append("A", adjLeft(ap,4), " ") -- Attribute pool (variable dictionary) + + mb~append("L", adjLeft(str(traceObj["OBJECTLOCKCOUNT"]),3), " ") -- L ... lock reserve count + isTrue=str(traceObj["HASOBJECTLOCK"]) + if isTrue='?' then + mb~append(isTrue) -- indicates that value is not present + else + mb~append(isTrue~?("*"," ")) -- asterisk to indicate holding object lock (can execute) + mb~append("] ") + end + else -- no object related information in this traceObject + do + if tmpOption='S' then + mb~append("] ") -- Standard: make sure we align traceline + else + mb~append("] ") -- Full: make sure we align traceline + end + + mb~append(str(traceObj["TRACELINE"])) + return mb~string -- return trace line with mtPrefix + + +adjLeft: procedure -- left adjust, but make sure we show all chars + use arg value, width + if value~length>=width then -- no left adjustment + return value + return value~left(width) -- left adjust with given width + +str: procedure -- make sure we supply a string if .nil, otherwise MutableBuffer causes an error + use arg value + if value~isNil then return '?' -- no entry, Rexx user omitted or deleted it + return value + + +---------------------- instance level ------------------- + +::method compareTo -- allow sorting, by default by NR which represents the creation sequence + use arg other + return sign(nz(self["NR"],-1) - nz(other["NR"],-1)) -- cf. rexxref.pdf, ComparableClass' compareTo definition + +nz: procedure -- in case a Rexx user removed the NR entry, make sure the subtraction can take place + use arg val,ifNilValue=0 + if val~isNil then return ifNilValue + return val + +::method makeString -- returns the traceline string + return self~class~makeStringImpl(self) -- let the class method makeStringImpl do the work + + Modified: main/trunk/interpreter/concurrency/Activity.cpp =================================================================== --- main/trunk/interpreter/concurrency/Activity.cpp 2024-02-01 18:16:20 UTC (rev 12786) +++ main/trunk/interpreter/concurrency/Activity.cpp 2024-02-12 13:25:25 UTC (rev 12787) @@ -78,8 +78,12 @@ #include "MutexSemaphore.hpp" #include "IdentityTableClass.hpp" +#include "StringTableClass.hpp" + #include <stdio.h> #include <time.h> +#include <atomic> +#include <unordered_map> const size_t ACT_STACK_SIZE = 20; @@ -98,6 +102,17 @@ } +static std::atomic<uint32_t> counter(0); // to generate idntfr for concurrency trace information +static std::unordered_map<thread_id_t, uint32_t> threadIDs; // to associate idntfr to system threads + +uint32_t Activity::getIdntfr() +{ + thread_id_t threadID = currentThread.getThreadID(); + if (threadIDs.find(threadID) == threadIDs.end()) threadIDs[threadID] = ++counter; + return threadIDs[threadID]; +} + + /** * Normal garbage collection live marking * @@ -3059,6 +3074,49 @@ } + +// ---- begin TraceObject; caching class for performance reasons (if the Rexx user +// should be allowed to change the class object after tracing has started, we +// need to change the logic to do the findClass() each time) +inline RexxClass *getRexxPackageTraceObject() // only do the findClass() once +{ + static RexxClass *RexxPackageTraceObject = OREF_NULL; + if (RexxPackageTraceObject==OREF_NULL) + { + RexxObject *t = OREF_NULL; // required for the findClass call + RexxPackageTraceObject = TheRexxPackage->findClass(GlobalNames::TRACEOBJECT, t); + } + return RexxPackageTraceObject; +} + + +/** Fill in additional trace information, some concurrency related. */ +StringTable* CreateTraceObject(Activity *activity, RexxActivation *activation, RexxString *traceline) +{ + ProtectedObject result; + StringTable *traceObject = (StringTable *) getRexxPackageTraceObject()->messageSend(GlobalNames::NEW, OREF_NULL, 0, result); + ProtectedObject p(traceObject); + + traceObject -> put(traceline, GlobalNames::TRACELINE ); + traceObject -> put(new_integer(activity->getInstance()->getIdntfr()), GlobalNames::INTERPRETER ); + traceObject -> put(new_integer(activity->getIdntfr()), GlobalNames::THREAD ); + + traceObject -> put(new_integer(activation ? activation->getIdntfr() : 0), GlobalNames::INVOCATION); + + // get variableDictionary if any + VariableDictionary *variableDictionary = (activation ? activation->getVariableDictionary() : NULL); + size_t variableDictionaryNr = variableDictionary ? variableDictionary->getIdntfr() : 0; + if (variableDictionaryNr > 0) // if method routine, get further information + { + traceObject -> put(new_integer(variableDictionaryNr), GlobalNames::ATTRIBUTEPOOL); // Rexx users relate better if using ATTRIBUTE + traceObject -> put(activation->isGuarded() ? TheTrueObject : TheFalseObject, GlobalNames::ISGUARDED ); + traceObject -> put(new_integer(activation ? activation->getReserveCount() : 0), GlobalNames::OBJECTLOCKCOUNT); + traceObject -> put(activation->isObjectScopeLocked() ? TheTrueObject : TheFalseObject, GlobalNames::HASOBJECTLOCK); + } + return traceObject; +} + + /** * Write out a line of trace output. * @@ -3068,11 +3126,19 @@ void Activity::traceOutput(RexxActivation *activation, RexxString *line) { // make sure this is a real string value (likely, since we constructed it in the first place) - line = line->stringTrace(); + Protected<RexxString> pline = line->stringTrace(); + Protected<StringTable> traceObject=CreateTraceObject(this, activation, pline); + // if the exit passes on the call, we write this to the .traceouput - if (callTraceExit(activation, line)) + if (callTraceExit(activation, pline)) { + // if in profiling mode we only let collect the traceObjects, but do not issue the tracelin + // we do not output the traceLine if currently in profiling mode + RexxObject *option = (RexxString *) traceObject->get(GlobalNames::OPTION); // the entry may be missing + if (option && ((RexxString *) option)->getStringData()[0] == 'P') + return; + RexxObject *stream = getLocalEnvironment(GlobalNames::TRACEOUTPUT); if (stream != OREF_NULL && stream != TheNilObject) @@ -3082,17 +3148,18 @@ try { ProtectedObject result; - stream->sendMessage(GlobalNames::LINEOUT, line, result); + + stream->sendMessage(GlobalNames::LINEOUT, traceObject, result); } catch (NativeActivation *) { - lineOut(line); // don't lose the data! + lineOut(traceObject->requestString()); // don't lose the data! } } // could not find the target, but don't lose the data! else { - lineOut(line); + lineOut(traceObject->requestString()); // don't lose the data! } } } Modified: main/trunk/interpreter/concurrency/Activity.hpp =================================================================== --- main/trunk/interpreter/concurrency/Activity.hpp 2024-02-01 18:16:20 UTC (rev 12786) +++ main/trunk/interpreter/concurrency/Activity.hpp 2024-02-12 13:25:25 UTC (rev 12787) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2020 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -220,6 +220,7 @@ void detachInstance(); void detachThread(); inline InterpreterInstance *getInstance() { return instance; } + uint32_t getIdntfr(); void nestAttach(); void returnAttach(); Modified: main/trunk/interpreter/execution/RexxActivation.cpp =================================================================== --- main/trunk/interpreter/execution/RexxActivation.cpp 2024-02-01 18:16:20 UTC (rev 12786) +++ main/trunk/interpreter/execution/RexxActivation.cpp 2024-02-12 13:25:25 UTC (rev 12787) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2023 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -82,8 +82,20 @@ #include "CommandIOConfiguration.hpp" #include "CommandIOContext.hpp" #include "LibraryPackage.hpp" + +#include <atomic> + #include <stdexcept> // std::exception_ptr, std::current_exception, std::rethrow_exception + +static std::atomic<uint32_t> counter(0); // to generate idntfr for concurrency trace + +uint32_t RexxActivation::getIdntfr() +{ + if (idntfr == 0) idntfr = ++counter; + return idntfr; +} + /** * Create a new activation object * @@ -450,6 +462,7 @@ // the "msgname" can also be the name of an external routine, the label // name of an internal routine. settings.messageName = name; + bool traceEntryDone = false; // not a reply restart situation? We need to do the full // initial setup @@ -495,6 +508,19 @@ { // get the object variables and reserve these settings.objectVariables = receiver->getObjectVariables(scope); + + // For proper diagnostic in case of deadlock, do the trace now + if (tracingLabels() && isMethodOrRoutine()) + { + traceEntry(); + if (!tracingAll()) + { + // we pause on the label only for ::OPTIONS TRACE LABELS + pauseLabel(); + } + traceEntryDone = true; + } + settings.objectVariables->reserve(activity); objectScope = SCOPE_RESERVED; } @@ -559,7 +585,7 @@ // is a routine or method invocation in one of those packages, give the // initial entry trace so the user knows where we are. // Must be one of ::OPTIONS TRACE ALL/RESULTS/INTERMEDIATES/LABELS - if (tracingLabels() && isMethodOrRoutine()) + if (!traceEntryDone && tracingLabels() && isMethodOrRoutine()) { traceEntry(); if (!tracingAll()) Modified: main/trunk/interpreter/execution/RexxActivation.hpp =================================================================== --- main/trunk/interpreter/execution/RexxActivation.hpp 2024-02-01 18:16:20 UTC (rev 12786) +++ main/trunk/interpreter/execution/RexxActivation.hpp 2024-02-12 13:25:25 UTC (rev 12787) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2023 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -122,6 +122,7 @@ void live(size_t) override; void liveGeneral(MarkReason reason) override; + uint32_t getIdntfr(); RexxObject *dispatch() override; wholenumber_t digits() override; wholenumber_t fuzz() override; @@ -407,6 +408,9 @@ inline bool isTopLevel() { return (activationContext&TOP_LEVEL_CALL) != 0; } inline bool isGuarded() { return settings.isGuarded(); } inline void setGuarded() { settings.setGuarded(true); } + inline bool isObjectScopeLocked() { return this->objectScope == SCOPE_RESERVED; } // for concurrency trace + unsigned short getReserveCount() { VariableDictionary *ovd = this->getVariableDictionary(); return ovd ? ovd->getReserveCount() : 0; } // for concurrency trace. Try to get the ovd counter, even if not yet assigned to current activation. + VariableDictionary * getVariableDictionary() { return this->receiver ? this->receiver->getObjectVariables(this->scope) : NULL; } // for concurrency trace. Try to get the ovd, even if not yet assigned to current activation. void enableExternalTrace(); void disableExternalTrace(); @@ -631,5 +635,6 @@ bool randomSet; // random seed has been set size_t blockNest; // block instruction nesting level size_t instructionCount; // The number of instructions since we last yielded control + uint32_t idntfr; // idntfr for concurrency trace }; #endif Modified: main/trunk/interpreter/execution/VariableDictionary.cpp =================================================================== --- main/trunk/interpreter/execution/VariableDictionary.cpp 2024-02-01 18:16:20 UTC (rev 12786) +++ main/trunk/interpreter/execution/VariableDictionary.cpp 2024-02-12 13:25:25 UTC (rev 12787) @@ -62,8 +62,18 @@ #include "DirectoryClass.hpp" #include "GlobalNames.hpp" #include "CompoundTableElement.hpp" +#include <atomic> +static std::atomic<uint32_t> counter(0); // to generate idntfr for concurrency trace + +uint32_t VariableDictionary::getIdntfr() +{ + if (idntfr == 0) idntfr = ++counter; + return idntfr; +} + + /** * Create a new variable dictionary object. * Modified: main/trunk/interpreter/execution/VariableDictionary.hpp =================================================================== --- main/trunk/interpreter/execution/VariableDictionary.hpp 2024-02-01 18:16:20 UTC (rev 12786) +++ main/trunk/interpreter/execution/VariableDictionary.hpp 2024-02-12 13:25:25 UTC (rev 12787) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2018 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -204,6 +204,9 @@ RexxObject *realStemValue(RexxString *stemName); + uint32_t getIdntfr(); + inline unsigned short getReserveCount() { return reserveCount; } // for concurrency trace + inline bool isScope(RexxClass *otherScope) { return scope == otherScope; } inline VariableDictionary *getNextDictionary() { return nextDictionary; } inline Activity *getReservingActivity() { return reservingActivity; } @@ -226,6 +229,7 @@ unsigned short reserveCount; // number of times reserved VariableDictionary *nextDictionary; // chained object dictionary RexxClass *scope; // scopy of this object dictionary + uint32_t idntfr; // idntfr for concurrency trace }; inline VariableDictionary *new_variableDictionary(size_t s) { return new VariableDictionary(s); } Modified: main/trunk/interpreter/memory/GlobalNames.h =================================================================== --- main/trunk/interpreter/memory/GlobalNames.h 2024-02-01 18:16:20 UTC (rev 12786) +++ main/trunk/interpreter/memory/GlobalNames.h 2024-02-12 13:25:25 UTC (rev 12787) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2022 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -258,3 +258,13 @@ GLOBAL_NAME(TIMESPAN, "TIMESPAN") GLOBAL_NAME(TOTALSECONDS, "TOTALSECONDS") +GLOBAL_NAME(ATTRIBUTEPOOL, "ATTRIBUTEPOOL") // TraceObject: a counter (number) +GLOBAL_NAME(HASOBJECTLOCK, "HASOBJECTLOCK") // TraceObject: .true/.false (isObjectScopeLocked) +GLOBAL_NAME(INTERPRETER, "INTERPRETER") // TraceObject: a counter (number) +GLOBAL_NAME(INVOCATION, "INVOCATION") // TraceObject: a counter (number) +GLOBAL_NAME(ISGUARDED, "ISGUARDED") // TraceObject: .true/.false (method definition) +GLOBAL_NAME(OBJECTLOCKCOUNT, "OBJECTLOCKCOUNT") // TraceObject: a counter (number, reserveCount) +GLOBAL_NAME(OPTION, "OPTION") // TraceObject: option at creation time +GLOBAL_NAME(THREAD, "THREAD") // TraceObject: a counter (number, activity) +GLOBAL_NAME(TRACELINE, "TRACELINE") // TraceObject: a trace line string +GLOBAL_NAME(TRACEOBJECT, "TRACEOBJECT") // TraceObject: class name Modified: main/trunk/interpreter/runtime/InterpreterInstance.cpp =================================================================== --- main/trunk/interpreter/runtime/InterpreterInstance.cpp 2024-02-01 18:16:20 UTC (rev 12786) +++ main/trunk/interpreter/runtime/InterpreterInstance.cpp 2024-02-12 13:25:25 UTC (rev 12787) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2022 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -52,8 +52,18 @@ #include "WeakReferenceClass.hpp" #include "RoutineClass.hpp" #include "NativeActivation.hpp" +#include <atomic> +static std::atomic<uint32_t> counter(0); // to generate idntfr for concurrency trace + +uint32_t InterpreterInstance::getIdntfr() +{ + if (idntfr == 0) idntfr = ++counter; + return idntfr; +} + + /** * Create a new Package object instance. * Modified: main/trunk/interpreter/runtime/InterpreterInstance.hpp =================================================================== --- main/trunk/interpreter/runtime/InterpreterInstance.hpp 2024-02-01 18:16:20 UTC (rev 12786) +++ main/trunk/interpreter/runtime/InterpreterInstance.hpp 2024-02-12 13:25:25 UTC (rev 12787) @@ -1,6 +1,6 @@ /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2005-2020 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -79,6 +79,7 @@ RexxString *getDefaultEnvironment() { return defaultEnvironment; } Activity *getRootActivity() { return rootActivity; } + uint32_t getIdntfr(); InterpreterInstance(ExitHandler *handlers); void addActivity(Activity *); @@ -144,6 +145,7 @@ RexxString *searchPath; // additional Rexx search path ArrayClass *searchExtensions; // extensions to search on for external calls void *applicationData; // application specific data + uint32_t idntfr; // idntfr for concurrency trace DirectoryClass *localEnvironment; // the current local environment StringTable *commandHandlers; // our list of command environment handlers StringTable *requiresFiles; // our list of requires files used by this instance |
From: <eri...@us...> - 2024-02-01 18:16:23
|
Revision: 12786 http://sourceforge.net/p/oorexx/code-0/12786 Author: erich_st Date: 2024-02-01 18:16:20 +0000 (Thu, 01 Feb 2024) Log Message: ----------- try to avoid 'Initial call of test container failed' events for temporary search_order_*.testGroup Modified Paths: -------------- test/trunk/ooRexx/base/directives/REQUIRES.testGroup Modified: test/trunk/ooRexx/base/directives/REQUIRES.testGroup =================================================================== --- test/trunk/ooRexx/base/directives/REQUIRES.testGroup 2024-01-30 13:21:30 UTC (rev 12785) +++ test/trunk/ooRexx/base/directives/REQUIRES.testGroup 2024-02-01 18:16:20 UTC (rev 12786) @@ -1,7 +1,7 @@ #!/usr/bin/env rexx /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2007-2023 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2007-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -347,6 +347,11 @@ -- this requires file without extension should resolve to .cls self~assertSame("cls", self~runDynamicSource(("return .c~extension", "::requires search_order_cls"))) + -- avoid "Initial call of test container failed" for search_order_*.testGroup + do with index name item file over keep + file~delete + end + ::method test_search_order_testGroup keep = self~createRequires("search_order_testgroup", ("testGroup", "rex", "other", "")) @@ -353,6 +358,11 @@ -- this requires file without extension should resolve to .testGroup self~assertSame("testGroup", self~runDynamicSource(("return .c~extension", "::requires search_order_testgroup")), "this ::REQUIRES search order tests fails when run from within the same directory, but works as expected otherwise") + -- avoid "Initial call of test container failed" for search_order_*.testGroup + do with index name item file over keep + file~delete + end + ::method test_search_order_rex keep = self~createRequires("search_order_rex", ("rex", "other", "")) |
From: <eri...@us...> - 2024-01-30 13:21:32
|
Revision: 12785 http://sourceforge.net/p/oorexx/code-0/12785 Author: erich_st Date: 2024-01-30 13:21:30 +0000 (Tue, 30 Jan 2024) Log Message: ----------- fix 32-bit build for [bugs:#1933] code fix Modified Paths: -------------- main/trunk/interpreter/expression/BuiltinFunctions.cpp Modified: main/trunk/interpreter/expression/BuiltinFunctions.cpp =================================================================== --- main/trunk/interpreter/expression/BuiltinFunctions.cpp 2024-01-29 17:28:38 UTC (rev 12784) +++ main/trunk/interpreter/expression/BuiltinFunctions.cpp 2024-01-30 13:21:30 UTC (rev 12785) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2022 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -1241,7 +1241,7 @@ #ifdef __REXX64__ return new_integer(timestamp.getBaseTime()); #else - timestamp.formatBaseTime(work, sizeof(work)); + timestamp.formatBaseTime(work); break; #endif @@ -1250,7 +1250,7 @@ #ifdef __REXX64__ return new_integer(timestamp.getUnixTime()); #else - timestamp.formatUnixTime(work, sizeof(work)); + timestamp.formatUnixTime(work); break; #endif @@ -1514,7 +1514,7 @@ #ifdef __REXX64__ return new_integer(timestamp.getBaseTime()); #else - timestamp.formatBaseTime(work, sizeof(work)); + timestamp.formatBaseTime(work); break; #endif @@ -1523,7 +1523,7 @@ #ifdef __REXX64__ return new_integer(timestamp.getUnixTime()); #else - timestamp.formatUnixTime(work, sizeof(work)); + timestamp.formatUnixTime(work); break; #endif @@ -1532,7 +1532,7 @@ #ifdef __REXX64__ return new_integer(timestamp.timeZoneOffset); #else - timestamp.formatTimeZone(work, sizeof(work)); + timestamp.formatTimeZone(work); break; #endif |
From: <eri...@us...> - 2024-01-29 17:28:41
|
Revision: 12784 http://sourceforge.net/p/oorexx/code-0/12784 Author: erich_st Date: 2024-01-29 17:28:38 +0000 (Mon, 29 Jan 2024) Log Message: ----------- minor ooSQLite code and docs updates; not a new build Modified Paths: -------------- docs/trunk/oosqlite/en-US/oosqlExtensions.xml docs/trunk/oosqlite/en-US/oosqlite.ent docs/trunk/oosqlite/en-US/oosqliteClass.xml docs/trunk/oosqlite/en-US/oosqliteConstants.xml incubator/ooSQLite/Makefile.win incubator/ooSQLite/install/platform/windows/ooSQLite.nsi incubator/ooSQLite/src/ooSQLite.cpp incubator/ooSQLite/src/rexx/ooSQLite.cls Modified: docs/trunk/oosqlite/en-US/oosqlExtensions.xml =================================================================== --- docs/trunk/oosqlite/en-US/oosqlExtensions.xml 2024-01-29 17:21:31 UTC (rev 12783) +++ docs/trunk/oosqlite/en-US/oosqlExtensions.xml 2024-01-29 17:28:38 UTC (rev 12784) @@ -7,12 +7,12 @@ # # Description: Open Object Rexx: ooSqlite XML file. # - # Copyright (c) 2013-2022, Rexx Language Association. All rights reserved. + # Copyright (c) 2013-2024, Rexx Language Association. All rights reserved. # # This program and the accompanying materials are made available under # the terms of the Common Public License v1.0 which accompanies this # distribution. A copy is also available at the following address: - # http://www.oorexx.org/license.html + # https://www.oorexx.org/license.html # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following @@ -57,7 +57,7 @@ <section id="sctMethodsOOSQLExtensions"><title>Method Table</title> <para> The following table provides links to the documentation for the primary methods and attributes used in working - with ??? + with ooSQLite extensions using the <computeroutput>ooSQLExtensions</computeroutput> class. </para> <table id="tblOOSQLExtensionsMethods" frame="all"> <title>ooSQLExtensions Methods and Attributes</title> @@ -77,11 +77,11 @@ </row> <row> <entry><link linkend="atrLastErrCodeClsExt">lastErrCode</link></entry> -<entry>.</entry> +<entry>Returns the last error code recorded for this class.</entry> </row> <row> <entry><link linkend="atrLastErrMsgClsExt">lastErrMsg</link></entry> -<entry>.</entry> +<entry>Returns the error message for the last error code recorded for this class.</entry> </row> <row> <entry align="center"><emphasis role="bold">Class Methods</emphasis></entry> @@ -89,7 +89,7 @@ </row> <row> <entry><link linkend="mthAutoBuiltin">autoBuiltin</link></entry> -<entry>.</entry> +<entry>Makes builtin extensions automatic for all database connections.</entry> </row> <row> <entry><link linkend="mthAutoCollationNeeded">autoCollationNeeded</link></entry> @@ -108,8 +108,8 @@ <entry>.</entry> </row> <row> -<entry><link linkend="mthCancelAutoBuiltin">CancelAutoBuiltin</link></entry> -<entry>.</entry> +<entry><link linkend="mthCancelAutoBuiltin">cancelAutoBuiltin</link></entry> +<entry>Cancels builtin extension as automatic for all database connections.</entry> </row> <row> <entry><link linkend="mthGetLibrary">getLibrary</link></entry> @@ -121,7 +121,7 @@ </row> <row> <entry><link linkend="mthListBuiltins">listBuiltins</link></entry> -<entry>.</entry> +<entry>Lists all builtin extensions.</entry> </row> <row> <entry><link linkend="mthLoadLibrary">loadLibrary</link></entry> @@ -137,7 +137,7 @@ </row> <row> <entry><link linkend="mthRegisterBuiltin">registerBuiltin</link></entry> -<entry>.</entry> +<entry>Registers builtin extensions with a database connection.</entry> </row> </tbody></tgroup> </table> @@ -148,18 +148,15 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>lastErrCode</secondary></indexterm> <programlisting> <![CDATA[ ->>--lastErrCode----------------------------------------------------->< - ->>--lastErrCode = varName------------------------------------------->< - +>>--lastErrCode-------------------------------------------------------------->< ]]> </programlisting> <para> - Reflects the last error code set by for the <computeroutput>ooSQLPackage</computeroutput> object. + Reflects the last error code set for the <computeroutput>ooSQLExtensions</computeroutput> class. </para> <variablelist> - <varlistentry><term><emphasis role="bold">lastErrCode get:</emphasis></term> + <varlistentry><term><emphasis role="bold">lastErrCode get</emphasis></term> <listitem> <para> The value of the <emphasis role="italic">lastErrCode</emphasis> attribute will be a SQLite result <link @@ -167,43 +164,20 @@ linkend="sctOOSQLiteSpecificResultCodes">codes</link>. </para> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">lastErrCode set:</emphasis></term> + <varlistentry><term><emphasis role="bold">Remarks</emphasis></term> <listitem> <para> - The programmer can not set the value of this attribute, it is set internally by the ooSQLite framework. + The <emphasis role="italic">lastErrCode</emphasis> and the + <emphasis role="italic">lastErrMsg</emphasis> attributes are always updated together. + The error message is always the message that goes with the error code. </para> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Remarks:</emphasis></term> + <varlistentry><term><emphasis role="bold">Example</emphasis></term> <listitem> <para> - The last error code attribute is similar to the <link linkend="atrLastErrMsgClsPack">lastErrMsg</link> attribute. - Its value is the last status code recorded by ooSQLite. The <emphasis role="italic">lastErrCode</emphasis> and the - <emphasis role="italic">lastErrMsg</emphasis> attributes are always updated together. The error message is always - the message that goes with the error code. - </para> - <para> - Each of the three major ooSQLite objects, an <link linkend="clsOOSQLiteConnection">ooSQLPackage</link>, an - <link linkend="clsOOSQLiteStmt">ooSQLiteStmt</link>, and an <link - linkend="clsOOSQLiteBackup">ooSQLiteBackup</link> object have a <emphasis role="italic">lastErrMsg</emphasis> and - a <emphasis role="italic">lastErrCode</emphasis> attribute. These attributes all serve the same basic purpose, to - hold the last error message and code recorded by ooSQLite. - </para> - <para> - The attributes are most useful when the invocation of <emphasis role="italic">new</emphasis> fails to initialize the - object correctly due to an error. The <emphasis role="italic">lastErrMsg</emphasis> and <emphasis - role="italic">lastErrCode</emphasis> attributes are always updated during <emphasis role="italic">new</emphasis>. - In general, these objects do not update the attributes after every method invocation. - </para> - </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Example:</emphasis></term> - <listitem> - <para> - This example uses the <emphasis role="italic">lastErrCode</emphasis> attribute to produce a meaningful error message when - a database connection fails to open: <programlisting> <![CDATA[ - - dbName = 'ooFoods.rdbx' + dbName = 'ooFoods.rdbx' dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READWRITE) -- Load the package and automatically register everything in the package for @@ -229,53 +203,29 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>lastErrMsg</secondary></indexterm> <programlisting> <![CDATA[ ->>--lastErrMsg----------------------------------------------------->< - ->>--lastErrMsg = varName------------------------------------------->< - +>>--lastErrMsg--------------------------------------------------------------->< ]]> </programlisting> <para> - xx + Reflects a human readable explanation, a message, of the last error code recorded + for the <computeroutput>ooSQLExtensions</computeroutput> object. </para> <variablelist> - <varlistentry><term><emphasis role="bold">lastErrMsg get:</emphasis></term> + <varlistentry><term><emphasis role="bold">lastErrMsg get</emphasis></term> <listitem> <para> - details about get + Returns a string message that corresponds to the last error code. </para> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">lastErrMsg set:</emphasis></term> + <varlistentry><term><emphasis role="bold">Remarks</emphasis></term> <listitem> <para> - details about set + The <emphasis role="italic">lastErrCode</emphasis> and the + <emphasis role="italic">lastErrMsg</emphasis> attributes are always updated together. + The error message is always the message that goes with the error code. </para> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Remarks:</emphasis></term> - <listitem> - <para> - Additional comments. - </para> - </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Details</emphasis></term> - <listitem> - <para> - Anything? - </para> - </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Example:</emphasis></term> - <listitem> - <para> - This example ... -<programlisting> -<![CDATA[ - - -]]> -</programlisting> - </para> - </listitem></varlistentry> </variablelist> </section> <!-- End ooSQLExtensions::lastErrMsg() [attribute] --> @@ -284,58 +234,51 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>autoBuiltin</secondary></indexterm> <programlisting> <![CDATA[ ->>--autoBuiltin(--+--------+--)--------------------------------------------->< - +--type--+ +>>--autoBuiltin(--+--------+--)---------------------------------------------->< + +--name--+ ]]> </programlisting> <para> - xx + Registers one or more ooSQLite builtin extensions as automatic. + This means that each time a database connection is opened, these builtin + extensions will be automatically registered for that connection. </para> <variablelist> - <varlistentry><term><emphasis role="bold">Arguments:</emphasis></term> + <varlistentry><term><emphasis role="bold">Arguments</emphasis></term> <listitem> - <para> - The arguments are: - </para> <variablelist> - <varlistentry><term>TERM</term> + <varlistentry><term>name [optional]</term> <listitem> <para> - xx + A single extension name or an Array of extension names to be made automatic. + If this argument is omitted all builtin extensions are made automatic. + Name can also be the special keyword <literal>ALL</literal>, with case not + significant, in which case all builtin extensions are made automatic. </para> </listitem></varlistentry> </variablelist> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Return value:</emphasis></term> + <varlistentry><term><emphasis role="bold">Return value</emphasis></term> <listitem> <para> - xx + Returns a SQLite <link linkend="sctResultCode">result code</link>. </para> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Remarks:</emphasis></term> + <varlistentry><term><emphasis role="bold">Remarks</emphasis></term> <listitem> <para> - Additional comments. + See also methods <link linkend="mthRegisterBuiltin">registerBuiltin</link> + and <link linkend="mthCancelAutoBuiltin">cancelAutoBuiltin</link>. </para> </listitem></varlistentry> <varlistentry><term><emphasis role="bold">Details</emphasis></term> <listitem> <para> - Anything? + The extensions come from the SQLite source tree, and are statically + linked to the ooSQLite shared library. </para> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Example:</emphasis></term> - <listitem> - <para> - This example ... -<programlisting> -<![CDATA[ - -]]> -</programlisting> - </para> - </listitem></varlistentry> </variablelist> </section> <!-- End ooSQLExtensions::autoBuiltin() --> @@ -344,7 +287,7 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>autoCollationNeeded</secondary></indexterm> <programlisting> <![CDATA[ ->>--autoCollationNeeded(--+--------+--)--------------------------------------------->< +>>--autoCollationNeeded(--+--------+--)-------------------------------------->< +--type--+ ]]> </programlisting> @@ -405,7 +348,7 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>autoCollation (Class method)</secondary></indexterm> <programlisting> <![CDATA[ ->>--autoCollation(--+--------+--)--------------------------------------------->< +>>--autoCollation(--+--------+--)-------------------------------------------->< +--type--+ ]]> </programlisting> @@ -527,7 +470,7 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>autoPackage (Class method)</secondary></indexterm> <programlisting> <![CDATA[ ->>--autoPackage(--+--------+--)--------------------------------------------->< +>>--autoPackage(--+--------+--)---------------------------------------------->< +--type--+ ]]> </programlisting> @@ -587,58 +530,52 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>cancelAutoBuiltin</secondary></indexterm> <programlisting> <![CDATA[ ->>--cancelAutoBuiltin(--+--------+--)--------------------------------------------->< - +--type--+ +>>--cancelAutoBuiltin(--+--------+--)---------------------------------------->< + +--name--+ ]]> </programlisting> <para> - xx + Cancels one or more automatic ooSQLite builtin extensions. + Automatic means that each time a database connection is opened, the builtin + extensions is automatically registered for that connection. + This function undoes this automatic registration for the named builtin extensions. </para> <variablelist> - <varlistentry><term><emphasis role="bold">Arguments:</emphasis></term> + <varlistentry><term><emphasis role="bold">Arguments</emphasis></term> <listitem> - <para> - The arguments are: - </para> <variablelist> - <varlistentry><term>TERM</term> + <varlistentry><term>name [optional]</term> <listitem> <para> - xx + A single extension name or an Array of extension names to be cancelled as + automatic. + If this argument is omitted all builtin extensions are cancelled as automatic. + Name can also be the special keyword <literal>ALL</literal>, with case not + significant, in which case all builtin extensions are cancelled as automatic. </para> </listitem></varlistentry> </variablelist> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Return value:</emphasis></term> + <varlistentry><term><emphasis role="bold">Return value</emphasis></term> <listitem> <para> - xx + Returns a SQLite <link linkend="sctResultCode">result code</link>. </para> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Remarks:</emphasis></term> + <varlistentry><term><emphasis role="bold">Remarks</emphasis></term> <listitem> <para> - Additional comments. + See also method <link linkend="mthAutoBuiltin">autoBuiltin</link>. </para> </listitem></varlistentry> <varlistentry><term><emphasis role="bold">Details</emphasis></term> <listitem> <para> - Anything? + The extensions come from the SQLite source tree, and are statically + linked to the ooSQLite shared library. </para> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Example:</emphasis></term> - <listitem> - <para> - This example ... -<programlisting> -<![CDATA[ - -]]> -</programlisting> - </para> - </listitem></varlistentry> </variablelist> </section> <!-- End ooSQLExtensions::cancelAutoBuiltin() --> @@ -647,7 +584,7 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>getLibrary (Class method)</secondary></indexterm> <programlisting> <![CDATA[ ->>--getLibrary(--+--------+--)--------------------------------------------->< +>>--getLibrary(--+--------+--)----------------------------------------------->< +--type--+ ]]> </programlisting> @@ -708,7 +645,7 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>getPackage (Class method)</secondary></indexterm> <programlisting> <![CDATA[ ->>--getPackage(--+--------+--)--------------------------------------------->< +>>--getPackage(--+--------+--)----------------------------------------------->< +--type--+ ]]> </programlisting> @@ -768,54 +705,77 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>listBuiltins</secondary></indexterm> <programlisting> <![CDATA[ ->>--listBuiltins(--+--------+--)--------------------------------------------->< - +--type--+ +>>--listBuiltins(--+---------+--)-------------------------------------------->< + +--print--+ ]]> </programlisting> <para> - xx + Returns a result set, in the current + <link linkend="atrRecordFormatClsOOSQLite">Result Set Format</link>, + listing all extensions builtin to ooSQLite. </para> <variablelist> - <varlistentry><term><emphasis role="bold">Arguments:</emphasis></term> + <varlistentry><term><emphasis role="bold">Arguments</emphasis></term> <listitem> - <para> - The arguments are: - </para> <variablelist> - <varlistentry><term>TERM</term> + <varlistentry><term>print [optional]</term> <listitem> <para> - xx + If .true, the result set is printed to the console as it is produced. </para> </listitem></varlistentry> </variablelist> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Return value:</emphasis></term> + <varlistentry><term><emphasis role="bold">Return value</emphasis></term> <listitem> <para> - xx + A list of the builtin extensions available in this version of ooSQLite. + The result set has two columns: + <variablelist> + <varlistentry><term>name</term> + <listitem> + <para> + The builtin extension's name + </para> + </listitem></varlistentry> + <varlistentry><term>description</term> + <listitem> + <para> + A short descriptive text for the builtin extension + </para> + </listitem></varlistentry> + </variablelist> </para> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Remarks:</emphasis></term> - <listitem> - <para> - Additional comments. - </para> - </listitem></varlistentry> <varlistentry><term><emphasis role="bold">Details</emphasis></term> <listitem> <para> - Anything? + The extensions come from the SQLite source tree, and are statically + linked to the ooSQLite shared library. </para> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Example:</emphasis></term> + <varlistentry><term><emphasis role="bold">Example</emphasis></term> <listitem> <para> - This example ... <programlisting> <![CDATA[ +do extension over .ooSQLExtensions~listBuiltins + say extension~name~left(11) extension~description +end +/* Output might be: +base64 Implements a base64() SQL function to convert between a blob and Base64 .. +csv Implements a virtual table for reading CSV files. +ieee754 Implements SQL functions for IEEE 754 binary64 floating-point numbers. +nextChar Implements the next_char(A, T, F, W, C) SQL function. +percentile Implements the percentile(Y, P) SQL function. +regExp Implements a POSIX extended regular expression matcher for UTF-8. +rot13 Implements a rot13() SQL function and a rot13 collating sequence. +spellFix Implements the spellfix1 virtual table that can search a vocabulary .. +toType Implements tointeger() and toreal() SQL functions. +wholeNumber Implements the wholenumber virtual table that returns whole numbers .. +*/ ]]> </programlisting> </para> @@ -829,7 +789,7 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>loadLibrary (Class method)</secondary></indexterm> <programlisting> <![CDATA[ ->>--loadLibrary(--+--------+--)--------------------------------------------->< +>>--loadLibrary(--+--------+--)---------------------------------------------->< +--type--+ ]]> </programlisting> @@ -890,7 +850,7 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>loadPackage (Class method)</secondary></indexterm> <programlisting> <![CDATA[ ->>--loadPackage(--+--------+--)--------------------------------------------->< +>>--loadPackage(--+--------+--)---------------------------------------------->< +--type--+ ]]> </programlisting> @@ -951,7 +911,7 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>resetAutoBuiltin (Class method)</secondary></indexterm> <programlisting> <![CDATA[ ->>--resetAutoBuiltin(--+--------+--)--------------------------------------------->< +>>--resetAutoBuiltin(--+--------+--)----------------------------------------->< +--type--+ ]]> </programlisting> @@ -1012,54 +972,70 @@ <indexterm><primary>ooSQLExtensions class</primary><secondary>registerBuiltin (Class method)</secondary></indexterm> <programlisting> <![CDATA[ ->>--registerBuiltin(--+--------+--)--------------------------------------------->< - +--type--+ +>>--registerBuiltin(--connection--+---------+--)----------------------------->< + +-,-name--+ ]]> </programlisting> <para> - xx + Registers one or more extensions builtin to ooSQLite with the specified + database connection. </para> <variablelist> - <varlistentry><term><emphasis role="bold">Arguments:</emphasis></term> + <varlistentry><term><emphasis role="bold">Arguments</emphasis></term> <listitem> - <para> - The arguments are: - </para> <variablelist> - <varlistentry><term>TERM</term> + <varlistentry><term>connection [required]</term> <listitem> <para> - xx + An open, valid, database connection that the builtin extension is to be + registered with. </para> </listitem></varlistentry> + <varlistentry><term>name [optional]</term> + <listitem> + <para> + A single extension name or an Array of extension names to be registered. + If this argument is omitted all builtin extensions are registered. + Name can also be the special keyword <literal>ALL</literal>, with case not + significant, in which case all builtin extensions are registered. + </para> + </listitem></varlistentry> </variablelist> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Return value:</emphasis></term> + <varlistentry><term><emphasis role="bold">Return value</emphasis></term> <listitem> <para> - xx + Returns a SQLite <link linkend="sctResultCode">result code</link>. </para> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Remarks:</emphasis></term> + <varlistentry><term><emphasis role="bold">Remarks</emphasis></term> <listitem> <para> - Additional comments. + See also method <link linkend="mthAutoBuiltin">autoBuiltin</link>. </para> </listitem></varlistentry> <varlistentry><term><emphasis role="bold">Details</emphasis></term> <listitem> <para> - Anything? + The extensions come from the SQLite source tree, and are statically + linked to the ooSQLite shared library. </para> </listitem></varlistentry> - <varlistentry><term><emphasis role="bold">Example:</emphasis></term> + <varlistentry><term><emphasis role="bold">Example</emphasis></term> <listitem> <para> - This example ... <programlisting> <![CDATA[ +mem = .ooSQLiteConnection~new(":memory:") +.ooSQLExtensions~registerBuiltin(mem, "base64") +do row over mem~exec("SELECT base64('SGVsbG8gd29ybGQh');", .true) + say row~allItems +end +/* Output +Hello world! +*/ ]]> </programlisting> </para> Modified: docs/trunk/oosqlite/en-US/oosqlite.ent =================================================================== --- docs/trunk/oosqlite/en-US/oosqlite.ent 2024-01-29 17:21:31 UTC (rev 12783) +++ docs/trunk/oosqlite/en-US/oosqlite.ent 2024-01-29 17:28:38 UTC (rev 12784) @@ -2,5 +2,5 @@ <!ENTITY BOOKID "oosqlite"> <!ENTITY YEAR "2005-2023"> <!ENTITY HOLDER "Rexx Language Association. All rights reserved."> -<!ENTITY VERSION "1.0.0"> +<!ENTITY VERSION "1.0.1"> <!ENTITY EDITION "2023.01.01 (last revised on 20140313 with r9954)"> Modified: docs/trunk/oosqlite/en-US/oosqliteClass.xml =================================================================== --- docs/trunk/oosqlite/en-US/oosqliteClass.xml 2024-01-29 17:21:31 UTC (rev 12783) +++ docs/trunk/oosqlite/en-US/oosqliteClass.xml 2024-01-29 17:28:38 UTC (rev 12784) @@ -7,7 +7,7 @@ # # Description: Open Object Rexx: ooSqlite XML file. # - # Copyright (c) 2012-2022, Rexx Language Association. All rights reserved. + # Copyright (c) 2012-2024, Rexx Language Association. All rights reserved. # # This program and the accompanying materials are made available under # the terms of the Common Public License v1.0 which accompanies this @@ -347,17 +347,15 @@ second through nth items, where n is the number of records: <programlisting> <![CDATA[ +-- Set the result set format to an array of arrays: +.ooSQLite~recordFormat = .ooSQLite~OO_ARRAY_OF_ARRAYS - -- Set the result set format to an array of arrays: - .ooSQLite~recordFormat = .ooSQLite~OO_ARRAY_OF_ARRAYS +dbName = 'ooFoods.rdbx' - dbName = 'ooFoods.rdbx' +dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READWRITE) - dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READWRITE) - - sql = 'SELECT * FROM foods ORDER BY name;' - resultSet = dbConn~exec(sql, .true) - +sql = 'SELECT * FROM foods ORDER BY name;' +resultSet = dbConn~exec(sql, .true) ]]> </programlisting> </para> @@ -429,23 +427,57 @@ This example shows how to iterate over the compile-time options: <programlisting> <![CDATA[ +do i = 1 + option = .ooSQLite~compileOptionGet(i) + if option = "NULL" + then leave + say 'Compile option:' option +end - opt = '' - do i = 1 while opt \== 'NULL' - opt = .ooSQLite~compileOptionGet(i) - say 'Compile option:' opt - end - say - /* Output might be: - -Compile option: CURDIR +Compile option: ATOMIC_INTRINSICS=0 +Compile option: COMPILER=msvc-1928 +Compile option: DEFAULT_AUTOVACUUM +Compile option: DEFAULT_CACHE_SIZE=-2000 +Compile option: DEFAULT_FILE_FORMAT=4 +Compile option: DEFAULT_FOREIGN_KEYS +Compile option: DEFAULT_JOURNAL_SIZE_LIMIT=-1 +Compile option: DEFAULT_MMAP_SIZE=0 +Compile option: DEFAULT_PAGE_SIZE=4096 +Compile option: DEFAULT_PCACHE_INITSZ=20 +Compile option: DEFAULT_RECURSIVE_TRIGGERS +Compile option: DEFAULT_SECTOR_SIZE=4096 +Compile option: DEFAULT_SYNCHRONOUS=2 +Compile option: DEFAULT_WAL_AUTOCHECKPOINT=1000 +Compile option: DEFAULT_WAL_SYNCHRONOUS=2 +Compile option: DEFAULT_WORKER_THREADS=0 Compile option: ENABLE_COLUMN_METADATA +Compile option: ENABLE_FTS3 +Compile option: ENABLE_FTS3_PARENTHESIS +Compile option: ENABLE_FTS4 +Compile option: ENABLE_FTS5 Compile option: ENABLE_MEMORY_MANAGEMENT +Compile option: MALLOC_SOFT_LIMIT=1024 +Compile option: MAX_ATTACHED=10 +Compile option: MAX_COLUMN=2000 +Compile option: MAX_COMPOUND_SELECT=500 +Compile option: MAX_DEFAULT_PAGE_SIZE=8192 +Compile option: MAX_EXPR_DEPTH=1000 +Compile option: MAX_FUNCTION_ARG=127 +Compile option: MAX_LENGTH=1000000000 +Compile option: MAX_LIKE_PATTERN_LENGTH=50000 +Compile option: MAX_MMAP_SIZE=0x7fff0000 +Compile option: MAX_PAGE_COUNT=1073741823 +Compile option: MAX_PAGE_SIZE=65536 +Compile option: MAX_SQL_LENGTH=1000000000 +Compile option: MAX_TRIGGER_DEPTH=1000 +Compile option: MAX_VARIABLE_NUMBER=32766 +Compile option: MAX_VDBE_OP=250000000 +Compile option: MAX_WORKER_THREADS=8 +Compile option: MUTEX_W32 +Compile option: SYSTEM_MALLOC Compile option: TEMP_STORE=1 Compile option: THREADSAFE=1 -Compile option: NULL - */ ]]> @@ -511,24 +543,21 @@ This example checks several random compile-time options and displays if they were defined at compile time. <programlisting> <![CDATA[ +names = - + "DEFAULT_AUTOVACUUM", "THREADSAFE", "TEMP_STORE", - + "4_BYTE_ALIGNED_MALLOC", "CURDIR", "SQLITE_THREADSAFE" +do name over names + say "Option" name ":" .ooSQLite~compileOptionUsed(name) +end - names = .array~of('DEFAULT_AUTOVACUUM', 'THREADSAFE', 'TEMP_STORE', - - '4_BYTE_ALIGNED_MALLOC', 'CURDIR', 'SQLITE_THREADSAFE') - do i = 1 to names~items - say 'Option' names[i] ':' .ooSQLite~compileOptionUsed(names[i]) - end - /* Output might be: - -Option DEFAULT_AUTOVACUUM : 0 +Option DEFAULT_AUTOVACUUM : 1 Option THREADSAFE : 1 Option TEMP_STORE : 1 Option 4_BYTE_ALIGNED_MALLOC : 0 -Option CURDIR : 1 +Option CURDIR : 0 Option SQLITE_THREADSAFE : 1 - */ - ]]> </programlisting> </para> @@ -924,7 +953,7 @@ <varlistentry><term><emphasis role="bold">Return value:</emphasis></term> <listitem> <para> - The number of the library version in use, perhaps 3007013. + The number of the library version in use, perhaps 3040001. </para> </listitem></varlistentry> <varlistentry><term><emphasis role="bold">Remarks:</emphasis></term> @@ -1257,13 +1286,10 @@ This example displays the source ID for the currently running database engine: <programlisting> <![CDATA[ +say "Source ID:" .ooSQLite~sourceID - say 'Source ID: ' .ooSQLite~sourceID - /* Output might be: - -Source ID: 2012-06-11 02:05:22 f5b5a13f7394dc143aa136f1d4faba6839eaa6dc - +Source ID: 2022-12-28 14:03:47 df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f38a24 */ ]]> </programlisting> @@ -1319,17 +1345,13 @@ This example shows the equivalence of the two <computeroutput>ooSQLite</computeroutput> class methods: <programlisting> <![CDATA[ +say "Return from libVersion method:" .ooSQLite~libVersion +say "Constant string value: " .ooSQLite~sqlite3Version - say 'Return from libVersion method:' .ooSQLite~libVersion - say 'Constant string value: ' .ooSQLite~sqlite3Version - /* Output would be, depending on the exact library version of the embedded database engine: - -Return from libVersion method: 3.7.13 -Constant string value: 3.7.13 - +Return from libVersion method: 3.40.1 +Constant string value: 3.40.1 */ - ]]> </programlisting> </para> @@ -1602,7 +1624,7 @@ <varlistentry><term>LibVersion</term> <listitem> <para> - A version string similar to <computeroutput>3.7.13</computeroutput>. This is the embedded SQLite database + A version string similar to <computeroutput>3.40.1</computeroutput>. This is the embedded SQLite database engine version and is identical to the output from the <link linkend="mthLibVersion">libVersion</link> method. </para> @@ -1610,7 +1632,7 @@ <varlistentry><term>Number</term> <listitem> <para> - A version number, similar to <computeroutput>3007013</computeroutput>. This is the embedded SQLite database + A version number, similar to <computeroutput>3040001</computeroutput>. This is the embedded SQLite database engine version number and is identical to the output from the <link linkend="mthLibVersionNumber">libVersionNumber</link> method. </para> @@ -1663,7 +1685,7 @@ Rexx: Open Object Rexx Version 4.2.0 -SQLite: SQLite Library Version 3.7.13 +SQLite: SQLite Library Version 3.40.1 2012-06-11 02:05:22 */ Modified: docs/trunk/oosqlite/en-US/oosqliteConstants.xml =================================================================== --- docs/trunk/oosqlite/en-US/oosqliteConstants.xml 2024-01-29 17:21:31 UTC (rev 12783) +++ docs/trunk/oosqlite/en-US/oosqliteConstants.xml 2024-01-29 17:28:38 UTC (rev 12784) @@ -7,7 +7,7 @@ # # Description: Open Object Rexx: ooSqlite XML file. # - # Copyright (c) 2012-2022, Rexx Language Association. All rights reserved. + # Copyright (c) 2012-2024, Rexx Language Association. All rights reserved. # # This program and the accompanying materials are made available under # the terms of the Common Public License v1.0 which accompanies this @@ -117,15 +117,15 @@ </row> <row> <entry>VERSION</entry> -<entry>"3.8.1" The value of this constant will vary depending on the exact version of the SQLite database engine embedded in ooSQLite. Typically this documentation is updated when ooSQLite is upgraded to use a new version of the SQLite library so that the value shown here is current.</entry> +<entry>"3.40.1" The value of this constant will vary depending on the exact version of the SQLite database engine embedded in ooSQLite. Typically this documentation is updated when ooSQLite is upgraded to use a new version of the SQLite library so that the value shown here is current.</entry> </row> <row> <entry>VERSION_NUMBER</entry> -<entry>3008001 The value of this constant will vary depending on the exact version of the SQLite database engine embedded in ooSQLite. Typically this documentation is updated when ooSQLite is upgraded to use a new version of the SQLite library so that the value shown here is current.</entry> +<entry>3040001 The value of this constant will vary depending on the exact version of the SQLite database engine embedded in ooSQLite. Typically this documentation is updated when ooSQLite is upgraded to use a new version of the SQLite library so that the value shown here is current.</entry> </row> <row> <entry>SOURCE_ID</entry> -<entry>"2013-10-17 12:57:35 c78be6d786c19073b3a6730dfe3fb1be54f5657a" The value of this constant will vary depending on the exact version of the SQLite database engine embedded in ooSQLite. Typically this documentation is updated when ooSQLite is upgraded to use a new version of the SQLite library so that the value shown here is current.</entry> +<entry>"2022-12-28 14:03:47 df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f38a24" The value of this constant will vary depending on the exact version of the SQLite database engine embedded in ooSQLite. Typically this documentation is updated when ooSQLite is upgraded to use a new version of the SQLite library so that the value shown here is current.</entry> </row> <row> @@ -1394,15 +1394,15 @@ <!-- NOTE these 3 constants should maybe be updated each time a new version of SQLite is used? ... --> <row> <entry>VERSION</entry> -<entry>"3.8.3" The value of this constant will vary depending on the exact version of the SQLite database engine embedded in ooSQLite. Typically this documentation is updated when ooSQLite is upgraded to use a new version of the SQLite library so that the value shown here is current.</entry> +<entry>"3.40.1" The value of this constant will vary depending on the exact version of the SQLite database engine embedded in ooSQLite. Typically this documentation is updated when ooSQLite is upgraded to use a new version of the SQLite library so that the value shown here is current.</entry> </row> <row> <entry>VERSION_NUMBER</entry> -<entry>3008003 The value of this constant will vary depending on the exact version of the SQLite database engine embedded in ooSQLite. Typically this documentation is updated when ooSQLite is upgraded to use a new version of the SQLite library so that the value shown here is current.</entry> +<entry>3040001 The value of this constant will vary depending on the exact version of the SQLite database engine embedded in ooSQLite. Typically this documentation is updated when ooSQLite is upgraded to use a new version of the SQLite library so that the value shown here is current.</entry> </row> <row> <entry>SOURCE_ID</entry> -<entry>"2014-02-03 14:04:11 6c643e45c274e755dc5a1a65673df79261c774be" The value of this constant will vary depending on the exact version of the SQLite database engine embedded in ooSQLite. Typically this documentation is updated when ooSQLite is upgraded to use a new version of the SQLite library so that the value shown here is current.</entry> +<entry>"2022-12-28 14:03:47 df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f38a24" The value of this constant will vary depending on the exact version of the SQLite database engine embedded in ooSQLite. Typically this documentation is updated when ooSQLite is upgraded to use a new version of the SQLite library so that the value shown here is current.</entry> </row> </tbody></tgroup> Modified: incubator/ooSQLite/Makefile.win =================================================================== --- incubator/ooSQLite/Makefile.win 2024-01-29 17:21:31 UTC (rev 12783) +++ incubator/ooSQLite/Makefile.win 2024-01-29 17:28:38 UTC (rev 12784) @@ -36,7 +36,7 @@ #/*----------------------------------------------------------------------------*/ -# This is a Visual C++, nMake compatible make file for ooSQLLite. +# This is a Visual C++, nMake compatible make file for ooSQLite. # # The compiler needs to be able to find the ooRexx native API headers and # libraries. If REXX_HOME is set on the system, the correct directory will be Modified: incubator/ooSQLite/install/platform/windows/ooSQLite.nsi =================================================================== --- incubator/ooSQLite/install/platform/windows/ooSQLite.nsi 2024-01-29 17:21:31 UTC (rev 12783) +++ incubator/ooSQLite/install/platform/windows/ooSQLite.nsi 2024-01-29 17:28:38 UTC (rev 12784) @@ -1,11 +1,11 @@ /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2012-2019 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2012-2023 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ /* distribution. A copy is also available at the following address: */ -/* http://www.oorexx.org/license.html */ +/* https://www.oorexx.org/license.html */ /* */ /* Redistribution and use in source and binary forms, with or */ /* without modification, are permitted provided that the following */ @@ -183,8 +183,8 @@ Call RemoveFiles ${EndIf} + DetailPrint "" DetailPrint "********** Installing ooSQLite **********" - DetailPrint "" ; Install the files @@ -213,6 +213,7 @@ ; Add the files ... File "${ExamplesDir}\*.rex" + File "${ExamplesDir}\*.csv" File "${ExamplesDir}\*.frm" File "${ExamplesDir}\ooFoods.rdbx" @@ -270,6 +271,7 @@ ; Create start menu shortcuts + DetailPrint "" DetailPrint "********** ooSQLite ${SHORTVERSION} Start Menu Shortcuts **********" CreateShortCut "${SMooRexxFolder}\Uninstall ${SHORTNAME}.lnk" "$INSTDIR\${UNINSTALLER}" "" "$INSTDIR\${UNINSTALLER}" 0 @@ -568,7 +570,6 @@ Function RemoveFiles DetailPrint "******* Removing current ooSQLite files ******" - DetailPrint "" ; We probably do not need to delete these files, we could just over-write ; them @@ -587,8 +588,8 @@ ; For the short cuts, we delete any known short cuts created by any ooSQLite ; installation. Each independent ooSQLite installation will create all ; relevant short cuts for that installation. + DetailPrint "" DetailPrint "******* Removing ooSQLite Start Menu short cuts ******" - DetailPrint "" Delete "${SMooRexxFolder}\Uninstall ${SHORTNAME}.lnk" Delete "${SMooRexxFolder}\ooRexx Documentation\ooSQLite Reference.lnk" Modified: incubator/ooSQLite/src/ooSQLite.cpp =================================================================== --- incubator/ooSQLite/src/ooSQLite.cpp 2024-01-29 17:21:31 UTC (rev 12783) +++ incubator/ooSQLite/src/ooSQLite.cpp 2024-01-29 17:28:38 UTC (rev 12784) @@ -1,6 +1,6 @@ /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2012-2023 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2012-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -11837,6 +11837,7 @@ return rc; } } + return SQLITE_OK; } else { Modified: incubator/ooSQLite/src/rexx/ooSQLite.cls =================================================================== --- incubator/ooSQLite/src/rexx/ooSQLite.cls 2024-01-29 17:21:31 UTC (rev 12783) +++ incubator/ooSQLite/src/rexx/ooSQLite.cls 2024-01-29 17:28:38 UTC (rev 12784) @@ -1,6 +1,6 @@ /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2012-2013 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2012-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -536,9 +536,9 @@ -- (oosqlite.dll / oosqlite.so depending on platform.) -- -- Copy the values directly from the top of sqlite3.h. -::constant VERSION "3.8.4.3" -::constant VERSION_NUMBER 3008004 -::constant SOURCE_ID "2014-04-03 16:53:12 a611fa96c4a848614efe899130359c9f6fb889c3" +::constant VERSION "3.40.1" +::constant VERSION_NUMBER 3040001 +::constant SOURCE_ID "2022-12-28 14:03:47 df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f38a24" -- OO_ prefix indicates constant is not from the SQLite library. |
From: <eri...@us...> - 2024-01-29 17:21:33
|
Revision: 12783 http://sourceforge.net/p/oorexx/code-0/12783 Author: erich_st Date: 2024-01-29 17:21:31 +0000 (Mon, 29 Jan 2024) Log Message: ----------- remove debug print and some ancient regex doc Modified Paths: -------------- main/trunk/interpreter/streamLibrary/StreamNative.cpp Removed Paths: ------------- main/trunk/extensions/rxregexp/rxregexp.doc Deleted: main/trunk/extensions/rxregexp/rxregexp.doc =================================================================== --- main/trunk/extensions/rxregexp/rxregexp.doc 2024-01-29 16:17:01 UTC (rev 12782) +++ main/trunk/extensions/rxregexp/rxregexp.doc 2024-01-29 17:21:31 UTC (rev 12783) @@ -1,299 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* */ -/* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2006 Rexx Language Association. All rights reserved. */ -/* */ -/* This program and the accompanying materials are made available under */ -/* the terms of the Common Public License v1.0 which accompanies this */ -/* distribution. A copy is also available at the following address: */ -/* https://www.oorexx.org/license.html */ -/* */ -/* Redistribution and use in source and binary forms, with or */ -/* without modification, are permitted provided that the following */ -/* conditions are met: */ -/* */ -/* Redistributions of source code must retain the above copyright */ -/* notice, this list of conditions and the following disclaimer. */ -/* Redistributions in binary form must reproduce the above copyright */ -/* notice, this list of conditions and the following disclaimer in */ -/* the documentation and/or other materials provided with the distribution. */ -/* */ -/* Neither the name of Rexx Language Association nor the names */ -/* of its contributors may be used to endorse or promote products */ -/* derived from this software without specific prior written permission. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ -/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ -/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ -/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ -/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ -/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ -/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ -/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/*----------------------------------------------------------------------------*/ -Object REXX Online Reference -Other Classes\The RegularExpression Class - -This class provides support for regular expressions. A regular -expression is a pattern you can use to match strings against. - -Here is a description of the syntax: - -| OR operator between the left and right expression -? Matches any single character -* Matches the previous expression zero or more times -+ Matches the previous expression one or more times -\ "Escape" symbol: use the next character literally -() Expression in parenthesis (use where needed) -{n} Matches previous expression n times (n>1) -[] Set definition: matches any single character out of the defined - set. - A '^' right after the opening bracket means that none of the - following characters should be matched. - A '-' (if not used with '\') defines a range between the last - specified character and the one following '-'. If it is the - first character in the set definition, it is used literally. - -The following symbolic names (all starting and ending with ':') can -be used to abbreviate common sets: - -:ALPHA: Characters in the range A-Z and a-z -:LOWER: Characters in the range a-z -:UPPER: Characters in the range A-Z -:DIGIT: Characters in the range 0-9 -:ALNUM: Characters in :DIGIT: and :ALPHA: -:XDIGIT: Characters in :DIGIT:, A-F and a-f -:BLANK: Space and tab characters -:SPACE: Characters '09'x to '0D'x and space -:CNTRL: Characters '00'x to '1F'x and '7F'x -:PRINT: Characters in the range '20'x to '7E'x -:GRAPH: Characters in :PRINT: without space -:PUNCT: All :PRINT: characters without space and not - in :ALNUM: - - -Examples: - - "(Hi|Hello) World" Matches "Hi World" and - "Hello World". - "file.???" Matches any file with three - characters after '.' - "file.?{3}" Same as above. - "a *b" Matches all strings that begin with - 'a' and end with 'b' and have an - arbitrary number of spaces in between - both. - "a +b" Same as above, but at least one space - must be present. - "file.[bd]at" Matches "file.bat" and "file.dat". - "[A-Za-z]+" Matches any string containing only - letters. - "[:ALPHA:]+" Same as above, using symbolic names. - "[^0-9]*" Matches any string containing no - numbers, including the empty string. - "[:DIGIT::LOWER:]" A single character, either a digit or - a lower case character. - "This is (very )+nice." Matches all strings with one or more - occurrences of "very " between - "This is " and "nice.". - -The RegularExpression class is not a built-in class. It is defined -in the RXREGEXP.CLS file. This means, you must use a -::requires statement to activate its functionality, as follows: - -::requires "RXREGEXP.CLS" - - -Methods available to the RegularExpression class: - -Init -Match -Parse -Pos -Position - - -Init - - +-,-"MAXIMAL"--+ ->>-Init(-+---------+-+--------------+-)-------------------->< - '-Pattern-' +-,-"MINIMAL"--+ - -Instantiates a RegularExpression object. The optional parameter -'Pattern' lets you define a pattern that will be used to match -strings. See the introductory text below for a description of the -syntax. If the strings match, you can decide wether you want -"greedy" matching (a maximum-length match) or "non-greedy" -matching (a minimum-length match). - -Examples: - - myRE1 = .RegularExpression~new - myRE2 = .RegularExpression~new("Hello?*") - - -Match - ->>-Match(-String-)->< - -This method tries to match the given string to the regular -expression that was defined on the "new" invocation or on the -"parse" invocation. It returns 0 on an unsuccessful match and 1 -on a successful match. For an example see "Parse". - - - -Parse - - +-,-"CURRENT"--+ ->>-Parse(-Pattern-+--------------+------------------------->< - +-,-"MAXIMAL"--+ - +-,-"MINIMAL"--+ - -This method creates the automation used to match a string from the -regular expression specified with 'Pattern'. The RegularExpression -object uses this regular expression until a new invocation of Parse -takes place. The second (optional) parameter specifies whether to -use minimal or maximal matching. The default is to use the current -matching behaviour. - -Return values: - -0 Regular expression was parsed successfully. -1 An unexpected symbol was met during parsing. -2 A missing ')' was found. -3 An illegal set was defined. -4 The regular expression ended unexpectedly. -5 An illegal number was specified. - - -Example 1: - - a.0 = "does not match regular expression" - a.1 = "matches regular expression" - b = .array~of("This is a nice flower.", - "This is a yellow flower.",, - "This is a blue flower.", - "Hi there!") - - myRE = .RegularExpression~new - e = myRE~parse("This is a ???? flower.") - if e == 0 then do - do i over b - j = myRE~match(i) - say i~left(24) ">>" a.j - end - end - else - say "Error" e "occured!" - exit - - ::requires "rxregexp.cls" - -Output: - -This is a nice flower. >> Does match regular expression -This is a yellow flower. >> Does not match regular expression -This is a blue flower. >> Does match regular expression -Hi there! >> Does not match regular expression - -Example 2: - - a.0 = "an invalid number!" - a.1 = "a valid number." - b = .array~of("1","42","0","5436412","1a","f43g") - myRE = .RegularExpression~new("[1-9][0-9]*") - do i over b - j = myRE~match(i) - say i "is" a.j - end - say - - /* Now allow "hex" numbers and a single 0 */ - if myRE~parse("0|([1-9a-f][0-9a-f]*)") == 0 then do - do i over b - j = myRE~match(i) - say i "is" a.j - end - end - else - say "invalid regular expression!" - - exit - - ::requires "rxregexp.cls" - -Example 3: - - str = "<p>Paragraph 1</p><p>Paragraph 2</p>" - myRE1 = .RegularExpression~new("<p>?*</p>","MINIMAL") - myRE1~match(str) - myRE2 = .RegularExpression~new("<p>?*</p>","MAXIMAL") - myRE2~match(str) - - say "myRE1 (minimal) matched" str~substr(1,myRE1~position) - say "myRE2 (maximal) matched" str~substr(1,myRE2~position) - - ::requires "rxregexp.cls" - -Output: - -myRE1 (minimal) matched <p>Paragraph 1</p> -myRE2 (maximal) matched <p>Paragraph 1</p><p>Paragraph 2</p> - - - -Pos - ->>-Pos-(-Haystack-)->< - -This method tries to locate a string defined by the regular -expression on the "new" invocation or on the "parse" invocation -in the given haystack string. -It returns 0 on an unsuccessful match or the starting position -on a successful match. The end position of the match can be -retrieved with the POSITION method. - -Example: - - str = "It is the year 2002!" - myRE = .RegularExpression~new("[1-9][0-9]*") - begin = myRE~pos(str) - if begin > 0 then do - year = str~substr(begin, myRE~position - begin + 1) - say "Found the number" year "in this sentence." - end - - ::requires "rxregexp.cls" - -Output: - -Found the number 2002 in this sentence. - - - -Position - ->>-Position------------------------------------------------>< - -Returns the character position at which either Parse, Pos or Match -ended, depending on what was invoked last. - -Example: - - myRE = .RegularExpression~new - myRE~Parse("[abc") -- illegal set definition - say myRE~Position -- will be 4 - - myRE = .RegularExpression~new("[abc]12") - myRE~Match("c12") - say myRE~Position -- will be 3 - - myRE~Match("a13") - say myRE~Position -- will be 2 (failure to match) - - ::requires "rxregexp.cls" Modified: main/trunk/interpreter/streamLibrary/StreamNative.cpp =================================================================== --- main/trunk/interpreter/streamLibrary/StreamNative.cpp 2024-01-29 16:17:01 UTC (rev 12782) +++ main/trunk/interpreter/streamLibrary/StreamNative.cpp 2024-01-29 17:21:31 UTC (rev 12783) @@ -2723,7 +2723,7 @@ { position_flags |= operation_read | operation_write; - // below block of code has issues (or is in errror) + // below block of code has issues (or is in error) // for one, last_op_was_read is currently always true // and two, collapsing our independent read and write pointers // is bad in a SEEK_CUR +/-offset situation. @@ -2733,7 +2733,8 @@ /* set both stream pointers to last active position */ if (last_op_was_read) { -printf("streamPosition: last_op_was_read: read c=%zd/l=%zd, write c=%zd/l=%zd\r\n", charReadPosition, lineReadPosition, charWritePosition, lineWritePosition); +//@@ this needs revisiting +//@@ printf("streamPosition: last_op_was_read: read c=%zd/l=%zd, write c=%zd/l=%zd\r\n", charReadPosition, lineReadPosition, charWritePosition, lineWritePosition); charWritePosition = charReadPosition; lineWritePosition = lineReadPosition; } |
From: <eri...@us...> - 2024-01-29 16:17:05
|
Revision: 12782 http://sourceforge.net/p/oorexx/code-0/12782 Author: erich_st Date: 2024-01-29 16:17:01 +0000 (Mon, 29 Jan 2024) Log Message: ----------- migrate sprintf to snprintf for Unix code as per [bugs:#1933] Modified Paths: -------------- main/trunk/common/platform/unix/SysLibrary.cpp main/trunk/extensions/hostemu/platform/unix/hostemu.cpp main/trunk/extensions/hostemu/platform/windows/hostemu.cpp main/trunk/extensions/orxncurses/orxncurses.cpp main/trunk/extensions/rxsock/rxsock.cpp main/trunk/extensions/rxsock/rxsock.h main/trunk/extensions/rxsock/rxsockfn.cpp main/trunk/interpreter/api/InterpreterAPI.cpp main/trunk/interpreter/classes/PackageClass.cpp main/trunk/interpreter/classes/RexxInfoClass.cpp main/trunk/interpreter/classes/support/RexxDateTime.cpp main/trunk/interpreter/classes/support/RexxDateTime.hpp main/trunk/interpreter/concurrency/Activity.cpp main/trunk/interpreter/execution/CPPCode.cpp main/trunk/interpreter/expression/BuiltinFunctions.cpp main/trunk/interpreter/memory/MemorySegment.cpp main/trunk/interpreter/parser/Scanner.cpp main/trunk/interpreter/platform/unix/ExternalFunctions.cpp main/trunk/interpreter/platform/unix/SystemCommands.cpp main/trunk/interpreter/runtime/Numerics.cpp main/trunk/interpreter/runtime/Version.cpp main/trunk/interpreter/streamLibrary/StreamNative.cpp main/trunk/rexxapi/server/QueueManager.cpp main/trunk/testbinaries/orxclassic.cpp main/trunk/testbinaries/orxclassic1.c main/trunk/testbinaries/rexxinstance.cpp Modified: main/trunk/common/platform/unix/SysLibrary.cpp =================================================================== --- main/trunk/common/platform/unix/SysLibrary.cpp 2024-01-29 08:22:11 UTC (rev 12781) +++ main/trunk/common/platform/unix/SysLibrary.cpp 2024-01-29 16:17:01 UTC (rev 12782) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2014 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -54,7 +54,7 @@ #define MAX_LIBRARY_NAME_LENGTH 250 -#define LIBARY_NAME_BUFFER_LENGTH (MAX_LIBRARY_NAME_LENGTH + sizeof("/usr/lib/lib") + sizeof(ORX_SHARED_LIBRARY_EXT)) +#define LIBARY_NAME_BUFFER_LENGTH (1 + MAX_LIBRARY_NAME_LENGTH + sizeof("/usr/lib/lib") + sizeof(ORX_SHARED_LIBRARY_EXT)) SysLibrary::SysLibrary() { @@ -85,13 +85,13 @@ return false; } - sprintf(nameBuffer, "lib%s%s", name, ORX_SHARED_LIBRARY_EXT); + snprintf(nameBuffer, LIBARY_NAME_BUFFER_LENGTH, "lib%s%s", name, ORX_SHARED_LIBRARY_EXT); // try loading directly libraryHandle = dlopen(nameBuffer, RTLD_LAZY); // if not found, then try from /usr/lib if (libraryHandle == NULL) { - sprintf(nameBuffer, "/usr/lib/lib%s%s", name, ORX_SHARED_LIBRARY_EXT); + snprintf(nameBuffer, LIBARY_NAME_BUFFER_LENGTH, "/usr/lib/lib%s%s", name, ORX_SHARED_LIBRARY_EXT); libraryHandle = dlopen(nameBuffer, RTLD_LAZY); // still can't find it? if (libraryHandle == NULL) Modified: main/trunk/extensions/hostemu/platform/unix/hostemu.cpp =================================================================== --- main/trunk/extensions/hostemu/platform/unix/hostemu.cpp 2024-01-29 08:22:11 UTC (rev 12781) +++ main/trunk/extensions/hostemu/platform/unix/hostemu.cpp 2024-01-29 16:17:01 UTC (rev 12782) @@ -1,6 +1,6 @@ /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2009-2017 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2009-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -33,9 +33,6 @@ /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ -/* Authors; */ -/* W. David Ashley <da...@us...> */ -/* */ /*----------------------------------------------------------------------------*/ @@ -57,8 +54,6 @@ /* */ /*--------------------------------------------------------------------*/ -// #define HOSTEMU_DEBUG - PCONSTRXSTRING prxCmd = NULL; EXECIO_OPTIONS ExecIO_Options; long lCmdPtr; @@ -137,8 +132,6 @@ /* */ /* Returns: ULONG - return code from RexxVariablePool() */ /* */ -/* Notes: None. */ -/* */ /*--------------------------------------------------------------------*/ unsigned long FetchRexxVar ( @@ -146,7 +139,6 @@ PRXSTRING prxVar) /* REXX variable contents */ { - /* local function variables */ SHVBLOCK RxVarBlock; unsigned long ulRetc; char * pszTemp; @@ -208,8 +200,6 @@ /* */ /* Returns: ULONG - return code from RexxVariablePool() */ /* */ -/* Notes: None. */ -/* */ /*--------------------------------------------------------------------*/ unsigned long SetRexxVar ( @@ -218,7 +208,6 @@ size_t ulLen) /* Value length */ { - /* local function data */ SHVBLOCK RxVarBlock; unsigned long ulRetc; @@ -257,10 +246,6 @@ /* */ /* Returns: Return indicating success or failure */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ RexxReturnCode RexxEntry GrxHost(PCONSTRXSTRING command, @@ -268,14 +253,9 @@ PRXSTRING retc) { - /* Local function variables */ unsigned long i, rc = 0; PLL pll; - #ifdef HOSTEMU_DEBUG - printf("HOSTEMU: Subcom called.\n"); - #endif - /* request the semaphore so we can get exclusive access to */ /* our variables */ pthread_mutex_lock(&hmtxExecIO); @@ -293,11 +273,6 @@ /* parse the command */ if (!yyparse ()) { - #ifdef HOSTEMU_DEBUG - printf("HOSTEMU: Parse complete, lStartRcd=%d, lRcdCnt=%d, lDirection=%d, fRW=%d, fFinis=%d\n", - ExecIO_Options.lStartRcd, ExecIO_Options.lRcdCnt, ExecIO_Options.lDirection, - ExecIO_Options.fRW, ExecIO_Options.fFinis); - #endif if (lStmtType == HI_STMT) { RexxSetHalt(getpid(), pthread_self()); } @@ -308,9 +283,6 @@ RexxSetTrace(getpid(), pthread_self()); } else if (lStmtType == EXECIO_STMT) { - #ifdef HOSTEMU_DEBUG - printf("HOSTEMU: Executing execio statement.\n"); - #endif /* check to see if the file is already open */ pll = Search_LL(ExecIO_Options.aFilename); if (pll == NULL) { @@ -397,11 +369,8 @@ pthread_mutex_unlock(&hmtxExecIO); - sprintf(retc->strptr, "%ld", rc); + snprintf(retc->strptr, 32, "%ld", rc); retc->strlength = strlen(retc->strptr); - #ifdef HOSTEMU_DEBUG - printf("HOSTEMU: Subcom return code = %u.\n", rc); - #endif return rc; } @@ -416,11 +385,6 @@ /* */ /* Returns: Return indicating success or failure */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ -/* */ /*--------------------------------------------------------------------*/ static unsigned long ExecIO_Write_From_Stem ( @@ -427,7 +391,6 @@ PLL pll) /* Pointer to file linked list item */ { - /* Local function variables */ char * Stem; /* Stem variable name */ char * Index; /* Stem index value (string) */ RXSTRING rxVal; /* Rexx stem variable value */ @@ -445,7 +408,7 @@ if (ExecIO_Options.lRcdCnt == -1) { /* process an "*" record count */ // get the number of elements - sprintf(Index, "%u", 0); + snprintf(Index, 32, "%u", 0); if (FetchRexxVar(Stem, &rxVal)) { return ERR_EXECIO_VAR_INVALID; // Variable name supplied on STEM or VAR option was not valid @@ -453,7 +416,7 @@ elements = atoi(rxVal.strptr); RexxFreeMemory(rxVal.strptr); while (ExecIO_Options.lStartRcd <= elements) { - sprintf(Index, "%ld", ExecIO_Options.lStartRcd); + snprintf(Index, 32, "%ld", ExecIO_Options.lStartRcd); if (FetchRexxVar(Stem, &rxVal)) { return ERR_EXECIO_VAR_INVALID; // Variable name supplied on STEM or VAR option was not valid @@ -467,7 +430,7 @@ else { /* process a specific record count */ while (ExecIO_Options.lStartRcd <= ExecIO_Options.lRcdCnt) { - sprintf(Index, "%ld", ExecIO_Options.lStartRcd); + snprintf(Index, 32, "%ld", ExecIO_Options.lStartRcd); if (FetchRexxVar(Stem, &rxVal)) { return ERR_EXECIO_VAR_INVALID; // Variable name supplied on STEM or VAR option was not valid @@ -495,10 +458,6 @@ /* */ /* Returns: Return indicating success or failure */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static unsigned long ExecIO_Write_From_Queue ( @@ -505,7 +464,6 @@ PLL pll) /* Pointer to file linked list item */ { - /* Local function variables */ char * Item; /* Item pulled from the queue */ long items; @@ -573,11 +531,6 @@ /* */ /* Returns: Return indicating success or failure */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ -/* */ /*--------------------------------------------------------------------*/ static unsigned long ExecIO_Read_To_Stem ( @@ -584,7 +537,6 @@ PLL pll) /* Pointer to file linked list item */ { - /* Local function variables */ char * Stem; /* Stem variable name */ char * Index; /* Stem index value (string) */ unsigned long ulRc = 0; /* Return code */ @@ -596,7 +548,7 @@ return ERR_EXECIO_NO_STORAGE; // Insufficient free storage to load EXECIO } - // skip until we reach line number 'StartRcd' + // skip until we reach line number 'StartRcd' for (i = 1; i < ExecIO_Options.lStartRcd; i++) { char* ignore; // avoid warning: ignoring return value of 'char* fgets(char*, int, FILE*)' @@ -613,7 +565,7 @@ if (*(szInline + strlen(szInline) - 1) == '\n') *(szInline + strlen(szInline) - 1) = '\0'; i++; - sprintf(Index, "%d", i); + snprintf(Index, 32, "%d", i); if (SetRexxVar(Stem, szInline, strlen(szInline))) { return ERR_EXECIO_VAR_INVALID; // Variable name supplied on STEM or VAR option was not valid @@ -628,7 +580,7 @@ *(szInline + strlen(szInline) - 1) = '\0'; } i++; - sprintf(Index, "%d", i); + snprintf(Index, 32, "%d", i); if (SetRexxVar(Stem, szInline, strlen(szInline))) { return ERR_EXECIO_VAR_INVALID; // Variable name supplied on STEM or VAR option was not valid @@ -641,8 +593,8 @@ ExecIO_Options.lRcdCnt--; } } - sprintf(szInline, "%d", i); - sprintf(Index, "%d", 0); + snprintf(szInline, 32, "%d", i); + snprintf(Index, 32, "%d", 0); if (SetRexxVar(Stem, szInline, strlen(szInline))) { return ERR_EXECIO_VAR_INVALID; // Variable name supplied on STEM or VAR option was not valid @@ -664,10 +616,6 @@ /* */ /* Returns: Return indicating success or failure */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static unsigned long ExecIO_Read_To_Queue ( @@ -674,12 +622,11 @@ PLL pll) /* Pointer to file linked list item */ { - /* Local function variables */ int i; /* process request */ - // skip until we reach line number 'StartRcd' + // skip until we reach line number 'StartRcd' for (i = 1; i < ExecIO_Options.lStartRcd; i++) { char* ignore; // avoid warning: ignoring return value of 'char* fgets(char*, int, FILE*)' @@ -730,10 +677,6 @@ /* */ /* Returns: Pointer to found struct or NULL if not found */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static PLL Search_LL ( @@ -740,7 +683,6 @@ char * SFilename) /* Source file name */ { - /* Local function variables */ PLL pll = pHead; while (pll != NULL) { @@ -763,10 +705,6 @@ /* */ /* Returns: None. */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static void Insert_LL ( @@ -796,10 +734,6 @@ /* */ /* Returns: None. */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static void Delete_LL ( @@ -833,10 +767,6 @@ /* */ /* Returns: Number of queued items */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static long queued ( @@ -843,7 +773,6 @@ void) /* No arguments */ { - /* local function variables */ size_t elements; RexxQueryQueue("SESSION", &elements); @@ -861,10 +790,6 @@ /* */ /* Returns: Number of queued items */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static void push ( @@ -891,10 +816,6 @@ /* */ /* Returns: Pointer to the pulled string */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static char * pull ( @@ -901,7 +822,6 @@ void) /* No arguments */ { - /* local function variables */ RXSTRING result = {0, NULL}; RexxReturnCode rc; @@ -914,10 +834,6 @@ RexxReturnCode rc; rc = RexxRegisterSubcomExe("HostEmu", (void *)GrxHost, NULL); - #ifdef HOSTEMU_DEBUG - printf("HOSTEMU: Library loaded.\n"); - printf("HOSTEMU: RexxRegisterSubcomExe retc = %d.\n", rc); - #endif } Modified: main/trunk/extensions/hostemu/platform/windows/hostemu.cpp =================================================================== --- main/trunk/extensions/hostemu/platform/windows/hostemu.cpp 2024-01-29 08:22:11 UTC (rev 12781) +++ main/trunk/extensions/hostemu/platform/windows/hostemu.cpp 2024-01-29 16:17:01 UTC (rev 12782) @@ -1,6 +1,6 @@ /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2009-2016 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2009-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -33,9 +33,6 @@ /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ -/* Authors; */ -/* W. David Ashley <da...@us...> */ -/* */ /*----------------------------------------------------------------------------*/ @@ -56,8 +53,6 @@ /* */ /*--------------------------------------------------------------------*/ -// #define HOSTEMU_DEBUG - PCONSTRXSTRING prxCmd = NULL; EXECIO_OPTIONS ExecIO_Options; long lCmdPtr; @@ -136,8 +131,6 @@ /* */ /* Returns: ULONG - return code from RexxVariablePool() */ /* */ -/* Notes: None. */ -/* */ /*--------------------------------------------------------------------*/ unsigned long FetchRexxVar ( @@ -145,7 +138,6 @@ PRXSTRING prxVar) /* REXX variable contents */ { - /* local function variables */ SHVBLOCK RxVarBlock; unsigned long ulRetc; char * pszTemp; @@ -207,8 +199,6 @@ /* */ /* Returns: ULONG - return code from RexxVariablePool() */ /* */ -/* Notes: None. */ -/* */ /*--------------------------------------------------------------------*/ unsigned long SetRexxVar ( @@ -217,7 +207,6 @@ size_t ulLen) /* Value length */ { - /* local function data */ SHVBLOCK RxVarBlock; unsigned long ulRetc; @@ -256,10 +245,6 @@ /* */ /* Returns: Return indicating success or failure */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ RexxReturnCode RexxEntry GrxHost(PCONSTRXSTRING command, @@ -267,14 +252,9 @@ PRXSTRING retc) { - /* Local function variables */ unsigned long i, rc = 0; PLL pll; - #ifdef HOSTEMU_DEBUG - printf("HOSTEMU: Subcom called.\n"); - #endif - /* request the semaphore so we can get exclusive access to */ /* our variables */ WaitForSingleObject(htmxExecIO, INFINITE); @@ -292,11 +272,6 @@ /* parse the command */ if (!yyparse ()) { - #ifdef HOSTEMU_DEBUG - printf("HOSTEMU: Parse complete, lStartRcd=%d, lRcdCnt=%d, lDirection=%d, fRW=%d, fFinis=%d\n", - ExecIO_Options.lStartRcd, ExecIO_Options.lRcdCnt, ExecIO_Options.lDirection, - ExecIO_Options.fRW, ExecIO_Options.fFinis); - #endif if (lStmtType == HI_STMT) { RexxSetHalt(GetCurrentProcessId(), GetCurrentThreadId()); } @@ -307,9 +282,6 @@ RexxSetTrace(GetCurrentProcessId(), GetCurrentThreadId()); } else if (lStmtType == EXECIO_STMT) { - #ifdef HOSTEMU_DEBUG - printf("HOSTEMU: Executing execio statement.\n"); - #endif /* check to see if the file is already open */ pll = Search_LL(ExecIO_Options.aFilename); if (pll == NULL) { @@ -400,11 +372,8 @@ ReleaseMutex(htmxExecIO); - sprintf(retc->strptr, "%u", rc); + snprintf(retc->strptr, 32, "%u", rc); retc->strlength = strlen(retc->strptr); - #ifdef HOSTEMU_DEBUG - printf("HOSTEMU: Subcom return code = %u.\n", rc); - #endif return rc; } @@ -419,11 +388,6 @@ /* */ /* Returns: Return indicating success or failure */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ -/* */ /*--------------------------------------------------------------------*/ static unsigned long ExecIO_Write_From_Stem ( @@ -430,7 +394,6 @@ PLL pll) /* Pointer to file linked list item */ { - /* Local function variables */ char * Stem; /* Stem variable name */ char * Index; /* Stem index value (string) */ RXSTRING rxVal; /* Rexx stem variable value */ @@ -448,7 +411,7 @@ if (ExecIO_Options.lRcdCnt == -1) { /* process an "*" record count */ // get the number of elements - sprintf(Index, "%u", 0); + snprintf(Index, 32, "%u", 0); if (FetchRexxVar(Stem, &rxVal)) { return ERR_EXECIO_VAR_INVALID; // Variable name supplied on STEM or VAR option was not valid @@ -456,7 +419,7 @@ elements = atoi(rxVal.strptr); RexxFreeMemory(rxVal.strptr); while (ExecIO_Options.lStartRcd <= elements) { - sprintf(Index, "%d", ExecIO_Options.lStartRcd); + snprintf(Index, 32, "%d", ExecIO_Options.lStartRcd); if (FetchRexxVar(Stem, &rxVal)) { return ERR_EXECIO_VAR_INVALID; // Variable name supplied on STEM or VAR option was not valid @@ -470,7 +433,7 @@ else { /* process a specific record count */ while (ExecIO_Options.lStartRcd <= ExecIO_Options.lRcdCnt) { - sprintf(Index, "%u", ExecIO_Options.lStartRcd); + snprintf(Index, 32, "%d", ExecIO_Options.lStartRcd); if (FetchRexxVar(Stem, &rxVal)) { return ERR_EXECIO_VAR_INVALID; // Variable name supplied on STEM or VAR option was not valid @@ -498,10 +461,6 @@ /* */ /* Returns: Return indicating success or failure */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static unsigned long ExecIO_Write_From_Queue ( @@ -508,7 +467,6 @@ PLL pll) /* Pointer to file linked list item */ { - /* Local function variables */ char * Item; /* Item pulled from the queue */ long items; @@ -576,11 +534,6 @@ /* */ /* Returns: Return indicating success or failure */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ -/* */ /*--------------------------------------------------------------------*/ static unsigned long ExecIO_Read_To_Stem ( @@ -587,7 +540,6 @@ PLL pll) /* Pointer to file linked list item */ { - /* Local function variables */ char * Stem; /* Stem variable name */ char * Index; /* Stem index value (string) */ unsigned long ulRc = 0; /* Return code */ @@ -599,7 +551,7 @@ return ERR_EXECIO_NO_STORAGE; // Insufficient free storage to load EXECIO } - // skip until we reach line number 'StartRcd' + // skip until we reach line number 'StartRcd' for (i = 1; i < ExecIO_Options.lStartRcd; i++) { fgets(szInline, sizeof(szInline), pll -> pFile); @@ -615,7 +567,7 @@ if (*(szInline + strlen(szInline) - 1) == '\n') *(szInline + strlen(szInline) - 1) = '\0'; i++; - sprintf(Index, "%d", i); + snprintf(Index, 32, "%d", i); if (SetRexxVar(Stem, szInline, strlen(szInline))) { return ERR_EXECIO_VAR_INVALID; // Variable name supplied on STEM or VAR option was not valid @@ -630,7 +582,7 @@ *(szInline + strlen(szInline) - 1) = '\0'; } i++; - sprintf(Index, "%d", i); + snprintf(Index, 32, "%d", i); if (SetRexxVar(Stem, szInline, strlen(szInline))) { return ERR_EXECIO_VAR_INVALID; // Variable name supplied on STEM or VAR option was not valid @@ -643,8 +595,8 @@ ExecIO_Options.lRcdCnt--; } } - sprintf(szInline, "%d", i); - sprintf(Index, "%d", 0); + snprintf(szInline, 32, "%d", i); + snprintf(Index, 32, "%d", 0); if (SetRexxVar(Stem, szInline, strlen(szInline))) { return ERR_EXECIO_VAR_INVALID; // Variable name supplied on STEM or VAR option was not valid @@ -666,10 +618,6 @@ /* */ /* Returns: Return indicating success or failure */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static unsigned long ExecIO_Read_To_Queue ( @@ -676,12 +624,11 @@ PLL pll) /* Pointer to file linked list item */ { - /* Local function variables */ int i; /* process request */ - // skip until we reach line number 'StartRcd' + // skip until we reach line number 'StartRcd' for (i = 1; i < ExecIO_Options.lStartRcd; i++) { fgets(szInline, sizeof(szInline), pll -> pFile); @@ -731,10 +678,6 @@ /* */ /* Returns: Pointer to found struct or NULL if not found */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static PLL Search_LL ( @@ -741,7 +684,6 @@ char * SFilename) /* Source file name */ { - /* Local function variables */ PLL pll = pHead; while (pll != NULL) { @@ -764,10 +706,6 @@ /* */ /* Returns: None. */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static void Insert_LL ( @@ -797,10 +735,6 @@ /* */ /* Returns: None. */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static void Delete_LL ( @@ -834,10 +768,6 @@ /* */ /* Returns: Number of queued items */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static long queued ( @@ -844,7 +774,6 @@ void) /* No arguments */ { - /* local function variables */ size_t elements; RexxQueryQueue("SESSION", &elements); @@ -862,10 +791,6 @@ /* */ /* Returns: Number of queued items */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static void push ( @@ -892,10 +817,6 @@ /* */ /* Returns: Pointer to the pulled string */ /* */ -/* References: None. */ -/* */ -/* Notes: */ -/* */ /*--------------------------------------------------------------------*/ static char * pull ( @@ -902,7 +823,6 @@ void) /* No arguments */ { - /* local function variables */ RXSTRING result = {0, NULL}; RexxReturnCode rc; @@ -916,11 +836,6 @@ rc = RexxRegisterSubcomExe("HostEmu", (REXXPFN)GrxHost, NULL); htmxExecIO = CreateMutex(NULL, false, NULL); - #ifdef HOSTEMU_DEBUG - printf("HOSTEMU: Library loaded.\n"); - printf("HOSTEMU: RexxRegisterSubcomExe retc = %d.\n", rc); - printf("HOSTEMU: CreateMutex htmxExecIO = %d.\n", htmxExecIO); - #endif } Modified: main/trunk/extensions/orxncurses/orxncurses.cpp =================================================================== --- main/trunk/extensions/orxncurses/orxncurses.cpp 2024-01-29 08:22:11 UTC (rev 12781) +++ main/trunk/extensions/orxncurses/orxncurses.cpp 2024-01-29 16:17:01 UTC (rev 12782) @@ -1,6 +1,6 @@ /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2010-2021 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2010-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -1373,7 +1373,7 @@ return 0; } getbegyx((WINDOW *)cself, y, x); - sprintf(buf, "%d %d", ADDONE(y), ADDONE(x)); + snprintf(buf, sizeof(buf), "%d %d", ADDONE(y), ADDONE(x)); return (RexxObjectPtr)context->NewStringFromAsciiz(buf); } @@ -1477,7 +1477,7 @@ return 0; } getmaxyx((WINDOW *)cself, y, x); - sprintf(buf, "%d %d", y, x); + snprintf(buf, sizeof(buf), "%d %d", y, x); return (RexxObjectPtr)context->NewStringFromAsciiz(buf); } @@ -1503,7 +1503,7 @@ return 0; } getparyx((WINDOW *)cself, y, x); - sprintf(buf, "%d %d", ADDONE(y), ADDONE(x)); + snprintf(buf, sizeof(buf), "%d %d", ADDONE(y), ADDONE(x)); return (RexxObjectPtr)context->NewStringFromAsciiz(buf); } @@ -1695,7 +1695,7 @@ return 0; } getyx((WINDOW *)cself, y, x); - sprintf(buf, "%d %d", ADDONE(y), ADDONE(x)); + snprintf(buf, sizeof(buf), "%d %d", ADDONE(y), ADDONE(x)); return (RexxObjectPtr)context->NewStringFromAsciiz(buf); } @@ -2673,7 +2673,7 @@ return 0; } wmouse_trafo((WINDOW *)cself, &y, &x, bf); - sprintf(buf, "%d %d", ADDONE(y), ADDONE(x)); + snprintf(buf, sizeof(buf), "%d %d", ADDONE(y), ADDONE(x)); return (RexxObjectPtr)context->NewStringFromAsciiz(buf); } @@ -2804,7 +2804,7 @@ { char buf[64]; - sprintf(buf, "%d", NCURSES_MOUSE_VERSION); + snprintf(buf, sizeof(buf), "%d", NCURSES_MOUSE_VERSION); return (RexxObjectPtr)context->NewStringFromAsciiz(buf); } @@ -2986,7 +2986,7 @@ short f, b; int retc = pair_content((short)num, &f, &b); - sprintf(buf, "%d %d", f, b); + snprintf(buf, sizeof(buf), "%d %d", f, b); return (RexxObjectPtr)context->NewStringFromAsciiz(buf); } Modified: main/trunk/extensions/rxsock/rxsock.cpp =================================================================== --- main/trunk/extensions/rxsock/rxsock.cpp 2024-01-29 08:22:11 UTC (rev 12781) +++ main/trunk/extensions/rxsock/rxsock.cpp 2024-01-29 16:17:01 UTC (rev 12782) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2023 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -371,7 +371,7 @@ *---------------------------------------------------------------*/ for (count=0; pHostEnt->h_aliases[count]; count++) { - sprintf(szBuffer,"ALIAS.%d",count+1); + snprintf(szBuffer, sizeof(szBuffer), "ALIAS.%d", count + 1); stem.setValue(szBuffer, context->String(pHostEnt->h_aliases[count])); } @@ -400,7 +400,7 @@ *---------------------------------------------------------------*/ for (count=0; pHostEnt->h_addr_list[count]; count++) { - sprintf(szBuffer, "ADDR.%d", count+1); + snprintf(szBuffer, sizeof(szBuffer), "ADDR.%d", count + 1); addr.s_addr = (*(uint32_t *)pHostEnt->h_addr_list[count]); stem.setValue(szBuffer, context->String(inet_ntoa(addr))); @@ -550,7 +550,7 @@ case ENOTEMPTY : pszErrno = "ENOTEMPTY"; break; #endif default: - sprintf(szBuff,"%d",theErrno); + snprintf(szBuff, sizeof(szBuff), "%d", theErrno); } context->SetContextVariable("errno", context->String(pszErrno)); @@ -570,7 +570,7 @@ { char buffer[256]; - sprintf(buffer, "%d.%d.%d", ORX_VER, ORX_REL, ORX_MOD); + snprintf(buffer, sizeof(buffer), "%d.%d.%d", ORX_VER, ORX_REL, ORX_MOD); return context->String(buffer); } Modified: main/trunk/extensions/rxsock/rxsock.h =================================================================== --- main/trunk/extensions/rxsock/rxsock.h 2024-01-29 08:22:11 UTC (rev 12781) +++ main/trunk/extensions/rxsock/rxsock.h 2024-01-29 16:17:01 UTC (rev 12782) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2021 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -187,7 +187,7 @@ else { char fullName[256]; - sprintf(fullName, "%s%s", prefix, name); + snprintf(fullName, sizeof(fullName), "%s%s", prefix, name); context->SetStemElement(stem, fullName, value); } } @@ -207,7 +207,7 @@ else { char fullName[256]; - sprintf(fullName, "%s.%d", prefix, (int)index); + snprintf(fullName, sizeof(fullName), "%s.%d", prefix, (int)index); context->SetStemElement(stem, fullName, value); } } @@ -228,7 +228,7 @@ else { char fullName[256]; - sprintf(fullName, "%s%s", prefix, name); + snprintf(fullName, sizeof(fullName), "%s%s", prefix, name); return context->GetStemElement(stem, fullName); } } @@ -242,7 +242,7 @@ else { char fullName[256]; - sprintf(fullName, "%s.%d", prefix, (int)index); + snprintf(fullName, sizeof(fullName), "%s.%d", prefix, (int)index); return context->GetStemElement(stem, fullName); } } Modified: main/trunk/extensions/rxsock/rxsockfn.cpp =================================================================== --- main/trunk/extensions/rxsock/rxsockfn.cpp 2024-01-29 08:22:11 UTC (rev 12781) +++ main/trunk/extensions/rxsock/rxsockfn.cpp 2024-01-29 16:17:01 UTC (rev 12782) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2023 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -570,7 +570,7 @@ switch (opt) { case SO_LINGER: - sprintf(buffer,"%d %d", lingStruct.l_onoff, lingStruct.l_linger); + snprintf(buffer, sizeof(buffer), "%d %d", lingStruct.l_onoff, lingStruct.l_linger); break; case SO_TYPE: @@ -588,12 +588,12 @@ // DWORD argument, whereas on Unix a struct timeval is expected case SO_RCVTIMEO: case SO_SNDTIMEO: - sprintf(buffer, "%d", (int)(tv.tv_sec * 1000 + tv.tv_usec / 1000)); + snprintf(buffer, sizeof(buffer), "%d", (int)(tv.tv_sec * 1000 + tv.tv_usec / 1000)); break; #endif default: - sprintf(buffer,"%d", intVal); + snprintf(buffer, sizeof(buffer), "%d", intVal); } // set the variable Modified: main/trunk/interpreter/api/InterpreterAPI.cpp =================================================================== --- main/trunk/interpreter/api/InterpreterAPI.cpp 2024-01-29 08:22:11 UTC (rev 12781) +++ main/trunk/interpreter/api/InterpreterAPI.cpp 2024-01-29 16:17:01 UTC (rev 12782) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2018 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -248,7 +248,7 @@ char *REXXENTRY RexxGetVersionInformation() { char ver[100]; - sprintf( ver, " %d.%d.%d r%d", ORX_VER, ORX_REL, ORX_MOD, ORX_BLD); + snprintf(ver, sizeof(ver), " %d.%d.%d r%d", ORX_VER, ORX_REL, ORX_MOD, ORX_BLD); char header[] = "Open Object Rexx Version"; #ifdef _DEBUG char build[] = " - Internal Test Version\nBuild date: "; @@ -265,11 +265,12 @@ char copy3[] = "\nThis program and the accompanying materials are made available under the terms"; char copy4[] = "\nof the Common Public License v1.0 which accompanies this distribution or at"; char copy5[] = "\nhttps://www.oorexx.org/license.html"; - char *ptr = (char *)SystemInterpreter::allocateResultMemory(strlen(header) + strlen(ver) + strlen(build) + strlen(__DATE__) + - strlen(mode) + strlen(copy1) + strlen(copy2) + strlen(copy3) + strlen(copy4) + strlen(copy5) + 1); + size_t length = strlen(header) + strlen(ver) + strlen(build) + strlen(__DATE__) + + strlen(mode) + strlen(copy1) + strlen(copy2) + strlen(copy3) + strlen(copy4) + strlen(copy5) + 1; + char *ptr = (char *)SystemInterpreter::allocateResultMemory(length); if (ptr != NULL) { - sprintf(ptr, "%s%s%s%s%s%s%s%s%s%s", header, ver, build, __DATE__, mode, copy1, copy2, copy3, copy4, copy5); + snprintf(ptr, length, "%s%s%s%s%s%s%s%s%s%s", header, ver, build, __DATE__, mode, copy1, copy2, copy3, copy4, copy5); } return ptr; } Modified: main/trunk/interpreter/classes/PackageClass.cpp =================================================================== --- main/trunk/interpreter/classes/PackageClass.cpp 2024-01-29 08:22:11 UTC (rev 12781) +++ main/trunk/interpreter/classes/PackageClass.cpp 2024-01-29 16:17:01 UTC (rev 12782) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2020 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -553,7 +553,7 @@ char linenumber[11]; /* formatted line number */ // format the line number as a string - sprintf(linenumber,"%zu", location.getLineNumber()); + snprintf(linenumber, sizeof(linenumber), "%zu", location.getLineNumber()); // get the line from the source string...this can return "" if the source is // not available or this string is somehow out of bounds. Modified: main/trunk/interpreter/classes/RexxInfoClass.cpp =================================================================== --- main/trunk/interpreter/classes/RexxInfoClass.cpp 2024-01-29 08:22:11 UTC (rev 12781) +++ main/trunk/interpreter/classes/RexxInfoClass.cpp 2024-01-29 16:17:01 UTC (rev 12782) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2021 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -190,11 +190,11 @@ day++; } // now format into a usable date and make into a string object. - sprintf(buffer, "%s %s %s", day, month, year); + snprintf(buffer, sizeof(buffer), "%s %s %s", day, month, year); interpreterDate = new_string(buffer); // now build the version string - sprintf(buffer, "%d.%d.%d", ORX_VER, ORX_REL, ORX_MOD); + snprintf(buffer, sizeof(buffer), "%d.%d.%d", ORX_VER, ORX_REL, ORX_MOD); interpreterVersion = new_string(buffer); languageLevel = new_string(Interpreter::languageLevel); Modified: main/trunk/interpreter/classes/support/RexxDateTime.cpp =================================================================== --- main/trunk/interpreter/classes/support/RexxDateTime.cpp 2024-01-29 08:22:11 UTC (rev 12781) +++ main/trunk/interpreter/classes/support/RexxDateTime.cpp 2024-01-29 16:17:01 UTC (rev 12782) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2022 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -1162,18 +1162,6 @@ /** - * Format a base date into human readable form. - * - * @param buffer The target buffer for the output. - */ -void RexxDateTime::formatBaseDate(char *buffer) -{ - // format this into the buffer as a number - sprintf(buffer, "%zd", getBaseDate()); -} - - -/** * Format a base time into human readable form. * * @param buffer The target buffer for the output. @@ -1196,18 +1184,6 @@ /** - * Format a date as the number of days in the current year. - * - * @param buffer The target buffer for the output. - */ -void RexxDateTime::formatDays(char *buffer) -{ - // format this into the buffer as a number - sprintf(buffer, "%d", (int)getYearDay()); -} - - -/** * Format a date in 'E'uropean format. * * @param buffer The target buffer for the output. @@ -1215,11 +1191,11 @@ * be NULL, in which case the default is used. The string value * can also be a null string (""). */ -void RexxDateTime::formatEuropeanDate(char *buffer, const char *sep) +void RexxDateTime::formatEuropeanDate(char *buffer, wholenumber_t bufferSize, const char *sep) { // make sure we have a valid delimiter sep = sep == NULL ? "/" : sep; - sprintf(buffer, "%02d%s%02d%s%02d", day, sep, month, sep, year % 100); + snprintf(buffer, bufferSize, "%02d%s%02d%s%02d", day, sep, month, sep, year % 100); } @@ -1242,11 +1218,11 @@ * be NULL, in which case the default is used. The string value * can also be a null string (""). */ -void RexxDateTime::formatNormalDate(char *buffer, const char *sep) +void RexxDateTime::formatNormalDate(char *buffer, wholenumber_t bufferSize, const char *sep) { // make sure we have a valid delimiter sep = sep == NULL ? " " : sep; - sprintf(buffer, "%d%s%3.3s%s%4.4d", day, sep, monthNames[month-1], sep, year); + snprintf(buffer, bufferSize, "%d%s%3.3s%s%4.4d", day, sep, monthNames[month-1], sep, year); } @@ -1258,11 +1234,11 @@ * be NULL, in which case the default is used. The string value * can also be a null string (""). */ -void RexxDateTime::formatOrderedDate(char *buffer, const char *sep) +void RexxDateTime::formatOrderedDate(char *buffer, wholenumber_t bufferSize, const char *sep) { // make sure we have a valid delimiter sep = sep == NULL ? "/" : sep; - sprintf(buffer, "%02d%s%02d%s%02d", year % 100, sep, month, sep, day); + snprintf(buffer, bufferSize, "%02d%s%02d%s%02d", year % 100, sep, month, sep, day); } @@ -1274,11 +1250,11 @@ * be NULL, in which case the default is used. The string value * can also be a null string (""). */ -void RexxDateTime::formatISODate(char *buffer, const char *sep) +void RexxDateTime::formatISODate(char *buffer, wholenumber_t bufferSize, const char *sep) { // make sure we have a valid delimiter sep = sep == NULL ? "-" : sep; - sprintf(buffer, "%04d%s%02d%s%02d", year, sep, month, sep, day); + snprintf(buffer, bufferSize, "%04d%s%02d%s%02d", year, sep, month, sep, day); } @@ -1290,11 +1266,11 @@ * be NULL, in which case the default is used. The string value * can also be a null string (""). */ -void RexxDateTime::formatStandardDate(char *buffer, const char *sep) +void RexxDateTime::formatStandardDate(char *buffer, wholenumber_t bufferSize, const char *sep) { // make sure we have a valid delimiter sep = sep == NULL ? "" : sep; - sprintf(buffer, "%04d%s%02d%s%02d", year, sep, month, sep, day); + snprintf(buffer, bufferSize, "%04d%s%02d%s%02d", year, sep, month, sep, day); } @@ -1306,16 +1282,14 @@ * be NULL, in which case the default is used. The string value * can also be a null string (""). */ -void RexxDateTime::formatUsaDate(char *buffer, const char *sep) +void RexxDateTime::formatUsaDate(char *buffer, wholenumber_t bufferSize, const char *sep) { // make sure we have a valid delimiter sep = sep == NULL ? "/" : sep; - sprintf(buffer, "%02d%s%02d%s%02d", month, sep, day, sep, year % 100); + snprintf(buffer, bufferSize, "%02d%s%02d%s%02d", month, sep, day, sep, year % 100); } - - /** * Format a date as the name of the current day. * @@ -1323,7 +1297,6 @@ */ void RexxDateTime::formatWeekDay(char *buffer) { - strcpy(buffer, getDayName()); // copy over the text name } @@ -1333,7 +1306,7 @@ * * @param buffer The target buffer for the output. */ -void RexxDateTime::formatCivilTime(char *buffer) +void RexxDateTime::formatCivilTime(char *buffer, wholenumber_t bufferSize) { int adjustedHours = hours; if (adjustedHours == 0) @@ -1344,66 +1317,33 @@ { adjustedHours -= 12; } - sprintf(buffer,"%d:%2.2d%s", adjustedHours, minutes, hours >= 12 ? POSTMERIDIAN : ANTEMERIDIAN); + snprintf(buffer, bufferSize, "%d:%2.2d%s", adjustedHours, minutes, hours >= 12 ? POSTMERIDIAN : ANTEMERIDIAN); } /** - * Format a time in 'H'ours format. - * - * @param buffer The target buffer for the output. - */ -void RexxDateTime::formatHours(char *buffer) -{ - sprintf(buffer, "%d", hours); // just format the hours -} - - -/** * Format a time in 'L'ong format. * * @param buffer The target buffer for the output. */ -void RexxDateTime::formatLongTime(char *buffer) +void RexxDateTime::formatLongTime(char *buffer, wholenumber_t bufferSize) { - sprintf(buffer, "%2.2d:%2.2d:%2.2d.%6.6d", hours, minutes, seconds, microseconds); + snprintf(buffer, bufferSize, "%2.2d:%2.2d:%2.2d.%6.6d", hours, minutes, seconds, microseconds); } /** - * Format a time in 'M'inutes format. - * - * @param buffer The target buffer for the output. - */ -void RexxDateTime::formatMinutes(char *buffer) -{ - sprintf(buffer,"%d", hours * MINUTES_IN_HOUR + minutes); -} - - -/** * Format a time in 'N'ormal format. * * @param buffer The target buffer for the output. */ -void RexxDateTime::formatNormalTime(char *buffer) +void RexxDateTime::formatNormalTime(char *buffer, wholenumber_t bufferSize) { - sprintf(buffer, "%2.2d:%2.2d:%2.2d", hours, minutes, seconds); + snprintf(buffer, bufferSize, "%2.2d:%2.2d:%2.2d", hours, minutes, seconds); } /** - * Format a time in 'S'econds format. - * - * @param buffer The target buffer for the output. - */ -void RexxDateTime::formatSeconds(char *buffer) -{ - sprintf(buffer, "%d", (hours * MINUTES_IN_HOUR + minutes) * SECONDS_IN_MINUTE + seconds); -} - - -/** * Format a the time zone offset value * * @param buffer The target buffer for the output. Modified: main/trunk/interpreter/classes/support/RexxDateTime.hpp =================================================================== --- main/trunk/interpreter/classes/support/RexxDateTime.hpp 2024-01-29 08:22:11 UTC (rev 12781) +++ main/trunk/interpreter/classes/support/RexxDateTime.hpp 2024-01-29 16:17:01 UTC (rev 12782) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2014 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -150,24 +150,19 @@ bool setSeconds(wholenumber_t s); bool setMinutes(wholenumber_t m); bool adjustTimeZone(int64_t o); - void formatBaseDate(char *buffer); void formatBaseTime(char *buffer)... [truncated message content] |
From: <per...@us...> - 2024-01-29 08:22:13
|
Revision: 12781 http://sourceforge.net/p/oorexx/code-0/12781 Author: perolovjonsson Date: 2024-01-29 08:22:11 +0000 (Mon, 29 Jan 2024) Log Message: ----------- Reverting unnecessary commit for Apple Modified Paths: -------------- main/trunk/CMakeLists.txt Modified: main/trunk/CMakeLists.txt =================================================================== --- main/trunk/CMakeLists.txt 2024-01-19 18:25:00 UTC (rev 12780) +++ main/trunk/CMakeLists.txt 2024-01-29 08:22:11 UTC (rev 12781) @@ -40,7 +40,7 @@ #/* Global settings */ #/*----------------------------------------------------------------------------*/ message(STATUS "CMake version is ${CMAKE_VERSION}") -if ( APPLE ) +if (APPLE) # apple builds with prior cmake version have an @rpath problem cmake_minimum_required (VERSION 3.12) else () @@ -52,26 +52,16 @@ # must come before the project command # 10.13.6 High Sierra is the minimum system supported -if( APPLE ) +if( APPLE AND BUILD_OSX_UNIVERSAL_BINARIES ) set( CMAKE_OSX_DEPLOYMENT_TARGET 10.13.6 CACHE STRING "" FORCE) endif() project (ooRexx) -# Cater for 3 versions of binaries on macOS - if( APPLE AND BUILD_OSX_UNIVERSAL_BINARIES ) set( CMAKE_OSX_ARCHITECTURES arm64 x86_64 ) endif() -if( APPLE AND BUILD_X86_64_BINARIES ) - set( CMAKE_OSX_ARCHITECTURES x86_64 ) -endif() - -if( APPLE AND BUILD_ARM64_BINARIES ) - set( CMAKE_OSX_ARCHITECTURES arm64 ) -endif() - include(CheckIncludeFile) include(CheckLibraryExists) include(CheckFunctionExists) @@ -2270,18 +2260,10 @@ # This was changed to cope with arm64 or x86_64 or both if( APPLE AND BUILD_OSX_UNIVERSAL_BINARIES ) set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL}-${CPACK_PACKAGE_RELEASE}.${OS_DIST}.arm64.x86_64") + else () + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL}-${CPACK_PACKAGE_RELEASE}.${OS_DIST}.${CMAKE_SYSTEM_PROCESSOR}") endif () -# Build binaries for x86_64 -if( APPLE AND BUILD_X86_64_BINARIES ) - set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL}-${CPACK_PACKAGE_RELEASE}.${OS_DIST}.x86_64") - endif () - -# Build binaries for arm64 -if( APPLE AND BUILD_ARM64_BINARIES ) - set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL}-${CPACK_PACKAGE_RELEASE}.${OS_DIST}.arm64") - endif () - message(STATUS "ORX_BLD_LVL ${ORX_BLD_LVL}") message(STATUS "CPACK_PACKAGE_RELEASE ${CPACK_PACKAGE_RELEASE}") message(STATUS "CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}") @@ -2308,15 +2290,9 @@ if( APPLE AND BUILD_OSX_UNIVERSAL_BINARIES ) set(rexx_exe_cpu "universal") + else () + set(rexx_exe_cpu ${CMAKE_SYSTEM_PROCESSOR}) endif () - - if( APPLE AND BUILD_X86_64_BINARIES ) - set(rexx_exe_cpu "x86_64") - endif () - - if( APPLE AND BUILD_ARM64_BINARIES ) - set(rexx_exe_cpu "arm64") - endif () endif () string(TOLOWER ${rexx_exe_opsys} rexx_exe_opsys) # make sure operating system is lowercase string(TOLOWER "${CMAKE_BUILD_TYPE}" rexx_build_type) |
From: <or...@us...> - 2024-01-19 18:25:06
|
Revision: 12780 http://sourceforge.net/p/oorexx/code-0/12780 Author: orexx Date: 2024-01-19 18:25:00 +0000 (Fri, 19 Jan 2024) Log Message: ----------- 20240119 Fix [documentation:#313] Modified Paths: -------------- docs/trunk/rexxref/en-US/fundclasses.xml Modified: docs/trunk/rexxref/en-US/fundclasses.xml =================================================================== --- docs/trunk/rexxref/en-US/fundclasses.xml 2024-01-17 20:45:46 UTC (rev 12779) +++ docs/trunk/rexxref/en-US/fundclasses.xml 2024-01-19 18:25:00 UTC (rev 12780) @@ -2505,7 +2505,7 @@ <para>Turns off the guard attribute of the method, allowing this method to run on an object even if another method has acquired exclusive access to the scope -variable pool. Methods are unguarded by default.</para> +variable pool. Methods are guarded by default.</para> <para> A guarded method can be active for an object only when no other method requiring exclusive access to the object's variable pool is active in the same object. This |
From: <per...@us...> - 2024-01-17 20:45:48
|
Revision: 12779 http://sourceforge.net/p/oorexx/code-0/12779 Author: perolovjonsson Date: 2024-01-17 20:45:46 +0000 (Wed, 17 Jan 2024) Log Message: ----------- further changes for macOS X64 arm64 or both Modified Paths: -------------- main/trunk/CMakeLists.txt Modified: main/trunk/CMakeLists.txt =================================================================== --- main/trunk/CMakeLists.txt 2024-01-17 20:13:00 UTC (rev 12778) +++ main/trunk/CMakeLists.txt 2024-01-17 20:45:46 UTC (rev 12779) @@ -2270,10 +2270,18 @@ # This was changed to cope with arm64 or x86_64 or both if( APPLE AND BUILD_OSX_UNIVERSAL_BINARIES ) set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL}-${CPACK_PACKAGE_RELEASE}.${OS_DIST}.arm64.x86_64") - else () - set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL}-${CPACK_PACKAGE_RELEASE}.${OS_DIST}.${CMAKE_SYSTEM_PROCESSOR}") endif () +# Build binaries for x86_64 +if( APPLE AND BUILD_X86_64_BINARIES ) + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL}-${CPACK_PACKAGE_RELEASE}.${OS_DIST}.x86_64") + endif () + +# Build binaries for arm64 +if( APPLE AND BUILD_ARM64_BINARIES ) + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL}-${CPACK_PACKAGE_RELEASE}.${OS_DIST}.arm64") + endif () + message(STATUS "ORX_BLD_LVL ${ORX_BLD_LVL}") message(STATUS "CPACK_PACKAGE_RELEASE ${CPACK_PACKAGE_RELEASE}") message(STATUS "CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}") @@ -2300,9 +2308,15 @@ if( APPLE AND BUILD_OSX_UNIVERSAL_BINARIES ) set(rexx_exe_cpu "universal") - else () - set(rexx_exe_cpu ${CMAKE_SYSTEM_PROCESSOR}) endif () + + if( APPLE AND BUILD_X86_64_BINARIES ) + set(rexx_exe_cpu "x86_64") + endif () + + if( APPLE AND BUILD_ARM64_BINARIES ) + set(rexx_exe_cpu "arm64") + endif () endif () string(TOLOWER ${rexx_exe_opsys} rexx_exe_opsys) # make sure operating system is lowercase string(TOLOWER "${CMAKE_BUILD_TYPE}" rexx_build_type) |
From: <per...@us...> - 2024-01-17 20:13:03
|
Revision: 12778 http://sourceforge.net/p/oorexx/code-0/12778 Author: perolovjonsson Date: 2024-01-17 20:13:00 +0000 (Wed, 17 Jan 2024) Log Message: ----------- provide for 3 different binary formats for macOS X64 arm64 or both Modified Paths: -------------- main/trunk/CMakeLists.txt Modified: main/trunk/CMakeLists.txt =================================================================== --- main/trunk/CMakeLists.txt 2024-01-13 17:30:08 UTC (rev 12777) +++ main/trunk/CMakeLists.txt 2024-01-17 20:13:00 UTC (rev 12778) @@ -40,7 +40,7 @@ #/* Global settings */ #/*----------------------------------------------------------------------------*/ message(STATUS "CMake version is ${CMAKE_VERSION}") -if (APPLE) +if ( APPLE ) # apple builds with prior cmake version have an @rpath problem cmake_minimum_required (VERSION 3.12) else () @@ -52,16 +52,26 @@ # must come before the project command # 10.13.6 High Sierra is the minimum system supported -if( APPLE AND BUILD_OSX_UNIVERSAL_BINARIES ) +if( APPLE ) set( CMAKE_OSX_DEPLOYMENT_TARGET 10.13.6 CACHE STRING "" FORCE) endif() project (ooRexx) +# Cater for 3 versions of binaries on macOS + if( APPLE AND BUILD_OSX_UNIVERSAL_BINARIES ) set( CMAKE_OSX_ARCHITECTURES arm64 x86_64 ) endif() +if( APPLE AND BUILD_X86_64_BINARIES ) + set( CMAKE_OSX_ARCHITECTURES x86_64 ) +endif() + +if( APPLE AND BUILD_ARM64_BINARIES ) + set( CMAKE_OSX_ARCHITECTURES arm64 ) +endif() + include(CheckIncludeFile) include(CheckLibraryExists) include(CheckFunctionExists) |
From: <eri...@us...> - 2024-01-13 17:30:10
|
Revision: 12777 http://sourceforge.net/p/oorexx/code-0/12777 Author: erich_st Date: 2024-01-13 17:30:08 +0000 (Sat, 13 Jan 2024) Log Message: ----------- fixes for [bugs:#1647] oorexx stops working on INPUTBOX Modified Paths: -------------- main/trunk/extensions/platform/windows/oodialog/APICommon.cpp main/trunk/extensions/platform/windows/oodialog/UtilityClasses.cls main/trunk/extensions/platform/windows/oodialog/ooShapesPE.cpp main/trunk/extensions/platform/windows/oodialog/oodUtilities.cpp Modified: main/trunk/extensions/platform/windows/oodialog/APICommon.cpp =================================================================== --- main/trunk/extensions/platform/windows/oodialog/APICommon.cpp 2024-01-13 17:28:43 UTC (rev 12776) +++ main/trunk/extensions/platform/windows/oodialog/APICommon.cpp 2024-01-13 17:30:08 UTC (rev 12777) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2018 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -194,7 +194,7 @@ * * 900 User message. * - * The ooSQLiteDB base class has not been initialized correctly + * The base class has not been initialized correctly * * @param c The method context we are operating under. * @param clsName The name of the base class. @@ -255,7 +255,7 @@ /** * Message * - * Argument 1, the database connection object, can not be null + * The owner dialog attribute can not be set after the underlying dialog is created. * * Raises 88.900 * @@ -1513,25 +1513,30 @@ * * 909: Class "class" not found * - * This function will load the package named by pkgName. If the - * pacakge is already loaded this should be relatively expensive. - * This also implies that this function could be used to load a - * package that has not been loaded. + * The current code is an ugly, temporary hack for [bugs:#1647]. + * With only a thread context available and no package to search, it + * seems to be difficult to find a context class. We really don't want + * to re-load the whole package with LoadPackage(pkgName) so we instead + * hope we have an ApplicationManager instance at .local~application + * which we query for a constant attribute PKG. + * The pkgName argument is completely ignored now. + * This is a bad fix as APICommon is meant to be used also for any code + * outside of ooDialog. ooShapes is such an example. */ RexxClassObject rxGetPackageClass(RexxThreadContext *c, CSTRING pkgName, CSTRING clsName) { - RexxClassObject theClass = NULL; - - RexxPackageObject pkg = c->LoadPackage(pkgName); - if ( pkg != NULL ) + RexxObjectPtr app, pkg, cls; + if ( + (app = c->DirectoryAt(TheDotLocalObj, "APPLICATION")) && + (pkg = c->SendMessage0(app, "PKG")) && + (cls = c->FindPackageClass((RexxPackageObject)pkg, clsName)) + ) { - theClass = c->FindPackageClass(pkg, clsName); + return (RexxClassObject)cls; } - if ( theClass == NULL ) - { - c->RaiseException1(Rexx_Error_Execution_noclass, c->String(clsName)); - } - return theClass; + + c->RaiseException1(Rexx_Error_Execution_noclass, c->String(clsName)); + return NULL; } /** @@ -1821,7 +1826,7 @@ /** - * Test if a genric Rexx object is the type of specified class object. + * Test if a generic Rexx object is the type of specified class object. * * @param c The method context we are executing under. * @param obj The object to test. Modified: main/trunk/extensions/platform/windows/oodialog/UtilityClasses.cls =================================================================== --- main/trunk/extensions/platform/windows/oodialog/UtilityClasses.cls 2024-01-13 17:28:43 UTC (rev 12776) +++ main/trunk/extensions/platform/windows/oodialog/UtilityClasses.cls 2024-01-13 17:30:08 UTC (rev 12777) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2014 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -228,6 +228,7 @@ ::class 'ApplicationManager' public inherit ResourceUtils +::constant pkg (self~package) ::attribute srcDir get external "LIBRARY oodialog app_srcDir_atr" ::method init external "LIBRARY oodialog app_init" Modified: main/trunk/extensions/platform/windows/oodialog/ooShapesPE.cpp =================================================================== --- main/trunk/extensions/platform/windows/oodialog/ooShapesPE.cpp 2024-01-13 17:28:43 UTC (rev 12776) +++ main/trunk/extensions/platform/windows/oodialog/ooShapesPE.cpp 2024-01-13 17:30:08 UTC (rev 12777) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2014 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -93,8 +93,7 @@ * * The package loader function is called when the library package is first * loaded. This makes it the ideal place for any initialization that must be - * done prior to the Rexx program start up. We call sqlite3_initialize() and - * set up a few global values. + * done prior to the Rexx program start up. We set up a few global values. * * @param c Thread context pointer passed from the interpreter when this package * is loaded. @@ -103,10 +102,7 @@ */ void RexxEntry ooShapesLoad(RexxThreadContext *c) { - if ( packageLoadHelper(c) ) - { - c->DirectoryPut(TheDotLocalObj, c->NullString(), "ROUTINEERRORMESSAGE"); - } + packageLoadHelper(c); } /** Modified: main/trunk/extensions/platform/windows/oodialog/oodUtilities.cpp =================================================================== --- main/trunk/extensions/platform/windows/oodialog/oodUtilities.cpp 2024-01-13 17:28:43 UTC (rev 12776) +++ main/trunk/extensions/platform/windows/oodialog/oodUtilities.cpp 2024-01-13 17:30:08 UTC (rev 12777) @@ -1,7 +1,7 @@ /*----------------------------------------------------------------------------*/ /* */ /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */ -/* Copyright (c) 2005-2022 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2005-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -239,7 +239,7 @@ #define CONST_DIR_USAGE_OPTS "[O]nly, [F]irst, [L]ast, or [N]ever" #define CONST_DIR_SYMBOL_SRC_OPTS "a collection class object, or a file name" -#define SETDEFAULTS_INDEXES "constDirUsage, symbolSrc, autoDetction, fontName, or fontSize" +#define SETDEFAULTS_INDEXES "constDirUsage, symbolSrc, autoDetection, fontName, or fontSize" inline bool checkApplicationMagic(RexxMethodContext *c, RexxObjectPtr magic) |
From: <eri...@us...> - 2024-01-13 17:28:45
|
Revision: 12776 http://sourceforge.net/p/oorexx/code-0/12776 Author: erich_st Date: 2024-01-13 17:28:43 +0000 (Sat, 13 Jan 2024) Log Message: ----------- fix message text for [bugs:#1919] Error message 25.12 is incomplete Modified Paths: -------------- docs/trunk/rexxref/en-US/errnums.xml main/trunk/interpreter/messages/RexxErrorMessages.h main/trunk/interpreter/messages/errnums.xml main/trunk/interpreter/messages/rexxmsg.xml Modified: docs/trunk/rexxref/en-US/errnums.xml =================================================================== --- docs/trunk/rexxref/en-US/errnums.xml 2024-01-09 22:03:58 UTC (rev 12775) +++ docs/trunk/rexxref/en-US/errnums.xml 2024-01-13 17:28:43 UTC (rev 12776) @@ -1140,7 +1140,7 @@ <varlistentry> <term>012</term> <listitem> -<para>PARSE must be followed by one of the keywords ARG, LINEIN, PULL, SOURCE, VALUE, VAR, or VERSION; found "<emphasis role="italic">word</emphasis>".</para> +<para>PARSE must be followed by optional keywords LOWER or UPPER, by an optional keyword CASELESS, and by one of the keywords ARG, LINEIN, PULL, SOURCE, VALUE, VAR, or VERSION; found "<emphasis role="italic">word</emphasis>".</para> </listitem> </varlistentry> <varlistentry> Modified: main/trunk/interpreter/messages/RexxErrorMessages.h =================================================================== --- main/trunk/interpreter/messages/RexxErrorMessages.h 2024-01-09 22:03:58 UTC (rev 12775) +++ main/trunk/interpreter/messages/RexxErrorMessages.h 2024-01-13 17:28:43 UTC (rev 12776) @@ -219,7 +219,7 @@ MESSAGE(Error_Invalid_subkeyword_signalon, "SIGNAL ON must be followed by one of the keywords ERROR, FAILURE, HALT, LOSTDIGITS, NOTREADY, NOMETHOD, NOSTRING, NOVALUE, SYNTAX, USER, or ANY; found \"&1\".") MESSAGE(Error_Invalid_subkeyword_signaloff, "SIGNAL OFF must be followed by one of the keywords ERROR, FAILURE, HALT, LOSTDIGITS, NOTREADY, NOMETHOD, NOSTRING, NOVALUE, SYNTAX, USER, or ANY; found \"&1\".") MESSAGE(Error_Invalid_subkeyword_form, "NUMERIC FORM must be followed by one of the keywords SCIENTIFIC or ENGINEERING; found \"&1\".") - MESSAGE(Error_Invalid_subkeyword_parse, "PARSE must be followed by one of the keywords ARG, LINEIN, PULL, SOURCE, VALUE, VAR, or VERSION; found \"&1\".") + MESSAGE(Error_Invalid_subkeyword_parse, "PARSE must be followed by optional keywords LOWER or UPPER, by an optional keyword CASELESS, and by one of the keywords ARG, LINEIN, PULL, SOURCE, VALUE, VAR, or VERSION; found \"&1\".") MESSAGE(Error_Invalid_subkeyword_numeric, "NUMERIC must be followed by one of the keywords DIGITS, FORM, or FUZZ; found \"&1\".") MESSAGE(Error_Invalid_subkeyword_procedure, "PROCEDURE must be followed by the keyword EXPOSE or nothing; found \"&1\".") MESSAGE(Error_Invalid_subkeyword_string_user_defined, "&1.") Modified: main/trunk/interpreter/messages/errnums.xml =================================================================== --- main/trunk/interpreter/messages/errnums.xml 2024-01-09 22:03:58 UTC (rev 12775) +++ main/trunk/interpreter/messages/errnums.xml 2024-01-13 17:28:43 UTC (rev 12776) @@ -1140,7 +1140,7 @@ <varlistentry> <term>012</term> <listitem> -<para>PARSE must be followed by one of the keywords ARG, LINEIN, PULL, SOURCE, VALUE, VAR, or VERSION; found "<emphasis role="italic">word</emphasis>".</para> +<para>PARSE must be followed by optional keywords LOWER or UPPER, by an optional keyword CASELESS, and by one of the keywords ARG, LINEIN, PULL, SOURCE, VALUE, VAR, or VERSION; found "<emphasis role="italic">word</emphasis>".</para> </listitem> </varlistentry> <varlistentry> Modified: main/trunk/interpreter/messages/rexxmsg.xml =================================================================== --- main/trunk/interpreter/messages/rexxmsg.xml 2024-01-09 22:03:58 UTC (rev 12775) +++ main/trunk/interpreter/messages/rexxmsg.xml 2024-01-13 17:28:43 UTC (rev 12776) @@ -20,7 +20,7 @@ do not correspond to error conditions. Otherwise, the component should be the utility that uses the message (e.g., RXQUEUE, SUBCOM, etc.) -Severity - Not really used. Rexx component messages should be Warning, the utilities Error +Severity - Not really used. Rexx component messages should be Info, Warning, or Error SymbolicName - A unique symbolic name for code to reference the error message from code. Rexx error conditions should start with Error_, and sub messages should add modifiers on to the @@ -1633,7 +1633,7 @@ <Component>Rexx</Component> <Severity>Warning</Severity> <SymbolicName>Error_Invalid_subkeyword_parse</SymbolicName> - <Text>PARSE must be followed by one of the keywords ARG, LINEIN, PULL, SOURCE, VALUE, VAR, or VERSION; found <q><Sub position="1" name="word"/></q>.</Text> + <Text>PARSE must be followed by optional keywords LOWER or UPPER, by an optional keyword CASELESS, and by one of the keywords ARG, LINEIN, PULL, SOURCE, VALUE, VAR, or VERSION; found <q><Sub position="1" name="word"/></q>.</Text> </SubMessage> <SubMessage> <Code>25</Code> |
From: <eri...@us...> - 2024-01-09 22:04:00
|
Revision: 12775 http://sourceforge.net/p/oorexx/code-0/12775 Author: erich_st Date: 2024-01-09 22:03:58 +0000 (Tue, 09 Jan 2024) Log Message: ----------- fix test binaries for [bugs:#1929] RexxVariablePool issues Modified Paths: -------------- main/trunk/testbinaries/orxclassic.cpp Modified: main/trunk/testbinaries/orxclassic.cpp =================================================================== --- main/trunk/testbinaries/orxclassic.cpp 2024-01-09 21:12:24 UTC (rev 12774) +++ main/trunk/testbinaries/orxclassic.cpp 2024-01-09 22:03:58 UTC (rev 12775) @@ -1,6 +1,6 @@ /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2008-2023 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2008-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -199,11 +199,9 @@ PSHVBLOCK nextblock = NULL; PSHVBLOCK currentblock = NULL; unsigned int tempint; + RexxStringObject str; + size_t len; - if (members == 0) { - return RXSHV_NOAVL; - } - // set up the shvblocks from the array for (ctr = 1; ctr <= members; ctr++) { nextblock = (PSHVBLOCK)malloc(sizeof(SHVBLOCK)); @@ -228,46 +226,38 @@ val = context->SendMessage0(entry, "shvvaluelen"); context->ObjectToUnsignedInt32(val, &tempint); currentblock->shvvaluelen = (size_t)tempint; - switch (currentblock->shvcode) { + + // all request codes require a name + val = context->SendMessage0(entry, "shvname"); + str = context->ObjectToString(val); + currentblock->shvname.strptr = context->StringData(str); + currentblock->shvname.strlength = context->StringLength(str); + + switch (currentblock->shvcode) + { case RXSHV_SET: case RXSHV_SYSET: - { - val = context->SendMessage0(entry, "shvname"); - currentblock->shvname.strptr = (char*)context->ObjectToStringValue(val); - currentblock->shvname.strlength = strlen(currentblock->shvname.strptr); + // a Set request also requires a value val = context->SendMessage0(entry, "shvvalue"); - size_t len = strlen(context->ObjectToStringValue(val)) + 1; - currentblock->shvvalue.strptr = (char *)malloc(len); - strncpy(currentblock->shvvalue.strptr, context->ObjectToStringValue(val), len); - currentblock->shvvalue.strlength = len - 1; + str = context->ObjectToString(val); + currentblock->shvvalue.strptr = (char *)context->StringData(str); + currentblock->shvvalue.strlength = context->StringLength(str); break; - } + case RXSHV_FETCH: case RXSHV_SYFET: - val = context->SendMessage0(entry, "shvname"); - currentblock->shvname.strptr = (char*)context->ObjectToStringValue(val); - currentblock->shvname.strlength = strlen(currentblock->shvname.strptr); - currentblock->shvvalue.strptr = (char*)malloc(currentblock->shvvaluelen + 1); - currentblock->shvvalue.strlength = currentblock->shvvaluelen + 1; + case RXSHV_PRIV: + len = currentblock->shvvaluelen; + currentblock->shvvalue.strlength = len; + // allocate a value buffer or let RexxVariablePool allocate it + currentblock->shvvalue.strptr = len == 0 ? NULL: (char *)malloc(len); break; + case RXSHV_DROPV: case RXSHV_SYDRO: - val = context->SendMessage0(entry, "shvname"); - currentblock->shvname.strptr = (char*)context->ObjectToStringValue(val); - currentblock->shvname.strlength = strlen(currentblock->shvname.strptr); - currentblock->shvvalue.strptr = NULL; - currentblock->shvvalue.strlength = 0; + default: + // allow invalid request codes to be handled by RexxVariablePool break; - case RXSHV_PRIV: - val = context->SendMessage0(entry, "shvname"); - currentblock->shvname.strptr = (char*)context->ObjectToStringValue(val); - currentblock->shvname.strlength = strlen(currentblock->shvname.strptr); - currentblock->shvvalue.strptr = NULL; - currentblock->shvvalue.strlength = 0; - break; - default: - free(currentblock); - return RXSHV_NOAVL; } } @@ -276,35 +266,24 @@ // set the array to the shvblocks currentblock = blocks; - for (ctr = 1; ctr <= members; ctr++) { + for (ctr = 1; ctr <= members; ctr++) + { RexxObjectPtr entry = context->ArrayAt(arr, ctr); context->SendMessage1(entry, "shvret=", context->UnsignedInt32ToObject((uint32_t)currentblock->shvret)); - switch (currentblock->shvcode) { - case RXSHV_SET: - case RXSHV_SYSET: - free(currentblock->shvvalue.strptr); - break; + switch (currentblock->shvcode) + { case RXSHV_FETCH: case RXSHV_SYFET: - context->SendMessage1(entry, "shvvalue=", context->NewStringFromAsciiz(currentblock->shvvalue.strptr)); - context->SendMessage1(entry, "shvvaluelen=", context->UnsignedInt32ToObject((uint32_t)currentblock->shvvalue.strlength)); - free(currentblock->shvvalue.strptr); - break; - case RXSHV_DROPV: - case RXSHV_SYDRO: - break; case RXSHV_PRIV: - if (currentblock->shvret == 0) { - context->SendMessage1(entry, "shvvalue=", context->NewStringFromAsciiz(currentblock->shvvalue.strptr)); - context->SendMessage1(entry, "shvvaluelen=", context->UnsignedInt32ToObject((uint32_t)currentblock->shvvalue.strlength)); - // this memory must be freed this way since it was allocated with RexxAllocateMemeory + context->SendMessage1(entry, "shvvalue=", context->NewString(currentblock->shvvalue.strptr, currentblock->shvvalue.strlength)); + context->SendMessage1(entry, "shvvaluelen=", context->UnsignedInt32ToObject((uint32_t)currentblock->shvvaluelen)); + // memory allocated by RexxVariablePool must be freed with RexxFreeMemory + if (currentblock->shvvaluelen == 0) RexxFreeMemory(currentblock->shvvalue.strptr); - } - else { - context->SendMessage1(entry, "shvvalue=", context->NewStringFromAsciiz("\0")); - context->SendMessage1(entry, "shvvaluelen=", context->WholeNumberToObject(0)); - } + else + free(currentblock->shvvalue.strptr); break; + default: break; } @@ -316,14 +295,17 @@ return retc; } -RexxRoutine0(size_t, // Return type - TestFNVariablePool) // Function name +RexxRoutine1(size_t, // Return type + TestFNVariablePool, // Function name + RexxArrayObject, arr) // Array of shvblocks + { RexxReturnCode retc = 0; + size_t members = context->ArrayItems(arr); size_t ctr = 0; SHVBLOCK block; - while (retc != RXSHV_LVAR) { + while (retc != RXSHV_LVAR && ctr < members) { block.shvnext = NULL; block.shvname.strptr = NULL; block.shvname.strlength = 0; @@ -334,10 +316,13 @@ block.shvcode = RXSHV_NEXTV; block.shvret = 0; retc = RexxVariablePool(&block); - if (retc != 0 && retc != RXSHV_LVAR) { - return -1; // indicate an error - } + ctr++; + RexxObjectPtr entry = context->ArrayAt(arr, ctr); + context->SendMessage1(entry, "shvret=", context->UnsignedInt32ToObject((uint32_t)block.shvret)); + context->SendMessage1(entry, "shvname=", context->NewString(block.shvname.strptr, block.shvname.strlength)); + context->SendMessage1(entry, "shvvalue=", context->NewString(block.shvvalue.strptr, block.shvvalue.strlength)); + if (block.shvname.strptr != NULL) { // this memory must be freed this way since it was allocated with RexxAllocateMemeory RexxFreeMemory((void *)block.shvname.strptr); |
From: <eri...@us...> - 2024-01-09 21:12:27
|
Revision: 12774 http://sourceforge.net/p/oorexx/code-0/12774 Author: erich_st Date: 2024-01-09 21:12:24 +0000 (Tue, 09 Jan 2024) Log Message: ----------- fix clean up of conditional include #defines Modified Paths: -------------- main/trunk/CMakeLists.txt main/trunk/config.h.in.cmake main/trunk/interpreter/platform/unix/SysRexxUtil.cpp Modified: main/trunk/CMakeLists.txt =================================================================== --- main/trunk/CMakeLists.txt 2024-01-09 17:19:27 UTC (rev 12773) +++ main/trunk/CMakeLists.txt 2024-01-09 21:12:24 UTC (rev 12774) @@ -1,6 +1,6 @@ #/*----------------------------------------------------------------------------*/ #/* */ -#/* Copyright (c) 2014-2023 Rexx Language Association. All rights reserved. */ +#/* Copyright (c) 2014-2024 Rexx Language Association. All rights reserved. */ #/* */ #/* This program and the accompanying materials are made available under */ #/* the terms of the Common Public License v1.0 which accompanies this */ @@ -356,6 +356,7 @@ # Check header files and functions. These are all defined to the config.h file. message(STATUS "-- determine available header files --") +check_include_file(malloc.h HAVE_MALLOC_H) check_include_file(stdint.h HAVE_STDINT_H) check_include_file(xlocale.h HAVE_XLOCALE_H) Modified: main/trunk/config.h.in.cmake =================================================================== --- main/trunk/config.h.in.cmake 2024-01-09 17:19:27 UTC (rev 12773) +++ main/trunk/config.h.in.cmake 2024-01-09 21:12:24 UTC (rev 12774) @@ -1,45 +1,23 @@ /* config.h.in. Generated from CMake. */ -/* Define to 1 if you have the <sys/xattr.h> header file. */ -#cmakedefine HAVE_SYS_XATTR_H +/* Define to 1 if you have the <stdint.h> header file. */ +#cmakedefine HAVE_STDINT_H -/* Define to 1 if you have the 'catopen' function. */ -#cmakedefine HAVE_CATOPEN +/* Define to 1 if you have the <malloc.h> header file. */ +#cmakedefine HAVE_MALLOC_H -/* Define to 1 if you have the 'euidaccess' function. */ -#cmakedefine HAVE_EUIDACCESS +/* Define to 1 if you have the <xlocale.h> header file. */ +#cmakedefine HAVE_XLOCALE_H /* Define to 1 if you have the <features.h> header file. */ #cmakedefine HAVE_FEATURES_H -/* Define to 1 if you have the 'getifaddrs' function. */ -#cmakedefine HAVE_GETIFADDRS - /* Define to 1 if you have the <ifaddrs.h> header file. */ #cmakedefine HAVE_IFADDRS_H -/* Define to 1 if you have the <xlocale.h> header file. */ -#cmakedefine HAVE_XLOCALE_H - -/* crypt() is known to be unavailable on Android */ -/* Define to 1 if you have the 'crypt' function. */ -#cmakedefine HAVE_CRYPT - -/* wordexp() is known to be unavailable on OpenBSD and Android */ -/* Define to 1 if you have the <wordexp.h> header file. */ -#cmakedefine HAVE_WORDEXP_H -/* Define to 1 if you have the 'wordexp' function. */ -#cmakedefine HAVE_WORDEXP - -/* Define to 1 if you have nanosleep function */ -#cmakedefine HAVE_NANOSLEEP - /* Define to 1 if you have the <nl_types.h> header file. */ #cmakedefine HAVE_NL_TYPES_H -/* Define to 1 if you have the 'nsleep' function. */ -#cmakedefine HAVE_NSLEEP - /* Define to 1 if you have the <pthread_np.h> header file. */ #cmakedefine HAVE_PTHREAD_NP_H @@ -52,6 +30,66 @@ /* Define to 1 if you have the 'pthread_stackseg_np' function. */ #cmakedefine HAVE_PTHREAD_STACKSEG_NP +/* Define to 1 if you have the <strings.h> header file. */ +#cmakedefine HAVE_STRINGS_H + +/* Define to 1 if you have the <sys/filio.h> header file. */ +#cmakedefine HAVE_SYS_FILIO_H + +/* Define to 1 if you have the <sys/ldr.h> header file. */ +#cmakedefine HAVE_SYS_LDR_H + +/* Define to 1 if you have the <sys/resource.h> header file. */ +#cmakedefine HAVE_SYS_RESOURCE_H + +/* Define to 1 if you have the <sys/select.h> header file. */ +#cmakedefine HAVE_SYS_SELECT_H + +/* Define to 1 if you have the <sys/sem.h> header file. */ +#cmakedefine HAVE_SYS_SEM_H + +/* Define to 1 if you have the <sys/signal.h> header file. */ +#cmakedefine HAVE_SYS_SIGNAL_H + +/* Define to 1 if you have the <sys/xattr.h> header file. */ +#cmakedefine HAVE_SYS_XATTR_H + +/* wordexp() is known to be unavailable on OpenBSD and Android */ +/* Define to 1 if you have the <wordexp.h> header file. */ +#cmakedefine HAVE_WORDEXP_H +/* Define to 1 if you have the 'wordexp' function. */ +#cmakedefine HAVE_WORDEXP + +/* Define to 1 if you have the <ncurses.h> header file. */ +#cmakedefine CURSES_HAVE_NCURSES_H +/* Define to 1 if you have the <ncurses/ncurses.h> header file. */ +#cmakedefine CURSES_HAVE_NCURSES_NCURSES_H + +/* Define to 1 if struct lstat has a member st_mtim */ +#cmakedefine HAVE_STAT_ST_MTIM + +/* Define to 1 if struct lstat has a member st_mtimespec */ +#cmakedefine HAVE_STAT_ST_MTIMESPEC + +/* Define to 1 if you have the 'catopen' function. */ +#cmakedefine HAVE_CATOPEN + +/* Define to 1 if you have the 'euidaccess' function. */ +#cmakedefine HAVE_EUIDACCESS + +/* Define to 1 if you have the 'getifaddrs' function. */ +#cmakedefine HAVE_GETIFADDRS + +/* crypt() is known to be unavailable on Android */ +/* Define to 1 if you have the 'crypt' function. */ +#cmakedefine HAVE_CRYPT + +/* Define to 1 if you have nanosleep function */ +#cmakedefine HAVE_NANOSLEEP + +/* Define to 1 if you have the 'nsleep' function. */ +#cmakedefine HAVE_NSLEEP + /* Define to 1 if you have pthread_mutex_timedlock function */ #cmakedefine HAVE_PTHREAD_MUTEX_TIMEDLOCK @@ -76,46 +114,12 @@ /* Define to 1 if getexecname is a valid function */ #cmakedefine HAVE_GETEXECNAME -/* Define to 1 if KERN_PROC_PATHNAME is a valid symbol */ -#cmakedefine HAVE_KERN_PROC_PATHNAME /* Define to 1 if KERN_PROC_ARGV is a valid symbol */ #cmakedefine HAVE_KERN_PROC_ARGV -/* Define to 1 if struct lstat has a member st_mtim */ -#cmakedefine HAVE_STAT_ST_MTIM +/* Define to 1 if KERN_PROC_PATHNAME is a valid symbol */ +#cmakedefine HAVE_KERN_PROC_PATHNAME -/* Define to 1 if struct lstat has a member st_mtimespec */ -#cmakedefine HAVE_STAT_ST_MTIMESPEC - -/* Define to 1 if you have the <stdint.h> header file. */ -#cmakedefine HAVE_STDINT_H - -/* Define to 1 if you have the <strings.h> header file. */ -#cmakedefine HAVE_STRINGS_H - -/* Define to 1 if you have the <sys/filio.h> header file. */ -#cmakedefine HAVE_SYS_FILIO_H - -/* Define to 1 if you have the <sys/ldr.h> header file. */ -#cmakedefine HAVE_SYS_LDR_H - -/* Define to 1 if you have the <sys/resource.h> header file. */ -#cmakedefine HAVE_SYS_RESOURCE_H - -/* Define to 1 if you have the <sys/select.h> header file. */ -#cmakedefine HAVE_SYS_SELECT_H - -/* Define to 1 if you have the <sys/sem.h> header file. */ -#cmakedefine HAVE_SYS_SEM_H - -/* Define to 1 if you have the <sys/signal.h> header file. */ -#cmakedefine HAVE_SYS_SIGNAL_H - -/* Define to 1 if you have the <ncurses.h> header file. */ -#cmakedefine CURSES_HAVE_NCURSES_H -/* Define to 1 if you have the <ncurses/ncurses.h> header file. */ -#cmakedefine CURSES_HAVE_NCURSES_NCURSES_H - /* Name of package */ #define PACKAGE ${PACKAGE} Modified: main/trunk/interpreter/platform/unix/SysRexxUtil.cpp =================================================================== --- main/trunk/interpreter/platform/unix/SysRexxUtil.cpp 2024-01-09 17:19:27 UTC (rev 12773) +++ main/trunk/interpreter/platform/unix/SysRexxUtil.cpp 2024-01-09 21:12:24 UTC (rev 12774) @@ -96,7 +96,12 @@ #include <sys/wait.h> // wait() #include <sys/ipc.h> #include <memory.h> + +// not available on macOS and BSDs +#if defined( HAVE_MALLOC_H ) #include <malloc.h> +#endif + #include <fcntl.h> #include <ctype.h> #include <string.h> |
From: <eri...@us...> - 2024-01-09 17:19:29
|
Revision: 12773 http://sourceforge.net/p/oorexx/code-0/12773 Author: erich_st Date: 2024-01-09 17:19:27 +0000 (Tue, 09 Jan 2024) Log Message: ----------- fix test update for [bugs:#1929] RexxVariablePool issues' Modified Paths: -------------- test/trunk/ooRexx/API/classic/CLASSIC.testGroup test/trunk/ooRexx/API/classic/CLASSICPackage.cls Modified: test/trunk/ooRexx/API/classic/CLASSIC.testGroup =================================================================== --- test/trunk/ooRexx/API/classic/CLASSIC.testGroup 2024-01-09 17:04:24 UTC (rev 12772) +++ test/trunk/ooRexx/API/classic/CLASSIC.testGroup 2024-01-09 17:19:27 UTC (rev 12773) @@ -1317,43 +1317,4 @@ return TestFNVariablePool(arg(1)) -::class Shv subclass shvblock - -/* -#define RXSHV_SET 0x00 /* Set var from given value */ -#define RXSHV_FETCH 0x01 /* Copy value of var to buffer */ -#define RXSHV_DROPV 0x02 /* Drop variable */ -#define RXSHV_SYSET 0x03 /* Symbolic name Set variable */ -#define RXSHV_SYFET 0x04 /* Symbolic name Fetch variable*/ -#define RXSHV_SYDRO 0x05 /* Symbolic name Drop variable */ -#define RXSHV_NEXTV 0x06 /* Fetch "next" variable */ -#define RXSHV_PRIV 0x07 /* Fetch private information */ -*/ -::constant code (.StringTable~of(- - ('S', 0), ('F', 1), ('D', 2), - - ('s', 3), ('f', 4), ('d', 5), - - ('N', 6), ('P', 7))) - -::constant OK ('00'~x2d) -- RXSHV_OK 0x00 /* Execution was OK */ -::constant NEWV ('01'~x2d) -- RXSHV_NEWV 0x01 /* Variable did not exist */ -::constant LVAR ('02'~x2d) -- RXSHV_LVAR 0x02 /* Last var trans via SHVNEXTV */ -::constant TRUNC ('04'~x2d) -- RXSHV_TRUNC 0x04 /* Truncation occurred-Fetch */ -::constant BADN ('08'~x2d) -- RXSHV_BADN 0x08 /* Invalid variable name */ -::constant MEMFL ('10'~x2d) -- RXSHV_MEMFL 0x10 /* Out of memory failure */ -::constant BADF ('80'~x2d) -- RXSHV_BADF 0x80 /* Invalid funct code (shvcode)*/ - -::method init - -- we must have at least a code and a name - use strict arg code, name, value = "", valuelen = 0 - c = self~code[code] - self~shvcode = (c == .nil)~?(42, c) -- 42 is illegal - self~shvname = name; - self~shvvalue = value; - self~shvvaluelen = valuelen; - self~shvnamelen = 0; - -::method makeArray - return .Array~of(self) - - ::options all syntax Modified: test/trunk/ooRexx/API/classic/CLASSICPackage.cls =================================================================== --- test/trunk/ooRexx/API/classic/CLASSICPackage.cls 2024-01-09 17:04:24 UTC (rev 12772) +++ test/trunk/ooRexx/API/classic/CLASSICPackage.cls 2024-01-09 17:19:27 UTC (rev 12773) @@ -1,6 +1,6 @@ /*----------------------------------------------------------------------------*/ /* */ -/* Copyright (c) 2008-2021 Rexx Language Association. All rights reserved. */ +/* Copyright (c) 2008-2024 Rexx Language Association. All rights reserved. */ /* */ /* This program and the accompanying materials are made available under */ /* the terms of the Common Public License v1.0 which accompanies this */ @@ -72,6 +72,45 @@ ::attribute shvret +::class Shv subclass shvblock public + +/* +#define RXSHV_SET 0x00 /* Set var from given value */ +#define RXSHV_FETCH 0x01 /* Copy value of var to buffer */ +#define RXSHV_DROPV 0x02 /* Drop variable */ +#define RXSHV_SYSET 0x03 /* Symbolic name Set variable */ +#define RXSHV_SYFET 0x04 /* Symbolic name Fetch variable*/ +#define RXSHV_SYDRO 0x05 /* Symbolic name Drop variable */ +#define RXSHV_NEXTV 0x06 /* Fetch "next" variable */ +#define RXSHV_PRIV 0x07 /* Fetch private information */ +*/ +::constant code (.StringTable~of(- + ('S', 0), ('F', 1), ('D', 2), - + ('s', 3), ('f', 4), ('d', 5), - + ('N', 6), ('P', 7))) + +::constant OK ('00'~x2d) -- RXSHV_OK 0x00 /* Execution was OK */ +::constant NEWV ('01'~x2d) -- RXSHV_NEWV 0x01 /* Variable did not exist */ +::constant LVAR ('02'~x2d) -- RXSHV_LVAR 0x02 /* Last var trans via SHVNEXTV */ +::constant TRUNC ('04'~x2d) -- RXSHV_TRUNC 0x04 /* Truncation occurred-Fetch */ +::constant BADN ('08'~x2d) -- RXSHV_BADN 0x08 /* Invalid variable name */ +::constant MEMFL ('10'~x2d) -- RXSHV_MEMFL 0x10 /* Out of memory failure */ +::constant BADF ('80'~x2d) -- RXSHV_BADF 0x80 /* Invalid funct code (shvcode)*/ + +::method init + -- we must have at least a code and a name + use strict arg code, name, value = "", valuelen = 0 + c = self~code[code] + self~shvcode = (c == .nil)~?(42, c) -- 42 is illegal + self~shvname = name; + self~shvvalue = value; + self~shvvaluelen = valuelen; + self~shvnamelen = 0; + +::method makeArray + return .Array~of(self) + + ::class TestMacroSpaceFuncs public ::method TestAddMacro PUBLIC EXTERNAL "LIBRARY orxclassic TestAddMacro" |