Operating System - OpenVMS
1751858 Members
6026 Online
108782 Solutions
New Discussion

Re: Pascal and getaddrinfo

 
SOLVED
Go to solution
stephenbrayshaw
Advisor

Pascal and getaddrinfo

Hi, I am trying to find documentation / examples on how to get pascal to be able to use getaddrinfo and preferably with ACP for compatability with our existing use of $QIO calls although without ACP is acceptable.

It is for IA64, OpenVMS 8.4 & above ( both HP & VSI versions) Pascal 6.1 & 6.2 & TCPIP V5.7-13 & above.

3 REPLIES 3
Steven Schweda
Honored Contributor
Solution

Re: Pascal and getaddrinfo

   Are you still looking?  After the recent Fortran adventure
( http://community.hpe.com/t5/x/x/m-p/6884503 ), I tried to learn enough
Pascal to do anything, and ended up with some code which seems to be
able to use the C getaddrinfo() directly.  Someone with more than a few
hours of Pascal experience (who can actually write a Pascal statement
without multiple returns to the language manual) might do things
differently, but, for the desperate, my try is (or should be) attached.

alp $ pas gai_p
alp $ link gai_p
alp $ r gai_p
  len = 12, name: >ftp.hpe.com<.
  sts = 0
  ai_p = 2130800
  ai_flags = 0
  ai_family = 2
  ai_socktype = 1
  ai_protocol = 6
  ai_addrlen = 16
  ai_canonname = 0
  ai_addr = 2130832
  ai_next = 2325192
  addr = 216.237.214.19

stephenbrayshaw
Advisor

Re: Pascal and getaddrinfo

Thank you very much Steven,

For anyone else looking at this post, to get to the source Steven attached you need to download the file and remove the .jpg extension

Steven Schweda
Honored Contributor

Re: Pascal and getaddrinfo

> Thank you very much Steven,

   Glad to help.  It was educational.  Now I know (slightly) more about
Pascal than I did before (which was approximately only that ":=" was the
assignment operator).

> For anyone else looking at this post, to get to the source Steven
> attached you need to download the file and remove the .jpg extension

      /t5/x/x/td-p/6878990

   Note that I never tried to look beyond the first result returned in
any of these cross-language programs.  I'd like to think that it'd be
possible to traverse the linked list returned by getaddrinfo(), for
example, but that's left as an exercise for the reader (the ever-popular
saying of us lazy folks).