TIP: Click on subject to list as thread! ANSI
echo: fidosoft.husky
to: All
from: Markus Reschke
date: 2013-12-16 20:05:42
subject: htick: rename option #2

Hello!

And the modifications to create proper reports including the new filename
and the original one from the TIC:

In file htick/src/report.c in function doSaveTic4Report() insert after
    fprintf(tichandle,"File %s\r\n",tic->file);
following:
>   if (tic->altfile != NULL) fprintf(tichandle,"AltFile 
>   if (tic->%s\r\n",tic->altfile);

In file htick/src/report.c in function  getReportInfo() insert after
    Report[rCount].file = sstrdup( tmptic.file );
the line:
>   Report[rCount].altfile = sstrdup(tmptic.altfile);

In file htick/src/report.c in function ReportOneFile() insert after
    char *tmp = NULL;
the line:
>   char *name;
and change
<   if(strlen(tic->file) > 12)
<       xscatprintf(&(msg->text)," %s\r% 23s ",
<       tic->file,
<       PrintBigSize(&bs)
<       );
<   else
<       xscatprintf(&(msg->text)," %-12s % 9s ",
<       tic->file,  
<       PrintBigSize(&bs)
<       );
into:
>   if (tic->altfile != NULL) name = tic->altfile;
>   else name = tic->file;
>   if(strlen(name) > 12)
>       xscatprintf(&(msg->text)," %s\r% 23s ",
>       name,
>       PrintBigSize(&bs)
>       );
>   else
>       xscatprintf(&(msg->text)," %-12s % 9s ",
>       name,  
>       PrintBigSize(&bs)
>       );

Also add after
    if (pRepDef->annfrfrom && tic->from.zone!=0) {
       xscatprintf(&(msg->text), "%sFrom:
%s\r",print_ch(24, ' '),aka2str(tic->from));
    }
following lines:
>   if (tic->altfile != NULL)
>   {
>     xscatprintf(&(msg->text), "%sTIC: %s\r",
print_ch(24, ' '), tic->file);
>   }


In file htick/src/toss.c at the top area replace
< /* tic keywords calculated crc */
with:
> /* tic keywords calculated crc (CCITT-16, polynom 0x1021) */
and insert after
  #define CRC_FILE         0x9AF9 /*0x1A66*/
the line:
  #define CRC_ALTFILE      0x02B3 /* "ALTFILE" */

In file htick/src/toss.c in function parseTic() insert after
     case CRC_FILE:      tic->file = sstrdup(param);
       break;
following:
     case CRC_ALTFILE:   tic->altfile = sstrdup(param);  /* just for reports */
       break;


The report will list the filename used for the filebase because that's the
one that will be requested. If the file is renamed the report will also
state the original name below the file description similar to the optional
Orig/From lines.

Regards,
Markus

--- 
* Origin: *** theca tabellaria *** (2:240/1661)
SEEN-BY: 3/0 633/267 640/954 712/0 550 848
@PATH: 240/1661 1120 2432/200 240/2188 5832 280/464 712/848 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.