Mac OS 9 Lives

Classic Mac OS Software => Hacking the System, Mac OS 9.3, and Beyond ! => Topic started by: OS923 on March 21, 2019, 06:49:13 AM

Title: 9.3
Post by: OS923 on March 21, 2019, 06:49:13 AM
I'll continue here where the 9.2.3 discussion has finished.
Title: Re: 9.3
Post by: OS923 on March 21, 2019, 07:00:03 AM
Everything has been merged to one folder. The programs are now sorted in categories.
Title: Re: 9.3
Post by: OS923 on March 25, 2019, 04:30:21 AM
I'm removing MSL, SIOUX, WASTE and PowerPlant from all my programs.
Title: Re: 9.3
Post by: OS923 on April 09, 2019, 06:21:39 AM
I'm removing C strings from all my programs.
Title: Re: 9.3
Post by: OS923 on April 12, 2019, 08:31:34 AM
My entire framework is now available in the OS 9.3 SDK as libraries with headers. Every Xxx library comes in 2 versions. XxxLib is meant for release versions while XxxDbg is meant for debug versions. XxxDbg shows filenames and line numbers in error messages.
Title: Re: 9.3
Post by: OS923 on April 17, 2019, 12:57:24 AM
I'm replacing all my console programs with a different type of console. CodeWarrior's console is a text processor where the cursor is always at the end, and when the program is finished you can save the text. My console program is a program that writes a text (which may be longer than 2 GB) and it displays the last lines in a window. This is much faster and uses little memory.
Title: Re: 9.3
Post by: OS923 on April 19, 2019, 09:21:19 AM
See in the attachment an example of a new, faster and smaller type of console program. (If you choose Quit before it's finished, then it will continue without updating the window and then it will quit.)
Title: Re: 9.3
Post by: OS923 on May 09, 2019, 07:02:14 AM
I found the way to relink OS 9.2.3. I replaced the shared libraries with static libraries and I made a third target where the static libraries are replaced with the code in those libraries, but this target is usually not built because it takes too long. But if I wish, I can easily debug it.

These programs are now in the Utilities folder in OS 9.3.

There are a few changes:
Title: Re: 9.3
Post by: OS923 on May 15, 2019, 09:37:54 AM
Code: [Select]
/* Finder flags (finderFlags, fdFlags and frFlags) */
/* Any flag reserved or not specified should be set to 0. */
/* If a flag applies to a file, but not to a folder, make sure to check */
/* that the item is not a folder by checking ((ParamBlockRec.ioFlAttrib & ioDirMask) == 0) */
enum {
    kIsOnDesk                   = 0x0001,                       /* Files and folders (System 6) */
    kColor                      = 0x000E,                       /* Files and folders */
                                                                /* bit 0x0020 was kRequireSwitchLaunch, but is now reserved for future use*/
    kIsShared                   = 0x0040,                       /* Files only (Applications only) */
                                                                /* If clear, the application needs to write to */
                                                                /* its resource fork, and therefore cannot be */
                                                                /* shared on a server */
    kHasNoINITs                 = 0x0080,                       /* Files only (Extensions/Control Panels only) */
                                                                /* This file contains no INIT resource */
    kHasBeenInited              = 0x0100,                       /* Files only */
                                                                /* Clear if the file contains desktop database */
                                                                /* resources ('BNDL', 'FREF', 'open', 'kind'...) */
                                                                /* that have not been added yet. Set only by the Finder */
                                                                /* Reserved for folders - make sure this bit is cleared for folders */
                                                                /* bit 0x0200 was the letter bit for AOCE, but is now reserved for future use */
    kHasCustomIcon              = 0x0400,                       /* Files and folders */
    kIsStationery               = 0x0800,                       /* Files only */
    kNameLocked                 = 0x1000,                       /* Files and folders */
    kHasBundle                  = 0x2000,                       /* Files only */
    kIsInvisible                = 0x4000,                       /* Files and folders */
    kIsAlias                    = 0x8000                        /* Files only */
};

I assume that this means that 0x0200 is reserved for folders. It should be 0, but when you check it, it's 1.
Title: Re: 9.3
Post by: OS923 on May 29, 2019, 09:45:50 AM
My own Unicode conversion is 13 times faster than Apple's UnicodeConverter.
Title: Re: 9.3
Post by: OS923 on June 06, 2019, 02:29:38 AM
I'm changing the AppleScript support of all my programs. For every event I define a class like QuitSupport or AppDiedSupport. Then I derive the program class from those classes. It's easier and safer and you can easily find which program supports which events.
Title: Re: 9.3
Post by: OS923 on July 08, 2019, 06:57:39 AM
The high level tools have been relinked. 47% of the low level tools have been relinked. Then I have one REALbasic program "Pseudo undelete" that has to be finished (no real delete and no report at this moment). Then I have the "Offline Wikipedia" program which does nothing yet except installing a handler and processing events.
Title: Re: 9.3
Post by: OS923 on August 08, 2019, 05:48:32 AM
This is the current progress. Some programs are unfinished. Do not use these programs.

https://tinyurl.com/20190808os93

This link will work 14 days. You need a bit more than 2 GB disk space.
Title: Re: 9.3
Post by: OS923 on September 05, 2019, 04:59:58 AM
I improved the "Pseudo delete" extension to make it return fLckdErr and fBsyErr.

I improved Belcut. You can now choose the bit depth of a merged picture.
Title: Re: 9.3
Post by: OS923 on September 11, 2019, 06:56:09 AM
I found a bug in BigFileTest and MergeWiki. "Build index" didn't work correctly because I was changing it to make it work with multiple languages.
Title: Re: 9.3
Post by: OS923 on October 02, 2019, 03:41:50 AM
I rewrote my REALbasic XML parser. The demo, the validation and the parsing are now separated. Then I'll do the same for HTML. Then I'll write the C++ version.

I need the C++ version of the HTML parser to check my documentation for unused style or undefined style.
Title: Re: 9.3
Post by: OS923 on October 11, 2019, 08:35:40 AM
I found a memory leak in "Lexer generator". Now all memory leaks are gone.
Title: Re: 9.3
Post by: OS923 on October 11, 2019, 08:36:39 AM
I found a bug in "Basic filter" and I improved it with drag and drop.
Title: Re: 9.3
Post by: OS923 on October 11, 2019, 08:37:05 AM
I finished the XML and HTML parsers in REALbasic.
Title: Re: 9.3
Post by: OS923 on October 21, 2019, 08:46:17 AM
I finished the XML and HTML parsers in C++.
Title: Re: 9.3
Post by: OS923 on October 21, 2019, 08:46:55 AM
This is the current progress. Some programs are unfinished. Do not use these programs.

https://tinyurl.com/20191021os93

This link will work 14 days. You need 2.59 GB disk space.
Title: Re: 9.3
Post by: OS923 on October 23, 2019, 06:59:49 AM
I improved the headers of the libraries and the use of profiler.
I included the HTML and XML parsers.
It parses HTML at 32.6 MB/s.
It parses XML at 29.2 MB/s.

https://tinyurl.com/20191023sdk

This link will work 14 days.
Title: Re: 9.3
Post by: OS923 on November 06, 2019, 09:20:40 AM
I used the HTML parser to detect unused and undefined style in my documentation.
Title: Re: 9.3
Post by: Jubadub on January 15, 2020, 10:27:07 AM
Does the Finder in either OS923 or OS93 handle HFS+ (Mac OS Extended) longer file names that surpass the HFS (Mac OS Standard) 31-character limit for HFS+ partitions? I remember it was one of the goals, but is that part done?
Title: Re: 9.3
Post by: OS923 on January 16, 2020, 07:37:26 AM
I'm not sure what you mean with "handle".

Some of my new programs which look like console applications support HFS+ to access files of more than 2 GB. This is part of my own framework (the BigFileLib library).

The PowerPlant framework didn't support HFS+. The OS 9.2.3 programs were written with PowerPlant, but I added some HFS+ support to some programs like "Scan long names" to enable them to see filenames that are longer than 31 characters.

When we look at Finder, it is probably similar: the HFS+ functions are probably only used when there's no other option, for example when files have to be copied. When Finder deletes files, I see that they are caught by my "Pseudo delete" extension, which shows that Finder uses HFS instructions to delete files. Internally Finder works with FSSpecs. You can see that when you handle Apple events.

So the best filosophy seems to be to use the HFS+ functions only when there's no other option. This functionality is finished and part of my own framework. Even more, before I draw Unicode, I always check whether it can be done using Quickdraw and this is faster.

The old OS 9.2.3 programs have already been thrown away and I won't keep the source code. These programs get a new version with my own framework. I will post these programs here one by one when one is finished. I have no PowerPlant projects anymore besides a few small demo projects in the OS 9.3 SDK.

The OS 9.3 programs will be drastically different and more functional. It won't be for the faint of heart.
Title: Re: 9.3
Post by: Jubadub on January 16, 2020, 07:46:17 AM
By "handle", what I meant, for example, is this:

Can we create a new folder in the Finder and name it "Folder name with more than 31 characters"?
Title: Re: 9.3
Post by: OS923 on January 17, 2020, 06:41:09 AM
No, but if that's what you want, I can do that in a few lines of code and pack it as a contextual menu extension.

The largest part of my work is the framework. If this is finished, then programs like "Change label" can be written in a few hundred lines of code.

Concerning the new Finder, I would lie if I say that it's an existing program, but it would also be incorrect to say that I have to start from zero. Most of the work that is necessary is done and works without error. What you see on screen is a drawing and this is a few hundred lines of code. Most work is behind the screen, what you don't see.

So to answer your question: I can create a new folder and name it "Folder name with more than 31 characters" in a few instructions using my framework, but this solution is not called "Finder".

I see that of all my work people are most interested in a new Finder. Perhaps I should finish this first?

The name for a new Finder that I was thinking of was "Friend".
Title: Re: 9.3
Post by: Jubadub on January 17, 2020, 02:58:56 PM
Thanks for the reply!

A new Finder is always an attractive idea, but please, since it's your project, feel free to program the parts that you personally want first. :)

Good luck! I'll be looking forward to bits and pieces of this project.
Title: Re: 9.3
Post by: OS923 on January 18, 2020, 01:38:12 AM
I linked MiniScheme and TinyScheme for OS 9 and I updated PLT Scheme and Gambit-C Scheme to CW Pro 6.3.

At this moment I'm trying to embed Scheme in my programs. (The problem is that the Scheme interpreters are written in C, and they use setjmp as an alternative for C++ exceptions, and this causes that the Scheme exceptions are not properly caught in a C/C++ program, so I have to catch them in Scheme.)

Then you can select files using S-expressions like the one you see in the attachment. The new Finder will use this to change the selection in a container window, the other programs will use this to select the files that they want to process.
Title: Re: 9.3
Post by: OS923 on January 18, 2020, 01:46:14 AM
Next problem is a custom Unicode editor that doesn't crash when you stop the program in the debugger. Apple's Unicode editor has to be terminated at the end of the program, otherwise you get an ugly crash. That makes it difficult to write a program for OS 9 which edits Unicode.

Next problem is drawing the desktop. A new Finder needs to draw the desktop, it needs to become front application when you click in the desktop and preferably this would be done without quitting the old Finder. I'll try this in the weekend, then you know that I'm serious.
Title: Re: 9.3
Post by: OS923 on January 18, 2020, 01:59:20 AM
This is new since the last OS 9.3 SDK preview:

October 23, 2019

The C++ version of the HTML parser and the XML parser are tested in TextTest.

October 30, 2019

I improved Backup & synchronization with a progress bar.

November 3, 2019

I improved AutoFlush. I wrote New subfolder CM. I wrote the PPC version of Pseudo delete. I wrote the 68K version of AutoFlush and Macros.

November 8, 2019

I wrote NewFolderWIconCM.

November 9, 2019

I wrote ObjectSpecifierTest.

November 10, 2019

I linked and beautified AEGizmos.

November 12, 2019

All projects have now 68K struct alignment.

November 13, 2019

I can convert CodeWarrior project files to a binary file and a text file with a Scheme expression.

November 29, 2019

My automatic parameter list indentation now recognizes C and C++ comments.

December 1, 2019

I wrote ReindentParametersCM.

December 11, 2019

I wrote the TimSort version for OS 9.

December 18, 2019

I wrote ProjectLib and ProjectTest.

December 20, 2019

I found a bug in NewFolderWIconCM. I split ObjectSpecifierTest into ObjectSpecifierTest and FinderObjectTest. I improved the precompiled headers of my libraries.

December 24, 2019

I improved the headers of my private projects:
I removed ErrorLib's dependency on MSL.
I changed the way in which I sorted the projects in categories.
I improved the headers.
I use the source code instead of the static libraries.

December 27, 2019

I found a bug in SchemeInterpreter. It doesn't catch exceptions. I'm reordering the SDK stuff.

December 28, 2019

I'm relinking PLT Scheme.

December 29, 2019

I tried to link GambitScheme 3.0. Total fail.

December 30, 2019

I linked MiniScheme 0.85 and TinyScheme 1.41.

December 31, 2019

I updated PLT Scheme 1.0.3p1 and GambitScheme 3.0 to CW Pro 6.3. I discontinued SchemeEmbedTest, SchemeInterpreterLib and SchemeInterpreterTest.

January 3, 2020

I rewrote FinderObjectLib. It recognizes now 5 types of Finder objects.

January 4, 2020

I rewrote some demo programs with AppDiedSupport, OpenAppSupport, OpenDocSupport, PrintDocSupport and QuitSupport. I found a bug in SaveAVolumeAsAFile. You could run it only once, the second time it would have insufficient memory. I made it open source.

January 5, 2020

I made Dictionary open source. I removed the startup thread. I improved the startup and the sort order.

January 12, 2020

I tried to link MzScheme with 68K struct alignment. I made a special version of FinderObjectLib that can be used in any piece of PowerPC software. Then I made the NewTextFileCM demo project.

January 13, 2020

I found a way to catch exceptions when embedding PLT Scheme. I linked the release version of Dictionary as a monolithic program. I found a way to link Scheme programs with GambitScheme.
Title: Re: 9.3
Post by: IIO on January 18, 2020, 04:21:50 AM
Next problem is drawing the desktop. A new Finder needs to draw the desktop, it needs to become front application when you click in the desktop and preferably this would be done without quitting the old Finder.

i think this would be okay if regular behavior of everything desktop will be available to only one of them.

one could even implement a function in the new finder which closes the old finder when you launch it - and relauch the old finder when you close it.

Title: Re: 9.3
Post by: OS923 on January 19, 2020, 01:48:59 AM
Relaunching the old Finder requires that you quit all applications. That's why it's more practical to allow Finder to run in the background. I may even leave certain tasks up to the old Finder, like formatting disks.
Title: Re: 9.3
Post by: IIO on January 19, 2020, 05:01:53 PM
i forgot about that.

...could this be changed? could one add doubleclick-to-launch to old finder?

i mean adding a "quit" function to old finder also works. so why not one for starting it.
Title: Re: 9.3
Post by: OS923 on January 20, 2020, 09:09:02 AM
could one add doubleclick-to-launch to old finder?
No.
Title: Re: 9.3
Post by: OS923 on January 20, 2020, 09:11:15 AM
Every attempt to make Finder obsolete failed. SystemClick patch was ignored. PicHandle in desktop window was ignored. The rest made Finder crash.

Now I'll try a solution that has a very small chance to crash: one program covers the desktop with a window and another program does the rest.
Title: Re: 9.3
Post by: IIO on January 20, 2020, 02:36:55 PM
what about this:

 - trigger the function of appearance -> show desktop in background - no
 - start new finder
 - close old finder

or will the desktop come back? (i am not on my mac right now.)
Title: Re: 9.3
Post by: IIO on January 20, 2020, 02:39:31 PM
could one add doubleclick-to-launch to old finder?
No.

but wait, i dont understand one thing:

when you remove old finder from the system folder, it wont even launch when you quit new finder, isnt it?

also, would the scenario of a replacment finder include that it will appear as finder to the system while you at the same time change the type of the old finder to APPL? :)
Title: Re: 9.3
Post by: IIO on January 20, 2020, 04:30:35 PM
okay, if you change old finder to APPL it chrashes with an error 411.

