home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1990 Jay Konigsberg - see Makefile for details
- * This is Free Software, distrubited under the GNU Software Aggrement.
- */
-
- #include "simped.h"
-
- char **deleteline(text, count, delline)
- char **text;
- int *count;
- int delline; /* returns the line number deleted or 0 */
- {
- int printf(),
- fflush(),
- puts(),
- fputs();
-
- void free();
-
- int inpchar=0,
- loop;
-
- if(delline > 0)
- {
- printf("\n%3d> ",delline);
- fputs(text[delline-1], stdout);
- fputs("Delete this line (Return=n/y): ", stdout);
- fflush(stdout);
- inpchar=getchar();
- putchar(inpchar);
- }
-
- if (inpchar == 'y' || inpchar == 'Y')
- {
- free(text[delline-1]);
- for(loop=delline-1; loop < *count-1; ++loop)
- {
- text[loop] = text[loop+1];
- }
- text[loop]=NULL;
- --*count;
- puts("\nLine deleted.");
- }
- else
- {
- puts("\nLine NOT deleted.");
- }
- return(text);
- }
-