SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
libs.cpp
Go to the documentation of this file.
1 // Copyright (C) 2006-2014 David Sugar, Tycho Softworks.
2 // Copyright (C) 2015 Cherokees of Idaho.
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
17 
18 #ifndef DEBUG
19 #define DEBUG
20 #endif
21 
22 #include <sipwitch/sipwitch.h>
23 
24 #include <stdio.h>
25 
26 using namespace SIPWITCH_NAMESPACE;
27 
28 static int init_callback = 0;
29 static int load_callback = 0;
30 
31 static class testCallback : public service::callback
32 {
33 public:
34  testCallback() : service::callback(1)
35  {if(++init_callback == 2) active_flag = true;};
36  void reload(service *cfg)
37  {++load_callback;};
38 } testcalls, extra;
39 
40 extern "C" int main()
41 {
42  service *cfg = new service("test");
43  assert(cfg != NULL);
44  // constructors built
45  assert(init_callback == 2);
46  // test reloading
47  cfg->commit();
48  assert(load_callback == 2);
49 }
int main()
Definition: libs.cpp:40
#define SIPWITCH_NAMESPACE
Definition: namespace.h:30
Top level include directory for GNU Telephony SIP Witch Server.