/
country.h
55 lines (39 loc) · 1.09 KB
/
country.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* GeoIP C library binding for nodejs
*
* Licensed under the GNU LGPL 2.1 license
*/
#ifndef NODE_GEOIP_COUNTRY_H
#define NODE_GEOIP_COUNTRY_H
#include <v8.h>
#include <node.h>
#include "node_geoip.h"
using namespace v8;
using namespace node;
namespace geoip {
class Country: ObjectWrap
{
private:
GeoIP *db;
int db_edition;
static Persistent<FunctionTemplate> constructor_template;
static int EIO_Country(eio_req *req);
static int EIO_AfterCountry(eio_req *req);
protected:
static Handle<Value> New(const Arguments& args);
public:
static void Init(Handle<Object> target);
static Handle<Value> lookupSync(const Arguments& args);
static Handle<Value> lookup(const Arguments& args);
static Handle<Value> update(const Arguments &args);
static Handle<Value> close(const Arguments &args);
};
}
struct country_baton_t {
geoip::Country * c;
//char host_cstr[256];
int country_id;
uint32_t ipnum;
Persistent<Function> cb;
};
#endif /* NODE_GEOIP_COUNTRY_H */