probably because some of the stuff which i´t requires from extensions or the suitcase is single-client.

it would have been too nice if a solution would have been that easy.

...

SIZE resource settings wont help much either i guess.
Title: Re: 9.3
Post by: OS923 on January 21, 2020, 06:51:41 AM
show desktop in background - no
I'll try this one first.
Title: Re: 9.3
Post by: Protools5LEGuy on January 21, 2020, 08:35:26 AM
No, but if that's what you want, I can do that in a few lines of code and pack it as a contextual menu extension.

The largest part of my work is the framework. If this is finished, then programs like "Change label" can be written in a few hundred lines of code.

Concerning the new Finder, I would lie if I say that it's an existing program, but it would also be incorrect to say that I have to start from zero. Most of the work that is necessary is done and works without error. What you see on screen is a drawing and this is a few hundred lines of code. Most work is behind the screen, what you don't see.

So to answer your question: I can create a new folder and name it "Folder name with more than 31 characters" in a few instructions using my framework, but this solution is not called "Finder".

I see that of all my work people are most interested in a new Finder. Perhaps I should finish this first?

The name for a new Finder that I was thinking of was "Friend".
I propose to keep using Finder and "Friend" side by side.

Just keeping in mind 2020 9.3 things-stuff will be done by "Friend"

I guess is the simplest approach
Title: Re: 9.3
Post by: IIO on January 21, 2020, 08:14:13 PM
I'll try this one first.

