|
|
1.1 root 1: /* map_command.c
2: * This will pull a map entry from a specified file and build the
3: * necessary command to download the map from mwcbbs.
4: */
5:
6: #include <stdio.h>
7: #include <curses.h>
8: #include "contents.h"
9: #include "maillist.h"
10:
11: void map_command (win2,row, col, screen_num)
12: WINDOW *win2;
13: int row, col, screen_num;
14: {
15: FILE *infp;
16: char mapcommand[78];
17: char choice = '\0';
18:
19: if ((infp=fopen(workfile,"r"))==NULL)
20: {
21: noraw();
22: endwin();
23: printf("Error opening file: %s for input!\n",workfile);
24: exit(1);
25: }
26:
27: fseek(infp,MAP_FORMULA,0l);
28: fread(&map_rec,sizeof(struct map),1,infp);
29:
30: strcpy(mapcommand,HOST);
31: strcat(mapcommand, map_rec.path);
32: strcat(mapcommand, recdir);
33:
34: wclear(win2);
35: wmove(win2,0,1);
36: wprintw(win2,"The following command will be used to download %s",
37: map_rec.name);
38: wmove(win2,5,1);
39: waddstr(win2,mapcommand);
40:
41: wmove(win2,17,1);
42: waddstr(win2,"Press [y] to download this file");
43: wmove(win2,18,1);
44: waddstr(win2,"or any other key to cancel.");
45: wrefresh(win2);
46:
47: while (choice == '\0')
48: choice = wgetch(win2);
49:
50: if((choice == 'y') || (choice == 'Y'))
51: system(mapcommand);
52: wclear(win2);
53: wrefresh(win2);
54:
55: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.