Porting xmtoolbox to IRIX
#1
Porting xmtoolbox to IRIX
xmtoolbox is a mwm-utils app that emulates the old IRIX toolbox. I'm porting it back to IRIX because it being FOSS gives us a great opportunity.

There's three files:

tbmain.c, tbparse.c and tbparse.h that are core for compilation when you remove the session management crap.

Code:
% c99 -c tbmain.c -woff 1196,3970,3604,1174
cc-1515 c99: ERROR File = tbmain.c, Line = 179
  A value of type "int" cannot be assigned to an entity of type "Widget".

        wframe=XmVaCreateManagedFrame(wshell,"mainFrame",
              ^

cc-1515 c99: ERROR File = tbmain.c, Line = 182
  A value of type "int" cannot be assigned to an entity of type "Widget".

        wmain=XmVaCreateManagedRowColumn(wframe,"main",
             ^

cc-1515 c99: ERROR File = tbmain.c, Line = 410
  A value of type "int" cannot be assigned to an entity of type "Widget".

        wmenu=XmVaCreateManagedRowColumn(wmain,"menu",
             ^

cc-1020 c99: ERROR File = tbmain.c, Line = 706
  The identifier "XmCHARSET_TEXT" is undefined.

                        XmCHARSET_TEXT,NULL,0,XmOUTPUT_ALL);
                        ^

cc-1020 c99: ERROR File = tbmain.c, Line = 706
  The identifier "XmOUTPUT_ALL" is undefined.

                        XmCHARSET_TEXT,NULL,0,XmOUTPUT_ALL);
                                              ^

5 errors detected in the compilation of "tbmain.c".


These errors are what stands between this and a potentially compilable object (In practice this is likely the beginning, as those woff flags suppress errors related to implicit declarations and more.

These are new functions related to Motif 2.3.8, which doesn't compile out of the box on IRIX and I'm not interested in -- let's backport this to IRIX instead?

https://github.com/alx210/mwm-utils/blob...c/tbmain.c -- reference file, other than the ifdefs I removed (I don't have this code public yet)

The first two errors are caused by this section:

Code:
wframe=XmVaCreateManagedFrame(wshell,"mainFrame",
                XmNshadowThickness,2,XmNshadowType,XmSHADOW_OUT,NULL);

        wmain=XmVaCreateManagedRowColumn(wframe,"main",
                XmNmarginWidth,0,XmNmarginHeight,0,XmNspacing,0,
                XmNorientation,XmVERTICAL,NULL);

In my code (the ifdefs of SESSIONMGR are removed) this is at line 179

There's no direct successor of functions for this in older motif that I can see and documentation of new motif stuff is rare at best. How do we rewrite this for old motif?

Same issue for line 410.

The final two are caused by this callback:

Code:
static void user_input_cb(Widget w, XtPointer client_data, XtPointer call_data)
{
        XmSelectionBoxCallbackStruct *cbs=
                (XmSelectionBoxCallbackStruct*)call_data;
        char **result=(char**)client_data;

        if(cbs->reason==XmCR_CANCEL)
                *result="\0";
        else
                *result=(char*)XmStringUnparse(cbs->value,NULL,0,
                        XmCHARSET_TEXT,NULL,0,XmOUTPUT_ALL);
}

XmStringUnparse confuses me, as does the doc here for it: https://linux.die.net/man/3/xmstringunparse

Is it possible to change this to something that is supported in Motif 2.1.x?

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
11-13-2021, 06:20 PM
#2
RE: Porting xmtoolbox to IRIX
Hey can you email me a tarball of what you've got so far? Just off the top of my head, XmStringUnparse is supported in Motif 2.1.30, although I actually prefer 2.1.32 which can be downloaded from the Imperial Software website...

Project: Temporarily lost at sea
Plan: World domination! Or something...
(This post was last modified: 11-13-2021, 09:50 PM by vishnu.)
vishnu
Tezro, Octane2, 2 x Onyx4

Trade Count: (0)
Posts: 1,245
Threads: 41
Joined: Dec 2017
Location: Minneapolis, Minnesota USA
Find Reply
11-13-2021, 09:47 PM
#3
RE: Porting xmtoolbox to IRIX
With Vishnu's excellent help, I have ported a working xmtoolbox to IRIX, though it doesn't look right yet.

My goal from here is to change the parse code to use the original chestrc, system.chestrc and auxchestrc in that order, add the horizontal mode to it, make color, fonts and such flexible, and keep it portable across many OSes.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
11-14-2021, 10:31 PM
#4
RE: Porting xmtoolbox to IRIX
It's working flawlessly (despite a compendium of compiler warnings) on my Slackware machine, compiled with gcc 10.2.0 and motif-2.1.32 that I downloaded (source code, compiled it myself) from the Imperial Software website... Smile

Project: Temporarily lost at sea
Plan: World domination! Or something...
vishnu
Tezro, Octane2, 2 x Onyx4

Trade Count: (0)
Posts: 1,245
Threads: 41
Joined: Dec 2017
Location: Minneapolis, Minnesota USA
Find Reply
11-15-2021, 04:47 AM
#5
RE: Porting xmtoolbox to IRIX
It already compiled fine. All I did was remove session management code which isn't necessary for IRIX.

The goal here is to bring it a portable, full scale replacement for it.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
11-15-2021, 05:54 AM
#6
RE: Porting xmtoolbox to IRIX
Maybe reach out to Alex (the dev) and see if it's possible to get some changes merged with the original source, like horizontal mode and a way to compile without xmsm support. You might not need a hard fork and you can benefit from future updates.

Octane2  R14k 600MHz, V10, 2GB RAM, 73GB disk, IRIX 6.5.22
shrek
It's not done until it's ogre.

Trade Count: (0)
Posts: 233
Threads: 19
Joined: Jan 2019
Location: United States
Find Reply
11-15-2021, 08:41 PM
#7
RE: Porting xmtoolbox to IRIX
I discussed this with him. He's not particularly interested in an IRIX specific version, and all I had to do was remove some already defined ifdef fields

He is not interested in restoring chestrc syntax used on IRIX or supporting proprietary unix, which is fair. So I agreed with him, said I'd begin a downstream fork, and we would share code in the future. He said he'd be keeping an eye on anything I or anyone else here did Smile

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
11-15-2021, 09:56 PM
#8
RE: Porting xmtoolbox to IRIX
Ok, so spring chicken idiot here still

We're getting the look and feel slowly worked out. Because IRIX doesn't use XFT, I'm trying to figure out the font syntax to set a font for this and I don't know (and I suspect Alyx doesn't either, as he lacks an SGI)

using xlsfonts | grep sgi > fontlist gets you a raw list of fonts the system used. From there I planned to just add them to Xresources one at a time as xmtoolbox*font: <string here> but that doesn't seem to work.

An example of a specific font name:

-sgi-screen-medium-r-normal--14-140-72-72-m-70-iso8859-1

I also tried what was said here and here:

https://unix.stackexchange.com/questions...icode-font
https://askubuntu.com/questions/161652/h...e-of-xterm

Nothing suggested has worked to change the root font -- and the rules used for rentertable and such don't really apply here as that's XFT -- I don't know how to translate that to here.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
11-16-2021, 03:13 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)