🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #54442

Re: Score file log for slrn ? -> man diff

#54442
From: jamie
Date: Mon, 22 Nov 1999 00:00
155 lines
5224 bytes
Sven Guckes <guckes@math.fu-berlin.de> wrote:
>* Mike Mckinney <mike@mike.local.net>:
>> Sometime back, for a previous version of slrn, someone
>> wrote a patch to have slrn generate a Score file log.
>> Does anyone know if such a patch is
>> available for current versions of slrn ?
>
>Well, what would that patch do other than using "diff"?

The original patch's diffs are too different from the current version
files to successfully patch them.  At Mike's request, I just rebuilt
Ollie's  "kill log" patch for slrn 0.9.5.7, using the original patch
as a guide.

The setting for this in the .slrnrc file would be
  set kill_log "News/killlog"
or whatever you set your news dir and kill log file to be.

------Cut here for slrnkilllog957.patch--------------
--- art.c.orig	Mon Nov 22 10:34:43 1999
+++ art.c	Mon Nov 22 11:24:14 1999
@@ -158,6 +158,10 @@
 
 Slrn_Article_Line_Type *Slrn_Article_Lines;
 
+#if SLRN_HAS_KILL_LOG
+char *Slrn_Kill_Log = NULL;
+#endif
+
 /*}}}*/
 /*{{{ static global variables */
 static SLscroll_Window_Type Slrn_Article_Window;
@@ -227,6 +231,9 @@
  * points at the current article, the we are at the end of that article.
  * If it points anywhere else, ignore it.
  */
+#if SLRN_HAS_KILL_LOG
+static FILE *fp_killlog = NULL;
+#endif
 
 /*}}}*/
 /*{{{ static function declarations */
@@ -5440,8 +5447,15 @@
      }
    else if (score < Slrn_Low_Score_Max)
      {
-	if ((score <= Slrn_Kill_Score_Max) && apply_kill)
-	  {
+       int kill_art = ((score <= Slrn_Kill_Score_Max) && apply_kill);
+#if SLRN_HAS_KILL_LOG
+       if (fp_killlog != NULL)
+        fprintf( fp_killlog, "[%s]\nScore: %d%s\nFrom: %s\nSubject: %s\n"
+                 "Message-ID: %s\n\n", Slrn_Current_Group_Name, score,
+                 kill_art?" (killed)":"", h->from, h->subject, h->msgid );
+#endif
+       if (kill_art)
+	     {
 	     int number = h->number;
 	     free_header (h);
 	     add_to_kill_list (number);
@@ -7437,7 +7451,16 @@
 #endif
    
    if (score && (1 == slrn_open_score (Slrn_Current_Group_Name)))
-     Perform_Scoring = 1;
+     {
+#if SLRN_HAS_KILL_LOG
+       if ((Slrn_Kill_Log != NULL) && (fp_killlog == NULL))
+         {
+            char file[SLRN_MAX_PATH_LEN];
+            fp_killlog = slrn_open_home_file( Slrn_Kill_Log, "a", file, 1 );
+         }
+#endif
+       Perform_Scoring = 1;
+     }
    else Perform_Scoring = 0;
    
    Slrn_Server_Min = r->min;
@@ -7578,7 +7601,23 @@
    else if (Slrn_Score_After_XOver 
        && Perform_Scoring)
      score_headers ();
-   
+
+#if SLRN_HAS_KILL_LOG
+   if (fp_killlog)
+     {
+       fprintf( fp_killlog, "[%s] killed %u, high %u, low %u\n\n",
+               Slrn_Current_Group_Name, Number_Killed,
+               Number_High_Scored, Number_Low_Scored );
+
+# if 0 /* could close file, but just flushing saves time entering a group */
+       fclose( fp_killlog );
+       fp_killlog = NULL;
+# else
+       fflush( fp_killlog ); /* flush buffer to disk */
+# endif
+     }
+#endif
+
    if (Headers == NULL)
      {
 	slrn_close_score ();
--- art.h.orig	Mon Nov 22 10:42:04 1999
+++ art.h	Mon Nov 22 10:43:12 1999
@@ -62,6 +62,9 @@
 extern int Slrn_Sig_Is_End_Of_Article;
 extern int Slrn_Del_Article_Upon_Read;
 extern int Slrn_Followup_Strip_Sig;
+#if SLRN_HAS_KILL_LOG
+extern char *Slrn_Kill_Log;
+#endif
 
 #endif				       /* NOT SLRNPULL_CODE */
 
--- startup.c.orig	Mon Nov 22 10:44:11 1999
+++ startup.c	Mon Nov 22 10:50:43 1999
@@ -565,6 +565,14 @@
 	  NULL
 #endif
      },
+     {"kill_log",
+#if SLRN_HAS_KILL_LOG
+        &Slrn_Kill_Log
+#else
+       NULL
+#endif
+    },
+	     
      {"server_object", &Server_Object},
      {"post_object", &Post_Object},
      {"printer_name", &Slrn_Printer_Name},
--- slrnfeat.h.orig	Mon Nov 22 10:51:31 1999
+++ slrnfeat.h	Mon Nov 22 10:52:50 1999
@@ -61,6 +61,11 @@
  */
 #define SLRN_HAS_CHARACTER_MAP	1
 
+/* If you want to be able to generate a log of posts killed by the scorefile
+ * (i.e. given a score of -9999) set this to 1.
+ */
+#define SLRN_HAS_KILL_LOG      1
+
 /* If you want to use uudeview's uulib instead of slrn's builtin one
  * change this to 1.  You will also need to edit the Makefile to point to
  * the uudeview include file and and library.  Only enable this if you

-----end of slrnkilllog957.patch------

-- 
  jamie  (mjwm@austin.rr.com)

  		"There's a seeker born every minute."

Technical Details
Message-ID: <slrn83j0q5.ano.jamie@bozo2.local.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <slrn83bgd8.4iu.mike@mike.local.net> <81bt7k$1m7gb$1@fu-berlin.de>

Show Full Headers
Complete Article Headers
Message-ID: <slrn83j0q5.ano.jamie@bozo2.local.net>
Subject: Re: Score file log for slrn ? -> man diff
Date: Mon, 22 Nov 1999 00:00:00 +0000
From: jamie@bozo2.local.net (jamie)
References: <slrn83bgd8.4iu.mike@mike.local.net> <81bt7k$1m7gb$1@fu-berlin.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 551731429
X-Acto-knife: sharp
Organization: http://extra.newsguy.com
X-Files-fan: yes
User-Agent: slrn/0.9.5.7 (UNIX)
Reply-To: mjwm@austin.rr.com
Newsgroups: news.software.readers