home *** CD-ROM | disk | FTP | other *** search
-
- ////////////////////////////////////////////////////////////////////////////////
- // TLXHSL01.SLT //
- // //
- // Telix Script to use HS/Link transfer protocol and //
- // generate a more informative "Log File"... //
- // //
- // This script is designed assuming you have defined //
- // an environment variable for "DSZLOG" in your AUTOEXEC.BAT //
- // and that you are using a Telix Usage Log file... //
- // //
- // Consult the "DOCs" for Telix, HS/Link, and DOS if //
- // you have any questions regarding these variables. //
- // //
- // Written for the "Public Domain" by: Mr. Jiggs //
- // //
- // Fotobeam/Brookside, Inc. //
- // 260 Lexington St. //
- // Waltham, Ma 02254-4613 //
- // Voice: (617) 893-1600 //
- // Fax: (617) 893-9951 //
- // BBS: (617) 893-6812 //
- // //
- ////////////////////////////////////////////////////////////////////////////////
-
- main () {
- str Switches[255], HS_Use[65], Baud_Rate[10], Port_Num[2];
- int Test_Val;
-
- itos(get_baud(),Baud_Rate); // Get the Baud Rate, save as Baud_Rate
- itos(get_port(),Port_Num); // Get the Com Port#, save as Port_Num
-
- // Build the command line extension to the HSLINK command... //
-
- Switches=" -E";
- strcat(Switches, Baud_Rate);
- strcat(Switches, " -P");
- strcat(Switches, Port_Num);
- strcat(Switches, " ");
- strcat(Switches,_ext_filespec);
-
- if (getenv("DSZLOG", HS_Use)) { // Check for existence of the //
- frename(HS_Use, "DSZLOG.ORG"); // DSZLOG Log File (from DOS) //
- Open_DSZ_Log (); // Rename it to "DSZLOG.ORG" //
- } // and open a new one for this //
- else // transfer... //
- prints("No DSZLOG File found !");// Otherwise print this message //
- // on the screen... //
-
- run("HSLINK", Switches, 0); // Execute the HS/Link Program //
-
- if (getenv("DSZLOG", HS_Use)) { // Check that log's still there //
- Transfer_to_Telix_Log(); // then move the information //
- fdelete(HS_Use); // into the Telix Log File and //
- frename("DSZLOG.ORG", HS_Use); // delete the new DSZLOG, and //
- } // finally restore orig DSZLOG //
-
- }
-
- Open_DSZ_Log () {
- str Entry_ID[128], Entry_Stripe[128], Stripe[128];
- str Entry_Date[16], Entry_Time[16], DSZ_Log_File[65];
- int Loop, Open_File;
-
- getenv("DSZLOG",DSZ_Log_File); // Check that log's still there //
-
- date(curtime(),Entry_Date); // Put the date into Entry_Date //
- time(curtime(),Entry_Time); // Put the time into Entry_Time //
-
- Stripe = "═";
- for (Loop = 0; Loop < 128; ++Loop)
- strcat(Stripe, "═");
-
- Entry_ID = "HS/Link with "; // Create an Entry Divider ID //
-
- strcat(Entry_ID,_entry_name); // with the BBS name //
- strcat(Entry_ID," (at ");
- strcat(Entry_ID,_entry_num); // and Phone Number //
- strcat(Entry_ID,") begun on ");
- strcat(Entry_ID,Entry_Date); // and Date //
- strcat(Entry_ID," at ");
- strcat(Entry_ID,Entry_Time); // and Time //
- substr(Stripe,0,strlen(Entry_ID),Entry_Stripe);
-
- if ( (Open_File = fopen(DSZ_Log_File,"a")) == 0)
- prints("Couldn't open the Log File !");
- else {
- fputc(10,Open_File); // Write the Divider ID to the //
- fputs(Entry_ID,Open_File); // new DSZLOG file... //
- fputc(10,Open_File);
- fputs(Entry_Stripe,Open_File);
- fputs(Stripe,Open_File);
- fputc(10,Open_File);
- fclose(Open_File);
- }
- }
-
- Transfer_to_Telix_Log() {
-
- str HS_Link_File[65], HS_Detail[255];
- int File_Handle;
-
- getenv("DSZLOG",HS_Link_File);
-
- if ( (File_Handle = fopen(HS_Link_File,"r")) != 0) { // If you can //
- while (!feof(File_Handle)) { // open the file //
- fgets(HS_Detail, 255, File_Handle);// for reading then//
- ustamp(HS_Detail, 0, 1); // read until the //
- HS_Detail = ""; // "eof", putting //
- } // the info into //
- fclose(File_Handle); // the Telix Log //
- }
-
- }
-