Annotation of cci/sys/stand/vdfmt/delete.c, revision 1.1.1.1

1.1       root        1: #include       "vdfmt.h"
                      2: #include       "cmd.h"
                      3: 
                      4: /*
                      5: **
                      6: */
                      7: static int     line = 0;
                      8: 
                      9: 
                     10: delete_help()
                     11: {
                     12:        indent();
                     13:        print("The following commands are available:\n");
                     14:        indent();
                     15:        print("STATus - Display formatter state.\n");
                     16:        print("QUIT   - Terminate current operation.\n");
                     17:        print("");
                     18:        print("Any line number between 0 and %d may be entered.\n", line-1);
                     19:        print("");
                     20:        exdent(2);
                     21: }
                     22: 
                     23: 
                     24: delete()
                     25: {
                     26:        register int    ctlr, drive;
                     27:        int             *table[(MAXCTLR * MAXDRIVE) + 50];
                     28:        int             list[(MAXCTLR * MAXDRIVE) + 50];
                     29:        int             tokens[(MAXCTLR * MAXDRIVE) + 50];
                     30:        int             *tok;
                     31: 
                     32:        indent();
                     33:        indent();
                     34:        line = 0;
                     35:        for(ctlr=0; ctlr<MAXCTLR; ctlr++)
                     36:                for(drive=0; drive<MAXDRIVE; drive++)
                     37:                        if(ops_to_do[ctlr][drive].op) {
                     38:                                table[line] = &ops_to_do[ctlr][drive].op;
                     39:                                list[line] = line;
                     40:                                print("%d) ", line++);
                     41:                                display_operations(ctlr, drive);
                     42:                        }
                     43:        list[line] = -1;
                     44:        exdent(1);
                     45:        if(line > 1) {
                     46:                for(;;) {
                     47:                        print("Delete line? ");
                     48:                        get_digit_list(tokens, list, delete_help);
                     49:                        if(kill_processes == true) {
                     50:                                kill_processes = false;
                     51:                                break;
                     52:                        }
                     53:                        indent();
                     54:                        tok = tokens;
                     55:                        for(tok=tokens; *tok != -1; tok++) {
                     56:                                if(*table[*tok] != 0) {
                     57:                                        print("Line %d has been deleted.\n",*tok);
                     58:                                        *table[*tok] = 0;
                     59:                                }
                     60:                        }
                     61:                        exdent(1);
                     62:                }
                     63:        }
                     64:        else if(line == 1) {
                     65:                print("Line 0 deleted since it was the only line possible.\n");
                     66:                *table[0] = 0;
                     67:        }
                     68:        else {
                     69:                print("Nothing to delete.\n");
                     70:        }
                     71:        exdent(1);
                     72: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.