Programmatically Controlling Programs

Started by tygre, Feb 01, 2026, 10:32 PM

Previous topic - Next topic

tygre

Hi there,

So, I continued my journey: I tried to make rumba work with my NAS, no luck. I also tried NSF as suggested by Rhetorica, and following their guide, no luck either ::)
But I'm learning and can still use yftpd! :)

Then, I decided to change focus: I installed GCC 2.95.3 and tried to compile two simple client/server programs.

GCC complains that the symbols _inet_pton (and _inet_aton when I used inet_aton() instead of inet_pton()) do not exist.
I read that NeXTStep is not fully POSIX-compliant (?). Could that be the reason? If so, what can I do? ???

Cheers!
Tygre
Scientific Progress Goes Boing!
http://www.chingu.asia/wiki

marvin

Hi @tygre ,

have you used the compiler like this: gcc -posix ... -lposix ?
DON'T PANIC

tygre

Hi @marvin !

I hadn't tried, but no luck with them.

First, I tried gcc -o client -posix -lposix client.c, but I got dozens of errors: "multiple definitions of symbol".
Then, I tried gcc -o client -posix -lposix -Xlinker -m client.c to change the errors into warnings, but I still got "undefined symbols... _inet_aton".

I grep'ed the libs on my system (like libiberty.a, libgcc.a...) and none contain anything "inet" anyway. I must be missing something ??? but where to find it? :(

Thanks in advance for any suggestions!
Tygre
Scientific Progress Goes Boing!
http://www.chingu.asia/wiki

tygre

Hi there,

I made some progress today! I managed to compile and run successfully the two simple client/server programs by replacing inet_aton() with inet_addr() and making a few other minor changes.

Let's see now if I can adapt the code of my FTP and HTTP clients... ::)

Cheers!
Tygre
Scientific Progress Goes Boing!
http://www.chingu.asia/wiki

tygre

Hi all!

Some more progress! :)

I now have all the pieces necessary:
- Some C code to download an LHA file containing a module from Aminet
- The lha command to unarchive this file and put the module in a known place
- Some ObjC code to run a pre-made journal that controls Paula to load and play the module

Now it's "just" a matter of putting them all together ;)

PS. Does anyone know how to "disassociate" Edit from .c, .m, and .h files and replace it with Emacs, for example? I tried to change the preferences of Project Builder, but Edit is still called. I don't know how to do in the Workspace...
Scientific Progress Goes Boing!
http://www.chingu.asia/wiki

marvin

Hi @tygre , in Workspace you can set the default application from the Tools -> Inspector -> Tools view.

As you can see from my screenshot, (for me) only Edit .app is linked to .c files, if there are more, the applications are listed in this inspector.

Screenshot_2026-03-25_14-20-05.png
DON'T PANIC

tygre

It works well now for .h, .c, and .m files, thanks a lot, Marvin! 8)

How could I add Emacs for Makefiles too?
In the Inspector, I can only see Edit and can't figure out how to add another program ???
Scientific Progress Goes Boing!
http://www.chingu.asia/wiki

marvin

Hi @tygre , NeXTstep apps announce by themselves which types of files they can open.

In this screenshot you see an example for Edit .app, which can open many different file-types.

Screenshot_2026-03-27_10-21-21.png

In my tests with Emacs .app it seems like the app does not link to text-files, which should be the correct type for a file named "Makefile".

As far as I know (NeXTstep 3.3), the file-types have to be added in the app's ProjectBuilder project and are compiled in.

I remember to have "hacked" in a file-type to some application in the 1990s. But do not know any more, if I had simply the sources and ProjectBuilder files, or did it with hex-editor and binaries only.

Is it useful, that you can hold Command-key together with drag&drop the file onto the Emacs app's icon to open it there?
DON'T PANIC

tygre

Hi @marvin !

Thanks for your help: I can see the file-types known to Emacs now :)

I could also see into its binary the known extension, like "f90" or "cxx". I could try to modify it using a HEX editor (which one would you recommend?), but maybe it's not really worth the trouble: I can open the Makefile manually, it's just that Edit is used by Project Builder...

Cheers!
Scientific Progress Goes Boing!
http://www.chingu.asia/wiki

marvin

Hi @tygre , on my 90s NeXT slab I found this two Hex-Editors, so it must have been one of those.

Screenshot_2026-04-04_23-06-56.pngScreenshot_2026-04-04_23-06-02.png
DON'T PANIC

ptek

#25
I also use hexi which I downloaded from https://nic.funet.fi/pub/NeXT/Editors/apps/. I have not tried forty-two yet.

EDIT: (2026-04-08) Provided download link to funnet.fi file archive.

tygre

Hi all,

Just to share with you the first working version of NeXTModRadio! :D

It can download an LHA archive from Aminet, extract it, find the first module file, and play it with Paula.

It can be found in NeXTModRadio.app. It needs the lha command available (which can be put in /usr/local/bin) and /tmp/ to be readable/writable by the current user. Of course, it needs Paula to be installed ;)

I'll be happy to get any feedback on its (limited) use and my implementation.

Cheers!
Scientific Progress Goes Boing!
http://www.chingu.asia/wiki