just drawing another window on top of it sounds like a solution with built-in time bomb.

i´ve never really known what these SIZE settings in finder do, and didnt had the balls to try. but some of them sound promising, isnt it.
Title: Re: 9.3
Post by: OS923 on January 22, 2020, 07:08:06 AM
just drawing another window on top of it sounds like a solution with built-in time bomb.
It sounds like just another regular program. It could be better than Finder, because Finder isn't a regular program.
Title: Re: 9.3
Post by: IIO on January 22, 2020, 08:30:12 PM
what about moving the complete desktop outside the visible range? (-25,000 -25,000)
Title: Re: 9.3
Post by: OS923 on January 23, 2020, 06:10:01 AM
That would be the same as making the desktop window invisible.
Title: Re: 9.3
Post by: IIO on January 26, 2020, 11:31:03 AM
if anyone knows that then it is you, so allow me to ask a question: how would i open an alias?

they are said to contain the path info in the resource fork of the alias file.

but of course i cant open an alias file, as it will always open the original. and if you delete the original, it wont open at all.

if you try to change the filetype, it changes the filetype of the original.

...

Title: Re: 9.3
Post by: cc333 on January 26, 2020, 07:40:24 PM
Hi,

Just checking in from a long hiatus...

This is a neat idea!

However, it would seem to me that the ideal solution for actually making it work would be to somehow reverse engineer and create a working clone of the old Finder, with documented code (is it possible to disassemble and analyze the existing binary?) and then extend it with features from your new Finder.

