home *** CD-ROM | disk | FTP | other *** search
- /*---------------------------------------------------------------------------*/
- /* */
- /* Module Name: AMAXPOLL.C */
- /* Program Name: AMAX */
- /* Revision: 2.xx */
- /* Purpose: Poll Generation Module */
- /* Programmer: Alan D. Bryant */
- /* */
- /* Copyright (C) 1988, 89, 90, 92 Alan D. Bryant, All Rights Reserved. */
- /* */
- /* NOTICE: This source code is copyrighted material. You are granted a */
- /* limited license to use and distribute the code. The complete text of */
- /* the license can be found in the document LICENSE.DOC which accompanies */
- /* this source code, or can be obtained directly from the author. */
- /* */
- /* Inquiries regarding this package should be directed to: */
- /* */
- /* AMAX */
- /* Alan D. Bryant */
- /* P. O. Box 101612 */
- /* Denver, CO 80250 */
- /* USA */
- /* */
- /*---------------------------------------------------------------------------*/
-
- #include <stdio.h>
- #include <dir.h>
- #include "amax.h"
-
-
- void poll();
-
- void poll()
- {
- FILE *stream;
-
- unsigned char system[50] = "";
- unsigned char hexname[15] = "";
- unsigned char pass[70] = "";
- unsigned char out[100] = "";
- unsigned char info[70] = "";
- unsigned char input[50] = "";
-
- unsigned char ch;
- char done = 0;
-
- int to_net;
- int to_node;
-
- struct ffblk ffblk;
-
- cls();
- output("$1AMAX $4Build Attach to Poll a System$0");
-
- while (! done) {
- bottomcls(2);
- cursor(2, 0);
-
- input[0] = 0x00;
- output("Destination System <net/node> ");
- vpanel(45);
- getln(input, 45);
-
- if (strlen(input) == 0) return;
-
- strcpy(system, input);
-
- if (strchr(system, '/') == NULL) {
- strcpy(system, findaddress(input));
- if (strlen(system) == 0) {
- output("\r\nExpected a Sysop name or node address in the form NET/NODE...press a key...");
- agetch();
- return;
- }
- }
-
- strcpy(hexname, parseaddress(system));
-
- to_net = extractnet(hexname);
- to_node = extractnode(hexname);
-
- strcpy(info, lookinfo(to_net, to_node, 0));
- sprintf(out, " Looks Like: %s\r\n\r\n", info);
- if (usenl) output(out);
-
- output("Correct? ");
- ch = menu_select("YN\r\x1B");
- if (ch == 0x1B) continue;
- if (ch == 'Y' || ch == '\r') {
- output("Yes\r\n\r\n");
- }
- else {
- output("No\r\n\r\n");
- output("Aborting...");
- pressanykey();
- continue;
- }
-
- strcpy(pass, outbound);
- strcat(pass, hexname);
- strcat(pass, ".?LO");
-
- if (findfirst(pass, &ffblk, 0) != 0) {
- output("Creating poll...\r\n\r\n");
- strcpy(pass, outbound);
- strcat(pass, hexname);
- strcat(pass, ".CLO");
- stream = fopen(pass, "a+b");
- if (stream == NULL) {
- output("Cannot open poll file...");
- pressanykey();
- continue;
- }
- fclose(stream);
- continue;
- }
- else {
- sprintf(out, "Looks like something is already en route to %d/%d.\r\n", to_net, to_node);
- output(out);
- output("Try initiating a manual poll...");
- pressanykey();
- continue;
- }
-
- }
- }
-