Category : Files from Magazines
Archive   : DDJSRC.ZIP
Filename : TESTEDIT.C

 
Output of file : TESTEDIT.C contained in archive : DDJSRC.ZIP
/* --------- testedit.c ------------ */
#include
#include
#include
#include "window.h"
#include "editor.h"

#define LNS 40 /* number of editor lines */
#define WD 60 /* length of an editor line */
#define LF (1+(80-WD)/2) /* leftmost column */
#define TP (1+(25-LNS/2)/2) /* top row */
#define RT LF+WD+1 /* rightmost column */
#define BT TP+LNS/2+1 /* bottom row */

char notes[LNS*WD];
void main(int, char **);

void main(int argc, char **argv)
{
FILE *fd;
if (argc > 1) {
setmem(notes, sizeof notes, ' ');
if ((fd = fopen(argv[1], "r")) != NULL) {
fread(notes, WD, LNS, fd);
fclose(fd);
}
clear_screen();
establish_window(LF,TP,RT,BT,TEXTFG,TEXTBG,FALSE);
if (text_editor(notes, LNS, WD) != ESC) {
fd = fopen(argv[1], "w");
fwrite(notes, WD, LNS, fd);
fclose(fd);
}
delete_window();
clear_screen();
set_cursor_type(0x0607);
}
}


  3 Responses to “Category : Files from Magazines
Archive   : DDJSRC.ZIP
Filename : TESTEDIT.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/