This would be very nontrivial, I would think.

If only Apple had open sourced it.... *sigh*

c
Title: Re: 9.3
Post by: OS923 on January 27, 2020, 08:49:10 AM
Covering the desktop with a window doesn't work, because if you click in the window then the program is moved to the front (and there's no way to stop this) and the window covers everything.

If you keep the window in the background, for example by creating it in an extension or application extension, then it doesn't get updated and it doesn't respond to clicks. You can create it in an extension if you go to the system zone. You can create it in an application extension when you use InitGraf and InitWindows, but no other inits.

There are 3 ways in which the desktop is drawn:

I wrote a little extension to find out who creates the desktop window and which parameters are used. The desktop window is created by Finder with proc ID 2048 = WDEF 128. WDEF 128 is a pointer to a function in Finder. If I can guess how this WDEF works, then I can replace Finder. Deselecting the option "Show desktop when in background" = making the desktop window invisible = moving it to {-x,-x}. This would be the simplest solution that has no particular reason to crash, compared to an exotic extension.

I'm now looking into Finder for instructions that you don't find in a normal application, like CalcVis. Then I may guess how they do it.
Title: Re: 9.3
Post by: OS923 on January 27, 2020, 08:56:07 AM
if anyone knows that then it is you, so allow me to ask a question: how would i open an alias?
Start ResEdit. In the open dialog there's an option to open "Use alias instead of original".
Title: Re: 9.3
Post by: IIO on January 27, 2020, 09:32:04 AM
aha, great, thanks - i knew it must be somewhere.


