ze-filter  (ze-filter-0.8.0-develop-180218)
ze-module-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 
28 static int add_scores(char *);
29 
30 int
31 main(argc, argv)
32  int argc;
33  char **argv;
34 {
35  int res = 0;
36  extern int ze_logLevel;
37 
38  bool r;
39 
40  configure("ze-module-test", conf_file, FALSE);
41 
43  ze_logLevel = 10;
44 
45  printf("Hello, world\n");
46 
47  load_all_modules("/etc/ze-filter", "ze-modules", "/usr/lib/ze-filter");
48 
49  module_info();
50 
51  {
52  mod_ctx_T arg;
53 
54  memset(&arg, 0, sizeof (arg));
55 
56  arg.id = "NOID";
57  arg.claddr = "10.3.5.5";
58  arg.clname = "minho.ensmp.fr";
59 
61  module_call(CALLBACK_CONNECT, rand() % 9, &arg);
62 
63  arg.callback = CALLBACK_EOM;
64  module_call(CALLBACK_EOM, rand() % 9, &arg);
65  }
66 
67  return 0;
68 }
#define CALLBACK_CONNECT
Definition: ze-callback.h:28
int ze_logLevel
Definition: zeSyslog.c:34
char * clname
Definition: ze-modules.h:61
void zeLog_SetOutput(bool, bool)
Definition: zeSyslog.c:490
#define FALSE
Definition: macros.h:160
bool module_info()
Definition: ze-modules.c:380
char * id
Definition: ze-modules.h:59
#define TRUE
Definition: macros.h:157
int callback
Definition: ze-modules.h:58
char * conf_file
Definition: ze-cf.c:38
bool module_call(int callback, int step, mod_ctx_T *arg)
Definition: ze-modules.c:421
int configure(char *, char *, bool)
Definition: ze-cf.c:1203
int main(int argc, char **argv)
bool load_all_modules(char *cfdir, char *modcf, char *moddir)
Definition: ze-modules.c:318
#define CALLBACK_EOM
Definition: ze-callback.h:36
char * claddr
Definition: ze-modules.h:60