fastgeoip 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/.gitignore +25 -0
- data/LICENSE +20 -0
- data/README.rdoc +11 -0
- data/Rakefile +55 -0
- data/VERSION +1 -0
- data/ext/GeoIP.c +1640 -0
- data/ext/GeoIP.h +252 -0
- data/ext/GeoIPCity.c +297 -0
- data/ext/GeoIPCity.h +72 -0
- data/ext/GeoIP_internal.h +19 -0
- data/ext/extconf.h +5 -0
- data/ext/extconf.rb +58 -0
- data/ext/fastgeoip.c +59 -0
- data/ext/global.h +32 -0
- data/ext/md5.c +326 -0
- data/ext/md5.h +40 -0
- data/ext/mkmf.log +24 -0
- data/ext/regionName.c +13518 -0
- data/ext/ruby_geoip.h +15 -0
- data/ext/timeZone.c +941 -0
- data/ext/types.h +140 -0
- data/fastgeoip.gemspec +66 -0
- data/lib/fastgeoip.rb +0 -0
- data/test/helper.rb +10 -0
- metadata +92 -0
data/ext/types.h
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
/* types.h - some common typedefs
|
2
|
+
* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
3
|
+
*
|
4
|
+
* This file is part of GNUPG.
|
5
|
+
*
|
6
|
+
* GNUPG is free software; you can redistribute it and/or modify
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
8
|
+
* the Free Software Foundation; either version 2 of the License, or
|
9
|
+
* (at your option) any later version.
|
10
|
+
*
|
11
|
+
* GNUPG is distributed in the hope that it will be useful,
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
* GNU General Public License for more details.
|
15
|
+
*
|
16
|
+
* You should have received a copy of the GNU General Public License
|
17
|
+
* along with this program; if not, write to the Free Software
|
18
|
+
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
19
|
+
*/
|
20
|
+
|
21
|
+
#ifndef G10_TYPES_H
|
22
|
+
#define G10_TYPES_H
|
23
|
+
|
24
|
+
#ifdef HAVE_INTTYPES_H
|
25
|
+
/* For uint64_t */
|
26
|
+
#include <inttypes.h>
|
27
|
+
#endif
|
28
|
+
|
29
|
+
/* The AC_CHECK_SIZEOF() in configure fails for some machines.
|
30
|
+
* we provide some fallback values here */
|
31
|
+
#if !SIZEOF_UNSIGNED_SHORT
|
32
|
+
#undef SIZEOF_UNSIGNED_SHORT
|
33
|
+
#define SIZEOF_UNSIGNED_SHORT 2
|
34
|
+
#endif
|
35
|
+
#if !SIZEOF_UNSIGNED_INT
|
36
|
+
#undef SIZEOF_UNSIGNED_INT
|
37
|
+
#define SIZEOF_UNSIGNED_INT 4
|
38
|
+
#endif
|
39
|
+
#if !SIZEOF_UNSIGNED_LONG
|
40
|
+
#undef SIZEOF_UNSIGNED_LONG
|
41
|
+
#define SIZEOF_UNSIGNED_LONG 4
|
42
|
+
#endif
|
43
|
+
|
44
|
+
|
45
|
+
#include <sys/types.h>
|
46
|
+
|
47
|
+
#ifndef HAVE_BYTE_TYPEDEF
|
48
|
+
#undef byte /* maybe there is a macro with this name */
|
49
|
+
#ifndef __riscos__
|
50
|
+
typedef unsigned char byte;
|
51
|
+
#else
|
52
|
+
/* Norcroft treats char = unsigned char as legal assignment
|
53
|
+
but char* = unsigned char* as illegal assignment
|
54
|
+
and the same applies to the signed variants as well */
|
55
|
+
typedef char byte;
|
56
|
+
#endif
|
57
|
+
#define HAVE_BYTE_TYPEDEF
|
58
|
+
#endif
|
59
|
+
|
60
|
+
#ifndef HAVE_USHORT_TYPEDEF
|
61
|
+
#undef ushort /* maybe there is a macro with this name */
|
62
|
+
typedef unsigned short ushort;
|
63
|
+
#define HAVE_USHORT_TYPEDEF
|
64
|
+
#endif
|
65
|
+
|
66
|
+
#ifndef HAVE_ULONG_TYPEDEF
|
67
|
+
#undef ulong /* maybe there is a macro with this name */
|
68
|
+
typedef unsigned long ulong;
|
69
|
+
#define HAVE_ULONG_TYPEDEF
|
70
|
+
#endif
|
71
|
+
|
72
|
+
#ifndef HAVE_U16_TYPEDEF
|
73
|
+
#undef u16 /* maybe there is a macro with this name */
|
74
|
+
#if SIZEOF_UNSIGNED_INT == 2
|
75
|
+
typedef unsigned int u16;
|
76
|
+
#elif SIZEOF_UNSIGNED_SHORT == 2
|
77
|
+
typedef unsigned short u16;
|
78
|
+
#else
|
79
|
+
#error no typedef for u16
|
80
|
+
#endif
|
81
|
+
#define HAVE_U16_TYPEDEF
|
82
|
+
#endif
|
83
|
+
|
84
|
+
#ifndef HAVE_U32_TYPEDEF
|
85
|
+
#undef u32 /* maybe there is a macro with this name */
|
86
|
+
#if SIZEOF_UNSIGNED_INT == 4
|
87
|
+
typedef unsigned int u32;
|
88
|
+
#elif SIZEOF_UNSIGNED_LONG == 4
|
89
|
+
typedef unsigned long u32;
|
90
|
+
#else
|
91
|
+
#error no typedef for u32
|
92
|
+
#endif
|
93
|
+
#define HAVE_U32_TYPEDEF
|
94
|
+
#endif
|
95
|
+
|
96
|
+
/****************
|
97
|
+
* Warning: Some systems segfault when this u64 typedef and
|
98
|
+
* the dummy code in cipher/md.c is not available. Examples are
|
99
|
+
* Solaris and IRIX.
|
100
|
+
*/
|
101
|
+
#ifndef HAVE_U64_TYPEDEF
|
102
|
+
#undef u64 /* maybe there is a macro with this name */
|
103
|
+
#if SIZEOF_UINT64_T == 8
|
104
|
+
typedef uint64_t u64;
|
105
|
+
#define U64_C(c) (UINT64_C(c))
|
106
|
+
#define HAVE_U64_TYPEDEF
|
107
|
+
#elif SIZEOF_UNSIGNED_INT == 8
|
108
|
+
typedef unsigned int u64;
|
109
|
+
#define U64_C(c) (c ## U)
|
110
|
+
#define HAVE_U64_TYPEDEF
|
111
|
+
#elif SIZEOF_UNSIGNED_LONG == 8
|
112
|
+
typedef unsigned long u64;
|
113
|
+
#define U64_C(c) (c ## UL)
|
114
|
+
#define HAVE_U64_TYPEDEF
|
115
|
+
#elif SIZEOF_UNSIGNED_LONG_LONG == 8
|
116
|
+
typedef unsigned long long u64;
|
117
|
+
#define U64_C(c) (c ## ULL)
|
118
|
+
#define HAVE_U64_TYPEDEF
|
119
|
+
#endif
|
120
|
+
#endif
|
121
|
+
|
122
|
+
typedef union {
|
123
|
+
int a;
|
124
|
+
short b;
|
125
|
+
char c[1];
|
126
|
+
long d;
|
127
|
+
#ifdef HAVE_U64_TYPEDEF
|
128
|
+
u64 e;
|
129
|
+
#endif
|
130
|
+
float f;
|
131
|
+
double g;
|
132
|
+
} PROPERLY_ALIGNED_TYPE;
|
133
|
+
|
134
|
+
typedef struct string_list {
|
135
|
+
struct string_list *next;
|
136
|
+
unsigned int flags;
|
137
|
+
char d[1];
|
138
|
+
} *STRLIST;
|
139
|
+
|
140
|
+
#endif /*G10_TYPES_H*/
|
data/fastgeoip.gemspec
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{fastgeoip}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Martin Karlsch"]
|
12
|
+
s.date = %q{2010-07-13}
|
13
|
+
s.description = %q{A much longer description will follow ...}
|
14
|
+
s.email = %q{martin@karlsch.com}
|
15
|
+
s.extensions = ["ext/extconf.rb"]
|
16
|
+
s.extra_rdoc_files = [
|
17
|
+
"LICENSE",
|
18
|
+
"README.rdoc"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".document",
|
22
|
+
".gitignore",
|
23
|
+
"LICENSE",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"ext/GeoIP.c",
|
28
|
+
"ext/GeoIP.h",
|
29
|
+
"ext/GeoIPCity.c",
|
30
|
+
"ext/GeoIPCity.h",
|
31
|
+
"ext/GeoIP_internal.h",
|
32
|
+
"ext/extconf.h",
|
33
|
+
"ext/extconf.rb",
|
34
|
+
"ext/fastgeoip.c",
|
35
|
+
"ext/global.h",
|
36
|
+
"ext/md5.c",
|
37
|
+
"ext/md5.h",
|
38
|
+
"ext/mkmf.log",
|
39
|
+
"ext/regionName.c",
|
40
|
+
"ext/ruby_geoip.h",
|
41
|
+
"ext/timeZone.c",
|
42
|
+
"ext/types.h",
|
43
|
+
"fastgeoip.gemspec",
|
44
|
+
"lib/fastgeoip.rb",
|
45
|
+
"test/helper.rb"
|
46
|
+
]
|
47
|
+
s.homepage = %q{http://github.com/dynamix/fastgeoip}
|
48
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
49
|
+
s.require_paths = ["ext"]
|
50
|
+
s.rubygems_version = %q{1.3.7}
|
51
|
+
s.summary = %q{Wrapper for MaxMind GeoIP based on net/geoip}
|
52
|
+
s.test_files = [
|
53
|
+
"test/helper.rb"
|
54
|
+
]
|
55
|
+
|
56
|
+
if s.respond_to? :specification_version then
|
57
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
58
|
+
s.specification_version = 3
|
59
|
+
|
60
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
61
|
+
else
|
62
|
+
end
|
63
|
+
else
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
data/lib/fastgeoip.rb
ADDED
File without changes
|
data/test/helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastgeoip
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Martin Karlsch
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-07-13 00:00:00 +02:00
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: A much longer description will follow ...
|
23
|
+
email: martin@karlsch.com
|
24
|
+
executables: []
|
25
|
+
|
26
|
+
extensions:
|
27
|
+
- ext/extconf.rb
|
28
|
+
extra_rdoc_files:
|
29
|
+
- LICENSE
|
30
|
+
- README.rdoc
|
31
|
+
files:
|
32
|
+
- .document
|
33
|
+
- .gitignore
|
34
|
+
- LICENSE
|
35
|
+
- README.rdoc
|
36
|
+
- Rakefile
|
37
|
+
- VERSION
|
38
|
+
- ext/GeoIP.c
|
39
|
+
- ext/GeoIP.h
|
40
|
+
- ext/GeoIPCity.c
|
41
|
+
- ext/GeoIPCity.h
|
42
|
+
- ext/GeoIP_internal.h
|
43
|
+
- ext/extconf.h
|
44
|
+
- ext/extconf.rb
|
45
|
+
- ext/fastgeoip.c
|
46
|
+
- ext/global.h
|
47
|
+
- ext/md5.c
|
48
|
+
- ext/md5.h
|
49
|
+
- ext/mkmf.log
|
50
|
+
- ext/regionName.c
|
51
|
+
- ext/ruby_geoip.h
|
52
|
+
- ext/timeZone.c
|
53
|
+
- ext/types.h
|
54
|
+
- fastgeoip.gemspec
|
55
|
+
- lib/fastgeoip.rb
|
56
|
+
- test/helper.rb
|
57
|
+
has_rdoc: true
|
58
|
+
homepage: http://github.com/dynamix/fastgeoip
|
59
|
+
licenses: []
|
60
|
+
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options:
|
63
|
+
- --charset=UTF-8
|
64
|
+
require_paths:
|
65
|
+
- ext
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
hash: 3
|
81
|
+
segments:
|
82
|
+
- 0
|
83
|
+
version: "0"
|
84
|
+
requirements: []
|
85
|
+
|
86
|
+
rubyforge_project:
|
87
|
+
rubygems_version: 1.3.7
|
88
|
+
signing_key:
|
89
|
+
specification_version: 3
|
90
|
+
summary: Wrapper for MaxMind GeoIP based on net/geoip
|
91
|
+
test_files:
|
92
|
+
- test/helper.rb
|