version 1.22, 2004/09/17 07:27:28 |
version 1.26, 2006/05/06 10:53:36 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/plugin/oxmisc.c,v 1.21 2004/09/16 23:53:45 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/plugin/oxmisc.c,v 1.25 2005/07/03 11:08:54 ohara Exp $ */ |
#include <stdio.h> |
#include <stdio.h> |
|
#include <string.h> |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <sys/socket.h> |
#include <sys/socket.h> |
Line 178 int oxWaitSyncBall(ox_stream ostream) |
|
Line 179 int oxWaitSyncBall(ox_stream ostream) |
|
fprintf(stderr,"Looking for the next message tag. mtag=%d\n",mtag); |
fprintf(stderr,"Looking for the next message tag. mtag=%d\n",mtag); |
/* or stdout */ |
/* or stdout */ |
fflush(NULL); |
fflush(NULL); |
|
if (mtag == -1) { |
|
fprintf(stderr,"Your peer seems to be dead.\n"); return; |
|
} |
} |
} |
} |
} |
|
|
Line 344 void oxSendResultOfControl(int fd) |
|
Line 348 void oxSendResultOfControl(int fd) |
|
void oxSendMathCap(ox_stream os,struct mathCap *mathcap) |
void oxSendMathCap(ox_stream os,struct mathCap *mathcap) |
{ |
{ |
int i,n,infosize,ncmo; |
int i,n,infosize,ncmo; |
struct object mathinfo; |
struct object mathinfo = OINIT; |
/* printf("ox sending mathcap\n"); fflush(stdout); */ |
/* printf("ox sending mathcap\n"); fflush(stdout); */ |
mathinfo = *((struct object *)(mathcap->infop)); |
mathinfo = *((struct object *)(mathcap->infop)); |
infosize = getoaSize(mathinfo); |
infosize = getoaSize(mathinfo); |
Line 618 int oxIsThereErrorClient(oxclientp client) { |
|
Line 622 int oxIsThereErrorClient(oxclientp client) { |
|
return(0); |
return(0); |
} |
} |
|
|
oxclientp oxCreateClient(char *sname,int portStream,int portControl) |
oxclientp oxCreateClient(char *sname,int portStream,int portControl, |
|
char *passControl, char *passData) |
/* you also need to change oxCreateClient2. */ |
/* you also need to change oxCreateClient2. */ |
{ |
{ |
int v = 0; |
int v = 0; |
Line 640 oxclientp oxCreateClient(char *sname,int portStream,in |
|
Line 645 oxclientp oxCreateClient(char *sname,int portStream,in |
|
if (fdStream == -1 || fdControl == -1) { |
if (fdStream == -1 || fdControl == -1) { |
fprintf(stderr,"\nOpen error in oxCreateClient.\n"); |
fprintf(stderr,"\nOpen error in oxCreateClient.\n"); |
return(NULL); |
return(NULL); |
|
} |
|
|
|
if (passControl != NULL) { |
|
if (v) fprintf(stderr,"Sending password %s for the control channel.\n", |
|
passControl); |
|
if (write(fdControl,passControl,strlen(passControl)+1) < 0) { |
|
fprintf(stderr,"oxCreateClient(): failed to send passControl.\n"); |
|
return(NULL); |
|
} |
|
} |
|
if (passData != NULL) { |
|
if (v) fprintf(stderr,"Sending password %s for the data channel.\n", |
|
passData); |
|
if (write(fdStream,passData,strlen(passData)+1) < 0) { |
|
fprintf(stderr,"oxCreateClient(): failed to send passData.\n"); |
|
return(NULL); |
|
} |
} |
} |
|
|
controlByteOrder = oxSetByteOrder(fdControl); |
controlByteOrder = oxSetByteOrder(fdControl); |