home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************/
- /* */
- /* Demo of how to use capture files from SALT, as well as how */
- /* to access some internal script variables for color, etc... */
- /* */
- /* Copyright 1995 deltaComm Development, Inc. */
- /* */
- /****************************************************************/
-
- main()
- {
- int ff, a;
- str dat[16];
-
- capture("captfile.cap"); // Open capture file
-
- msgbox("", "Closing capture file will exit Telix", 0);
-
- while ((capture_stat > 0)) // While the capture log is open
- terminal(); // do terminal emulation....
-
- // as soon as capture is closed...
- ff=_back_color; // let's monkey with the colors!
- _back_color=_fore_color; // Here, we invert the video!
- _fore_color=ff; // But remember, color changes
- update_term(); // don't happen until we do this
-
- while (cinp_cnt()) // While there are chars waiting to
- cgetc(); // be received, go get them. This
- // is just a way to clear buffers
-
- if (carrier()) // If we're online right now, then
- { // tell us a little bit about
- printsc("Baud rate: "); // yourself, Ms. Remote....
- prints(get_baud());
- printsc("Data Bit: "); // Sure, Chuck, I have 8 bits...
- prints(get_datab());
- printsc("Parity: ");
- prints(get_parity());
- printsc("Port: ");
- prints(get_port());
- printsc("Stop Bit: ");
- prints(get_stopb());
- hangup(); // Sorry, no love connection
- }
-
- if (filefind("captfile.cap", a)) // Find our capture file
- {
- ff=fopen("captfile.cap", "r"); // Open file to get a handle on it
- if (ferror(ff)) fclearerr(ff); // Clear any errors with the file
-
- printsc("file attribute code: "); // Display various file variables
- printn(fileattr("captfile.cap"));
- printsc("File size: ");
- printn(filesize("captfile.cap"));
- date(filetime("captfile.cap"), dat);
- prints(dat);
- fclose(ff); // Close and release file
- }
-
- if (usage_stat()) // Check if usage log open
- {
- ustamp("Telix stopped by 'Capture Watcher' script.", 1, 0);
- usagelog("*CLOSE*");
- }
-
- printer(0); // Deactivate printer log
- exittelix(0, 1); // Close Telix
- }
-