How do I go about getting a change to the core code to support the XT
interface?
Below are the changes I've made (connection only paradigm). I know is this
only half a job but is enough to get me going and allow integration with my
app.
To e_os.h
#if defined(XTI)
#include <sys/tiuser.h>
#define get_last_socket_error() t_errno
#define clear_socket_error() t_errno=0
#define closesocket(s) t_close(s)
#define readsocket(s,b,n) XTI_t_rcv(s,b,n,0)
#define writesocket(s,b,n) t_snd(s,b,n,0)
#define ioctlsocket(a,b,c) XTI_t_ioctl((a),(b),(int)(c))
#else
#if defined(WINDOWS)
.....
and the supporting code:
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <fcntl.h>
#include <poll.h>
#include <sys/tiuser.h>
static int waitforsomething(int fd)
{
int numevents=0;
struct pollfd fds[1];
fds[0].fd = fd;
fds[0].events = POLLIN | POLLPRI;
fds[0].revents = 0;
while ((numevents = poll(fds, 1, -1)) == -1 )
{
if (errno != EINTR) return -1;
}
return numevents;
}
int XTI_t_ioctl(int fd, int cmd, int pbuff)
{
return -1;
}
int XTI_t_rcv(int fd, char *buf, unsigned nbytes, int *flags)
{
int osievent = 0;
int readflags=0;
waitforsomething(fd);
osievent = t_look(fd);
switch (osievent)
{
case T_DATA: break;
default: return -1;
}
readflags=O_NONBLOCK;
return t_rcv(fd, buf, nbytes, &readflags);
}
Regards
Phil
Phil Harrison Project Delivery Services
Technical Specialist & Interoperability TDA
*0161 932 5639(n/w 7617 5639)
Mobile 07711 450218
* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
This e-mail is only for the above addressees. It may contain confidential or
privileged information.
If you are not an addressee you must not copy, distribute, disclose or use any
of the information in
it or any attachments. If you have received it in error please notify the
sender and delete it
immediately.
Lloyds TSB Bank plc. Registered office: 25 Gresham Street, London EC2V 7HN.
Registered in
England and Wales, number 2065. Telephone: 020 7626 1500.
Lloyds TSB Scotland plc. Registered office: Henry Duncan House, 120 George
Street, Edinburgh
EH2 4LH. Registered in Scotland, number 95237. Telephone: 0131 225 4555.
Cheltenham & Gloucester plc. Registered office: Barnett Way, Gloucester GL4
3RL. Registered in
England and Wales, number 2299428. Telephone: 01452 372372.
Lloyds TSB Bank plc, Lloyds TSB Scotland plc and Cheltenham & Gloucester plc
are authorised
and regulated by the Financial Services Authority and are signatories to the
Banking Codes.
Lloyds TSB Bank plc and Lloyds TSB Scotland plc represent only the Scottish
Widows and Lloyds
TSB Marketing Group for life assurance, pensions and investment business.
Cheltenham & Gloucester plc acts as an introducer only for life assurance,
pensions and
investment business.
Lloyds TSB Group plc. Registered office: Henry Duncan House, 120 George
Street, Edinburgh
EH2 4LH. Registered in Scotland, number 95000. Telephone: 0131 225 4555.