IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 12, 2008, 12:52:06 PM (18 years ago)
Author:
eugene
Message:

use virtual stacks for host and job queries by user thread

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pcontrol/IDops.c

    r8296 r18098  
    11# include "pcontrol.h"
    22
    3 static IDtype CurrentJobID  = 0;
    4 static IDtype CurrentHostID = 0;
     3static IDtype CurrentJobID  = 1;
     4static IDtype CurrentHostID = 1;
    55
    6 /* for now, no persistence : we could use the date/time to seed the upper byte(s) if needed */
     6/* for now, no persistence between sessions : we could use the date/time to seed the upper
     7 * byte(s) if needed */
    78void InitIDs () {
    8   CurrentJobID = 0;
    9   CurrentHostID = 0;
     9  CurrentJobID = 1;
     10  CurrentHostID = 1;
    1011}
    1112
     
    4142}
    4243
     44IDtype GetID (char *IDword) {
     45
     46  int Nargs;
     47  IDtype ID;
     48  unsigned int word0, word1, word2, word3;
     49  char *endptr;
     50
     51  Nargs = sscanf (IDword, "%x.%x.%x.%x", &word3, &word2, &word1, &word0);
     52  if (Nargs == 4) {
     53      IDtype tmp;
     54    ID = 0;
     55    ID |= (word0 << 0);
     56    ID |= (word1 << 16);
     57    tmp = word2;
     58    ID |= (tmp << 32);
     59    tmp = word3;
     60    ID |= (tmp << 48);
     61    return ID;
     62  }
     63   
     64  ID = strtoll (IDword, &endptr, 10);
     65  if (*endptr == 0) {
     66    return ID;
     67  }
     68
     69  return 0;
     70}
Note: See TracChangeset for help on using the changeset viewer.