[BACK]Return to oxmisc2.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / plugin

Diff for /OpenXM/src/kan96xx/plugin/oxmisc2.c between version 1.14 and 1.17

version 1.14, 2002/11/07 13:32:06 version 1.17, 2002/11/08 14:18:02
Line 1 
Line 1 
 /* $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.16 2002/11/08 02:54:12 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[];
Line 1347  void oxClientListRemove(struct object ob) {
Line 1329  void oxClientListRemove(struct object ob) {
         /* errorOxmisc2("oxClientListRemove(): the client table is full.\n");*/          /* errorOxmisc2("oxClientListRemove(): the client table is full.\n");*/
   }    }
 }  }
   static void KoxCleanClientList() {
     extern int OxClientListn;
     extern struct object OxClientList[];
     int i,j,n;
     struct object ob;
     n = 0;
     for (i=0; i<OxClientListn; i++) {
           if ((OxClientList[i]).tag != Snull) {
             if (!isItClientObject(OxClientList[i])) {
                   (OxClientList[i]).tag = Snull;
             }
           }
     }
   }
 struct object KoxGetClientList() {  struct object KoxGetClientList() {
   extern int OxClientListn;    extern int OxClientListn;
   extern struct object OxClientList[];    extern struct object OxClientList[];
   int i,j,n;    int i,j,n;
   struct object rob;    struct object rob;
     KoxCleanClientList();
   n = 0;    n = 0;
   for (i=0; i<OxClientListn; i++) {    for (i=0; i<OxClientListn; i++) {
         if ((OxClientList[i]).tag != Snull) n++;          if ((OxClientList[i]).tag != Snull) n++;

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.17

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>