]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Remove duplicate function
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 29 Nov 2010 14:36:05 +0000 (14:36 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 29 Nov 2010 14:36:05 +0000 (14:36 +0000)
CMakeLists.txt
include/defs.h
include/info.h
report.c

index 314ac8870d580b41cf3c3b994efb97f66e9d5f8d..5218ea208a99a8f7c644de68c3ff336b0a587e4a 100755 (executable)
@@ -3,7 +3,7 @@ PROJECT(sarg C)
 SET(sarg_VERSION 2)
 SET(sarg_REVISION "3.2-pre1")
 SET(sarg_BUILD "")
-SET(sarg_BUILDDATE "Nov-28-2010")
+SET(sarg_BUILDDATE "Nov-29-2010")
 
 INCLUDE(AddFileDependencies)
 INCLUDE(CheckIncludeFile)
index ef18bb7e65a819246dfb9d679b5581381c6ab80e..86b837059e88fd56c0e703f7f5608e92d88c5a57 100755 (executable)
@@ -134,7 +134,6 @@ void realtime(void);
 void report_day(const struct userinfostruct *user);
 
 // report.c
-void gravatmp(const struct userinfostruct *uinfo, const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, int indexonly, long long int incache, long long int oucache);
 void gerarel(void);
 int ger_read(char *buffer,struct generalitemstruct *item,const char *filename);
 
index a397708dceaad828f35fde82cdc05de41e881a92..d8f9144a0d07f31b9f860fc79beff4a106c9bbbd 100755 (executable)
@@ -1,3 +1,3 @@
-#define VERSION PACKAGE_VERSION" Nov-28-2010"
+#define VERSION PACKAGE_VERSION" Nov-29-2010"
 #define PGM PACKAGE_NAME
 #define URL "http://sarg.sourceforge.net"
index 6f49e6d8217ea93014897ce34fdf0f3c13b98d60..aa53a3bd4cea416cdc73e1ac92583651688dcc9f 100644 (file)
--- a/report.c
+++ b/report.c
@@ -32,7 +32,7 @@ static FILE *fp_tt=NULL;
 static void maketmp(const char *user, const char *dirname, int debug, int indexonly);
 static void maketmp_hour(const char *user, const char *dirname, int indexonly);
 static void gravatmp_hora(const char *dirname, const struct userinfostruct *uinfo, const char *data, const char *hora, long long int elap, long long int accbytes, int indexonly);
-static void gravatmpf(const struct userinfostruct *uinfo, const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, int indexonly, long long int incache, long long int oucache);
+static void gravatmp(const struct userinfostruct *uinfo, const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, int indexonly, long long int incache, long long int oucache);
 static void gravaporuser(const struct userinfostruct *uinfo, const char *dirname, const char *url, const char *ip, const char *data, const char *hora, long long int tam, long long int elap, int indexonly);
 static void gravager(FILE *fp_gen, const struct userinfostruct *uinfo, long long int nacc, const char *url, long long int nbytes, const char *ip, const char *hora, const char *dia, long long int nelap, long long int incache, long long int oucache);
 static void grava_SmartFilter(const char *dirname, const char *user, const char *ip, const char *data, const char *hora, const char *url, const char *smart);
@@ -354,7 +354,7 @@ void gerarel(void)
          strcpy(oldmsg,"DENIED");
       else
          strcpy(oldmsg,"OK");
-      gravatmpf(puinfo,oldurl,nacc,nbytes,oldmsg,nelap,indexonly,incache,oucache);
+      gravatmp(puinfo,oldurl,nacc,nbytes,oldmsg,nelap,indexonly,incache,oucache);
       gravager(fp_gen,puinfo,nacc,oldurl,nbytes,oldaccip,oldacchora,oldaccdia,nelap,incache,oucache);
       free(oldurl);
    }
@@ -461,7 +461,7 @@ static void maketmp_hour(const char *user, const char *dirname, int indexonly)
 }
 
 
-void gravatmp(const struct userinfostruct *uinfo, const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, int indexonly, long long int incache, long long int oucache)
+static void gravatmp(const struct userinfostruct *uinfo, const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, int indexonly, long long int incache, long long int oucache)
 {
    FILE *fp_ou;
    char wdirname[MAXLEN];
@@ -485,42 +485,6 @@ void gravatmp(const struct userinfostruct *uinfo, const char *oldurl, long long
    */
    fprintf(fp_ou,"%"PRIu64"\t%"PRIu64"\t%s\t%s\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n",(uint64_t)nacc,(uint64_t)nbytes,oldurl,oldmsg,(uint64_t)nelap,(uint64_t)incache,(uint64_t)oucache);
 
-   fclose(fp_ou);
-   ttopen=0;
-
-   if(fp_tt) {
-      fputs("</table>\n</div>\n",fp_tt);
-      fputs("</body>\n</html>\n",fp_tt);
-      fclose(fp_tt);
-      fp_tt=NULL;
-   }
-
-   return;
-}
-
-static void gravatmpf(const struct userinfostruct *uinfo,const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, int indexonly, long long int incache, long long int oucache)
-{
-   FILE *fp_ou;
-   char wdirname[MAXLEN];
-
-   if(indexonly || (ReportType & REPORT_TYPE_USERS_SITES) == 0) return;
-
-   if (snprintf(wdirname,sizeof(wdirname),"%s/%s.utmp",tmp,uinfo->filename)>=sizeof(wdirname)) {
-      debuga(_("Path too long %s/%s.utmp\n"),tmp,uinfo->filename);
-      exit(EXIT_FAILURE);
-   }
-
-   if((fp_ou=MY_FOPEN(wdirname,"a"))==NULL){
-      debuga(_("(report) Cannot open file %s\n"),wdirname);
-      exit(EXIT_FAILURE);
-   }
-
-   /*
-   This complicated printf is due to Microsoft's inability to comply with any standard. Msvcrt is unable
-   to print a long long int unless it is exactly 64-bits long.
-   */
-   fprintf(fp_ou,"%"PRIu64"\t%"PRIu64"\t%s\t%s\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n",(uint64_t)nacc,(uint64_t)nbytes,oldurl,oldmsg,(uint64_t)nelap,(uint64_t)incache,(uint64_t)oucache);
-
    if (fclose(fp_ou)==EOF) {
       debuga(_("Failed to close file %s - %s\n"),wdirname,strerror(errno));
       exit(EXIT_FAILURE);
@@ -528,7 +492,7 @@ static void gravatmpf(const struct userinfostruct *uinfo,const char *oldurl, lon
    ttopen=0;
 
    if(fp_tt) {
-      fputs("</table>\n",fp_tt);
+      fputs("</table>\n</div>\n",fp_tt);
       fputs("</body>\n</html>\n",fp_tt);
       fclose(fp_tt);
       fp_tt=NULL;
@@ -537,7 +501,6 @@ static void gravatmpf(const struct userinfostruct *uinfo,const char *oldurl, lon
    return;
 }
 
-
 static void gravatmp_hora(const char *dirname, const struct userinfostruct *uinfo, const char *data, const char *hora, long long int elap, long long int bytes, int indexonly)
 {