AWAITIOX - C Example
!From http://docs.hp.com/en/524521-012/524521-012.pdf, Page 157

#include <in.h>
#include <netdb.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <cextdecs(AWAITIOX, FILE_GETINFO_)>
..
struct sockaddr_in fhost;
int len,rsock;
char buffer [8*1024];
short error, rsock2, rcount;
long tag;
..
error = recvfrom_nw(rsock, buffer, sizeof(buffer), 0,
(struct sockaddr *) &fhost, &len, tag);
if error (!= 0) /* some error checking */
{
printf ("recvfrom_nw failed, error %d\n," errno);
exit (1);
}
rsock2=(short)rsock; /* AWAITIOX/FILE_GETINFO_ expects a short
for socket descriptor */
(void) AWAITIOX (&rsock2,,&rcount,&tag,1l);
(void) FILE_GETINFO_ (rsock2, &error);
if (error != 0)
{
printf ("error from AWAITIOX, error %d\n", errno);
exit (1);
}
error = socket_get_info (rsock, (char*) &fhost, len);
if (error != 0)
{
printf ("socket_get_info failed, error %d\n", errno);
exit(1)
}

C / TAL Comparisons (Using SEND_NW as an example):
C Synopsis, used for data type comparisons
#include <....lost in html conversion>
#include <...lost in html conversion>
error = send_nw (socket, nbuffer_ptr, nbuffer_length, flags,tag);
int error, socket;
char *nbuffer_ptr;
int nbuffer_length, flags;
long tag;


C / TAL Comparisons (Using SEND_NW as an example):
C Synopsis, used for data type comparisons
#include <....lost in html conversion>
#include <...lost in html conversion>
error = send_nw (socket, nbuffer_ptr, nbuffer_length, flags,tag);
int error, socket;
char *nbuffer_ptr;
int nbuffer_length, flags;
long tag;

Tal Synopsis, used for data type comparisons
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
error := send_nw (socket, nbuffer_ptr, nbuffer_length,
flags, tag);
INT(32) error, socket;
STRING .EXT nbuffer_ptr;
INT(32) nbuffer_length,
flags;
INT(32) tag;

Friday, July 24, 2009 5:48:20 PM, From: jim, To: Stories