* University of Maryland at College Park
*/
/*
- * $Id: diskfile.c,v 1.27.4.6.4.3.2.15 2003/12/16 22:36:45 martinea Exp $
+ * $Id: diskfile.c,v 1.27.4.6.4.3.2.15.2.5 2004/11/19 13:28:15 martinea Exp $
*
* read disklist file
*/
static disklist_t lst;
static FILE *diskf;
static char *diskfname = NULL;
-static host_t *hostlist;
+static am_host_t *hostlist;
static int line_num, got_parserror;
/* local functions */
else return &lst;
}
-host_t *lookup_host(hostname)
+am_host_t *lookup_host(hostname)
char *hostname;
{
- host_t *p;
+ am_host_t *p;
for(p = hostlist; p != NULL; p = p->next) {
if(strcasecmp(p->hostname, hostname) == 0) return p;
disk_t *lookup_disk(hostname, diskname)
char *hostname, *diskname;
{
- host_t *host;
+ am_host_t *host;
disk_t *disk;
host = lookup_host(hostname);
char *diskname;
{
disk_t *disk;
- host_t *host;
+ am_host_t *host;
disk = alloc(sizeof(disk_t));
disk->line = 0;
host = lookup_host(hostname);
if(host == NULL) {
- host = alloc(sizeof(host_t));
+ host = alloc(sizeof(am_host_t));
host->next = hostlist;
hostlist = host;
static int read_diskline()
{
- host_t *host;
+ am_host_t *host;
disk_t *disk;
dumptype_t *dtype;
interface_t *netif = 0;
disk->auth = dtype->auth;
disk->maxdumps = dtype->maxdumps;
disk->maxpromoteday = dtype->maxpromoteday;
+ disk->bumppercent = dtype->bumppercent;
+ disk->bumpsize = dtype->bumpsize;
+ disk->bumpdays = dtype->bumpdays;
+ disk->bumpmult = dtype->bumpmult;
disk->start_t = dtype->start_t;
disk->strategy = dtype->strategy;
+ disk->estimate = dtype->estimate;
disk->compress = dtype->compress;
disk->comprate[0] = dtype->comprate[0];
disk->comprate[1] = dtype->comprate[1];
skip_whitespace(s, ch);
fp = s - 1;
if(ch && ch != '#') { /* get optional spindle number */
+ char *fp1;
+ int is_digit=1;
+ skip_non_whitespace(s, ch);
+ s[-1] = '\0';
+ fp1=fp;
+ if (*fp1 == '-') fp1++;
+ for(;*fp1!='\0';fp1++) {
+ if(!isdigit(*fp1)) {
+ is_digit = 0;
+ }
+ }
+ if(is_digit == 0) {
+ parserror("non-integer spindle `%s'", fp);
+ if(host == NULL) amfree(hostname);
+ amfree(disk->name);
+ amfree(disk);
+ return 1;
+ }
disk->spindle = atoi(fp);
skip_integer(s, ch);
}
/* success, add disk to lists */
if(host == NULL) { /* new host */
- host = alloc(sizeof(host_t));
+ host = alloc(sizeof(am_host_t));
malloc_mark(host);
host->next = hostlist;
hostlist = host;
dump_disklist()
{
disk_t *dp, *prev;
- host_t *hp;
+ am_host_t *hp;
if(hostlist == NULL) {
printf("DISKLIST not read in\n");