Porting Unix programs with C68

Anything QL Software or Programming Related.
Post Reply
swensont
Forum Moderator
Posts: 325
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Porting Unix programs with C68

Post by swensont »

I'm very rusty with C and have little experiece with C programs in the Unix environment. I have an old Unix program circa 1988 that uses termcap for screen handling. Does C68 have a library for termcap? The output is all ascii, so I could convert the termcap calls to something more QDOS-like, but I was wondering it if was possible to port with little changes.


User avatar
tofro
Font of All Knowledge
Posts: 3148
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Porting Unix programs with C68

Post by tofro »

Tim,

C68 is very well set to port (older) UNIX applications to QDOS - Much better than, for example Metacomco C. Most of (older, non-graphics) Unix application will just require make and you're done.
And it does, in fact have curses/termcap support (although not for a lot of particularly complicated functions, rather bare-bone vt52, but that''s enough for most UNIX apps.)

Make sure you download and install the curses companion disk for C68, though.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
prime
Trump Card
Posts: 192
Joined: Fri Feb 18, 2011 8:58 pm

Re: Porting Unix programs with C68

Post by prime »

Now what I'd like to see ported is Joe, it would be nice to have a proper text editor that uses the Wordstar keys :)

Cheers.

Phill.


Derek_Stewart
Font of All Knowledge
Posts: 4797
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Porting Unix programs with C68

Post by Derek_Stewart »

Hi,

I have looking at some Linux source code, Joe is amonst them, which should be able to be ported.

I have been looking at some Turbo C source code from DOS. Which uses conio.h, graphics.h incluxe ciles, which not ANSI C standard.

Does anyone have any experience of porting msdos/turbo c source code?


Regards, Derek
User avatar
tofro
Font of All Knowledge
Posts: 3148
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Porting Unix programs with C68

Post by tofro »

Derek,
depending on the features used from conio - This might be a major exercise.

DOS programs typically were very hardware-dependant, with direct access to screen memory, or using ANSI VT52 escape codes directly - If this is the case, the program would need to be re-written to use QDOS functions instead (Which is kind of daunting with the direct screen access on the PC, considering that you're poking characters in a text oriented screen memory in DOS which will not work on the QL)

In a nutshell: Your mileage may vary.

Regards,
Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Post Reply