TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Doug Nazar
from: Darin McBride
date: 1996-06-01 00:01:52
subject: Semaphores (16 & 32)

Hello Doug!

29 May 96 23:36, Doug Nazar wrote to Darin McBride:

 DN> Hello Darin!

 DN> Tuesday May 28 1996 22:12, Darin McBride wrote to Doug Nazar:

 DM>> Yup - but when I link with OS2286.LIB, the program can't even
 DM>> load.  :-/

 DN> Only link with OS2286.LIB for 16-bit programs. The 16 bit

I wonder why it's in 'watcom/lib386/os2' then... :-/

 DN> functions are still in OS2386.LIB but renamed. (ie. DosCreateSem
 DN> -> Dos16CreateSem).

Ah... I thought I tried this, but obviously not quite right.

 DM>> APIENTRY16, actually.  But I finally got the calling stuff
 DM>> set up, but... it still refuses to run.  :-/

 DN> Here. I whipped up a quick demo program. It compiles (and runs!)
 DN> with both IBM VA & Watcom.

*THANK*YOU*.  By playing with this, I found the problem, and will reveal my
stupidity/ignorance/name-du-jour here.

 DN> extern "C" { /*fold00*/

 DN> #define DosSemClear   DOS16SEMCLEAR
 DN> #define DosSemRequest DOS16SEMREQUEST
 DN> #define DosCreateSem  DOS16CREATESEM
 DN> #define DosOpenSem    DOS16OPENSEM
 DN> #define DosCloseSem   DOS16CLOSESEM

A few tests show that because of APIENTRY16 including the pascal calling
convention, case is immaterial.  Dos16SemClear works as well as
DOS16SEMCLEAR. Due to this, I may just simply toss the #define's, and use
them as Dos16 rather than Dos.  Um, maybe not.  :-)

 DN>    typedef PVOID * _Seg16 HSEM16;
 DN>    typedef HSEM * PHSEM16;

These typedef's were *not* in the extern "C" - and that was my
problem.  :-/

 DN> class OS2MSG { /*fold00*/

Could you post the full version of this OS2MSG?  (Assuming you'll release
it to the PD... :->)

 DM>> 'dontKnow' is a string delemitating the name of an
 DM>> environment variable that is permitted to override
 DM>> semaphoreName.

 DN> Well that helps :-) Actually, all this discussion brought to
 DN> light that override which helps here. I'm running two squish
 DN> setups, one for the hub & one for the bbs. The hub tosses to the
 DN> bbs address & then I move things over with a set of utils. This
 DN> will allow me to run concurrently.

Heheh... Glad to return a tiny smidgeon of what I received... :-)

 DM>> What OS/2 editor do you use that has folding?

 DN> FTE. It's a great little editor. The only real complaint I had

Really?  Wow - never noticed before.  :-)  I'm still using an older beta... :-)

 DN> was it's slow initialization because there where dozens of text
 DN> config files but version .38 uses a compiled config. Also has a
 DN> PM version which is just an AVIO (I believe).

Hmmm... gonna have to find it again.  :-)

 DN> The URL is  http://ixtas.fri.uni-lj.si/~markom/fte

Hey, you're a mind reader.  :-)  Thanks,

Darin McBride

--- GoldED/2 2.42.G0614
* Origin: Tanktalus' Tower BBS/RPGs Galore! (1:342/5015)
SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1
@PATH: 342/5015 61 3615/50 396/1 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.