|
|
1.1 root 1: #include <stdio.h>
2: #include <curses.h>
3: #include "contents.h"
4: #include "maillist.h"
5:
6: void display_mail (master_win,win3,row,col,screen_num)
7: WINDOW *master_win, *win3;
8: int row, col, screen_num;
9:
10: {
11: FILE *infp;
12: char choice = '\0';
13:
14: if((infp=fopen(workfile,"r")) == NULL)
15: {
16: noraw();
17: endwin();
18: printf("(mail)ADD_DEL_SCREEN: could'nt open file for input!\n");
19: exit(1);
20: }
21:
22: /* draw entry template */
23: add_del_screen(master_win);
24:
25: /* get the desired record */
26: fseek(infp,MAIL_FORMULA,0l);
27: fread(&mail_rec,sizeof(struct mail),1,infp);
28:
29:
30: /* print the info from this record */
31: wstandout(master_win);
32:
33: wmove(master_win,SITEHI);
34: waddstr(master_win,mail_rec.site);
35:
36: wmove(master_win,LOGHI);
37: waddstr(master_win,mail_rec.login);
38:
39: wmove(master_win,STATEHI);
40: waddstr(master_win,mail_rec.state);
41:
42: wmove(master_win,CITYHI);
43: waddstr(master_win,mail_rec.city);
44:
45: wstandend(master_win);
46: wrefresh(master_win);
47: fclose(infp);
48:
49:
50:
51: /* prompt the user to delete the record */
52:
53: wclear(win3);
54: wmove(win3,0,0);
55: waddstr(win3,"Press [y] to delete, or");
56: wmove(win3,1,0);
57: waddstr(win3,"any other to abort.");
58: wrefresh(win3);
59:
60:
61: while(choice == '\0')
62: choice = wgetch(win3);
63:
64:
65: /* if the user really chose to delete the record, then call del_rec */
66:
67: if ((choice == 'y') || (choice == 'Y'))
68: {
69: wclear(win3);
70: wrefresh(win3);
71: del_rec(win3,row,col,screen_num);
72: }
73:
74: wclear(master_win);
75: wrefresh(master_win);
76: wclear(win3);
77: wmove(win3,1,0);
78: waddstr(win3,"Press <RETURN>");
79: wrefresh(win3);
80: while (13 != wgetch(win3));
81:
82: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.