finder window: that WDEF 128 will receive the current monitor size at some point. after creation, from what i know.

if you know your current monitor size (and you do) you at least know what integer number(s) you have to search for when debugging.
Title: Re: 9.3
Post by: OS923 on January 28, 2020, 07:48:47 AM
There are 2 things particular about the desktop window:
Title: Re: 9.3
Post by: IIO on January 28, 2020, 11:59:49 AM
  • It doesn't erase the contents with white color. That's easy.

figures, since it is always being filled with the default pattern or a pattern or picture from the appearance.

it is amazing how different is it from other windows.

it is the only window i know which can not be dragged with drag any window.

i can only guess how that stuff is calculated. it might absolutely be that it is not at all near the WDEF resource but somewhere much, much deeper. it should be inside the finder app though.
Title: Re: 9.3
Post by: OS923 on February 28, 2020, 10:06:07 AM
I don't have time for this now because I'm being evicted from my house. But I have to say: I requested to be evicted because I despise this landlord.
Title: Re: 9.3
Post by: OS923 on March 13, 2020, 09:30:06 AM
The libraries will be closed until April 3 because of Corona virus. You won't hear from me until after this date.
Title: Re: 9.3
Post by: Philgood on March 14, 2020, 02:19:11 AM
Hope you are doing well over there.
Title: Re: 9.3
Post by: OS923 on May 12, 2020, 03:27:26 AM
Evictions are forbidden until july 18. In the mean time the landlord changed his mind. He wants me to stay. So back to 'normal'.
Title: Re: 9.3
Post by: OS923 on May 12, 2020, 03:28:58 AM
I haven't been able to use the internet for 2 months. First thing I did when the shops reopened, buy bin bags and a fancy tablet.
Title: Re: 9.3
Post by: IIO on May 12, 2020, 03:39:22 AM
oh there he is. i was about to ask if someone knows if you are okay.
Title: Re: 9.3
Post by: adespoton on July 13, 2020, 03:26:59 PM
If the current plan is to supplement the Finder, why not do it like Greg's Browser did it?  Except in this case, you'll add in support for all the things the Finder can't do, instead of just patching Apple Events to enable NextStep-style browser windows.

Has anyone heard from Greg lately?  It's possible he'd even be willing to help, or at least donate some code....
Title: Re: 9.3
Post by: IIO on July 14, 2020, 02:35:09 PM
i believe most parts in all of these third party browsers from 1999 were relying on basic finder functions (but correct me if am wrong), while cliff´s approach is more to build a custom library of functions which are "better" than the one from apple. (you could see him here experiment with disk access methods and search algorithms)

of course it would be nice to sneak into their source or have the people here.
Title: Re: 9.3
Post by: OS923 on July 15, 2020, 11:27:00 AM
I'll rewrite the old OS 9.2.3 programs in English and with my new libraries and make them open source as a demo in the OS 9.3 SDK. For the replacement of Finder I'm still stuck with taking over the desktop.

There's more good news: I bought a HP EliteBook 2530p in the second handstore for 20 euro and it has Windows 10 Pro. After some recharging and self test I could boot and it works fine, not one disk error and used for only 1776 hours. Now I can do what wasn't possible on my other computers.
Title: Re: 9.3
Post by: OS923 on September 05, 2020, 04:07:08 AM
I updated all my REALbasic programs.

They are faster.
They use less memory.
The interface is smoother.
They are safer because reading and writing binary data are separated by wrapper classes.
They use the same stream classes and utilities modules.
They are a bit bigger.
Results are now written to a file instead of a window.
Instead of a "New 1" folder with a report, you get a report with a datestamp.
New output is placed in a new folder with a datestamp.
Similar programs have now a similar interface.
BasicFilter can now do 4 things at the same time with the same selection.
CountTypesAndCreators saves the report now as Mac text instead of Unicode and you can choose the number format.
ReplaceAll can now search several regular expressions at the same time.
You can now drag items to the MakePaths icon or open them from the menu.
XRayVision has now Select all and Deselect all buttons and undo.

