]> git.neil.brown.name Git - TABS.git/blob - lablist/lablist.h
Terminal Alocation and Booking System - June 2006
[TABS.git] / lablist / lablist.h
1
2
3 /*
4  * interface to the lab listing programs "lab" and "skyterm"
5  *
6  * will provide a list of ws or hosts for each lab in a list
7  *
8  * make_lablist() -> empty list
9  * add_lab(lablist, name) -> success if lab is know, this supports lab groups
10  *                              through attributes common to a set of labs
11  * load_labs(lablist)
12  *  fills in info, freeing old info
13  *
14  * the info in each list is an array of workstations - see below
15  * and a labinfo structure for the lab
16  */
17
18 #include        "../db_client/db_client.h"
19 #include        "../lib/dlink.h"
20
21 typedef struct hostg
22 {
23     int         hgid;
24     CLIENT      *handle;
25     hostgroup_info info;
26     table       tab;
27     time_t      tabtime;
28 } *hostg;
29
30 typedef struct workstation
31 {
32     entityid    wsid;
33     cluster     *status;
34     cluster     *alloc;
35 } *workstation;
36
37 typedef struct labinfo
38 {
39     entityid    labid;
40     char        *labname;
41     hostinfo    info;
42     hostg       hg;
43
44     cluster     *alloc;
45
46     workstation wslist;
47     int         wscnt;
48 } *labinfo;
49
50 #define lablist_make() (dl_head())
51 #define lablist_empty(l) (l == dl_next(l))
52 #define lablist_next(l) ((labinfo)dl_next(l))
53
54 char *add_lab(void *, char *);
55 void load_labs(void *);