This commit is contained in:
whottgen 2004-11-04 18:34:22 +00:00
parent db9eed56a1
commit f24c18bb4a
3 changed files with 88 additions and 2 deletions

View File

@ -1,5 +1,5 @@
include_HEADERS=containers_public.h queue.h smtp.h cfg.h count.h safe_write.h sunos_comp.h htdns.h smmapd.h htmalloc.h include_HEADERS=containers_public.h queue.h smtp.h cfg.h count.h safe_write.h sunos_comp.h htdns.h smmapd.h htmalloc.h stats.h
lib_LTLIBRARIES = libsmmapdfw.la lib_LTLIBRARIES = libsmmapdfw.la
libsmmapdfw_la_SOURCES = cfg.c queue.c count.c safe_write.c config_public.c htdns.c smtp.c htmalloc.c libsmmapdfw_la_SOURCES = cfg.c queue.c count.c safe_write.c config_public.c htdns.c smtp.c htmalloc.c stats.c

View File

@ -0,0 +1,46 @@
/*
Copyright (C) 2004, Wolfgang Hottgenroth
This file is part of smmapdfw.
smmapdfw is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
smmapdfw is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with smmapdfw. If not, write to the Free Software Foundation, 59
Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <assert.h>
#include "stats.h"
count_t statCounter[STAT_CNT_MAXNUM];
void initStatCounter() {
int i;
for (i=0; i<STAT_CNT_MAXNUM; i++) {
count_init(statCounter[i]);
}
}
unsigned int getStatCounter(int cnt_idx) {
assert((cnt_idx >= 0) && (cnt_idx < STAT_CNT_MAXNUM));
return count_get(&statCounter[cnt_idx]);
}
void incStatCounter(int cnt_idx) {
assert((cnt_idx >= 0) && (cnt_idx < STAT_CNT_MAXNUM));
count_inc(&statCounter[cnt_idx]);
}

View File

@ -0,0 +1,40 @@
/*
Copyright (C) 2004, Wolfgang Hottgenroth
This file is part of smmapdfw.
smmapdfw is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
smmapdfw is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with smmapdfw. If not, write to the Free Software Foundation, 59
Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _STATS_H
#define _STATS_H
#define STAT_CNT_ACCEPTED 0
#define STAT_CNT_FAILED 1
#define STAT_CNT_OK_RETURNED 2
#define STAT_CNT_PERM_RETURNED 3
#define STAT_CNT_TEMP_RETURNED 4
#define STAT_CNT_NOTFOUND_RETURNED 5
#define STAT_CNT_CLASS_NOT_FOUND_FAILURE 6
#define STAT_CNT_NETSTRING_FAILURE 7
#define STAT_CNT_MAXNUM 8
void initStatCounter();
unsigned int getStatCounter(int cnt_idx);
void incStatCounter(int cnt_idx);
#endif _STATS_H_