[eggheads-patches] PATCH: rmoldtcl.patch

Peter 'Rattacresh' Backes rtc at rhrk.uni-kl.de
Sun Oct 10 19:56:29 CST 1999


* Removed obsolete tcl_set/getdn/uploads
* functions set_handle_up/dnloads removed from source (were marked as 
'stupid backwards compat functions')


-- Peter 'Rattacresh' Backes, rtc at rhrk.uni-kl.de

-------------- next part --------------
diff -urN eggdrop1.3.29/doc/UPDATES1.3 eggdrop1.3.29+rmoldtcl/doc/UPDATES1.3
--- eggdrop1.3.29/doc/UPDATES1.3	Sun Oct 10 13:47:30 1999
+++ eggdrop1.3.29+rmoldtcl/doc/UPDATES1.3	Sun Oct 10 13:31:15 1999
@@ -4,6 +4,9 @@
 
 1.3.29
 Foundby   Fixedby   What....
+          rtc       removed tcl functions setuploads, getuploads, setdnloads
+                    and getdnloads and C functions set_handle_dnloads
+                    and set_handle_uploads
           dw        kicks weren't being logged
           rtc       added assert debugging feature
 	  Fabian    main() wasn't removing unknown sockets correctly
diff -urN eggdrop1.3.29/doc/tcl-commands.doc eggdrop1.3.29+rmoldtcl/doc/tcl-commands.doc
--- eggdrop1.3.29/doc/tcl-commands.doc	Sun Oct 10 13:47:30 1999
+++ eggdrop1.3.29+rmoldtcl/doc/tcl-commands.doc	Sun Oct 10 13:29:35 1999
@@ -1517,24 +1517,6 @@
       a sublist with two elements: nickname the file is being sent to, and
       the filename
 
-  setuploads <handle> <#uploads> <size-in-k>
-    sets a user's statistics on the number of files uploaded and the total
-      kilobytes uploaded
-    returns: nothing
-
-  getuploads <handle>
-    returns: list containing upload statistics for a user: the first
-      element is the number of files uploaded; the second element is the
-      total kilobytes uploaded
-
-  setdnloads <handle> <#dnloads> <size-in-k>
-    like setuploads, but sets the download statistics
-    returns: nothing
-
-  getdnloads <handle>
-    returns: list containing download statistics, in the same format
-      as getuploads
-
   mkdir <directory> [required-flags]
     creates a directory in the files system, only users with the
     required flags may access
