IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 12, 2006, 1:17:11 AM (20 years ago)
Author:
eugene
Message:

adding ASSERTs all over

File:
1 edited

Legend:

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

    r8424 r10652  
    145145}
    146146
    147 /* find the host by ID in the defined host stacks (don't pull off stack) */
    148 /* the Find functions are not thread-safe: DROP */
    149 # if (0)
    150 Host *FindHostByID (IDtype HostID, int *StackID) {
    151 
    152   Host *host;
    153 
    154   *StackID = PCONTROL_HOST_IDLE;
    155   host = FindHostInStackByID (*StackID, HostID);
    156   if (host != NULL) return (host);
    157 
    158   *StackID = PCONTROL_HOST_DOWN;
    159   host = FindHostInStackByID (*StackID, HostID);
    160   if (host != NULL) return (host);
    161 
    162   *StackID = PCONTROL_HOST_DONE;
    163   host = FindHostInStackByID (*StackID, HostID);
    164   if (host != NULL) return (host);
    165 
    166   *StackID = PCONTROL_HOST_BUSY;
    167   host = FindHostInStackByID (*StackID, HostID);
    168   if (host != NULL) return (host);
    169 
    170   *StackID = PCONTROL_HOST_OFF;
    171   host = FindHostInStackByID (*StackID, HostID);
    172   if (host != NULL) return (host);
    173 
    174   *StackID = -1;
    175   return (NULL);
    176 }
    177 
    178 /* find the host by Name in the defined host stacks (don't pull off stack) */
    179 Host *FindHostByName (char *name, int *StackID) {
    180 
    181   Host *host;
    182 
    183   *StackID = PCONTROL_HOST_IDLE;
    184   host = FindHostInStackByName (*StackID, name);
    185   if (host != NULL) return (host);
    186 
    187   *StackID = PCONTROL_HOST_DOWN;
    188   host = FindHostInStackByName (*StackID, name);
    189   if (host != NULL) return (host);
    190 
    191   *StackID = PCONTROL_HOST_DONE;
    192   host = FindHostInStackByName (*StackID, name);
    193   if (host != NULL) return (host);
    194 
    195   *StackID = PCONTROL_HOST_BUSY;
    196   host = FindHostInStackByName (*StackID, name);
    197   if (host != NULL) return (host);
    198 
    199   *StackID = PCONTROL_HOST_OFF;
    200   host = FindHostInStackByName (*StackID, name);
    201   if (host != NULL) return (host);
    202 
    203   *StackID = -1;
    204   return (NULL);
    205 }
    206 
    207 Host *FindHostInStackByID (int StackID, IDtype ID) {
    208 
    209   Host *host;
    210   Stack *stack;
    211 
    212   stack = GetHostStack (StackID);
    213   if (stack == NULL) return (NULL);
    214 
    215   host = FindStackByID (stack, ID);
    216   return (host);
    217 }
    218 
    219 Host *FindHostInStackByName (int StackID, char *name) {
    220 
    221   Host *host;
    222   Stack *stack;
    223 
    224   stack = GetHostStack (StackID);
    225   if (stack == NULL) return (NULL);
    226 
    227   host = FindStackByName (stack, name);
    228   return (host);
    229 }
    230 # endif
    231 
    232147IDtype AddHost (char *hostname) {
    233148
Note: See TracChangeset for help on using the changeset viewer.