version 1.14, 2002/11/07 13:32:06 |
version 1.16, 2002/11/08 02:54:12 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/plugin/oxmisc2.c,v 1.13 2002/02/24 10:27:20 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/plugin/oxmisc2.c,v 1.15 2002/11/07 23:52:20 takayama Exp $ */ |
#include <stdio.h> |
#include <stdio.h> |
#include "ox_kan.h" |
#include "ox_kan.h" |
#include "oxmisc2.h" /* This file requires sm1 object description. */ |
#include "oxmisc2.h" /* This file requires sm1 object description. */ |
Line 382 int oxClientToObject(oxclientp client,struct object ro |
|
Line 382 int oxClientToObject(oxclientp client,struct object ro |
|
} |
} |
putoa(rob,11,KpoInteger(client->engineByteOrder)); |
putoa(rob,11,KpoInteger(client->engineByteOrder)); |
putoa(rob,12,KpoInteger(client->controlByteOrder)); |
putoa(rob,12,KpoInteger(client->controlByteOrder)); |
|
putoa(rob,13,KpoInteger(client->engineID)); |
return(0); |
return(0); |
} |
} |
|
|
Line 438 int oxObjectToClient(struct object ob,oxclientp cp) |
|
Line 439 int oxObjectToClient(struct object ob,oxclientp cp) |
|
cp->engineByteOrder = KopInteger(ob1); |
cp->engineByteOrder = KopInteger(ob1); |
ob1 = getoa(ob,12); |
ob1 = getoa(ob,12); |
cp->controlByteOrder = KopInteger(ob1); |
cp->controlByteOrder = KopInteger(ob1); |
|
|
|
ob1 = getoa(ob,13); |
|
cp->engineID = KopInteger(ob1); |
|
|
|
|
return(0); |
return(0); |
Line 1296 oxclientp oxCreateEngine_RFC_101(int fdstream,int port |
|
Line 1300 oxclientp oxCreateEngine_RFC_101(int fdstream,int port |
|
client->dataport = portStream; |
client->dataport = portStream; |
client->controlport = -1; |
client->controlport = -1; |
client->controlfd = -1; |
client->controlfd = -1; |
client->id = engineID; |
client->id = oxGetClientID(); |
|
client->engineID = engineID; |
client->type = CLIENT_SOCKET; /* socket */ |
client->type = CLIENT_SOCKET; /* socket */ |
client->engineByteOrder = engineByteOrder; |
client->engineByteOrder = engineByteOrder; |
client->controlByteOrder = -1; |
client->controlByteOrder = -1; |
return(client); |
return(client); |
} |
} |
|
|
#define MAX_N_OF_CLIENT 1024 |
|
static struct object OxClientList[MAX_N_OF_CLIENT]; |
|
static int OxClientListn = 0; |
|
int oxGetClientID() { |
|
extern struct object OxClientList[]; |
|
extern int OxClientListn; |
|
extern struct object Nobj; |
|
int i; |
|
for (i=0; i<OxClientListn; i++) { |
|
if ((OxClientList[i]).tag == Snull) { |
|
return i; |
|
} |
|
} |
|
i = OxClientListn; |
|
(OxClientList[i]).tag = Snull; |
|
if (OxClientListn < MAX_N_OF_CLIENT-1) { |
|
OxClientListn++; |
|
return i; |
|
}else{ |
|
errorOxmisc2("oxGetClientID(): the client table is full.\n"); |
|
return 0; |
|
} |
|
} |
|
void oxClientListUpdate(struct object ob) { |
void oxClientListUpdate(struct object ob) { |
int id; |
int id; |
extern struct object OxClientList[]; |
extern struct object OxClientList[]; |