ze-filter  (ze-filter-0.8.0-develop-180218)
ze-bestof-test.c
Go to the documentation of this file.
1 
2 /*
3  *
4  * ze-filter - Mail Server Filter for sendmail
5  *
6  * Copyright (c) 2001-2018 - Jose-Marcio Martins da Cruz
7  *
8  * Auteur : Jose Marcio Martins da Cruz
9  * jose.marcio.mc@gmail.org
10  *
11  * Historique :
12  * Creation : janvier 2002
13  *
14  * This program is free software, but with restricted license :
15  *
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20  *
21  * More details about ze-filter license can be found at ze-filter
22  * web site : http://foss.jose-marcio.org
23  */
24 
25 #include <ze-sys.h>
26 #include <ze-filter.h>
27 #include <ze-bestof-n.h>
28 
29 int
30 main(argc, argv)
31  int argc;
32  char **argv;
33 {
34  int res = 0;
35  extern int ze_logLevel;
36 
37  bool r;
38 
39  char buf[64];
40 
41  bestof_T best;
42 
43  configure("ze-module-test", conf_file, FALSE);
44 
46  ze_logLevel = 10;
47 
48  printf("Hello, world\n");
49 
50  bestof_init(&best, 5, NULL);
51 
52  bestof_add(&best, -5.);
53  bestof_add(&best, -4.);
54  bestof_add(&best, 0.);
55  bestof_add(&best, 4.);
56  bestof_add(&best, 5.);
57 
58  printf("AVERAGE : %7.3f\n", bestof_average(&best));
59 
60  return 0;
61 }
bool bestof_init(bestof_T *b, int dim, bestcomp_F bcmp)
Definition: ze-bestof-n.c:51
int ze_logLevel
Definition: zeSyslog.c:34
void zeLog_SetOutput(bool, bool)
Definition: zeSyslog.c:490
double bestof_average(bestof_T *b)
Definition: ze-bestof-n.c:97
#define FALSE
Definition: macros.h:160
bool bestof_add(bestof_T *b, double v)
Definition: ze-bestof-n.c:75
#define TRUE
Definition: macros.h:157
char * conf_file
Definition: ze-cf.c:38
int configure(char *, char *, bool)
Definition: ze-cf.c:1203
int main(int argc, char **argv)