http://www.fileconvoy.com/dfl.php?id=g4b48edecfc5e66e01000278883e3d37fc9e7f8fc98
Title: Re: 9.3
Post by: IIO on September 05, 2020, 06:02:48 AM
wow, so there are still true one-click filehosters.
Title: Re: 9.3
Post by: OS923 on October 21, 2020, 08:12:48 AM
Before I continue here I want to write an external editor for CodeWarrior to get more control over my text. See this discussion:

http://macos9lives.com/smforum/index.php/topic,5740.0.html
Title: Re: 9.3
Post by: OS923 on December 02, 2020, 12:58:52 PM
Just a warning in case that you want to write a contextual menu extension. If you have multiple volumes, and you make a folder on each volume with the same name, and you move those folders to the desktop, and you use a contextual menu extension in those folders, then the CMM can act on the wrong folder with the same name. A CMM uses Finder object specifiers, and things on the desktop with the same name have the same Finder object specifier. The new Finder won't have this problem if it uses FSSpecs instead of Finder object specifiers.

There's another complication: window path select doesn't work without Finder because it sends a reveal objects event to Finder. I can install an Apple event handler for this event in Finder that resends the event to the new Finder, but this feature won't work without Finder.
Title: Re: 9.3
Post by: OS923 on December 08, 2020, 11:05:25 AM
I updated my extensions.
There's one new extension.
It logs the patches which are installed in the programs of your choice.

I know, I'm hopping from subject to subject,
but this is logic
because good ideas don't come all at once and in the right order.
Title: Re: 9.3
Post by: snes1423 on December 10, 2020, 01:48:21 PM
Ooh can I beta test would love to try this out in a early stage of development  :P
Title: Re: 9.3
Post by: Hopfenholz on December 10, 2020, 02:31:14 PM
I thought of a cool name for it

9der
Title: Re: 9.3
Post by: OS923 on March 15, 2021, 10:44:19 AM
I updated my C++ framework. The main change is that I respond now to possible errors in functions which can’t return an error code like constructors, destructors and operator delete. And I removed ExitToShell everywhere, so that a program always exits from main.

Now I'm testing all the programs.
Title: Re: 9.3
Post by: OS923 on April 26, 2021, 07:32:48 AM
See the progress in the attachment.
Title: Re: 9.3
Post by: OS923 on May 17, 2021, 11:18:37 AM
There was a bug in the RequiredSuiteTest demo program. OpenOrPrintDocList has to be DoAEOpenOrPrintDoc.
Title: Re: 9.3
Post by: OS923 on July 26, 2021, 10:26:53 AM
All my programs work now with paths that may be longer than 255 characters.

I wrote a new program that writes the documentation in HTML. The old program was too complicated.
Title: Re: 9.3
Post by: OS923 on August 09, 2021, 10:12:53 AM
I copied an AVL tree implementation in C++ from www.github.com It's written by Prabal Basu of the Utah state university. I found his implementation interesting because his functions take a pointer by value and return a pointer, which is much easier than what I was doing. Perhaps he wrote this first in LISP? It's very slow because it recalculates the height and balance every time they are needed. The speed is comparable to Apple's AVL tree. I changed this to store the height and balance in every node and this appeared to be the fastest AVL tree implementation that I have seen. Insertion is 4% faster and deletion is 3% faster compared to my own solution. I'm using this now in all my programs.
Title: Re: 9.3
Post by: OS923 on August 18, 2021, 12:06:09 PM
I changed the old program that writes the documentation in HTML into a link checker.

The old program copied a HTML file folder. In these files I inserted Scheme expressions between French quotes. These expressions were evaluated and replaced with the result. This was wonderful, but there's a simpler solution. HTML pages can be generated in C++ by means of macros. This is easier than typing HTML in a text editor.

Code: [Select]
#define E(x) ""
#define S_(x,attr) "<" x attr ">"
#define SE_(x,attr,text) S_(x,attr) text E(x)

#define A_(attr,text) SE_("a",attr,text)
#define B_(attr,text) SE_("b",attr,text)
#define BODY_(attr,text) SE_("body",attr,text)
#define BR_(attr) S_("hr",attr)
#define H1_(attr,text) SE_("h1",attr,text)
#define H2_(attr,text) SE_("h2",attr,text)
#define H3_(attr,text) SE_("h3",attr,text)
#define H4_(attr,text) SE_("h4",attr,text)
#define HEAD_(attr,text) SE_("head",attr,text)
#define HR_(attr) S_("hr",attr)
#define HTML_(attr,text) SE_("html",attr,text)
#define I_(attr,text) SE_("i",attr,text)
#define IMG_(attr) S_("img",attr)
#define LI_(attr,text) SE_("li",attr,text)
#define LINK_(attr) S_("link",attr)
#define META_(attr) S_("meta",attr)
#define P_(attr,text) SE_("p",attr,text)
#define PRE_(attr,text) SE_("pre",attr,text)
#define SPAN_(attr,text) SE_("span",attr,text)
#define TABLE_(attr,text) SE_("table",attr,text)
#define TD_(attr,text) SE_("td",attr,text)
#define TITLE_(attr,text) SE_("title",attr,text)
#define TR_(attr,text) SE_("tr",attr,text)
#define UL_(attr,text) SE_("ul",attr,text)

