Hosts.h File Reference

#include "constants.h"

Include dependency graph for Hosts.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Host
 this struct defines a Host More...
struct  HostsStruct
 this is the hosts array More...

Defines

#define NOTINIT   -2
 Host status not initialized.
#define NOTAVAIL   -1
 not available
#define AVAIL   0
 available, but not used

Functions

HostsStructhostsCreate ()
 Constructor.
void hostsDestroy (HostsStruct *h)
 destroyer
int hostsAdd (HostsStruct *h)
 add a host to the host struct, empty
int hostsAddResource (HostsStruct *h, int hostIndex, char *resourceName)
 adds a resource to the host, caller cannot free resource after this
int hostsSetStatus (HostsStruct *h, int hostIndex, int status)
int hostsSetWeight (HostsStruct *h, int hostIndex, int weight)
int hostsSetName (HostsStruct *h, int hostIndex, char *name)
int hostsSetMemory (HostsStruct *h, int hostIndex, int mem)
int hostsGetIndex (HostsStruct *h)
int hostsGetIndexByName (HostsStruct *h, char *name)
int hostsGetIndexByResource (HostsStruct *h, char *resourceName)
int hostsGetStatus (HostsStruct *h, int hostIndex)
int hostsGetWeight (HostsStruct *h, int hostIndex)
int hostsGetMemory (HostsStruct *h, int hostIndex)
char * hostsGetName (HostsStruct *h, int hostIndex)
int hostsGetNumResources (HostsStruct *h, int hostIndex)
int hostsHasResource (HostsStruct *h, int hostIndex, char *resourceName)


Define Documentation

#define AVAIL   0
 

available, but not used

Definition at line 12 of file Hosts.h.

Referenced by hostsAdd(), and hostsGetIndex().

#define NOTAVAIL   -1
 

not available

Definition at line 11 of file Hosts.h.

Referenced by hostsGetIndex(), hostsSetStatus(), and replaceCrashedHost().

#define NOTINIT   -2
 

Host status not initialized.

Definition at line 10 of file Hosts.h.

Referenced by hostsCreate(), and hostsGetIndex().


Function Documentation

int hostsAdd HostsStruct h  ) 
 

add a host to the host struct, empty

Definition at line 44 of file Hosts.c.

References AVAIL, HostsStruct::hosts, MAXHOSTS, HostsStruct::numHosts, Host::numResources, Host::status, HostsStruct::totalWeight, and Host::weight.

Referenced by abreTag().

int hostsAddResource HostsStruct h,
int  hostIndex,
char *  resourceName
 

adds a resource to the host, caller cannot free resource after this

Definition at line 69 of file Hosts.c.

References HostsStruct::hosts, MAX_RNAME_LENGTH, MAXRESOURCES, HostsStruct::numHosts, Host::numResources, and Host::resources.

Referenced by abreTag().

HostsStruct* hostsCreate  ) 
 

Constructor.

Definition at line 12 of file Hosts.c.

References HostsStruct::hosts, MAXHOSTS, NOTINIT, Host::numResources, and Host::status.

Referenced by createLayout().

void hostsDestroy HostsStruct h  ) 
 

destroyer

Definition at line 27 of file Hosts.c.

Referenced by destroyLayout().

int hostsGetIndex HostsStruct h  ) 
 

Definition at line 200 of file Hosts.c.

References AVAIL, HostsStruct::hosts, MAXHOSTS, NOTAVAIL, NOTINIT, and HostsStruct::totalWeight.

Referenced by fechaTag(), and replaceCrashedHost().

int hostsGetIndexByName HostsStruct h,
char *  name
 

Definition at line 230 of file Hosts.c.

References HostsStruct::hosts, MAX_HNAME_LENGTH, Host::name, and HostsStruct::numHosts.

Referenced by abreTag(), and replaceCrashedHost().

int hostsGetIndexByResource HostsStruct h,
char *  resourceName
 

Definition at line 242 of file Hosts.c.

References hostsHasResource(), MAXHOSTS, and HostsStruct::numHosts.

Referenced by abreTag().

Here is the call graph for this function:

int hostsGetMemory HostsStruct h,
int  hostIndex
 

Definition at line 273 of file Hosts.c.

References HostsStruct::hosts, Host::mem, and HostsStruct::numHosts.

char* hostsGetName HostsStruct h,
int  hostIndex
 

Definition at line 304 of file Hosts.c.

References HostsStruct::hosts, Host::name, and HostsStruct::numHosts.

Referenced by abreTag(), fechaTag(), and replaceCrashedHost().

int hostsGetNumResources HostsStruct h,
int  hostIndex
 

Definition at line 317 of file Hosts.c.

References HostsStruct::hosts, HostsStruct::numHosts, and Host::numResources.

int hostsGetStatus HostsStruct h,
int  hostIndex
 

Definition at line 261 of file Hosts.c.

References HostsStruct::hosts, HostsStruct::numHosts, and Host::status.

Referenced by hostsGetWeight().

int hostsGetWeight HostsStruct h,
int  hostIndex
 

Definition at line 285 of file Hosts.c.

References HostsStruct::hosts, hostsGetStatus(), HostsStruct::numHosts, and Host::weight.

Here is the call graph for this function:

int hostsHasResource HostsStruct h,
int  hostIndex,
char *  resourceName
 

Definition at line 330 of file Hosts.c.

References HostsStruct::hosts, MAX_RNAME_LENGTH, HostsStruct::numHosts, Host::numResources, and Host::resources.

Referenced by hostsGetIndexByResource().

int hostsSetMemory HostsStruct h,
int  hostIndex,
int  mem
 

Definition at line 136 of file Hosts.c.

References HostsStruct::hosts, Host::mem, and HostsStruct::numHosts.

Referenced by abreTag().

int hostsSetName HostsStruct h,
int  hostIndex,
char *  name
 

Definition at line 150 of file Hosts.c.

References HostsStruct::hosts, MAX_HNAME_LENGTH, Host::name, and HostsStruct::numHosts.

Referenced by abreTag().

int hostsSetStatus HostsStruct h,
int  hostIndex,
int  status
 

Definition at line 94 of file Hosts.c.

References HostsStruct::hosts, NOTAVAIL, HostsStruct::numHosts, Host::status, HostsStruct::totalWeight, and Host::weight.

Referenced by replaceCrashedHost().

int hostsSetWeight HostsStruct h,
int  hostIndex,
int  weight
 

Definition at line 114 of file Hosts.c.

References HostsStruct::hosts, HostsStruct::numHosts, HostsStruct::totalWeight, and Host::weight.

Referenced by abreTag().


Generated on Tue Jan 17 19:24:09 2006 for Void by  doxygen 1.4.6