todd@uhccux.UUCP (The Perplexed Wiz) (12/01/87)
Has anyone successfully linked a Microsoft C (version 5.0) function to Arity/Prolog 4.0? It seems like a lot has changed since Arity wrote the "Building Arity/Prolog Applications" handbook. For example, the handbook talks about an Arity supplied file called "arityc.h". However, all I can find is "apctype.h" on my disks. It also seems that some of the MSC compile options Arity says I must use to compile the C code no longer exists in MSC version 5.0. Also, the Arity handbook shows a C function called 'getint_c' being used to translate (I guess?) parameters passed from Prolog to the C function. However, I can't figure out where this function is supposed to come from. Thanks in advance for any help/hints/tips you can offer me...todd P.S. What I am trying to do is link custom graphics and MIDI functions to Arity/Prolog. -- Todd Ogasawara, U. of Hawaii Faculty Development Program UUCP: {ihnp4,uunet,ucbvax,dcdwest}!sdcsvax!nosc!uhccux!todd ARPA: uhccux!todd@nosc.MIL BITNET: todd@uhccux INTERNET: todd@uhccux.UHCC.HAWAII.EDU
todd@uhccux.UUCP (The Perplexed Wiz) (12/04/87)
To answer my own dumb (read "I didn't read the manuals closely enough!") questions. In article <1214@uhccux.UUCP> todd@uhccux.UUCP (The Perplexed Wiz) writes: >Has anyone successfully linked a Microsoft C (version 5.0) function >to Arity/Prolog 4.0? It seems like a lot has changed since Arity Yes. >wrote the "Building Arity/Prolog Applications" handbook. For example, >the handbook talks about an Arity supplied file called "arityc.h". >However, all I can find is "apctype.h" on my disks. It also seems that There is no 'arityc.h'. However, it appears that the one reference to that file is merely a typo that should be 'apctype.h'. >some of the MSC compile options Arity says I must use to compile the C >code no longer exists in MSC version 5.0. Also, the Arity handbook Uh-uh...I misread the example. The options exist as advertised. All I had to do was switch from msc foo /Alfw (Microsoft C 4.0) to cl /c /Alfw foo.c (Microsoft C 5.0) >shows a C function called 'getint_c' being used to translate (I guess?) >parameters passed from Prolog to the C function. However, I can't >figure out where this function is supposed to come from. It is documented on page 49 of the "Building..." manual. It also seems that you can ignore the compiler warning 4058 (address of frame variable taken, DS != SS) that occurs when getint_c is used. -- Todd Ogasawara, U. of Hawaii Faculty Development Program UUCP: {ihnp4,uunet,ucbvax,dcdwest}!sdcsvax!nosc!uhccux!todd ARPA: uhccux!todd@nosc.MIL BITNET: todd@uhccux INTERNET: todd@uhccux.UHCC.HAWAII.EDU
randyg@iscuva.ISCS.COM (Randy Gordon) (12/08/87)
In article <1214@uhccux.UUCP> todd@uhccux.UUCP (The Perplexed Wiz) writes: > >Has anyone successfully linked a Microsoft C (version 5.0) function >to Arity/Prolog 4.0? It seems like a lot has changed since Arity >wrote the "Building Arity/Prolog Applications" handbook. For example, I just put up an example of linking arity prolog and C (version 4) with the plink linker on the Arity Bulletin Board. Plink allows you both multiple overlays and multiple overlay areas. With version 4 Arity, you have to add a few "class" statements to your plink command file. (Not necessary using the microsoft linker). In a couple of weeks version 5 of Arity Prolog will be out and the C interface will be much cleaner(getint, etc dissapears... and you can call prolog from C!)