#define DQ(x) "\"" x "\""
#define SQ(x) "'" x "'"
#define AV(attr,val) " " attr "=" DQ(val)

#define A(href,text) A_(AV("href",href),text)
#define B(text) B_("",text)
#define BODY(text) BODY_("",text)
#define BR() BR_("")
#define H1(text) H1_("",text)
#define H2(text) H2_("",text)
#define H3(text) H3_("",text)
#define H4(text) H4_("",text)
#define HEAD(text) HEAD_("",text)
#define HR() HR_("")
#define HTML(text) HTML_("",text)
#define I(text) I_("",text)
#define IMG(src) IMG_(AV("src",src))
#define LI(text) LI_("",text)
#define LINK(href,type,rel) LINK_(AV("href",href) AV("type",type) AV("rel",rel))
#define META(name,content) META_(AV("name",name) AV("content",content))
#define P(text) P_("",text)
#define PRE(text) PRE_("",text)
#define SPAN(text) SPAN_("",text)
#define TABLE(text) TABLE_("",text)
#define TD(text) TD_("",text)
#define TITLE(text) TITLE_("",text)
#define TR(text) TR_("",text)
#define UL(text) UL_("",text)

static const char* const c=
    HTML(HEAD(TITLE("Test"))
         BODY(H1("Test")
              H2("Chapter 1")
              P("Paragraph 1")
              HR()
              P("Paragraph 2")
              HR()
              H2("Chapter 2")
              P("This is a "
                B(I("test"))
                ".")
              HR()
              P(IMG("Logo.png"))
              P(A("Contents.htm","Contents"))));
Then I wrote a program that converts HTML into C++ macros.
Title: Re: 9.3
Post by: OS923 on August 23, 2021, 08:29:45 AM
The definition of E appeared incorrectly because it's interpreted as HTML. I'll try again.

Code: [Select]
#define E(x) "<" "/" x ">"
Title: Re: 9.3
Post by: OS923 on August 31, 2021, 08:12:38 AM
I wrote Prabal Basu’s AVL tree solution in Scheme.

