|
|
1.1 ! root 1: /* Copyright Bell Telephone Laboratories Whippany, N.J. ! 2: ! 3: * *********************************** ! 4: * *********************************** ! 5: * ********** DELETE LINES *********** ! 6: * *** R. B. Drake WH 8C-005 X4163 *** ! 7: * **** Fri Aug 24 17:14:56 1979 ***** ! 8: * *********************************** ! 9: * *********************************** ! 10: * This routine is ! 11: * called by "bed" to delete lines either singly or in large batches ! 12: * on a single line delete, a copy of the line is saved in the array ! 13: * "temp" for possible restoration by the "undo" routine. ! 14: ! 15: */ ! 16: /* "@(#) delete.c: V 1.1 12/21/80" */ ! 17: #include "bas.h" ! 18: extern char temp[]; ! 19: extern int start,finish; ! 20: extern int line; ! 21: delete() ! 22: { ! 23: char *save; ! 24: if(expr[0] == '\0') ! 25: { ! 26: fetch(local.thing.linno,&lbdptr); ! 27: if(local.thing.linno != inst.thing.linno) ! 28: { ! 29: error(local.thing.linno,0); ! 30: return(-1); ! 31: } ! 32: /* save line for possible undo */ ! 33: expand(); ! 34: sprintf(temp,"%d %s %s\n\0",inst.thing.linno,decode(inst.thing.opcode.lobyte),linbuf); ! 35: line = inst.thing.linno; ! 36: save=curptr; ! 37: cover(lbdptr,curptr); ! 38: lbdptr=curptr=save; ! 39: return(0); ! 40: } ! 41: lnpars(); ! 42: if(finish == 0) ! 43: { ! 44: local.thing.linno = start; ! 45: expr[0] = '\0'; ! 46: delete(); ! 47: return(0); ! 48: } ! 49: if(fetch(start,&lbdptr) == -1) return(-1); ! 50: save = curptr; ! 51: fetch(finish,&lbdptr); ! 52: cover(lbdptr,save); ! 53: return(0); ! 54: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.