-
Notifications
You must be signed in to change notification settings - Fork 129
/
init.cc
36 lines (31 loc) · 900 Bytes
/
init.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* GeoIP C library binding for nodejs
*
* Licensed under the GNU LGPL 2.1 license
*/
#include "netspeed.h"
#include "country6.h"
#include "country.h"
#include "region.h"
#include "city.h"
#include "org.h"
#include "utils.h"
extern "C" {
static void init(Handle<Object> target)
{
HandleScope scope;
// Modules
geoip::NetSpeed::Init(target);
geoip::Country6::Init(target);
geoip::Country::Init(target);
geoip::Region::Init(target);
geoip::City::Init(target);
geoip::Org::Init(target);
// Utility memeber method
Local<FunctionTemplate> t = FunctionTemplate::New(geoip::check);
target->Set(String::NewSymbol("check"), t->GetFunction());
// only works on libgeoip >= 1.4.7
//target->Set(String::NewSymbol("libgeoip"), String::New(GeoIP_lib_version()));
}
NODE_MODULE(geoip, init);
}