Code: [Select]
(define node
  (class object% (k)
    (private
      [key k]
      [height 1]
      [balance 0]
      [left #f]
      [right #f]
      (get-cond-height (lambda (x)
                         (if x
                             (send x get-height)
                             0))))
    (public
      (get-key (lambda () key))
      (set-key (lambda (k) (set! key k)))
      (get-height (lambda () height))
      (get-balance (lambda () balance))
      (get-left (lambda () left))
      (set-left (lambda (l) (set! left l)))
      (get-right (lambda () right))
      (set-right (lambda (r) (set! right r)))
      (calc-height-and-balance (lambda ()
                                 (define left-height (get-cond-height left))
                                 (define right-height (get-cond-height right))
                                 (begin
                                   (set! height (+ 1 (max left-height right-height)))
                                   (set! balance (- left-height right-height))))))
    (sequence
      (super-init))))

(define (balance-node node)
  (define balance (send node get-balance))
  (cond ((< 1 balance)
         (if (< 0 (send (send node get-left) get-balance))
             (rotate-ll node)
             (rotate-lr node)))
        ((< balance -1)
         (if (< 0 (send (send node get-right) get-balance))
             (rotate-rl node)
             (rotate-rr node)))
        (else node)))

(define (rotate-ll node)
  (define temp (send node get-left))
  (begin
    (send node set-left (send temp get-right))
    (send temp set-right node)
    (send node calc-height-and-balance)
    (send temp calc-height-and-balance)
    temp))

(define (rotate-rr node)
  (define temp (send node get-right))
  (begin
    (send node set-right (send temp get-left))
    (send temp set-left node)
    (send node calc-height-and-balance)
    (send temp calc-height-and-balance)
    temp))

(define (rotate-lr node)
  (begin
    (send node set-left (rotate-rr (send node get-left)))
    (rotate-ll node)))

(define (rotate-rl node)
  (begin
    (send node set-right (rotate-ll (send node get-right)))
    (rotate-rr node)))

(define (get-in-order-predecessor node)
  (define (get-most-right x)
    (define r (send x get-right))
    (if r
        (get-most-right r)
        x))
  (get-most-right (send node get-left)))

(define (update-node node)
  (begin
    (send node calc-height-and-balance)
    (balance-node node)))

(define (dump-node node)
  (list (send node get-key)
        (let ((left (send node get-left)))
          (if left
              (dump-node left)
              #f))
        (let ((right (send node get-right)))
          (if right
              (dump-node right)
              #f))))

(define (verify-node node)
  (define key (send node get-key))
  (and (<= -1 (send node get-balance) 1)
       (let ((left (send node get-left)))
         (or (not left)
             (and (< (send left get-key) key)
                  (verify-node left))))
       (let ((right (send node get-right)))
         (or (not right)
             (and (< key (send right get-key))
                  (verify-node right))))))

(define (find-node last k)
  (define key (send last get-key))
  (cond ((< k key)
         (let ((left (send last get-left)))
           (if left
               (find-node left k)
               #f)))
        ((< key k)
         (let ((right (send last get-right)))
           (if right
               (find-node right k)
               #f)))
        (else last)))

(define (insert-node last k)
  (if last
      (let ((last-key (send last get-key)))
        (cond ((< k last-key)
               (begin
                 (send last set-left (insert-node (send last get-left) k))
                 (update-node last)))
              ((< last-key k)
               (begin
                 (send last set-right (insert-node (send last get-right) k))
                 (update-node last)))
              (else (error "Double: " k))))
      (make-object node k)))

(define (delete-node last k)
  (if last
      (let ((last-key (send last get-key)))
        (cond ((< k last-key)
               (begin
                 (send last set-left (delete-node (send last get-left) k))
                 (update-node last)))
              ((< last-key k)
               (begin
                 (send last set-right (delete-node (send last get-right) k))
                 (update-node last)))
              ((and (send last get-left)
                    (send last get-right))
               (let* ((temp (get-in-order-predecessor last))
                      (temp-key (send temp get-key)))
                 (begin
                   (send last set-key temp-key)
                   (send last set-left (delete-node (send last get-left) temp-key))
                   (update-node last))))
              (else (let* ((last-left (send last get-left))
                           (temp (if last-left
                                     last-left
                                     (send last get-right))))
                      (if temp
                          (update-node temp)
                          #f)))))
      (error "Not found: " k)))

(define tree
  (class object% ()
    (private
      [top #f])
    (public
      (dump (lambda ()
              (if top
                  (dump-node top)
                  #f)))
      (verify (lambda ()
                (if top
                    (verify-node top)
                    #f)))
      (find (lambda (k)
              (if top
                  (find-node top k)
                  #f)))
      (insert (lambda (k)
                (set! top (insert-node top k))))
      (delete (lambda (k)
                (set! top (delete-node top k)))))
    (sequence
      (super-init))))

(define t (make-object tree))

(define (dump) (send t dump))
(define (verify) (send t verify))
(define (insert x) (send t insert x))
(define (find x) (send t find x))
(define (delete x) (send t delete x))

(define test1
  '(53 90 71 63 16 9 6 58 79 37
       70 77 41 94 52 17 42 38 98 46
       49 95 68 3 14 45 13 91 26 15
       2 92 36 64 51 80 61 59 67 30
       8 20 5 100 29 31 21 56 69 73
       24 27 93 32 54 66 19 78 57 55
       60 83 22 62 82 4 75 40 28 76
       86 89 12 72 44 84 43 65 97 81
       88 7 47 10 18 96 50 35 1 23
       11 33 87 39 74 48 99 34 85 25))

(for-each insert test1)

(verify)

(define test2
  '(11 81 9 42 12 75 87 60 57 3
       56 79 52 36 83 44 100 69 47 99
       95 43 46 13 19 78 70 64 80 71
       82 34 35 68 98 28 51 62 31 32
       30 73 97 5 21 17 53 7 85 6
       20 33 92 24 89 38 26 45 96 77
       22 1 63 39 40 29 76 90 2 74
       23 72 16 41 91 8 61 50 37 84
       65 59 66 58 25 48 18 93 55 27
       88 67 10 54 94 14 49 4 86 15))

(map find test2)

(define test3
  '(33 45 44 63 27 89 51 85 98 68
       82 20 100 17 8 86 40 73 61 97
       2 9 71 57 52 23 22 87 64 13
       81 66 79 26 31 84 62 34 48 10
       19 46 15 59 58 47 69 37 99 70
       32 55 30 90 56 78 42 21 77 39
       93 49 74 80 53 54 6 95 14 65
       11 38 50 72 83 76 92 67 12 96
       88 60 41 18 5 36 3 29 24 1
       35 91 7 75 25 43 16 94 4 28))

(for-each delete test3)

(dump)[code]
Title: Re: 9.3
Post by: OS923 on August 31, 2021, 08:14:48 AM
I'm improving my REALbasic programs with threads, Cancel and a progress bar.
Title: Re: 9.3
Post by: OS923 on September 06, 2021, 08:57:53 AM
To get it right I should rewrite my REALbasic programs in C++. I wrote these programs in REALbasic because I wanted to use them on Windows too, but since I use them only on OS 9 I’m better off with C++.

Then I should use HFS+ instead of HFS. But in some cases HFS is better. Scanning a directory with HFS+ is 18% slower.
Title: Re: 9.3
Post by: IIO on October 02, 2021, 04:28:12 PM
Code: [Select]
#define E(x) "<" "/" x ">"

the euler constant should be written as small e anyway.

if not as (U+2107) or Ɛ (U+0190)