diff -urN eggdrop1.3.29/src/mod/filesys.mod/files.c eggdrop1.3.29+rmoldtcl/src/mod/filesys.mod/files.c
--- eggdrop1.3.29/src/mod/filesys.mod/files.c	Sun Oct 10 13:47:32 1999
+++ eggdrop1.3.29+rmoldtcl/src/mod/filesys.mod/files.c	Sun Oct 10 13:29:35 1999
@@ -1172,6 +1172,7 @@
 static int cmd_filestats(int idx, char *par)
 {
   char *nick;
+  struct userrec *u;
 
   context;
   if (!par[0]) {
@@ -1182,12 +1183,11 @@
   putlog(LOG_FILES, "*", "#%s# filestats %s", dcc[idx].nick, nick);
   if (nick[0] == 0)
     tell_file_stats(idx, dcc[idx].nick);
-  else if (!get_user_by_handle(userlist, nick))
+  else if (!(u = get_user_by_handle(userlist, nick)))
     dprintf(idx, "No such user.\n");
   else if (!strcmp(par, "clear") && dcc[idx].user &&
 	   (dcc[idx].user->flags & USER_JANITOR)) {
-    set_handle_uploads(userlist, nick, 0, 0);
-    set_handle_dnloads(userlist, nick, 0, 0);
+    set_user (&USERENTRY_FSTAT, u, NULL);
     dprintf(idx, "Cleared filestats for %s.\n", nick);
   } else
     tell_file_stats(idx, nick);
diff -urN eggdrop1.3.29/src/mod/filesys.mod/filesys.c eggdrop1.3.29+rmoldtcl/src/mod/filesys.mod/filesys.c
--- eggdrop1.3.29/src/mod/filesys.mod/filesys.c	Sun Oct 10 13:47:32 1999
+++ eggdrop1.3.29+rmoldtcl/src/mod/filesys.mod/filesys.c	Sun Oct 10 13:29:35 1999
@@ -882,40 +882,3 @@
   return dccdir[0];
 }
 
-/* 2 stupid backward compatability functions */
-/* set upload/dnload stats for a user */
-static void set_handle_uploads(struct userrec *bu, char *hand,
-			       unsigned int ups, unsigned long upk)
-{
-  struct userrec *u = get_user_by_handle(bu, hand);
-  struct user_entry *ue = find_user_entry(&USERENTRY_FSTAT, u);
-  register struct filesys_stats *fs = NULL;
-
-  if (ue)
-    fs = ue->u.extra;
-  if (!fs) {
-    fs = user_malloc(sizeof(struct filesys_stats));
-    bzero(fs, sizeof(struct filesys_stats));
-  }
-  fs->uploads = ups;
-  fs->upload_ks = upk;
-  set_user(&USERENTRY_FSTAT, u, fs);
-}
-
-static void set_handle_dnloads(struct userrec *bu, char *hand,
-			       unsigned int dns, unsigned long dnk)
-{
-  struct userrec *u = get_user_by_handle(bu, hand);
-  struct user_entry *ue = find_user_entry(&USERENTRY_FSTAT, u);
-  register struct filesys_stats *fs = NULL;
-
-  if (ue)
-    fs = ue->u.extra;
-  if (!fs) {
-    fs = user_malloc(sizeof(struct filesys_stats));
-    bzero(fs, sizeof(struct filesys_stats));
-  }
-  fs->dnloads = dns;
-  fs->dnload_ks = dnk;
-  set_user(&USERENTRY_FSTAT, u, fs);
-}
diff -urN eggdrop1.3.29/src/mod/filesys.mod/filesys.h eggdrop1.3.29+rmoldtcl/src/mod/filesys.mod/filesys.h
--- eggdrop1.3.29/src/mod/filesys.mod/filesys.h	Sun Oct 10 13:47:32 1999
+++ eggdrop1.3.29+rmoldtcl/src/mod/filesys.mod/filesys.h	Sun Oct 10 13:29:35 1999
@@ -31,10 +31,6 @@
 static int files_get(int, char *, char *);
 static void files_setpwd(int, char *);
 static int resolve_dir(char *, char *, char *, int);
-static void set_handle_uploads(struct userrec *bu, char *hand,
-			       unsigned int ups, unsigned long upk);
-static void set_handle_dnloads(struct userrec *bu, char *hand,
-			       unsigned int dns, unsigned long dnk);
 #else
 #define H_fil (*(p_tcl_hash_list *)(filesys_funcs[8]))
 #endif
diff -urN eggdrop1.3.29/src/mod/filesys.mod/tclfiles.c eggdrop1.3.29+rmoldtcl/src/mod/filesys.mod/tclfiles.c
--- eggdrop1.3.29/src/mod/filesys.mod/tclfiles.c	Sun Oct 10 13:47:32 1999
+++ eggdrop1.3.29+rmoldtcl/src/mod/filesys.mod/tclfiles.c	Sun Oct 10 13:29:35 1999
@@ -540,56 +540,6 @@
   return TCL_OK;
 }
 
-static int tcl_getuploads STDVAR
-{
-  struct userrec *u;
-  struct filesys_stats *fs;
-  char s[81];
-
-  BADARGS(2, 2, " handle");
-  u = get_user_by_handle(userlist, argv[1]);
-  if (u) {
-    fs = get_user(&USERENTRY_FSTAT, u);
-    if (fs) {
-      sprintf(s, "%u %u", fs->uploads, fs->upload_ks);
-      Tcl_AppendResult(irp, s, NULL);
-    }
-  }
-  return TCL_OK;
-}
-
-static int tcl_getdnloads STDVAR
-{
-  struct userrec *u;
-  struct filesys_stats *fs;
-  char s[81];
-
-  BADARGS(2, 2, " handle");
-  u = get_user_by_handle(userlist, argv[1]);
-  if (u) {
-    fs = get_user(&USERENTRY_FSTAT, u);
-    if (fs) {
-      sprintf(s, "%u %u", fs->dnloads, fs->dnload_ks);
-      Tcl_AppendResult(irp, s, NULL);
-    }
-  }
-  return TCL_OK;
-}
-
-static int tcl_setuploads STDVAR
-{
-  BADARGS(4, 4, " handle files k");
-  set_handle_uploads(userlist, argv[1], atoi(argv[2]), atoi(argv[3]));
-  return TCL_OK;
-}
-
-static int tcl_setdnloads STDVAR
-{
-  BADARGS(4, 4, " handle files k");
-  set_handle_dnloads(userlist, argv[1], atoi(argv[2]), atoi(argv[3]));
-  return TCL_OK;
-}
-
 static tcl_cmds mytcls[] =
 {
   {"getdesc", tcl_getdesc},
@@ -608,10 +558,6 @@
   {"share", tcl_share},
   {"unshare", tcl_unshare},
   {"filesend", tcl_filesend},
-  {"getuploads", tcl_getuploads},
-  {"setuploads", tcl_setuploads},
-  {"getdnloads", tcl_getdnloads},
-  {"setdnloads", tcl_setdnloads},
   {"mkdir", tcl_mkdir},
   {"rmdir", tcl_rmdir},
   {"cp", tcl_cp},


More information about the Patches mailing list