|
|
1.1 ! root 1: #include "vdfmt.h" ! 2: ! 3: ! 4: /* ! 5: ** Lists all the operations specified so far. ! 6: */ ! 7: ! 8: list() ! 9: { ! 10: register int ctlr, drive; ! 11: boolean can_do = false; ! 12: ! 13: /* Determine if there are any operations to do */ ! 14: for(ctlr=0; ctlr<MAXCTLR; ctlr++) ! 15: for(drive=0; drive<MAXDRIVE; drive++) { ! 16: if(ops_to_do[ctlr][drive].op) ! 17: can_do = true; ! 18: } ! 19: if(can_do == false) { ! 20: indent(); ! 21: print("There are no operations to list!\n\n"); ! 22: exdent(1); ! 23: return; ! 24: } ! 25: indent(); ! 26: print("The following operations will occur when Start is issued:\n"); ! 27: indent(); ! 28: for(ctlr=0; ctlr<MAXCTLR; ctlr++) ! 29: for(drive=0; drive<MAXDRIVE; drive++) ! 30: if(ops_to_do[ctlr][drive].op != 0) { ! 31: print(""); /* force an indent */ ! 32: display_operations(ctlr, drive); ! 33: } ! 34: exdent(2); ! 35: } ! 36: ! 37: ! 38: /* ! 39: ** ! 40: */ ! 41: ! 42: display_operations(ctlr, drive) ! 43: register int ctlr, drive; ! 44: { ! 45: print_op_list(ops_to_do[ctlr][drive].op); ! 46: printf(": Controller %d, drive %d", ctlr, drive); ! 47: printf(", type %s.\n", d_info[ctlr][drive].info->type_name); ! 48: } ! 49: ! 50: ! 51: /* ! 52: ** ! 53: */ ! 54: ! 55: print_op_list(ops) ! 56: int ops; ! 57: { ! 58: register int cur_op; ! 59: char *prefix = ""; ! 60: ! 61: for(cur_op=0; cur_op<NUMOPS; cur_op++) { ! 62: if(ops & (1 << cur_op)) { ! 63: printf("%s%s", prefix, operations[cur_op].op_name); ! 64: prefix = ", "; ! 65: } ! 66: } ! 67: } ! 68:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.