Is the preference file of SheepShaver capable of comments like those preceded by '#'?

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
Mac9LnUniDU
Space Cadet
Posts: 4
Joined: Mon Apr 26, 2021 1:35 am

Is the preference file of SheepShaver capable of comments like those preceded by '#'?

Post by Mac9LnUniDU »

Is the preference file "~/.sheepshaver_prefs" of SheepShaver capable of comments by recognizing comment characters such as '#' in bash, '//' in C++ or '<!-- -->' in HTML?

If it is capable of ignoring a comment lead by a comment character like '#', can the comment start in the middle of the line, or does the comment have to start at the beginning of the line?
Last edited by Mac9LnUniDU on Fri Apr 30, 2021 8:05 pm, edited 1 time in total.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Is the preference file of SheepShaver capable of comments like those preceded by '#'?

Post by Ronald P. Regensburg »

I do not know for sure, but I very much doubt it.

What would you want to use commenting out for? You can delete a line if you wish. The next time you save settings in the GUI prefs editor, the line will re-appear.
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Is the preference file of SheepShaver capable of comments like those preceded by '#'?

Post by adespoton »

Mac9LnUniDU wrote: Fri Apr 30, 2021 12:43 pm Is the preference file "~/.sheepshaver_prefs" of SheepShaver capable of comments by recognizing comment characters such as '#' in bash, '//' in C++ or '<!-- -->' in HTML?

If it is capable of ignoring a comment lead by a comment characters like '#', can the comment start in the middle of the line, or does the comment have to start at the beginning of the line?
I just checked through the source to refresh myself. In BII and SheepShaver, each newline is checked for a prefs argument. If a recognized one is found at the start of the line, the associated value is loaded. If an unrecognized value is found, 'WARNING: Unknown preferences keyword '%s'' is emitted and prefs loading continues to the next line.

Beyond that, there is specific code to check the first character. A # or ; at the start of the line will result in that line being ignored. Any # or ; found in the middle of a line will be part of the value provided, as the code just checks the keyword, the delimiter, and the value, which is the rest of the line, with spaces stripped, until the end of line (ignoring any newline at the end).
Post Reply