Geo-IP-1.51/0000755000175000017500000000000013167530465011124 5ustar greggregGeo-IP-1.51/LICENSE0000644000175000017500000004370213167530465012137 0ustar greggregThis software is copyright (c) 2002 - 2017 by MaxMind, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2002 - 2017 by MaxMind, Inc. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2002 - 2017 by MaxMind, Inc. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Geo-IP-1.51/MANIFEST0000644000175000017500000000222113167530465012252 0ustar greggreg# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.010. CONTRIBUTING.md Changes INSTALL IP.xs LICENSE MANIFEST META.json META.yml Makefile.PL README.md cpanfile dist.ini example/benchmark.pl example/city.pl example/country_v6.pl example/geolite-mirror-simple.pl example/netspeed.pl example/netspeedcell.pl example/org.pl example/region.pl lib/Geo/IP.pm lib/Geo/IP/Record.pm lib/Geo/IP/Record.pod ppport.h t/00-report-prereqs.dd t/00-report-prereqs.t t/city.t t/country.t t/country_v6.t t/data/GeoIP.dat t/data/GeoIPASNum.dat t/data/GeoIPASNumv6.dat t/data/GeoIPCity.dat t/data/GeoIPDomain.dat t/data/GeoIPISP.dat t/data/GeoIPNetSpeedCell.dat t/data/GeoIPOrg.dat t/data/GeoIPRegion.dat t/data/GeoIPv6.dat t/data/GeoLiteCityIPv6.dat t/domain.t t/netspeedcell.t t/org.t t/region.t typemap xt/0_base.t xt/1_lookup.t xt/20_min_capi_version.t xt/2_namelookup.t xt/author/00-compile.t xt/author/eol.t xt/author/mojibake.t xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-spell.t xt/author/pod-syntax.t xt/author/portability.t xt/author/synopsis.t xt/author/test-version.t xt/author/tidyall.t xt/release/cpan-changes.t xt/release/meta-json.t Geo-IP-1.51/README.md0000644000175000017500000002763713167530465012422 0ustar greggreg# NAME Geo::IP - Look up location and network information by IP Address # VERSION version 1.51 # SYNOPSIS use Geo::IP; my $gi = Geo::IP->new(GEOIP_MEMORY_CACHE); # look up IP address '24.24.24.24' # returns undef if country is unallocated, or not defined in our database my $country = $gi->country_code_by_addr('24.24.24.24'); $country = $gi->country_code_by_name('yahoo.com'); # $country is equal to "US" use Geo::IP; my $gi = Geo::IP->open("/usr/local/share/GeoIP/GeoIPCity.dat", GEOIP_STANDARD); my $record = $gi->record_by_addr('24.24.24.24'); print $record->country_code, $record->country_code3, $record->country_name, $record->region, $record->region_name, $record->city, $record->postal_code, $record->latitude, $record->longitude, $record->time_zone, $record->area_code, $record->continent_code, $record->metro_code; # the IPv6 support is currently only avail if you use the CAPI which is much # faster anyway. ie: print Geo::IP->api equals to 'CAPI' use Socket; use Socket6; use Geo::IP; my $g = Geo::IP->open('/usr/local/share/GeoIP/GeoIPv6.dat') or die; print $g->country_code_by_ipnum_v6(inet_pton AF_INET6, '::24.24.24.24'); print $g->country_code_by_addr_v6('2a02:e88::'); # DESCRIPTION This module uses the GeoIP Legacy file based database. This database simply contains IP blocks as keys, and countries as values. This database should be more complete and accurate than reverse DNS lookups. This module can be used to automatically select the geographically closest mirror, to analyze your web server logs to determine the countries of your visitors, for credit card fraud detection, and for software export controls. # IP GEOLOCATION USAGE IP geolocation is inherently imprecise. Locations are often near the center of the population. Any location provided by a GeoIP database or web service should not be used to identify a particular address or household. # IP ADDRESS TO COUNTRY DATABASES Free monthly updates to the database are available from http://dev.maxmind.com/geoip/geolite This free database is similar to the database contained in IP::Country, as well as many paid databases. It uses ARIN, RIPE, APNIC, and LACNIC whois to obtain the IP->Country mappings. If you require greater accuracy, MaxMind offers a database on a paid subscription basis. Also included with this is a service that updates your database automatically each month, by running a program called geoipupdate included with the C API from a cronjob. For more details on the differences between the free and paid databases, see: http://www.maxmind.com/en/geolocation\_landing Do not miss the city database, described in Geo::IP::Record Make sure to use the `geolite-mirror-simple.pl` script from the example directory to stay current with the databases. # BENCHMARK the lookups are fast. This is my laptop ( examples/benchmark.pl ): Benchmark: running city_mem, city_std, country_mem, country_std, country_v6_mem, country_v6_std, isp_mem, isp_std for at least 10 CPU seconds... city_mem: 10.3121 wallclock secs (10.30 usr + 0.01 sys = 10.31 CPU) @ 387271.48/s (n=3992769) city_std: 10.0658 wallclock secs ( 2.86 usr + 7.17 sys = 10.03 CPU) @ 54392.62/s (n=545558) country_mem: 10.1772 wallclock secs (10.16 usr + 0.00 sys = 10.16 CPU) @ 1077507.97/s (n=10947481) country_std: 10.1432 wallclock secs ( 2.30 usr + 7.85 sys = 10.15 CPU) @ 83629.56/s (n=848840) country_v6_mem: 10.2579 wallclock secs (10.25 usr + -0.00 sys = 10.25 CPU) @ 365997.37/s (n=3751473) country_v6_std: 10.8541 wallclock secs ( 1.77 usr + 9.07 sys = 10.84 CPU) @ 10110.42/s (n=109597) isp_mem: 10.147 wallclock secs (10.13 usr + 0.01 sys = 10.14 CPU) @ 590109.66/s (n=5983712) isp_std: 10.0484 wallclock secs ( 2.71 usr + 7.33 sys = 10.04 CPU) @ 73186.35/s (n=734791) # CLASS METHODS - $gi = Geo::IP->new( $flags ); Constructs a new Geo::IP object with the default database located inside your system's _datadir_, typically _/usr/local/share/GeoIP/GeoIP.dat_. Flags can be set to either GEOIP\_STANDARD, or for faster performance (at a cost of using more memory), GEOIP\_MEMORY\_CACHE. When using memory cache you can force a reload if the file is updated by setting GEOIP\_CHECK\_CACHE. GEOIP\_INDEX\_CACHE caches the most frequently accessed index portion of the database, resulting in faster lookups than GEOIP\_STANDARD, but less memory usage than GEOIP\_MEMORY\_CACHE - useful for larger databases such as GeoIP Legacy Organization and GeoIP City. Note, for GeoIP Country, Region and Netspeed databases, GEOIP\_INDEX\_CACHE is equivalent to GEOIP\_MEMORY\_CACHE. Prior to geoip-api version 1.6.3, the C API would leak diagnostic messages onto stderr unconditionally. From Geo::IP v1.44 onwards, the flag squelching this behavior (GEOIP\_SILENCE) is implicitly added to the flags passed in new(), open(), and open\_type(). To combine flags, use the bitwise OR operator, |. For example, to cache the database in memory, but check for an updated GeoIP.dat file, use: Geo::IP->new( GEOIP\_MEMORY\_CACHE | GEOIP\_CHECK\_CACHE ); - $gi = Geo::IP->open( $database\_filename, $flags ); Constructs a new Geo::IP object with the database located at `$database_filename`. - $gi = Geo::IP->open\_type( $database\_type, $flags ); Constructs a new Geo::IP object with the $database\_type database located in the standard location. For example $gi = Geo::IP->open_type( GEOIP_CITY_EDITION_REV1 , GEOIP_STANDARD ); opens the database file in the standard location for GeoIP Legacy City, typically _/usr/local/share/GeoIP/GeoIPCity.dat_. # OBJECT METHODS - $code = $gi->country\_code\_by\_addr( $ipaddr ); Returns the ISO 3166 country code for an IP address. - $code = $gi->country\_code\_by\_name( $hostname ); Returns the ISO 3166 country code for a hostname. - $code = $gi->country\_code3\_by\_addr( $ipaddr ); Returns the 3 letter country code for an IP address. - $code = $gi->country\_code3\_by\_name( $hostname ); Returns the 3 letter country code for a hostname. - $name = $gi->country\_name\_by\_addr( $ipaddr ); Returns the full country name for an IP address. - $name = $gi->country\_name\_by\_name( $hostname ); Returns the full country name for a hostname. - $r = $gi->record\_by\_addr( $ipaddr ); Returns a Geo::IP::Record object containing city location for an IP address. - $r = $gi->record\_by\_name( $hostname ); Returns a Geo::IP::Record object containing city location for a hostname. - $org = $gi->org\_by\_addr( $ipaddr ); **deprecated** use `name_by_addr` instead. Returns the Organization, ISP name or Domain Name for an IP address. - $org = $gi->org\_by\_name( $hostname ); **deprecated** use `name_by_name` instead. Returns the Organization, ISP name or Domain Name for a hostname. - $info = $gi->database\_info; Returns database string, includes version, date, build number and copyright notice. - $old\_charset = $gi->set\_charset( $charset ); Set the charset for the city name - defaults to GEOIP\_CHARSET\_ISO\_8859\_1. To set UTF8, pass GEOIP\_CHARSET\_UTF8 to set\_charset. For perl >= 5.008 the utf8 flag is honored. - $charset = $gi->charset; Gets the currently used charset. - ( $country, $region ) = $gi->region\_by\_addr('24.24.24.24'); Returns a list containing country and region. If region and/or country is unknown, undef is returned. Sure this works only for region databases. - ( $country, $region ) = $gi->region\_by\_name('www.xyz.com'); Returns a list containing country and region. If region and/or country is unknown, undef is returned. Sure this works only for region databases. - $netmask = $gi->last\_netmask; Gets netmask of network block from last lookup. - $gi->netmask(12); Sets netmask for the last lookup - my ( $from, $to ) = $gi->range\_by\_ip('24.24.24.24'); Returns the start and end of the current network block. The method tries to join several continuous netblocks. - $api = $gi->api or $api = Geo::IP->api Returns the currently used API. # prints either CAPI or PurePerl print Geo::IP->api; - $continent = $gi->continent\_code\_by\_country\_code('US'); Returns the continent code by country code. - $dbe = $gi->database\_edition Returns the database\_edition of the currently opened database. if ( $gi->database_edition == GEOIP_COUNTRY_EDITION ){ ... } - $isp = $gi->isp\_by\_addr('24.24.24.24'); Returns the isp for 24.24.24.24 - $isp = $gi->isp\_by\_name('www.maxmind.com'); Returns the isp for www.something.de - my $time\_zone = $gi->time\_zone('US', 'AZ'); Returns the time zone for country/region. # undef print $gi->time_zone('US', ''); # America/Phoenix print $gi->time_zone('US', 'AZ'); # Europe/Berlin print $gi->time_zone('DE', '00'); # Europe/Berlin print $gi->time_zone('DE', ''); - $id = $gi->id\_by\_addr('24.24.24.24'); Returns the country\_id for 24.24.24.24. The country\_id might be useful as array index. 0 is unknown. - $id = $gi->id\_by\_name('www.maxmind.com'); Returns the country\_id for www.maxmind.com. The country\_id might be useful as array index. 0 is unknown. - $cc = $gi->country\_code3\_by\_addr\_v6('::24.24.24.24'); - $cc = $gi->country\_code3\_by\_name\_v6('ipv6.google.com'); - $cc = $gi->country\_code\_by\_addr\_v6('2a02:ea0::'); - $cc = $gi->country\_code\_by\_ipnum\_v6($ipnum); use Socket; use Socket6; use Geo::IP; my $g = Geo::IP->open('/usr/local/share/GeoIP/GeoIPv6.dat') or die; print $g->country_code_by_ipnum_v6(inet_pton AF_INET6, '::24.24.24.24'); - $cc = $gi->country\_code\_by\_name\_v6('ipv6.google.com'); - name\_by\_addr Returns the Organization, ISP name or Domain Name for a IP address. - name\_by\_addr\_v6 Returns the Organization, ISP name or Domain Name for an IPv6 address. - name\_by\_ipnum\_v6 Returns the Organization, ISP name or Domain Name for an ipnum. - name\_by\_name Returns the Organization, ISP name or Domain Name for a hostname. - name\_by\_name\_v6 Returns the Organization, ISP name or Domain Name for a hostname. - org\_by\_addr\_v6 **deprecated** use `name_by_addr_v6` Returns the Organization, ISP name or Domain Name for an IPv6 address. - org\_by\_name\_v6 **deprecated** use `name_by_name_v6` Returns the Organization, ISP name or Domain Name for a hostname. - teredo Returns the current setting for teredo. - enable\_teredo Enable / disable teredo $gi->enable_teredo(1); # enable $gi->enable_teredo(0); # disable - lib\_version if ( $gi->api eq 'CAPI' ){ print $gi->lib_version; } # ISSUE TRACKER AND GIT repo Is available from GitHub, see https://github.com/maxmind/geoip-api-perl # SEE ALSO [GeoIP2](https://metacpan.org/pod/GeoIP2) - database reader for the GeoIP2 format. # SUPPORT Bugs may be submitted through [https://github.com/maxmind/geoip-api-perl/issues](https://github.com/maxmind/geoip-api-perl/issues). # AUTHORS - Dave Rolsky - Greg Oschwald # CONTRIBUTORS - asb-cpan - Boris Zentner - Boris Zentner - John SJ Anderson - Olaf Alders - Philip A. Prindeville - shawniverson - Thomas J Mather - Tina Mueller - Will Storey # COPYRIGHT AND LICENSE This software is copyright (c) 2002 - 2017 by MaxMind, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Geo-IP-1.51/Makefile.PL0000644000175000017500000001001013167530465013066 0ustar greggreguse ExtUtils::MakeMaker; use Config; use Cwd; use 5.006; require DynaLoader; $geoip_libpath = ''; $geoip_incpath = ''; my @replacement_args; my %config; while ( $_ = shift ) { my ( $key, $val ) = split( /=/, $_, 2 ); $config{$key} = $val; } unless ( $config{LIBS} ) { # currently we check only for the C Library version if it is in a # standard place my $geoip_version = 0; my $clib = DynaLoader::dl_findfile('GeoIP'); my $found = $clib ? 1 : 0; if ($clib) { $geoip_version = 10000; # V 1.0.0 ( means, we have something ) # a GeoIP lib is found, just check the version, we need 1.4.5 now my $lib = DynaLoader::dl_load_file( $clib, 0 ); if ($lib) { for ( [ 10403, 'GeoIP_last_netmask' ], # V 1.4.3 [ 10405, 'GeoIP_range_by_ip' ], # V 1.4.5 [ 10405, 'GeoIP_code_by_id' ], # V 1.4.5 [ 10407, 'GeoIP_country_code_by_addr_v6' ], # V 1.4.7 [ 10407, 'GeoIP_record_by_addr_v6' ], # V 1.4.7 or 1.4.8? [ 10500, 'GeoIP_country_code_by_ipnum_v6_gl' ], # V1.5.0 ) { $geoip_version = $_->[0] if DynaLoader::dl_find_symbol( $lib, $_->[1] ); } # to bad we can not distinguish between 1.4.7 and 1.4.8 here # I add a test to t/20_min_capi_version.t. if ( $geoip_version < 10500 ) { print STDERR <<__ERR__; Your installed version of libgeoip is outdated! Please update to at least version to 1.5.0 and reinstall this module. http://dev.maxmind.com/geoip/downloadable __ERR__ exit(0); } } } =pod # Test for existence of libGeoIP my $found = 0; foreach (split(/\s+/, $Config{libpth})) { if (-f "$_/libGeoIP." . $Config{so}) { $found = 1; last; } } =cut if ( !$found and !$config{PP} ) { print STDERR <<'GeoIP_Not_Installed;'; The GeoIP CAPI is not installed you should do that NOW. Otherwise the slow pure Perl API is used. GeoIP must be installed prior to building Geo::IP and I can't find it in the standard library directories. You can download GeoIP C API from: http://dev.maxmind.com/geoip/downloadable If GeoIP is installed, but in a non-standard directory, then use the following options to Makefile.PL: perl Makefile.PL LIBS='-L/home/me/lib' INC='-I/home/me/include' Note that if you build against a shareable library in a non-standard location you may (on some platforms) also have to set your LD_LIBRARY_PATH environment variable at run time for perl to find the library. If you installed the GeoIP C libraries to the /usr/local/lib directory, then you may need to add /usr/local/lib to /etc/ld.so.conf then run /sbin/ldconfig /etc/ld.so.conf GeoIP_Not_Installed; $config{PP} = 1; } } if ( $config{LIBS} !~ /\-lGeoIP\b/ ) { $config{LIBS} .= ' -lGeoIP'; } @extras = (); push( @extras, CAPI => 'TRUE' ) if ($PERL_VERSION >= 5.005 and $OSNAME eq 'MSWin32' and $Config{archname} =~ /-object\b/i ); push( @extras, ABSTRACT_FROM => 'lib/Geo/IP.pm', AUTHOR => 'T.J. Mather (tjmather@tjmather.com)' ) if ( $ExtUtils::MakeMaker::VERSION >= 5.4301 ); push( @extras, LICENSE => 'perl_5', ) if ( $ExtUtils::MakeMaker::VERSION >= 6.31 ); push( @extras, META_MERGE => { resources => { bugtracker => 'https://github.com/maxmind/geoip-api-perl/issues', repository => 'https://github.com/maxmind/geoip-api-perl', }, }, ) if ( $ExtUtils::MakeMaker::VERSION >= 6.46 ); my $pp = delete $config{PP}; WriteMakefile( NAME => 'Geo::IP', dist => { COMPRESS => 'gzip', SUFFIX => '.gz' }, VERSION_FROM => 'lib/Geo/IP.pm', LIBS => $pp ? [] : ['-lGeoIP'], DEFINE => '-DPERL_EXT', # otherwise 'cxinc' isn't defined CONFIGURE => sub { @{ $_[1] }{qw/XS C/} = ( {}, [] ) if $pp; $_[1] }, @extras, %config ); Geo-IP-1.51/CONTRIBUTING.md0000644000175000017500000001022313167530465013353 0ustar greggreg# CONTRIBUTING Thank you for considering contributing to this distribution. This file contains instructions that will help you work with the source code. Please note that if you have any questions or difficulties, you can reach the maintainer(s) through the bug queue described later in this document (preferred), or by emailing the releaser directly. You are not required to follow any of the steps in this document to submit a patch or bug report; these are recommendations, intended to help you (and help us help you faster). The distribution is managed with [Dist::Zilla](https://metacpan.org/release/Dist-Zilla). However, you can still compile and test the code with the `Makefile.PL` or `Build.PL` in the repository: perl Makefile.PL make make test or perl Build.PL ./Build ./Build test As well as: $ prove -bvr t or $ perl -Mblib t/some_test_file.t You may need to satisfy some dependencies. The easiest way to satisfy dependencies is to install the last release. This is available at https://metacpan.org/release/Geo-IP If you use cpanminus, you can do it without downloading the tarball first: $ cpanm --reinstall --installdeps --with-recommends Geo::IP Dist::Zilla is a very powerful authoring tool, but requires a number of author-specific plugins. If you would like to use it for contributing, install it from CPAN, then run one of the following commands, depending on your CPAN client: $ cpan `dzil authordeps --missing` or $ dzil authordeps --missing | cpanm There may also be additional requirements not needed by the dzil build which are needed for tests or other development: $ cpan `dzil listdeps --author --missing` or $ dzil listdeps --author --missing | cpanm Or, you can use the 'dzil stale' command to install all requirements at once: $ cpan Dist::Zilla::App::Command::stale $ cpan `dzil stale --all` or $ cpanm Dist::Zilla::App::Command::stale $ dzil stale --all | cpanm You can also do this via cpanm directly: $ cpanm --reinstall --installdeps --with-develop --with-recommends Geo::IP Once installed, here are some dzil commands you might try: $ dzil build $ dzil test $ dzil test --release $ dzil xtest $ dzil listdeps --json $ dzil build --notgz You can learn more about Dist::Zilla at http://dzil.org/. The code for this distribution is [hosted at GitHub](https://github.com/maxmind/geoip-api-perl). You can submit code changes by forking the repository, pushing your code changes to your clone, and then submitting a pull request. Detailed instructions for doing that is available here: https://help.github.com/articles/creating-a-pull-request If you have found a bug, but do not have an accompanying patch to fix it, you can submit an issue report [via the web](https://github.com/maxmind/geoip-api-perl/issues) . This is a good place to send your questions about the usage of this distribution. ## Travis All pull requests for this distribution will be automatically tested by [Travis](https://travis-ci.org/) and the build status will be reported on the pull request page. If your build fails, please take a look at the output. ## Tidyall This distribution uses [Code::TidyAll](https://metacpan.org/release/Code-TidyAll) to enforce a uniform coding style. This is tested as part of the author testing suite. You can install and run tidyall by running the following commands: $ cpanm Code::TidyAll $ tidyall -a Please run this before committing your changes and address any issues it brings up. ## Contributor Names If you send a patch or pull request, your name and email address will be included in the documentation as a contributor (using the attribution on the commit or patch), unless you specifically request for it not to be. If you wish to be listed under a different name or address, you should submit a pull request to the .mailmap file to contain the correct mapping. [Check here](https://github.com/git/git/blob/master/Documentation/mailmap.txt) for more information on git's .mailmap files. This file was generated via Dist::Zilla::Plugin::GenerateFile::FromShareDir 0.013 from a template file originating in Dist-Zilla-PluginBundle-MAXMIND-0.84. Geo-IP-1.51/xt/0000755000175000017500000000000013167530465011557 5ustar greggregGeo-IP-1.51/xt/release/0000755000175000017500000000000013167530465013177 5ustar greggregGeo-IP-1.51/xt/release/meta-json.t0000644000175000017500000000006413167530465015261 0ustar greggreg#!perl use Test::CPAN::Meta::JSON; meta_json_ok(); Geo-IP-1.51/xt/release/cpan-changes.t0000644000175000017500000000034413167530465015714 0ustar greggreguse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CPAN::Changes 0.012 use Test::More 0.96 tests => 1; use Test::CPAN::Changes; subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; Geo-IP-1.51/xt/2_namelookup.t0000644000175000017500000000076113167530465014343 0ustar greggreg# -*- Mode: Perl; -*- use strict; use Test; $^W = 1; BEGIN { plan tests => 11 } use Geo::IP; my $gi = Geo::IP->new(GEOIP_MEMORY_CACHE); while () { chomp; my ( $host, $exp_country ) = split("\t"); my $country = $gi->country_code_by_name($host); ok( $country, $exp_country ); } __DATA__ 203.174.65.12 JP 212.208.74.140 FR 200.219.192.106 BR 134.102.101.18 DE 193.75.148.28 BE 134.102.101.18 DE 147.251.48.1 CZ 194.244.83.2 IT 203.15.106.23 AU 196.31.1.1 ZA yahoo.com US Geo-IP-1.51/xt/20_min_capi_version.t0000644000175000017500000000070713167530465015575 0ustar greggreg# -*- Mode: Perl; -*- use strict; use Test; $^W = 1; BEGIN { plan tests => 1 } use Geo::IP; my $capi_version; if ( Geo::IP->api eq 'CAPI' ) { eval { $capi_version = Geo::IP->lib_version }; } unless ( defined $capi_version ) { # ugh, we use the pure perl API ok( 1, 1, "Pure perl API - skip" ); } else { ok( $capi_version, qr/^1\.[56]\./, "This module only supports >= 1.5.x releases of the libGeoIP C API." ); } Geo-IP-1.51/xt/author/0000755000175000017500000000000013167530465013061 5ustar greggregGeo-IP-1.51/xt/author/synopsis.t0000644000175000017500000000006013167530465015131 0ustar greggreg#!perl use Test::Synopsis; all_synopsis_ok(); Geo-IP-1.51/xt/author/pod-spell.t0000644000175000017500000000134213167530465015145 0ustar greggreguse strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007004 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ APNIC ARIN Alders Alders' Anderson Boris Dave Eilam Eilam's GEOLOCATION Geo GeoIP GeoLite Greg IP Inc John LACNIC LLC MAXMIND MAXMIND's Mather MaxMind MaxMind's Mueller Netspeed Olaf Oschwald Oschwald's PayPal Philip Prindeville Record Rolsky Rolsky's SJ Storey TINITA Thomas Tina Will Zentner api asb bzentner bzm cronjob dat datadir drolsky genehack geoip geoipupdate geolocation goschwald ipnum isp lib netblocks netmask oalders onwards philipp shawniverson teredo tjmather whois will Geo-IP-1.51/xt/author/tidyall.t0000644000175000017500000000067413167530465014717 0ustar greggreg# This file was automatically generated by Dist::Zilla::Plugin::Test::TidyAll v$VERSION use Test::More 0.88; BEGIN { if ( $] < 5.010 ) { plan skip_all => 'This test requires Perl version 5.010'; } } use Test::Code::TidyAll 0.24; tidyall_ok( verbose => ( exists $ENV{TEST_TIDYALL_VERBOSE} ? $ENV{TEST_TIDYALL_VERBOSE} : 1 ), jobs => ( exists $ENV{TEST_TIDYALL_JOBS} ? $ENV{TEST_TIDYALL_JOBS} : 4 ), ); done_testing; Geo-IP-1.51/xt/author/test-version.t0000644000175000017500000000063713167530465015716 0ustar greggreguse strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 1.09 use Test::Version; my @imports = qw( version_all_ok ); my $params = { is_strict => 1, has_version => 1, multiple => 0, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; Geo-IP-1.51/xt/author/mojibake.t0000644000175000017500000000015113167530465015024 0ustar greggreg#!perl use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); Geo-IP-1.51/xt/author/no-tabs.t0000644000175000017500000000072413167530465014614 0ustar greggreguse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'lib/Geo/IP.pm', 'lib/Geo/IP/Record.pm', 'lib/Geo/IP/Record.pod', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/city.t', 't/country.t', 't/country_v6.t', 't/domain.t', 't/netspeedcell.t', 't/org.t', 't/region.t' ); notabs_ok($_) foreach @files; done_testing; Geo-IP-1.51/xt/author/00-compile.t0000644000175000017500000000256613167530465015124 0ustar greggreguse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.057 use Test::More; plan tests => 3; my @module_files = ( 'Geo/IP.pm', 'Geo/IP/Record.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { +require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ); Geo-IP-1.51/xt/author/portability.t0000644000175000017500000000026713167530465015615 0ustar greggreguse strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); Geo-IP-1.51/xt/author/pod-coverage.t0000644000175000017500000000227713167530465015631 0ustar greggreg#!perl # This file was automatically generated by Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable. use Test::Pod::Coverage 1.08; use Test::More 0.88; BEGIN { if ( $] <= 5.008008 ) { plan skip_all => 'These tests require Pod::Coverage::TrustPod, which only works with Perl 5.8.9+'; } } use Pod::Coverage::TrustPod; { package My::Coverage; use parent 'Pod::Coverage::Moose', 'Pod::Coverage::TrustPod'; $INC{'My/Coverage.pm'} = 1; } my %skip = map { $_ => 1 } qw( Geo::IP Geo::IP::Record Geo::Mirror ); my @modules; for my $module ( all_modules() ) { next if $skip{$module}; push @modules, $module; } plan skip_all => 'All the modules we found were excluded from POD coverage test.' unless @modules; plan tests => scalar @modules; my %trustme = (); my @also_private = ( qr/\A (?: BUILD(?:ARGS)? | DEMOLISH ) \z/x ); for my $module ( sort @modules ) { pod_coverage_ok( $module, { coverage_class => 'My::Coverage', also_private => \@also_private, trustme => $trustme{$module} || [], }, "pod coverage for $module" ); } done_testing(); Geo-IP-1.51/xt/author/eol.t0000644000175000017500000000075613167530465014035 0ustar greggreguse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/Geo/IP.pm', 'lib/Geo/IP/Record.pm', 'lib/Geo/IP/Record.pod', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/city.t', 't/country.t', 't/country_v6.t', 't/domain.t', 't/netspeedcell.t', 't/org.t', 't/region.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; Geo-IP-1.51/xt/author/pod-syntax.t0000644000175000017500000000025213167530465015353 0ustar greggreg#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Geo-IP-1.51/xt/1_lookup.t0000644000175000017500000000113613167530465013476 0ustar greggreg# -*- Mode: Perl; -*- use strict; use Test; $^W = 1; BEGIN { plan tests => 18 } use Geo::IP; my $gi = Geo::IP->new(); while () { chomp; my ( $ipaddr, $exp_country ) = split("\t"); my $country = $gi->country_code_by_addr($ipaddr); ok( uc($country), $exp_country ); } __DATA__ 203.174.65.12 JP 212.208.74.140 FR 200.219.192.106 BR 134.102.101.18 DE 193.75.148.28 BE 134.102.101.18 DE 147.251.48.1 CZ 194.244.83.2 IT 203.15.106.23 AU 196.31.1.1 ZA 210.54.22.1 NZ 210.25.5.5 CN 210.54.122.1 NZ 210.25.15.5 CN 192.37.51.100 CH 192.37.150.150 CH 192.106.51.100 IT 192.106.150.150 IT Geo-IP-1.51/xt/0_base.t0000644000175000017500000000013613167530465013075 0ustar greggreg# -*- Mode: Perl; -*- BEGIN { print "1..1\n"; } use Geo::IP; BEGIN { print "ok 1\n"; } Geo-IP-1.51/t/0000755000175000017500000000000013167530465011367 5ustar greggregGeo-IP-1.51/t/region.t0000644000175000017500000000037613167530465013045 0ustar greggreguse strict; use warnings; use Geo::IP; use Test::More; my $gi = Geo::IP->open( 't/data/GeoIPRegion.dat', GEOIP_STANDARD ); is_deeply( [ $gi->region_by_addr('64.17.254.223') ], [ 'US', 'CA' ], 'expected region and country' ); done_testing(); Geo-IP-1.51/t/00-report-prereqs.dd0000644000175000017500000000553213167530465015114 0ustar greggregdo { my $x = { 'develop' => { 'requires' => { 'Code::TidyAll::Plugin::Test::Vars' => '0.02', 'Devel::PPPort' => '3.23', 'File::Spec' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Parallel::ForkManager' => '1.19', 'Perl::Critic' => '1.126', 'Perl::Tidy' => '20160302', 'Pod::Coverage::Moose' => '0', 'Pod::Coverage::TrustPod' => '0', 'Pod::Wordlist' => '0', 'Test' => '0', 'Test::CPAN::Changes' => '0.19', 'Test::CPAN::Meta::JSON' => '0.16', 'Test::Code::TidyAll' => '0.50', 'Test::EOL' => '0', 'Test::Mojibake' => '0', 'Test::More' => '0.96', 'Test::NoTabs' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', 'Test::Portability::Files' => '0', 'Test::Spelling' => '0.12', 'Test::Synopsis' => '0', 'Test::Vars' => '0.009', 'Test::Version' => '2.05', 'parent' => '0', 'perl' => '5.006', 'warnings' => '0' } }, 'runtime' => { 'requires' => { 'DynaLoader' => '0', 'Exporter' => '0', 'base' => '0', 'strict' => '0', 'vars' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'Test::More' => '0.96', 'warnings' => '0' } } }; $x; }Geo-IP-1.51/t/00-report-prereqs.t0000644000175000017500000001342613167530465014771 0ustar greggreg#!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: Geo-IP-1.51/t/city.t0000644000175000017500000000216013167530465012523 0ustar greggreguse strict; use warnings; use Geo::IP; use Test::More; my $gi = Geo::IP->open( 't/data/GeoIPCity.dat', GEOIP_STANDARD ); my $record = $gi->record_by_addr('64.17.254.216'); is( $record->area_code, 310, 'expexted area code' ); is( $record->city, 'El Segundo', 'expected city' ); is( $record->country_code, 'US', 'expected country code' ); is( $record->country_code3, 'USA', 'expected 3 letter country code' ); is( $record->country_name, 'United States', 'expected country name' ); is( $record->dma_code, 803, 'expected DMA code' ); is( $record->latitude, 33.9164, 'expected latitude' ); is( $record->longitude, '-118.4040', 'expected longitude' ); is( $record->metro_code, 803, 'expected metro code' ); is( $record->postal_code, '90245', 'expected postal code' ); is( $record->region, 'CA', 'expeced region' ); is( $record->region_name, 'California', 'expected region name' ); is( $record->time_zone, 'America/Los_Angeles', 'expected time zone' ); done_testing(); Geo-IP-1.51/t/country.t0000644000175000017500000000051013167530465013253 0ustar greggreguse strict; use warnings; use Geo::IP; use Test::More; my $gi = Geo::IP->open( 't/data/GeoIP.dat', GEOIP_STANDARD ); is( $gi->country_code_by_addr('64.17.254.216'), 'US', 'expected country code' ); is( $gi->country_name_by_addr('64.17.254.216'), 'United States', 'expected country name' ); done_testing(); Geo-IP-1.51/t/org.t0000644000175000017500000000153013167530465012342 0ustar greggreguse strict; use warnings; use Geo::IP; use Test::More; for my $method (qw( org_by_addr isp_by_addr name_by_addr )) { subtest $method => sub { my $gi = Geo::IP->open( 't/data/GeoIPOrg.dat', GEOIP_STANDARD ); is( $gi->$method('12.87.118.0'), 'AT&T Worldnet Services', 'expected org' ); }; # There isn't an isp_by_addr_v6 method next if $method eq 'isp_by_addr'; # We don't support v6 lookups with the pure Perl API on older Perls next if Geo::IP->api eq 'PurePerl' and $] < 5.014; my $v6_method = $method . '_v6'; subtest $v6_method => sub { my $gi = Geo::IP->open( 't/data/GeoIPASNumv6.dat', GEOIP_STANDARD ); is( $gi->$v6_method('2001:4:112::'), 'AS112 DNS-OARC', 'expected ASN' ); }; } done_testing(); Geo-IP-1.51/t/netspeedcell.t0000644000175000017500000000033413167530465014223 0ustar greggreguse strict; use warnings; use Geo::IP; use Test::More; my $gi = Geo::IP->open( 't/data/GeoIPNetSpeedCell.dat', GEOIP_STANDARD ); is( $gi->name_by_addr('2.125.160.1'), 'Dialup', 'expected "speed"' ); done_testing(); Geo-IP-1.51/t/domain.t0000644000175000017500000000035013167530465013021 0ustar greggreguse strict; use warnings; use Geo::IP; use Test::More; my $gi = Geo::IP->open( 't/data/GeoIPDomain.dat', GEOIP_STANDARD ); is( $gi->name_by_addr('67.43.156.0'), 'shoesfin.NET', 'expected domain name' ); done_testing(); Geo-IP-1.51/t/country_v6.t0000644000175000017500000000054213167530465013673 0ustar greggreguse strict; use warnings; use Geo::IP; use Test::More; if ( Geo::IP->api eq 'PurePerl' and $] < 5.014 ) { plan skip_all => 'perl provides ipv6 functions from version 5.14'; } my $gi = Geo::IP->open( 't/data/GeoIPv6.dat', GEOIP_STANDARD ); is( $gi->country_code_by_addr_v6('2001:200::'), 'JP', 'expected country code' ); done_testing(); Geo-IP-1.51/t/data/0000755000175000017500000000000013167530465012300 5ustar greggregGeo-IP-1.51/t/data/GeoIP.dat0000644000175000017500000000636313167530465013745 0ustar greggreg©ªÿÿÿÿÿÿÿÿÿÿ ÿÿ ÿÿ ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáÿÿ ÈÉ !ˆ‰"#cd$ÿÿ7ÿÿ%ÿÿ&ÿÿÿÿ'(ÿÿ)ÿÿ*ÿÿÿÿ+ÿÿ,ÿÿ-ÿÿ.ÿÿ/ÿÿ0ÿÿ1ÿÿ23ÿÿÿÿ4ÿÿ56ÿÿÿÿ89:ÿÿÿÿNÿÿ;<ÿÿÿÿ=ÿÿ>ÿÿ?@ÿÿÿÿAÿÿBÿÿCÿÿDEÿÿFÿÿÿÿGÿÿHÿÿIJÿÿÿÿKÿÿLÿÿMÿÿÿÿOPÿÿÿÿQRÿÿSÿÿTÿÿUÿÿVÿÿWÿÿXÿÿYÿÿÿÿZÿÿ[\ÿÿÿÿ]^ÿÿÿÿ_`ÿÿaÿÿáÿÿbáÿÿÿÿeÿÿwÿÿÿÿfgÿÿÿÿhÿÿiÿÿjkÿÿlÿÿÿÿmnÿÿÿÿoÿÿpqÿÿÿÿrsÿÿÿÿtÿÿuÿÿvÿÿxÿÿÿÿyzÿÿÿÿ{|ÿÿÿÿ}ÿÿ~ÿÿ€ÿÿÿÿÿÿ‚ÿÿƒÿÿ„…ÿÿ†ÿÿ‡‡ôÿÿôÿÿÿÿŠžÿÿ‹ÿÿŒÿÿÿÿŽÿÿÿÿÿÿ‘’ÿÿÿÿ“ÿÿ”ÿÿ•ÿÿ–ÿÿ—˜ÿÿÿÿ™ÿÿš›ÿÿœÿÿÿÿŸÿÿÿÿµ ÿÿÿÿ¡¢ÿÿÿÿ£ÿÿ¤ÿÿ¥¦ÿÿ§ÿÿÿÿ¨ÿÿ©ÿÿªÿÿ«¬ÿÿÿÿ­ÿÿ®ÿÿ¯°ÿÿ±ÿÿÿÿ²³ÿÿ´ÿÿÿÿ¶ÿÿ·ÿÿ¸ÿÿÿÿ¹ºÿÿÿÿ»¼ÿÿ½ÿÿÿÿ¾ÿÿ¿ÀÿÿÿÿÁÂÿÿÃÿÿÄÿÿÿÿÅÿÿÆÿÿÇÿÿbÿÿÊÿÿ÷ËÌÍÿÿãÿÿÎÿÿÏÿÿÐÿÿÑÿÿÒÿÿÓÿÿÔÿÿÿÿÕÖÿÿ×ÿÿØÿÿÿÿÙÚÿÿÛÿÿÿÿÜÿÿÝÿÿÞßÿÿàÿÿáÿÿâÿÿÿÿbÿÿäåÿÿæÿÿÿÿçÿÿèéÿÿÿÿêÿÿëÿÿìíÿÿÿÿîïÿÿðÿÿÿÿñÿÿòÿÿóÿÿôõÿÿÿÿöbÿÿøÿÿùÿÿúÿÿûÿÿÿÿüÿÿýþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿ  ÿÿÿÿ lÿÿÿÿdÿÿPÿÿÿÿ()ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿ!"ÿÿÿÿ#ÿÿ$%ÿÿÿÿ&'ÿÿMÿÿÿÿ*ÿÿÿÿ<ÿÿ+ÿÿ,-ÿÿ.ÿÿ/ÿÿÿÿ0ÿÿ12ÿÿ3ÿÿ4ÿÿÿÿ56ÿÿ7ÿÿ8ÿÿÿÿ9:ÿÿÿÿ;ÿÿ¢ÿÿÿÿ=>ÿÿ?ÿÿÿÿ@ÿÿAÿÿBCÿÿDÿÿEÿÿÿÿFGÿÿHÿÿÿÿIJÿÿKÿÿÿÿLÿÿMÿÿNOÿÿJÿÿÿÿÿÿQRÿÿÿÿSTÿÿÿÿUÿÿVWÿÿXÿÿYÿÿZÿÿ[ÿÿ\ÿÿ]ÿÿ^ÿÿ_ÿÿÿÿ`aÿÿÿÿbÿÿcÿÿ8ÿÿeÿÿÿÿfghÿÿi–ÿÿjÿÿÿÿkÿÿlÿÿmnÿÿoÿÿÿÿpÿÿqrÿÿÿÿstÿÿÿÿuvÿÿwxyz…†{|‚JÿÿJÿÿ}JÿÿJÿÿ~JÿÿJÿÿ€Jÿÿ{{JÿÿJÿÿƒJÿÿ„Jÿÿ{‡ˆ{‰‹ŒŠJÿÿJÿÿ{Jÿÿ{JÿÿJÿÿŽJÿÿ{Jÿÿ‘•Jÿÿ’Jÿÿ“JÿÿJÿÿ”Jÿÿ{{Jÿÿÿÿ—˜ÿÿ™ÿÿšÿÿ›ÿÿœÿÿÿÿžÿÿŸÿÿÿÿ ¡ÿÿÿÿ¢£ÿÿ¤ÿÿ¥ÿÿÿÿ¦ÿÿ§ÿÿ¨¿ÿÿÿÿ«ÿÿÐÿÿ¬ÿÿÿÿ­ÿÿ®ÿÿ¯°±ÿÿ²ÿÿÁÿÿ³´ÿÿÿÿµÿÿ¶·ÿÿ¸ÿÿÿÿ¹ÿÿºÿÿ»¼ÿÿÿÿ½¾ÿÿÿÿ¿ÿÿÀ&ÿÿÿÿÿÿÂÃÿÿÿÿÄÿÿÅÆÿÿÇÿÿÿÿÈÿÿÉÿÿÊËÿÿÿÿÌÍÿÿÿÿÎÿÿÏéÿÿÿÿÿÿÑÒÓÔÿÿïðÕÿÿÖÿÿ×ÿÿÿÿØÿÿÙÚÿÿÿÿÛÿÿÜÿÿÝÞÿÿÿÿßÿÿàáÿÿÿÿâÿÿãäÿÿåÿÿÿÿæçÿÿÿÿèÿÿéêëÿÿìîÿÿíáÿÿÿÿbÿÿñÿÿÿÿòÿÿóôÿÿõÿÿöÿÿÿÿ÷øÿÿùÿÿÿÿúÿÿûÿÿüýÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿbÿÿÿÿÿÿ ÿÿ ÿÿ ÿÿ ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿ!"ÿÿ#ÿÿ$ÿÿÿÿ%&ÿÿ'ÿÿoÿÿoÿÿGeo-IP-1.51/t/data/GeoIPv6.dat0000644000175000017500000000264413167530465014217 0ustar greggregÿÿÿÿÿÿÓÿÿÿÿÿÿÿÿ ÿÿ ÿÿ ÿÿ ÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿ!ÿÿ"ÿÿ#ÿÿ$ÿÿ%ÿÿ&ÿÿ'ÿÿ(ÿÿ)ÿÿ*ÿÿ+ÿÿ,ÿÿ-ÿÿ.ÿÿ/ÿÿ0ÿÿ1ÿÿ2ÿÿ3ÿÿ4ÿÿ5ÿÿ6ÿÿ7ÿÿ8ÿÿ9ÿÿ:ÿÿ;ÿÿ<ÿÿ=ÿÿ>ÿÿ?ÿÿ@ÿÿAÿÿBÿÿCÿÿDÿÿEÿÿFÿÿGÿÿHÿÿIÿÿJÿÿKÿÿLÿÿMÿÿNÿÿOÿÿPÿÿQÿÿRSTÿÿÿÿ“UÿÿVÿÿWÿÿXÿÿYÿÿZÿÿ[ÿÿ\ÿÿ]ÿÿ^ÿÿ_ÿÿ`ÿÿaÿÿbÿÿcÿÿdefÿÿzÿÿgÿÿÿÿhÿÿijÿÿkÿÿlÿÿÿÿmnÿÿÿÿopÿÿÿÿqÿÿrÿÿstÿÿÿÿuÿÿvÿÿwxÿÿÿÿyÿÿáÿÿ{ÿÿ|ÿÿ}ÿÿ~ÿÿÿÿ€ÿÿÿÿ‚ÿÿÿÿƒ„ÿÿ…ÿÿ†ÿÿÿÿ‡ÿÿˆÿÿ‰ÿÿŠÿÿ‹ÿÿŒÿÿÿÿŽÿÿÿÿÿÿ‘’ÿÿÿÿyÿÿ”ÿÿ•ÿÿ–ÿÿ—ÿÿ˜ÿÿ™ÿÿšÿÿ›ÿÿœÿÿÿÿžÿÿŸÿÿ ÿÿ¡¢ÿÿ£¤¥ÿÿºÿÿ¦ÿÿÿÿ§ÿÿ¨©ÿÿªÿÿ«ÿÿÿÿ¬­ÿÿÿÿ®¯ÿÿÿÿ°ÿÿ±ÿÿ²³ÿÿÿÿ´ÿÿµÿÿ¶·ÿÿÿÿ¸ÿÿ¹áÿÿÿÿ»ÿÿ¼ÿÿ½ÿÿ¾ÿÿ¿ÿÿÀÿÿÁÿÿÂÿÿÿÿÃÄÿÿÅÿÿÆÿÿÿÿÇÿÿÈÿÿÉÿÿÊÿÿËÿÿÌÿÿÍÿÿÎÏÿÿÿÿÐÿÿÑÒÿÿÿÿyÔÿÿÕÿÿÖÿÿ×ÿÿØÿÿÙÿÿÚÿÿÛÿÿÜÿÿÝÿÿÞÿÿÿÿßàÿÿáÿÿâÿÿãÿÿäÿÿåÿÿÿÿæçÿÿèÿÿéÿÿêÿÿëÿÿìÿÿíÿÿîÿÿoÿÿÿÿÿÿÿ ïGeo-IP-1.51/t/data/GeoIPISP.dat0000644000175000017500000001122013167530465014305 0ustar greggreg±²$$$$$ $ $ $$ $$$$$$$$$$$$$%ÎÏ !‹Œ"#ef$$8$%$&$$'($)$*$$+$,$-$.$/$0$1$23$$4$56$$7$39:;$$P$<=$$>$?$@A$$B$C$D$EF$G$$H$I$JK$$L$M$NO$$A$QR$$ST$U$V$W$X$Y$Z$[$$\$]^$$_`$$ab$c$VdV$g$z$$hi$$j$k$lm$n$$op$$q$rs$$tu$$v$w$x$y$c{$$|}$$~$$€$$‚ƒ$„$$…$†$‡ˆ$‰$ŠŠmm$¡¢$Ž$$$‘$’“$$”•$$–$—$˜$™$š›$$œ$ž$Ÿ$ $$y£$$º¤$$¥¦$$§$¨$©ª$«$$¬$­$®$¯°$$±$²$³´$µ$$¶·$¸$¹$$»$¼$½$$¾¿$$ÀÁ$Â$$Ã$ÄÅ$$ÆÇ$È$É$$Ê$Ë$Ì$Íy$$Ð$ÿÑÒÓ$ê$Ô$Õ$Ö$×$Ø$Ù$Ú$$ÛÜ$Ý$Þ$$ßà$á$$â$ã$äå$æ$ç$è$$é£$$ëì$í$$î$ïð$$ñ$ò$óô$$õö$÷$$ø$ù$ú$ûü$$ýþ$A$$$$$$$$$$ $$  $ $ $$$$$$$$¸$l$X$$01$$$$ $!$$"#$$$$%&$'$($$)*$$+$,-$$./$Ñ$2$$D$3$45$6$7$$8$9:$;$<$$=>$?$@$$AB$$C$æ$EF$G$$H$I$JK$L$M$$NO$P$$QR$S$$T$U$VW$ $$YZ$$[\$$]$^_$`$a$b$c$d$e$f$g$$hi$$j$k$m$$nop$qž$r$$s$t$uv$w$$x$yz$${|$$}~$€‚Žƒ„‰Š++…++†+‡+ˆ+ƒƒ++‹+Œ+ƒ—˜ƒ‘“”’++ƒ+ƒ•++–+ƒ+™+š+›++œ+ƒƒ+$Ÿ $¡$¢$£$¤$¥$¦$§$$¨©$$ª«$¬$­$$®$¯$°<$³$È$´$$µ$¶$·¸$$¹$º»$$¼$½¾$¿$$À$Á$ÂÃ$$ÄÅ$$Æ$ÇI$$ÉÊËÌ$éêÍ$Î$Ï$$Ð$ÑÒ$$Ó$Ô$ÕÖ$$×$ØÙ$$Ú$ÛÜ$Ý$$Þß$$à$áâã$äç$åQ$æ$Qè$Q$ë$$ì$íî$ï$ð$$ñò$ó$$ô$õ$ö÷$$øù$$úû$$ü$ý$þ$ÿc$$$$$$$$$ $$  $ $$ $$$$$$V$$$$$$$$$$$$ $$!"$#$}}*AT&T ServicesTowerstream INuvox CommunicationsCentury LinkSpeakeasyLoud PacketAT&T Internet ServicesFDN CommunicationsCovad CommunicationsASDASD srl a socio unicoAndrews & Arnold LtdIP-Only Telecommunication Networks ABFrance TelecomSurfplanet GmbHBouygues TelecomBredband2 ABTelebecComcast - HoustonSungard Network SolutionsVECTANT Ltd.ÿÿÿ$Geo-IP-1.51/t/data/GeoLiteCityIPv6.dat0000644000175000017500000001176713167530465015674 0ustar greggregw     JK45 !*+"#($&%')%,/0-.12.3&67@A8:;9%<=?0>>>0%BCFGDE%%HI.%LMbcNOXYPQTURS.3VW.%Z[^_\]%%`a..delmfgjhi%%k.nostprq:%uv%%xyz{|}~€‚ƒ„…†‡rsˆ—˜‰Š‹ŒŽ‘’D“•”N–X™š›œÖמº»Ÿ ­®¡¢§¨£¥¤b¦l©«ªv¬€¯°´µ±³²Š¶¸·”¹ž¼½Ê˾¿ÄÅÀÂÁ¨Ã²ÆÈÇ¼ÉÆÌÍÑÒÎÐÏЖÓÔÉÕÚØÙôõÚÛèéÜÝáâÞàßä¦ãäå·æçÁ·êëïðìîíîÕñò–óøö÷øùüýúû·–þÿÕ·   ·¤  É–BC+,  ¬¬!"&'#$¦%(*) )-.89/03412·Õ576*¬:;>?<=·@A¬¬DE[\FGPQHILMJK¬)NO¬ÏRSWXTVU4ÕYZ¦¬]^hi_`cdab¬”ef¬g>jknolmÉ)pqÕÉtu>?vwàáxy¬­z{’“|}ˆ‰~ƒ„€–‚H…‡†R¤Š‹ŽŒÕ²‘Õ‚”•¢£–—žŸ˜™š›6œ\· ¡·¹¤¥¨©¦§Ãª«¹–®¯Åư±º»²³¶·´µ¦·¸¹¬‚¼½Á¾¿–ÀfÃĬÇÈÕÖÉÊÐÑËÌÏÍΖ¬–ÒÔÓp¬×ØÜÝÙÛÚz·Þß)²âãäåùúæçîïèéìêë·¬í¬ðñõöòôó„÷ø”¦ûüýþÿ¤Õ²²    ¬Õ ¬–()–¬íŽ !$%"#)&'·œ*+45,-01./Ϭ23‚¦67:;89¬¬<=)¬@A¦§BCstDE]^FGSTHILMJKǪNORPQÏÕÓUVYZWXÕ·[\–Ï_`ijabefcd·Égh–¬klopmn·qrÕ²uv‘wx‚ƒyz~{}|˜Õ€ó„…‹Œ†‡ˆ¬‰ŠÕ¬Ž¢‚’“œ”•˜™–—‚‚𛬬žŸ¢£ ¡g²¤¥¦²¨©Öת«ÀÁ¬­¶·®¯²³°±¬‚´µ·²¸¹¼½º»Éß¾¿ÕÕÂÃÌÍÄÅÈÉÆÇœ)ÊË·²ÎÏÒÓÐÑ·ÕÔÕ¹²ØÙïðÚÛåæÜÝáâÞߦà¬ãäÕçèëìéê·¹íîà6ñòûüóô÷øõö‚Õùú¹Õýþÿ¹¶·À*o€õ à…0À£¬ðM+w!¸ë.Ü8 Ðí-0pÎ Ð|+^dÜæâ,¢ í$àýf¸E ¬Ä J |"`Å+0£"À¯¿ í$0ÁànÜ-#¹Ÿ$€¹*®€f#€„8p?#ÐÖlm"lE@;%àn$#½7œ#¸Ôj@Y #ÞPñ"@Y M ´# )c0£"€„0£"À¯CÀ‘!Ûð"ÐG¸ |"ÐGí8#€Ù°j!pÎ 5°"€и!€„|Ý  ýî ¡z#ÜWx?ñå¼"»ÐGU"ï."«n02 €õ …ÐGPe#À>H¥!¸¶"À  ´# À‘!U":À$àýùœ½#¼ÄR©ü ¥ÿÿÿGeo-IP-1.51/t/data/GeoIPCity.dat0000644000175000017500000000774113167530465014577 0ustar greggreg¸¹+++++ + + ++ +++++++++++++,ÎÏ !‹Œ"#ef$+8+%+&++'(+)+*++++,+-+.+/+0+1+23++4+56++7+E9:;++P+<=++>+?+@A++B+C+D+EF+G++H+I+JK++L+M+NO++c+QR++ST+U+V+W+X+Y+Z+[++\+]^++_`++ab+c+d+g+z++hi++j+k+lm+n++op++q+rs++tu++v+w+x+y+ {++|}++~++€++‚ƒ+„++…+†+‡ˆ+‰+ŠŠ»»+¡¢+Ž+++‘+’“++”•++–+—+˜+™+š›++œ+ž+Ÿ+ ++Å£++º¤++¥¦++§+¨+©ª+«++¬+­+®+¯°++±+²+³´+µ++¶·+¸+¹++Ò»+¼+½++¾¿++ÀÁ+Â++Ã+ÄÅ++ÆÇ+È+É++Ê+Ë+Ì+Íí++Ð+ÿÑÒÓ+ê+Ô+Õ+Ö+×+Ø+Ù+Ú++ÛÜ+Ý+Þ++ßà+á++â+ã+äå+æ+ç+è++é ++ëì+í++î+ïð++ñ+ò+óô++õö+÷++ø+ù+ú+ûü++ýþ+%++++++++++ ++  + + ++++++++@+l+X++01++++ +!++"#+$++%&+'+(++)*++++,-++./+R+2++D+3+45+6+7++8+9:+;+<++=>+?+@++AB++C+d+EF+G++H+I+JK+L+M++NO+P++QR+S++T+U+VW+t++YZ++[\++]+^_+`+a+b+c+d+e+f+g++hi++j+k+…m++nop+q¥+r++s+t+uv+w++x+yz++{|++}~+€‚‘ƒ„Š‹¥…¶¥†É‡ÉˆÉ‰¶ÉŒ¥¥¶¥¶Ž¶¥å’“žŸ”•˜™É¶–¥¥—¥¶ûš›¶*¶œ¶¶ ¤¶¡¥¢@¶£¶—Œ¥+¦§+¨+©+ª+«+¬+­+®++¯°++±²+³+´++µ+¶+·\+º+Ï+»++¼+½+¾¿++À+ÁÂ++Ã+ÄÅ+Æ++Ç+È+ÉÊ++ËÌ++Í+Îq++ÐÑÒÓ+ðñÔ+Õ+Ö++×+ØÙ++Ú+Û+ÜÝ++Þ+ßà++á+âã+ä++åæ++ç+èéê+ëî+ì‹+í+‹ï+‹+ò++ó+ôõ+ö+÷++øù+ú++û+ü+ýþ++ÿ+++++++¡++ + + + + ++++++++++++++Á+++++ ++!+"#++$%+&+'++()+*+Ûï*áPAPittsburghö¢!iBüÁáCAEl Segundo90245¤ f îA áSCGreenville29615ùÈ €ê8ªáTXSan Antonio78251?öØh ºÈ áCAFremont94538g0!0ÛVR ô@w@wá C!0ª áFLDelray Beachç€h?Ñ^áCAMilpitas95035Ä-!´ÞðQ áILGlenview600257ã!™ß2 áGADouglasville« ˈâl20FeltreÇ|"HMH9London†S#s¢12Oslo¿›$,JA8Lagnysì"á8p?#ÐÖJB4Lille598001#ºîJB4Lille1#ºîJB4RonchinÄ/#úïJB4Fâches-thumesnils/#˜ïJB6Villeneuve?ø"þþJB4Pecquencourt)'#ÀôJB4Tortequesne©##ûíJB4Lille590001#ºîJB4Marcq-en-baroeul3#,ð¿16Linköping'a$GÙ&QCVal-d'orj9p1p8ÏÎ"}™áTXHoustoná ê Ùp áPAPhiladelphia19108ã!*ÿ"³áWAMilton98354­"RÍ5€ o40Setagaya-ç TÆ0o40Tokyo2é FÊ0ÿÿÿ+Geo-IP-1.51/t/data/GeoIPDomain.dat0000644000175000017500000000537013167530465015072 0ustar greggregFFÎÏ ’“ RSF ,-FFFFFFFFFFFGFFF#FFF F!F"FQ$F%F&F'F(F)FQ*+FQF.FCFF/0FF1F2F34F567[[=F89[:[F;F<F[[>[?[@[ABF[FDFFEFFFGHFFIFJFKLFMFFNFOFPQFiFFTklFUFVWFFXFYZFF[\]F^dFF_`vavbvFcFvvefFvghFvijFvFmFF|nFFopFFqFrFstFGuvFwFxFyFGz{FGF}F~FFF€F‚ƒ„„‹F…„†„‡„ˆ„‰„Š„F„„Œ„ŽF„F‘F„FF”F¸•–—F¬F˜F™FšF›FœFžŸ¤F F¡¢F£F¥¦F§¨F©ª«FF­®F¯FF°F±²FF³´GFµ¶GF·G¹FºF»F¼FF½F¾¿FFÀÁFÂFFÃÄÅÆšÊFǚȚFÉFššËšÌšÍšFÐFæFÑÒFÓFÞÔFÕFÖF×FØFÙFFÚÛFÜFFÝ¥FFßFàáFâFFãFäFå²FçFFèéêFëøFìFFíFîFï¼ð¼ñ¼ò¼ó¼ô¼õöF÷F¼FFùúFûFüFýFþFÿFFFÄÄÄÄÄFF F FF F F  FFFFFFFFFFFFÒFÒFÒÒÒÒFF!"#$FF6%F&F'FF(F)*FF+F,F-.FF/F01F2æF34æ5æFæF78FF9F:F;<F=FF>F?@FFABFCFDFFEúF*nuvox.netqwest.netspeakeasy.netshoesfin.NETameritech.netpacbell.netcovad.netpopwifi.itin-addr.arpaoleane.frbbox.frbredband2.comtelebecinternet.netcomcastbusiness.netgol.ne.jpÿÿÿFGeo-IP-1.51/t/data/GeoIPASNumv6.dat0000644000175000017500000000047213167530465015120 0ustar greggreg00000000 0 0 0 0 0000000000000000000 0!0"0#0$0%0&0'00()0*0+00,-0.00/10*AS112 DNS-OARCÿÿÿ0Geo-IP-1.51/t/data/GeoIPNetSpeedCell.dat0000644000175000017500000000576013167530465016175 0ustar greggreg‘÷5÷÷ ÷÷#÷ ÷ ÷÷ ÷÷÷÷÷÷÷÷÷÷÷÷÷÷øøøø ø!ø"ø÷ø$÷%÷&÷÷'(÷÷)*÷+ÿ÷,÷-÷.÷/0ÿ1ÿ÷2÷3÷4÷ÿ6789:;Ü÷<=š›>?}~@÷Q÷A÷B÷÷CD÷E÷FG÷HO÷÷I÷J÷K÷LM ÷N÷ P÷ ÷RST÷÷m÷UV÷÷W÷X÷YZ÷÷[÷\÷]÷^_÷`a÷b i÷cd e f g h ÷Nj÷ k lP÷÷no÷÷pq÷r÷s÷t÷u÷v÷w÷xy÷z P{ ÷|÷N÷÷÷€÷÷‚÷ƒ÷„…÷†÷÷‡ˆ‰Šÿÿ‹÷4Œ÷ÿÿŽ÷ÿ÷‘÷÷’“÷÷”•÷÷–÷—÷˜™÷N ÷œ¯°÷÷žŸ÷÷ ÷¡¢÷÷£¤¥÷¦«÷÷§÷¨÷©ªÿ÷4¬÷­÷®÷÷±÷÷ɲ÷÷³´÷÷µ÷¶÷·¸÷¹÷÷º÷»÷¼÷½¾÷÷¿÷À÷ÁÂ÷Ã÷ÄÅ÷ÆÈ÷÷Ç4ÿÿÊ÷Ë÷Ì÷÷ÍÎ÷÷ÏÐ÷Ñ÷÷Ò÷ÓÔÕ4ÿÖ÷×÷Ø÷Ù÷Ú÷Û÷÷ÝÞ÷ßíî÷à÷á÷â÷ã÷ä÷åæÿ÷ç÷è÷é÷êëÿìÿ÷4ï÷ö÷ð÷ñ÷ò÷ó÷ô÷ÿõÿ÷÷ø÷ù÷÷ú÷ûü÷÷ý÷þ÷ÿ÷÷  ÷÷÷÷÷N  ÷ ÷ ÷ ÷ P÷Z÷G÷÷÷-÷÷÷÷÷÷÷÷÷÷ ÷!÷"÷÷#$÷%&÷'ÿ)(ÿ4ÿ*÷ÿ+ÿ,÷÷.÷/0÷1÷÷2÷3÷45÷6÷789ÿ@÷÷:÷;÷<=ÿ÷>÷?÷4ÿAB÷ÿCD÷E÷F÷÷÷HI÷÷JK÷÷L÷MN÷O÷P÷Q÷R÷S÷T÷U÷ VW÷ XY÷P÷[÷÷\]^÷_y÷`abÿk÷cÿdÿ÷efÿ÷ghÿiÿ÷j4ÿl÷m÷n÷o÷ÿpq÷ÿrs÷ÿtu÷ÿvw÷ÿxÿz{÷|€÷}ÿ÷~÷÷4÷‚÷ƒ÷„÷…÷ÿ†‡÷ÿˆÿ‰ÿŠÿ‹Œ÷ÿŽ÷ÿÿ’÷ž÷“÷÷”÷•÷–—÷÷˜÷™š÷÷›÷œ÷4÷÷Ÿ ¡¢÷µ¶£÷¤÷¥÷÷¦÷§¨÷÷©÷ª÷«¬÷÷­÷®¯°±  ´÷²³ N  P·÷÷á¸÷¹º÷»Ò÷¼÷÷½¾÷¿÷÷À÷Á÷ÂÃ÷÷ÄÅ÷÷ÆÇÈÉ  Í÷ÊË ÷ÌN Î÷Ï÷ Ð ÑP÷÷ÓÔ÷Õ÷Ö÷×÷Ø÷Ù÷÷ÚÛ÷÷ÜÝ÷Þ÷÷ß÷àP÷â÷÷ã÷ä÷åæ÷ç÷÷èéêëÿÿò÷ì÷í÷î÷ïðÿ÷ñ4ÿó÷ô÷õ÷ÿö÷*DialupCable/DSLCorporateÿÿÿ ÷Geo-IP-1.51/t/data/GeoIPRegion.dat0000644000175000017500000000027013167530465015100 0ustar greggreg$ô$ô$ô$ô$ô$ô$ô$ô $ô $ô $ô$ô $ô$ô$ô$ô$ô$ô$ô$ô$ô$ô$ô$ô$ô$ô$ô$ô$ô5$ôÿÿÿGeo-IP-1.51/t/data/GeoIPOrg.dat0000644000175000017500000001151213167530465014405 0ustar greggreg²³%%%%% % % %% %%%%%%%%%%%%%&ÏÐ !Œ"#ef$%8%%%&%%'(%)%*%%+%,%-%.%/%0%1%23%%4%56%%7%=9:;%%P%<=%%>%?%@A%%B%C%D%EF%G%%H%I%JK%%L%M%NO%%P%QR%%ST%U%V%W%X%Y%Z%[%%\%]^%%_`%%ab%c%d%g%z%%hi%%j%k%lm%n%%op%%q%rs%%tu%%v%w%x%y%†{%%|}%%~%%€%%‚ƒ%„%%…%†%‡ˆ%‰%Š‹–¦µÁ%Ž¢£%%‘%%’%“”%%•–%%—%˜%™%š%›œ%%%žŸ% %¡%%ʤ%%»¥%%¦§%%¨%©%ª«%¬%%­%®%¯%°±%%²%³%´µ%¶%%·¸%¹%º%%Ö¼%½%¾%%¿À%%ÁÂ%Ã%%Ä%ÅÆ%%ÇÈ%É%Ê%%Ë%Ì%Í%Îë%%Ñ%ÒÓÔ%ë%Õ%Ö%×%Ø%Ù%Ú%Û%%ÜÝ%Þ%ß%%àá%â%%ã%ä%åæ%ç%è%é%%êý%%ìí%î%%ï%ðñ%%ò%ó%ôõ%%ö÷%ø%%ù%ú%û%üý%%þÿ%%%%%%%%%% % %%  % %%%%%%%%%A%m%Y%%12%%% %!%"%%#$%%%%&'%(%)%%*+%%,%-.%%/0%X%3%%E%4%56%7%8%%9%:;%<%=%%>?%@%A%%BC%%D%r%FG%H%%I%J%KL%M%N%%OP%Q%%RS%T%%U%V%WX%…%%Z[%%\]%%^%_`%a%b%c%d%e%f%g%h%%ij%%k%l%©n%%opq%rŸ%s%%t%u%vw%x%%y%z{%%|}%%~%€‚ƒŽ„…Š‹¹¹†¹¹‡¹ˆ¹‰¹„„¹¹Œ¹¹„‘˜™„’”•“¹¹„¹„–¹¹—¹„¹šž¹›¹œ¹¹¹„„¹% ¡%¢%£%¤%¥%¦%§%¨%%©ª%%«¬%­%®%%¯%°%±Ê%´%É%µ%%¶%·%¸¹%%º%»¼%%½%¾¿%À%%Á%Â%ÃÄ%%ÅÆ%%Ç%ÈÑ%%ÊËÌÍ%êëÎ%Ï%Ð%%Ñ%ÒÓ%%Ô%Õ%Ö×%%Ø%ÙÚ%%Û%ÜÝ%Þ%%ßà%%á%âãä%åè%æô%ç%ôé%ô%ì%%í%îï%ð%ñ%%òó%ô%%õ%ö%÷ø%%ùú%%ûü%%ý%þ%ÿ%%%%%%%%%%  %%  % %%%%%%%% %%%%%%%%%%% %!%%"#%$%00*AT&T Worldnet ServicesKarlin Peebles LLPEndodontic Associates Of Savannah,p.c Voxip LpbkATMIVikco Insurancezudoarichikito_ania_jab?o?skahalle_moorepark_tair x opticalDSLAM WAN AllocationLeung Yin Lam DbaCovad CommunicationsChild Care Assoc. Of Brevard County (pinewood)Marino Dalla GasperinaSTONEHOUSE office networkEffectiv SolutionsTransports Routiers De MarchandisesSurfplanet GmbHBouygues TelecomBevtecLINO Solutions Internet de TélébecComcast - HoustonSungard Network SolutionsLariat SoftwareVECTANT Ltd.ÿÿÿ%Geo-IP-1.51/t/data/GeoIPASNum.dat0000644000175000017500000000477213167530465014653 0ustar greggreg{%{{{{ { { {{ {{|||{|{|{{{|{{{{{{ {|!"{#{${|{&'()àá*+²³,-tu./]^0{<{1{2{{34{5{6{{7{8{9{:{;{ƒ=>?{{G{@A{{B{C{DE{{F{‹{HI{JK{LU{{M{N{O{P{QR“S“T“{“V{W{X{Y{Z{“[“\“{_{e{{`a{{b{c{d™{f{{gh{{ij{{k{l{mn{o{{pq¡{rs¡{¡{vŒ{w{xy{{z{{|{{}~€©‡{©{‚ƒ©„©…©{†{©©ˆ‰{©Š‹{©{Ž{{œ{{‘{{’{“{”•{–‹—‹˜‹{™š‹{›F‹{ž{Ÿ{ ¡{¢©ª{£¤©¥©{¦§©¨©{©{†«{¬{©­©®¯{°{±{©‹{´{е¶·{Å{¸{¹{º{»{¼{½{¾{¿ÀÁ°Â{{°°ÃÄ{°{{ÆÇ{È{{É{ÊË{{ÌÍ‹΋{ÏF‹Ñ{Ò{Ó{Ô{{Õ{Ö×{{ØÙ{Ú{{Û¸ܸݸÞ¸߸{âã{{ä{åæç{{ð{è{éê{ë{ì{{í{îï{Ë{{ñò{ó{{ô{õ{ö÷{ø{ùúûÛÿ{üÛ{ýþÛ{Û{{{Û{{{{{{{  { { { {{ú{{{{{{{{{{{{{.{{5{ {{!{"{#${{%{&'{{({)*{+{{,{-{./0{C1{C2C3C4C{{6789{JK:{;{<{{={>?{{@{A{BC{{D{EF{GKHKIK{KL{{pM{NO{P^{Q{{RS{T{{U{V{WX{{YZS[S\S]S{S{_`{a{b{c{d{efg““kh“{i{jT“l{m{“n“o“\q{{r{s{tu{v{{wxy{z|{{|*AS7018AS33224AS11456AS209AS23504AS35908AS7132AS18566AS28929 ASDASD srlAS12552 IP-OnlyAS3215 France Telecom - OrangeAS33984 Surfplanet GmbHAS5410 Bouygues Telecom ISPAS29518 Bredband2 ABAS35911AS11025AS7381 SunGard Availability Services USAAS2519 JPNICÿÿÿ {Geo-IP-1.51/IP.xs0000644000175000017500000002761213167530465012020 0ustar greggreg#ifdef __cplusplus extern "C" { #endif #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #include "GeoIP.h" #include "GeoIPCity.h" /* if we're built against a version of geoip-api-c that doesn't define this, * the flag should be harmless (as long as it doesn't clash with another * flag using the same bit position). */ #ifndef GEOIP_SILENCE #define GEOIP_SILENCE 16 #endif #ifdef __cplusplus } #endif MODULE = Geo::IP PACKAGE = Geo::IP PROTOTYPES: DISABLE const char * region_name_by_code(CLASS, country_code, region) char * CLASS char * country_code char * region CODE: RETVAL = (const char *) GeoIP_region_name_by_code(country_code, region); OUTPUT: RETVAL const char * continent_code_by_country_code(CLASS, country_code) char * CLASS char * country_code CODE: RETVAL = (const char *) GeoIP_country_continent[GeoIP_id_by_code(country_code)]; OUTPUT: RETVAL const char * time_zone(CLASS, country_code, region) char * CLASS char * country_code char * region CODE: RETVAL = (const char *) GeoIP_time_zone_by_country_and_region(country_code, region); OUTPUT: RETVAL GeoIP * new(CLASS,flags = 0) char * CLASS int flags PREINIT: GeoIP * gi; CODE: gi = GeoIP_new(flags | GEOIP_SILENCE); if ( gi ) GeoIP_set_charset(gi, GEOIP_CHARSET_ISO_8859_1); RETVAL = gi; OUTPUT: RETVAL GeoIP * open_type(CLASS,type,flags = 0) char * CLASS int type int flags PREINIT: GeoIP * gi; CODE: gi = GeoIP_open_type(type, flags | GEOIP_SILENCE); if ( gi ) GeoIP_set_charset(gi, GEOIP_CHARSET_ISO_8859_1); RETVAL = gi; OUTPUT: RETVAL GeoIP * open(CLASS,filename,flags = 0) char * CLASS char * filename int flags PREINIT: GeoIP * gi; CODE: gi = ( filename != NULL ) ? GeoIP_open(filename, flags | GEOIP_SILENCE) : NULL; if ( gi ) GeoIP_set_charset(gi, GEOIP_CHARSET_ISO_8859_1); RETVAL = gi; OUTPUT: RETVAL int id_by_addr(gi, addr) GeoIP *gi char * addr CODE: RETVAL = GeoIP_id_by_addr(gi,addr); OUTPUT: RETVAL int id_by_name(gi, name) GeoIP *gi char * name CODE: RETVAL = GeoIP_id_by_name(gi,name); OUTPUT: RETVAL int database_edition (gi) GeoIP *gi CODE: RETVAL = GeoIP_database_edition(gi); OUTPUT: RETVAL char * database_info (gi) GeoIP *gi CODE: RETVAL = GeoIP_database_info(gi); OUTPUT: RETVAL const char * country_code_by_ipnum_v6(gi, ptr) GeoIP *gi char *ptr CODE: RETVAL = GeoIP_country_code_by_ipnum_v6(gi,*(geoipv6_t*)ptr); OUTPUT: RETVAL const char * country_code_by_addr_v6(gi, addr) GeoIP *gi char * addr CODE: RETVAL = GeoIP_country_code_by_addr_v6(gi,addr); OUTPUT: RETVAL const char * country_code_by_name_v6(gi, name) GeoIP *gi char * name CODE: RETVAL = GeoIP_country_code_by_name_v6(gi,name); OUTPUT: RETVAL const char * country_code3_by_ipnum_v6(gi, ptr) GeoIP *gi char *ptr CODE: RETVAL = GeoIP_country_code3_by_ipnum_v6(gi,*(geoipv6_t*)ptr); OUTPUT: RETVAL const char * country_code3_by_addr_v6(gi, addr) GeoIP *gi char * addr CODE: RETVAL = GeoIP_country_code3_by_addr_v6(gi,addr); OUTPUT: RETVAL const char * country_code3_by_name_v6(gi, name) GeoIP *gi char * name CODE: RETVAL = GeoIP_country_code3_by_name_v6(gi,name); OUTPUT: RETVAL const char * country_name_by_name_v6(gi, name) GeoIP *gi char * name CODE: RETVAL = GeoIP_country_name_by_name_v6(gi,name); OUTPUT: RETVAL const char * country_name_by_ipnum_v6(gi, ptr) GeoIP *gi char *ptr CODE: RETVAL = GeoIP_country_name_by_ipnum_v6(gi,*(geoipv6_t*)ptr); OUTPUT: RETVAL const char * country_name_by_addr_v6(gi, addr) GeoIP *gi char * addr CODE: RETVAL = GeoIP_country_name_by_addr_v6(gi,addr); OUTPUT: RETVAL const char * country_code_by_addr(gi, addr) GeoIP *gi char * addr CODE: RETVAL = GeoIP_country_code_by_addr(gi,addr); OUTPUT: RETVAL const char * country_code_by_name(gi, name) GeoIP *gi char * name CODE: RETVAL = GeoIP_country_code_by_name(gi,name); OUTPUT: RETVAL const char * country_code3_by_addr(gi, addr) GeoIP *gi char * addr CODE: RETVAL = GeoIP_country_code3_by_addr(gi,addr); OUTPUT: RETVAL const char * country_code3_by_name(gi, name) GeoIP *gi char * name CODE: RETVAL = GeoIP_country_code3_by_name(gi,name); OUTPUT: RETVAL const char * country_name_by_addr(gi, addr) GeoIP *gi char * addr CODE: RETVAL = GeoIP_country_name_by_addr(gi,addr); OUTPUT: RETVAL const char * country_name_by_name(gi, name) GeoIP *gi char * name CODE: RETVAL = GeoIP_country_name_by_name(gi,name); OUTPUT: RETVAL void name_by_ipnum_v6(gi, ptr) GeoIP *gi char * ptr PREINIT: char * n; PPCODE: ST(0) = sv_newmortal(); n = GeoIP_name_by_ipnum_v6(gi,*(geoipv6_t*)ptr); if ( n != NULL ) { ST(0) = newSVpv(n, strlen(n)); free(n); #if defined(sv_utf8_decode) if ( GeoIP_charset(gi) == GEOIP_CHARSET_UTF8 ) SvUTF8_on(ST(0)); #endif sv_2mortal(ST(0)); } XSRETURN(1); void name_by_addr_v6(gi, addr) GeoIP *gi char * addr PREINIT: char * n; PPCODE: ST(0) = sv_newmortal(); n = GeoIP_name_by_addr_v6(gi,addr); if ( n != NULL ) { ST(0) = newSVpv(n, strlen(n)); free(n); #if defined(sv_utf8_decode) if ( GeoIP_charset(gi) == GEOIP_CHARSET_UTF8 ) SvUTF8_on(ST(0)); #endif sv_2mortal(ST(0)); } XSRETURN(1); void name_by_name_v6(gi, name) GeoIP *gi char * name PREINIT: char * n; PPCODE: ST(0) = sv_newmortal(); n = GeoIP_name_by_name_v6(gi,name); if ( n != NULL ) { ST(0) = newSVpv(n, strlen(n)); free(n); #if defined(sv_utf8_decode) if ( GeoIP_charset(gi) == GEOIP_CHARSET_UTF8 ) SvUTF8_on(ST(0)); #endif sv_2mortal(ST(0)); } XSRETURN(1); void org_by_addr(gi, addr) GeoIP *gi char * addr PREINIT: char * n; PPCODE: ST(0) = sv_newmortal(); n = GeoIP_org_by_addr(gi,addr); if ( n != NULL ) { ST(0) = newSVpv(n, strlen(n)); free(n); #if defined(sv_utf8_decode) if ( GeoIP_charset(gi) == GEOIP_CHARSET_UTF8 ) SvUTF8_on(ST(0)); #endif sv_2mortal(ST(0)); } XSRETURN(1); void org_by_name(gi, name) GeoIP *gi char * name PREINIT: char * n; PPCODE: ST(0) = sv_newmortal(); n = GeoIP_org_by_name(gi,name); if ( n != NULL ) { ST(0) = newSVpv(n, strlen(n)); free(n); #if defined(sv_utf8_decode) if ( GeoIP_charset(gi) == GEOIP_CHARSET_UTF8 ) SvUTF8_on(ST(0)); #endif sv_2mortal(ST(0)); } XSRETURN(1); void range_by_ip(gi, addr) GeoIP *gi const char * addr PREINIT: char ** r; PPCODE: r = GeoIP_range_by_ip(gi,addr); if (r != NULL){ EXTEND(SP,2); PUSHs( sv_2mortal( newSVpv(r[0], 0) ) ); PUSHs( sv_2mortal( newSVpv(r[1], 0) ) ); if ( r[0] ) free(r[0]); if ( r[1] ) free(r[1]); free(r); } void region_by_addr(gi, addr) GeoIP *gi char * addr PREINIT: GeoIPRegion * gir; PPCODE: gir = GeoIP_region_by_addr(gi,addr); if (gir){ EXTEND(SP,2); ( gir->country_code[0] == '\0' && gir->country_code[1] == '\0' ) ? PUSHs ( sv_newmortal() ) : PUSHs ( sv_2mortal( newSVpv(gir->country_code, 2) ) ); ( gir->region[0] == '\0' && gir->region[1] == '\0' ) ? PUSHs ( sv_newmortal() ) : PUSHs( sv_2mortal( newSVpv(gir->region, 2) ) ); GeoIPRegion_delete(gir); } void region_by_name(gi, name) GeoIP *gi char * name PREINIT: GeoIPRegion * gir; PPCODE: gir = GeoIP_region_by_name(gi,name); if (gir){ EXTEND(SP,2); ( gir->country_code[0] == '\0' && gir->country_code[1] == '\0' ) ? PUSHs ( sv_newmortal() ) : PUSHs ( sv_2mortal( newSVpv(gir->country_code, 2) ) ); ( gir->region[0] == '\0' && gir->region[1] == '\0' ) ? PUSHs ( sv_newmortal() ) : PUSHs( sv_2mortal( newSVpv(gir->region, 2) ) ); GeoIPRegion_delete(gir); } GeoIPRecord * record_by_ipnum_v6(gi, ipnum) GeoIP *gi char * ipnum PREINIT: char * CLASS = "Geo::IP::Record"; CODE: RETVAL = GeoIP_record_by_ipnum_v6(gi,*(geoipv6_t*)ipnum); OUTPUT: RETVAL GeoIPRecord * record_by_addr_v6(gi, addr) GeoIP *gi char * addr PREINIT: char * CLASS = "Geo::IP::Record"; CODE: RETVAL = GeoIP_record_by_addr_v6(gi,addr); OUTPUT: RETVAL GeoIPRecord * record_by_name_v6(gi, addr) GeoIP *gi char * addr PREINIT: char * CLASS = "Geo::IP::Record"; CODE: RETVAL = GeoIP_record_by_name_v6(gi,addr); OUTPUT: RETVAL GeoIPRecord * record_by_addr(gi, addr) GeoIP *gi char * addr PREINIT: char * CLASS = "Geo::IP::Record"; CODE: RETVAL = GeoIP_record_by_addr(gi,addr); OUTPUT: RETVAL GeoIPRecord * record_by_name(gi, addr) GeoIP *gi char * addr PREINIT: char * CLASS = "Geo::IP::Record"; CODE: RETVAL = GeoIP_record_by_name(gi,addr); OUTPUT: RETVAL int enable_teredo(gi, tf) GeoIP *gi int tf CODE: RETVAL = GeoIP_enable_teredo(gi, tf); OUTPUT: RETVAL int teredo(gi) GeoIP *gi CODE: RETVAL = GeoIP_teredo(gi); OUTPUT: RETVAL int set_charset(gi, charset) GeoIP *gi int charset CODE: RETVAL = GeoIP_set_charset(gi, charset); OUTPUT: RETVAL const char * lib_version(CLASS) char * CLASS CODE: RETVAL = GeoIP_lib_version(); OUTPUT: RETVAL int charset(gi) GeoIP *gi CODE: RETVAL = GeoIP_charset(gi); OUTPUT: RETVAL int last_netmask(gi) GeoIP *gi CODE: RETVAL = GeoIP_last_netmask(gi); OUTPUT: RETVAL void DESTROY(gi) GeoIP *gi CODE: GeoIP_delete(gi); MODULE = Geo::IP PACKAGE = Geo::IP::Record const char * country_code(gir) GeoIPRecord *gir CODE: RETVAL = (const char *)gir->country_code; OUTPUT: RETVAL const char * country_code3(gir) GeoIPRecord *gir CODE: RETVAL = (const char *)gir->country_code3; OUTPUT: RETVAL const char * country_name(gir) GeoIPRecord *gir CODE: RETVAL = (const char *)gir->country_name; OUTPUT: RETVAL const char * region(gir) GeoIPRecord *gir CODE: RETVAL = (const char *)gir->region; OUTPUT: RETVAL const char * region_name(gir) GeoIPRecord *gir CODE: RETVAL = (const char *) GeoIP_region_name_by_code(gir->country_code, gir->region); OUTPUT: RETVAL const char * time_zone(gir) GeoIPRecord *gir CODE: RETVAL = (const char *) GeoIP_time_zone_by_country_and_region(gir->country_code, gir->region); OUTPUT: RETVAL void city(gir) GeoIPRecord *gir PREINIT: SV * n; PPCODE: n = newSVpv( gir->city ? gir->city : "", 0); #if defined(sv_utf8_decode) if ( gir->charset == GEOIP_CHARSET_UTF8 ) SvUTF8_on(n); #endif sv_2mortal(n); ST(0) = n; XSRETURN(1); const char * postal_code(gir) GeoIPRecord *gir CODE: RETVAL = (const char *)gir->postal_code; OUTPUT: RETVAL float _latitude(gir) GeoIPRecord *gir CODE: RETVAL = gir->latitude; OUTPUT: RETVAL float _longitude(gir) GeoIPRecord *gir CODE: RETVAL = gir->longitude; OUTPUT: RETVAL int dma_code(gir) GeoIPRecord *gir CODE: RETVAL = gir->dma_code; OUTPUT: RETVAL int metro_code(gir) GeoIPRecord *gir CODE: RETVAL = gir->dma_code; /* we can NOT use metro_code here. metro_code may be not present in older CAPI's */ OUTPUT: RETVAL int area_code(gir) GeoIPRecord *gir CODE: RETVAL = gir->area_code; OUTPUT: RETVAL const char * continent_code(gir) GeoIPRecord *gir CODE: RETVAL = (const char *)gir->continent_code; OUTPUT: RETVAL void DESTROY(gir) GeoIPRecord *gir CODE: GeoIPRecord_delete(gir); void _XScompiled () CODE: XSRETURN_YES; Geo-IP-1.51/dist.ini0000644000175000017500000000151513167530465012572 0ustar greggregname = Geo-IP author = Dave Rolsky author = Greg Oschwald copyright_holder = MaxMind, Inc. copyright_year = 2002 version = 1.51 [Encoding] encoding = bytes match = \.dat$ [@MAXMIND] dist = Geo-IP make_tool = MakeMaker::Runner pod_coverage_class = Pod::Coverage::Moose pod_coverage_skip = Geo::IP pod_coverage_skip = Geo::IP::Record pod_coverage_skip = Geo::Mirror stopwords_file = .stopwords -remove = CopyFilesFromBuild -remove = Git::GatherDir -remove = InstallGuide -remove = MAXMIND::VersionProvider -remove = Test::CleanNamespaces [Git::GatherDir] exclude_filename = cpanfile exclude_filename = CONTRIBUTING.md exclude_filename = LICENSE exclude_filename = perlcriticrc exclude_filename = perltidyrc exclude_filename = ppport.h exclude_filename = README.md exclude_filename = tidyall.ini Geo-IP-1.51/INSTALL0000644000175000017500000000105413167530465012155 0ustar greggregTo install the GeoIP C library, go to http://www.maxmind.com/app/c Geo::IP 1.37 requires GeoIP CAPI 1.4.5 or higher Note that Geo::IP 1.36 requires GeoIP C 1.4.5 or higher To install the Perl XS wrapper, run perl Makefile.PL make make test make install To install the PurePerl code (no C API required), run perl Makefile.PL PP=1 make make test make install (If you get a "libGeoIP.so.1: cannot open shared object No such file or directory" error, add /usr/local/lib to /etc/ld.so.conf then run /sbin/ldconfig /etc/ld.so.conf ) Geo-IP-1.51/META.json0000644000175000017500000010426013167530465012550 0ustar greggreg{ "abstract" : "Look up location and network information by IP Address", "author" : [ "Dave Rolsky ", "Greg Oschwald " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Geo-IP", "prereqs" : { "develop" : { "requires" : { "Code::TidyAll::Plugin::Test::Vars" : "0.02", "Devel::PPPort" : "3.23", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Parallel::ForkManager" : "1.19", "Perl::Critic" : "1.126", "Perl::Tidy" : "20160302", "Pod::Coverage::Moose" : "0", "Pod::Coverage::TrustPod" : "0", "Pod::Wordlist" : "0", "Test" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta::JSON" : "0.16", "Test::Code::TidyAll" : "0.50", "Test::EOL" : "0", "Test::Mojibake" : "0", "Test::More" : "0.96", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Portability::Files" : "0", "Test::Spelling" : "0.12", "Test::Synopsis" : "0", "Test::Vars" : "0.009", "Test::Version" : "2.05", "parent" : "0", "perl" : "5.006", "warnings" : "0" } }, "runtime" : { "requires" : { "DynaLoader" : "0", "Exporter" : "0", "base" : "0", "strict" : "0", "vars" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "Test::More" : "0.96", "warnings" : "0" } } }, "provides" : { "Geo::IP" : { "file" : "lib/Geo/IP.pm", "version" : "1.51" }, "Geo::IP::Record" : { "file" : "lib/Geo/IP/Record.pm", "version" : "1.51" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/maxmind/geoip-api-perl/issues" }, "homepage" : "http://metacpan.org/release/Geo-IP", "repository" : { "type" : "git", "url" : "git://github.com/maxmind/geoip-api-perl.git", "web" : "https://github.com/maxmind/geoip-api-perl" } }, "version" : "1.51", "x_Dist_Zilla" : { "perl" : { "version" : "5.026001" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Encoding", "name" : "Encoding", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MakeMaker::Runner", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@MAXMIND/MakeMaker::Runner", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@MAXMIND/ManifestSkip", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@MAXMIND/License", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@MAXMIND/ExecDir", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@MAXMIND/ShareDir", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@MAXMIND/Manifest", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::CheckVersionIncrement", "name" : "@MAXMIND/CheckVersionIncrement", "version" : "0.121750" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@MAXMIND/TestRelease", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@MAXMIND/ConfirmRelease", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@MAXMIND/Authority", "version" : "1.009" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@MAXMIND/AutoPrereqs", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::GitHub::Meta", "name" : "@MAXMIND/GitHub::Meta", "version" : "0.44" }, { "class" : "Dist::Zilla::Plugin::GitHub::Update", "config" : { "Dist::Zilla::Plugin::GitHub::Update" : { "metacpan" : 1 } }, "name" : "@MAXMIND/GitHub::Update", "version" : "0.44" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "@MAXMIND/MetaResources", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@MAXMIND/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.010" } ], "include_underscores" : 0 }, "Dist::Zilla::Role::MetaProvider::Provider" : { "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004", "inherit_missing" : 1, "inherit_version" : 1, "meta_noindex" : 1 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000033", "version" : "0.004" } }, "name" : "@MAXMIND/MetaProvides::Package", "version" : "2.004003" }, { "class" : "Dist::Zilla::Plugin::Meta::Contributors", "name" : "@MAXMIND/Meta::Contributors", "version" : "0.003" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@MAXMIND/MetaConfig", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@MAXMIND/MetaJSON", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@MAXMIND/MetaYAML", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@MAXMIND/NextRelease", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "@MAXMIND/Test::More with subtest", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "@MAXMIND/Modules for use with tidyall", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "@MAXMIND/Test::Version which fixes https://github.com/plicease/Test-Version/issues/7", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::MAXMIND" ], "phase" : "build", "run_under_travis" : 0, "skip" : [] } }, "name" : "@MAXMIND/Dist::Zilla::PluginBundle::MAXMIND", "version" : "0.054" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 1, "check_all_prereqs" : 1, "modules" : [], "phase" : "release", "run_under_travis" : 0, "skip" : [ "Dist::Zilla::Plugin::MAXMIND::CheckChangesHasContent", "Dist::Zilla::Plugin::MAXMIND::Contributors", "Dist::Zilla::Plugin::MAXMIND::Git::CheckFor::CorrectBranch", "Dist::Zilla::Plugin::MAXMIND::License", "Dist::Zilla::Plugin::MAXMIND::TidyAll", "Dist::Zilla::Plugin::MAXMIND::VersionProvider", "Pod::Weaver::PluginBundle::MAXMIND" ] } }, "name" : "@MAXMIND/PromptIfStale", "version" : "0.054" }, { "class" : "Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable", "name" : "@MAXMIND/Test::Pod::Coverage::Configurable", "version" : "0.06" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "config" : { "Dist::Zilla::Plugin::Test::PodSpelling" : { "directories" : [ "bin", "lib" ], "spell_cmd" : "", "stopwords" : [ "APNIC\n", "ARIN\n", "Alders", "Alders'", "Eilam", "Eilam's", "GEOLOCATION\n", "GeoIP\n", "GeoLite\n", "LACNIC\n", "LLC\n", "MAXMIND", "MAXMIND's", "MaxMind", "MaxMind's", "Netspeed\n", "Oschwald", "Oschwald's", "PayPal", "Rolsky", "Rolsky's", "api\n", "cronjob\n", "dat\n", "datadir\n", "geoip\n", "geoipupdate\n", "geolocation\n", "ipnum\n", "isp\n", "netblocks\n", "netmask\n", "onwards\n", "teredo\n", "whois\n" ], "wordlist" : "Pod::Wordlist" } }, "name" : "@MAXMIND/Test::PodSpelling", "version" : "2.007004" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@MAXMIND/PodSyntaxTests", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@MAXMIND/RunExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", "name" : "@MAXMIND/MojibakeTests", "version" : "0.8" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", "config" : { "Dist::Zilla::Plugin::Test::CPAN::Changes" : { "changelog" : "Changes" } }, "name" : "@MAXMIND/Test::CPAN::Changes", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Meta::JSON", "name" : "@MAXMIND/Test::CPAN::Meta::JSON", "version" : "0.004" }, { "class" : "Dist::Zilla::Plugin::Test::EOL", "config" : { "Dist::Zilla::Plugin::Test::EOL" : { "filename" : "xt/author/eol.t", "finder" : [ ":ExecFiles", ":InstallModules", ":TestFiles" ], "trailing_whitespace" : 1 } }, "name" : "@MAXMIND/Test::EOL", "version" : "0.19" }, { "class" : "Dist::Zilla::Plugin::Test::NoTabs", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "filename" : "xt/author/no-tabs.t", "finder" : [ ":InstallModules", ":ExecFiles", ":TestFiles" ] } }, "name" : "@MAXMIND/Test::NoTabs", "version" : "0.15" }, { "class" : "Dist::Zilla::Plugin::Test::Portability", "config" : { "Dist::Zilla::Plugin::Test::Portability" : { "options" : "" } }, "name" : "@MAXMIND/Test::Portability", "version" : "2.001000" }, { "class" : "Dist::Zilla::Plugin::Test::Synopsis", "name" : "@MAXMIND/Test::Synopsis", "version" : "2.000007" }, { "class" : "Dist::Zilla::Plugin::Test::TidyAll", "name" : "@MAXMIND/Test::TidyAll", "version" : "0.04" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : 0, "fail_on_warning" : "author", "fake_home" : 0, "filename" : "xt/author/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "develop", "script_finder" : [ ":PerlExecFiles" ], "skips" : [], "switch" : [] } }, "name" : "@MAXMIND/Test::Compile", "version" : "2.057" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@MAXMIND/Test::ReportPrereqs", "version" : "0.027" }, { "class" : "Dist::Zilla::Plugin::Test::Version", "name" : "@MAXMIND/Test::Version", "version" : "1.09" }, { "class" : "Dist::Zilla::Plugin::MAXMIND::Contributors", "name" : "@MAXMIND/MAXMIND::Contributors", "version" : "0.84" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "git_version" : "2.11.0", "include_authors" : 0, "include_releaser" : 1, "order_by" : "name", "paths" : [] } }, "name" : "@MAXMIND/Git::Contributors", "version" : "0.030" }, { "class" : "Dist::Zilla::Plugin::SurgicalPodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugins" : [ "@MAXMIND" ], "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@MAXMIND/SingleEncoding", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@MAXMIND/List", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@MAXMIND/Verbatim", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@MAXMIND/header", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@MAXMIND/Name", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@MAXMIND/Version", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@MAXMIND/prelude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "TYPES", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@MAXMIND/Leftovers", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@MAXMIND/postlude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::GenerateSection", "name" : "@MAXMIND/generate SUPPORT", "version" : "1.06" }, { "class" : "Pod::Weaver::Section::AllowOverride", "name" : "@MAXMIND/allow override SUPPORT", "version" : "0.05" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@MAXMIND/Authors", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "@MAXMIND/Contributors", "version" : "0.009" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@MAXMIND/Legal", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@MAXMIND/footer", "version" : "4.015" } ] } }, "name" : "@MAXMIND/SurgicalPodWeaver", "version" : "0.0023" }, { "class" : "Dist::Zilla::Plugin::MAXMIND::WeaverConfig", "name" : "@MAXMIND/MAXMIND::WeaverConfig", "version" : "0.84" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@MAXMIND/README.md in build", "version" : "0.163250" }, { "class" : "Dist::Zilla::Plugin::GenerateFile::FromShareDir", "config" : { "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : { "destination_filename" : "CONTRIBUTING.md", "dist" : "Dist-Zilla-PluginBundle-MAXMIND", "encoding" : "UTF-8", "has_xs" : 1, "location" : "build", "source_filename" : "CONTRIBUTING.md" }, "Dist::Zilla::Role::RepoFileInjector" : { "allow_overwrite" : 1, "repo_root" : ".", "version" : "0.007" } }, "name" : "@MAXMIND/Generate CONTRIBUTING.md", "version" : "0.013" }, { "class" : "Dist::Zilla::Plugin::CPANFile", "name" : "@MAXMIND/CPANFile", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::PPPort", "name" : "@MAXMIND/PPPort", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::MAXMIND::License", "name" : "@MAXMIND/MAXMIND::License", "version" : "0.84" }, { "class" : "Dist::Zilla::Plugin::CheckStrictVersion", "name" : "@MAXMIND/CheckStrictVersion", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::CheckSelfDependency", "config" : { "Dist::Zilla::Plugin::CheckSelfDependency" : { "finder" : [ ":InstallModules" ] }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000033", "version" : "0.004" } }, "name" : "@MAXMIND/CheckSelfDependency", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@MAXMIND/CheckPrereqsIndexed", "version" : "0.020" }, { "class" : "Dist::Zilla::Plugin::MAXMIND::CheckChangesHasContent", "name" : "@MAXMIND/MAXMIND::CheckChangesHasContent", "version" : "0.84" }, { "class" : "Dist::Zilla::Plugin::MAXMIND::Git::CheckFor::CorrectBranch", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.11.0", "repo_root" : "." } }, "name" : "@MAXMIND/MAXMIND::Git::CheckFor::CorrectBranch", "version" : "0.84" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.11.0", "repo_root" : "." } }, "name" : "@MAXMIND/Git::CheckFor::MergeConflicts", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::MAXMIND::TidyAll", "name" : "@MAXMIND/MAXMIND::TidyAll", "version" : "0.84" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@MAXMIND/UploadToCPAN", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "CONTRIBUTING.md", "Changes", "LICENSE", "Makefile.PL", "README.md", "cpanfile", "ppport.h", "tidyall.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.11.0", "repo_root" : "." } }, "name" : "@MAXMIND/Git::Check", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "v%v%n%n%c" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "CONTRIBUTING.md", "Changes", "LICENSE", "Makefile.PL", "README.md", "cpanfile", "ppport.h", "tidyall.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.11.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@MAXMIND/Commit generated files", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "v1.51", "tag_format" : "v%v", "tag_message" : "v%v" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.11.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@MAXMIND/Git::Tag", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.11.0", "repo_root" : "." } }, "name" : "@MAXMIND/Git::Push", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease", "config" : { "Dist::Zilla::Plugin::BumpVersionAfterRelease" : { "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 0, "munge_makefile_pl" : 1 } }, "name" : "@MAXMIND/BumpVersionAfterRelease", "version" : "0.015" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "Bump version after release" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [ "(?^:.+)" ], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.11.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@MAXMIND/Commit version bump", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.11.0", "repo_root" : "." } }, "name" : "@MAXMIND/Push version bump", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [ "CONTRIBUTING.md", "LICENSE", "README.md", "cpanfile", "perlcriticrc", "perltidyrc", "ppport.h", "tidyall.ini" ], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "Git::GatherDir", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@MAXMIND/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.010" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.010" } }, "x_authority" : "cpan:MAXMIND", "x_contributors" : [ "asb-cpan ", "Boris Zentner ", "Boris Zentner ", "John SJ Anderson ", "Olaf Alders ", "Philip A. Prindeville ", "shawniverson ", "Thomas J Mather ", "Tina Mueller ", "Will Storey " ], "x_serialization_backend" : "Cpanel::JSON::XS version 3.0239" } Geo-IP-1.51/Changes0000644000175000017500000003003713167530465012422 0ustar greggregRevision history for Perl extension Geo::IP. 1.51 2017-10-11 - Added the following missing methods for IPv6 lookups to the pure Perl implementation: name_by_addr_v6, name_by_name_v6, org_by_addr_v6, and org_by_name_v6. Reported by Earl Killian. GitHub #28. 1.50 2016-07-21 - MYMETA files are now no longer included in releases. - Geo::Mirror is no longer included in this distribution. 1.45 2014-09-29 - Fixed typo in 1.44 release notes. - Replaced `use vars` with `our`. 1.44 2014-09-29 - On installation, this API will now default to the pure Perl version rather than failing if libGeoIP is not found. (GitHub #6, #11) - Add support for GEOIP_SILENCE ( Philip Prindeville ) - Unit tests for different databases were added. 1.43 2013-12-02 - Update FIPS codes ( Boris Zentner ) - Fix test case ( Boris Zentner ) - Update time zones ( Boris Zentner ) 1.42 2013-06-06 - Fix testcase any CAPI >= 1.5.0 should work ( Boris Zentner ) - Add new pure perl region code TH 81 Bueng Kan ( Boris Zentner ) 1.41 2013-02-20 - Add South Sudan ( Boris Zentner ) - Doc fixes ( Tina Müller ) - Update FIPS Codes ( Boris Zentner ) - Update PurePerl country list. ( Boris Zentner ) 1.40 2011-08-23 - Add new CAPI method region_name_by_code ( Boris Zentner ) - Add support for GEOIP_NETSPEED_EDITION_REV1 ( Boris Zentner ) - Add new CAPI method record_by_ipnum_v6 ( Boris Zentner ) - Add new CAPI glue methods to use GeoIPCityv6 databases record_by_addr_v6 record_by_name_v6 ( Boris Zentner ) 1.39 2011-05-07 - Upd Docs ( Boris Zentner ) - Add glue for the CAPI lib_version method ( Boris Zentner ) - Add CAPI glue for the methods enable_teredo and teredo. currently only avail in conjunction with the CAPI ( Boris Zentner ) - Add example/benchmark.pl and example/country_v6.pl ( Boris Zentner ) - Add name_by_name and name_by_addr ( Boris Zentner ) - Add org_by_name_v6 and org_by_addr_v6 only XS ( Boris Zentner ) - Add name_by_ipnum_v6, name_by_name_v6 and name_by_addr_v6 XS glue ( Boris Zentner ) - Add sub Geo::IP::CLONE_SKIP {1} in conjunction with .xs Avoid thread issues ( Boris Zentner ) - Export GEOIP_DOMAIN_EDITION by default ( Boris Zentner ) - Update region codes 20100810 ( Boris Zentner ) - Fix some PP 3letter country codes ( Boris Zentner ) - Fix PP continent codes ( Boris Zentner ) - Add PP continent_code_by_country_code ( Boris Zentner ) - Add PP Geo::IP->time_zone ( Boris Zentner ) - Update region codes 20100420 ( Boris Zentner ) - Link at least to CAPI 1.4.7 ( Boris Zentner ) - Add example/geolite-mirror-simple.pl to download maxmind databases ( Boris Zentner ) - Update region codes ( Boris Zentner ) - Update timezones ( Boris Zentner ) - Add isp_by_name and isp_by_addr if the CAPI is used ( Boris Zentner ) - Add isp_by_addr and org_by_addr to the PurePerl API ( Boris Zentner ) - Add api method, so users know if they use the PurePerl or CAPI glue print Geo::IP->api ( Boris Zentner ) - Silence redefined warning, when perl is started with -w and the PurePerl API is used ( Boris Zentner ) - Export GEOIP_CITYCONFIDENCE_EDITION, GEOIP_LOCATIONA_EDITION, GEOIP_ACCURACYRADIUS_EDITION and GEOIP_COUNTRY_EDITION_V6 ( Boris Zentner ) - Add some more v6 XS glue. IPv6 support require the CAPI to work.( Boris Zentner ) - GeoIP_country_code_by_addr_v6 - GeoIP_country_code_by_name_v6 - GeoIP_country_code3_by_addr_v6 - GeoIP_country_code3_by_name_v6 - Change RU's continent code from AS to EU ( Boris Zentner ) - Change Turkey's continent code from AS to EU ( Boris Zentner ) - org_by_* and friends return UTF8 scalars, if the charset is set to GEOIP_CHARSET_UTF8 ( Boris Zentner ) - Add PP ASNum support ( Boris Zentner ) - Add XS glue for time_zone and continent_code_by_country_code ( Boris Zentner ) - Add glue for database_edition ( Boris Zentner ) - Workaround centos/mod_perl issue when the PP fallback is used and Sys::Mmap is not installed ( Boris Zentner ) - Update PurePerl region names 20090723 ( Boris Zentner ) - Add XS glue for GeoIP_country_code_by_ipnum_v6 ( Boris Zentner ) 1.38 2009-05-16 - PurePerl region_by_addr and region_by_name return '00' for unknown regions, like the CAPI does ( Boris Zentner ) - Update to latest FIPS codes from 20090401 ( Boris Zentner ) - Fix Pureperl handling of GEOIP_REGION_EDITION_REV0 ( Boris Zentner ) - Fix segfault when undef is supplied as filename to open ( Boris Zentner ) - Fix PP GEOIP_ISP_EDITION handling ( Boris Zentner ) - Add PP support for GEOIP_DOMAIN_EDITION ( Boris Zentner ) - Handle database types in the same way, as the CAPI does ( Boris Zentner ) - Remove Australia double timezones entries. ( Boris Zentner ) 1.37 2009-03-6 - Document region_by_addr and region_by_name ( Boris Zentner ) - region_by_addr and region_by_name return undef for unknown countries and regions. Instead of "\0" and '000' ( Boris Zentner ) - Add PP function region_by_addr ( Boris Zentner ) - Change the default values of Geo::IP::Record fields for metro_code and area_code to 0 instead of '' PurePerl only ( Boris Zentner ) - Change the default values of Geo::IP::Record fields for region, postal_code and region_name to undef instead of '' ( Boris Zentner ) - Force the output of Geo::IP::Record::longitude and ::latitude to four decimal places ( Boris Zentner ) - Fix PurePerl three letter code for Romania ( Boris Zentner ) - Update PurePerl regionnames 20090201 ( Boris Zentner ) - Update PurePerl timezones 20090201 ( Boris Zentner ) - Update timezones for Australia - Fix: PurePerl's get_city_record_as_hash, record_by_addr and record_by_name to return undef for private and unknown IP's. Former we returned a Geo::IP::Record object with everything undef. The PurePerl code and the CAPI wrapper are now behave the same. ( Boris Zentner ) - Update region codes from http://www.maxmind.com/app/fips10_4 Dec 17th, 2008 ( Boris Zentner ) 1.36 2008-12-20 - Add the methods charset and set_charset to the pureperl fallback ( Boris Zentner ) - Fix: We require CAPI 1.4.5 not 1.4.4 for range_by_ip ( Boris Zentner ) - Add isp_by_addr and org_by_addr to the pureperl fallback ( Boris Zentner ) 1.35 2008-09-29 - Add GEOIP_DOMAIN_EDITION for the PurePerl ( Boris Zentner ) - Add open_type method to the PurePerl fallback ( Boris Zentner ) - Add CAPI Version detection, for the case, where a outdated CAPI is installed. ( Boris Zentner ) - Add metro_code, a replacement for the depreciated dma_code method. ( Boris Zentner ) - Add range_by_ip, netmask and last_netmask to the PurePerl API ( Boris Zentner ) - Add range_by_ip to the C API wrapper ( Boris Zentner ) 1.34 2008-08-04 - Add Geo::IP::Record::region_name to the PurePerl API ( Boris Zentner ) - Add missing record_by_name function to the PurePerl API ( Boris Zentner ) - Add missing country/country code 'Other' for the pureperl fallback ( Boris Zentner ) - Fix trash of $_ in Geo::Mirror ( Boris Zentner ) - Geo::Mirror die, if open failed ( Boris Zentner ) - Fix pureperl time_zone for countries with region codes, but only one time_zone ( Boris Zentner ). - Add continent_code to the pureperl and C API ( Boris Zentner ) - minimum perl version is 5.6 now ( Boris Zentner ) 1.33 2008-05-05 - make cpantesters happy exit 0 early, if libGeoIP is not found. ( Boris Zentner ) 1.32 2008-05-04 - make Geo::IP::Record::time_zone work for the pure perl part of Geo::IP ( Boris Zentner ) - BEGIN{$Geo::IP::GEOIP_PP_ONLY=1} use Geo::IP; disable the C API, even if it is installed. ( Boris Zentner ) - rename $Geo::IP::TESTING_PERL_ONLY to $Geo::IP::GEOIP_PP_ONLY. ( Boris Zentner ) - Fix Geo::IP::Record to use the C API, only, when Geo::IP use it ( Boris Zentner ) 1.31 2008-03-22 - Added BL/Saint Barthelemy, MF/Saint Martin (ISO-3166-1 additions) - Change default database name for NetWare to sys:/etc/GeoIP/GeoIP.dat and MSWin32 to c:/GeoIP/GeoIP.dat ( Guenter Knauf ) - Added support for time_zone lookup in GeoIP City API 1.30 2007-12-16 - Add GEOIP_MMAP_CACHE support ( Peter Shipley ) - Added last_netmask - gets netmask of network block from last lookup - Merged in Geo::IP::PurePerl code, PurePerl code is mostly API compatible with XS code, except for charset functions - Added set_charset - enables UTF8 output of city name - requires C API 1.4.3 or greater 1.28 2007-02-4 - Added support for region name lookup in GeoIP City API - Fixed database_info method (Ken Neighbors) 1.27 2005-09-8 - Fixed Autoloader/open issue (Alexander Vasiljev) - Fixed compilation error in Perl 5.005 with semicolon in GeoIP_database_info in IP.xs(Stephen Schulte) - Added support for open_type (Frank Mather) 1.26 2005-05-19 - Fixed segfault issue if non-resolvable domain name is passed to region_by_addr or region_by_name - Added support for GEOIP_INDEX_CACHE - which just caches the most frequently accessed index portion of the database, resulting in faster lookups than GEOIP_STANDARD, but less memory usage than GEOIP_MEMORY_CACHE 1.25 2004-12-24 - Added database_info method (Frank Mather) - Added example/netspeed.pl to MANIFEST 1.24 2004-11-30 - Fixed memory leak in ISP/Organization database lookups by adding O_CHAR to typemap 1.23 2004-10-06 - Updated test case, removed www.bundesregierung.de - Geo::Mirror: fallback to using Geo::IP::PurePerl if Geo::IP is not available (Graham Barr) - Geo::Mirror: added support for mirror freshness 1.22 2004-02-29 - Added support for Netspeed - Fixed IP address in examples 1.21 2003-02-28 - Added support for GEOIP_CHECK_CACHE 1.20 2003-06-06 - Added support for GeoIP City Format Rev 1, DMA Codes and area codes 1.15 2003-03-04 - Added support for GeoIP Organization and ISP databases 1.14 2003-02-19 - Added support for GeoIP Region Edition 1.13 2002-12-24 - Added float to typemap, required to compile for Perl < 5.8 1.12 2002-12-11 - Added support for postal codes - Removed non-portable asprintf code 1.11 2002-11-22 - Forget to include typemap and INSTALL in MANIFEST 1.10 2002-11-22 - Added support for GeoIP City Edition - Added more documentation on where to get databases, and sourceforge. 0.26 2002-02-25 - Made flags optional to new and open - Removed www.moinfo.gov.kw from test, domain no longer resolves. 0.20 2002-06-25 - Brought up to date with latest changes for GeoIP C 0.2.0 0.11 2002-04-27 - install process works for non-standard GeoIP C library installs 0.10 2002-04-21 - Fixed DESTROY (Brian Grossman) - Set PI to more accurate value (Mike Mitchell) 0.09 2002-04-08 - Fixed bug when no database file specified. - Fixed bug in t/3_mirror.t test script 0.08 2002-04-07 - This perl module is now a XS wrapper around the GeoIP C library for improved performance. Note that the API has changed. - Removed the geoip-lookup script, since GeoIP C contains a geoiplookup executable that provides the same functionality 0.07 2002-04-01 - Removed dependency on Berkeley DB - requires new Geo-IP data format. 0.06 2002-02-19 - Geo::IP - Added new method, lookup_country_by_name, performs DNS lookup of IP address for hostnames - added O_RDWR option to tie DB_File for compatibility (Allen Smith) - makes directory '/usr/local/geoip' (Philip Mak) - added binmode for compatibility (Randy Kobes) - Geo::Mirror - Mirror when doesn't find country, default to US - Special handing for "EU" (European Union) treat as country with coordinates between Germany and Italy. 0.05 2002-02-15 - Added new option to Geo::Mirror->new, database_file - Fixed test problem with t/3_mirror.t - Added error handling to Makefile.PL for database download 0.04 2002-02-15 - Added new module, Geo::Mirror - Added new default file location for database in /usr/local/geoip/Geo-IP.db - Installation easier, Makefile.PL downloads and extracts database file - Added geolookup script - Removed old Net::Geography wrapper 0.03 2001-02-28 - Geo::IP now generates Berkeley DB file from data file, to get around differing versions of Berkeley DB. - now croaks if db file can not be opened (Nick Craig-Wood) 0.02 2001-02-11 - renamed to Geo::IP from Net::Geography - revised docs - data separated from perl distribution, can be downloaded from http://geo-ip.com 0.01 2001-06-30 - original version; created by h2xs 1.19 Geo-IP-1.51/cpanfile0000644000175000017500000000270613167530465012635 0ustar greggregrequires "DynaLoader" => "0"; requires "Exporter" => "0"; requires "base" => "0"; requires "strict" => "0"; requires "vars" => "0"; on 'test' => sub { requires "ExtUtils::MakeMaker" => "0"; requires "File::Spec" => "0"; requires "Test::More" => "0.96"; requires "warnings" => "0"; }; on 'test' => sub { recommends "CPAN::Meta" => "2.120900"; }; on 'develop' => sub { requires "Code::TidyAll::Plugin::Test::Vars" => "0.02"; requires "Devel::PPPort" => "3.23"; requires "File::Spec" => "0"; requires "IO::Handle" => "0"; requires "IPC::Open3" => "0"; requires "Parallel::ForkManager" => "1.19"; requires "Perl::Critic" => "1.126"; requires "Perl::Tidy" => "20160302"; requires "Pod::Coverage::Moose" => "0"; requires "Pod::Coverage::TrustPod" => "0"; requires "Pod::Wordlist" => "0"; requires "Test" => "0"; requires "Test::CPAN::Changes" => "0.19"; requires "Test::CPAN::Meta::JSON" => "0.16"; requires "Test::Code::TidyAll" => "0.50"; requires "Test::EOL" => "0"; requires "Test::Mojibake" => "0"; requires "Test::More" => "0.96"; requires "Test::NoTabs" => "0"; requires "Test::Pod" => "1.41"; requires "Test::Pod::Coverage" => "1.08"; requires "Test::Portability::Files" => "0"; requires "Test::Spelling" => "0.12"; requires "Test::Synopsis" => "0"; requires "Test::Vars" => "0.009"; requires "Test::Version" => "2.05"; requires "parent" => "0"; requires "perl" => "5.006"; requires "warnings" => "0"; }; Geo-IP-1.51/example/0000755000175000017500000000000013167530465012557 5ustar greggregGeo-IP-1.51/example/benchmark.pl0000644000175000017500000000342713167530465015054 0ustar greggreg#!/usr/bin/perl # use strict; # Thu May 5 20:11:02 2011 use warnings; our $VERSION = '0.02'; use Benchmark qw/ :hireswallclock timeit cmpthese timethese timestr/; use Geo::IP; use Geo::IP::Record; our @ips; sub rand_ip { join '.', map { int( rand(256) ) } 1 .. 4; } push @ips, rand_ip() for 1 .. 1e5; my $p = '/usr/local/share/GeoIP'; my $gi = Geo::IP->open( "$p/GeoIP.dat", GEOIP_STANDARD ) or die; my $gim = Geo::IP->open( "$p/GeoIP.dat", GEOIP_MEMORY_CACHE ) or die; my $gic = Geo::IP->open( "$p/GeoIPCity.dat", GEOIP_STANDARD ) or die; my $gicm = Geo::IP->open( "$p/GeoIPCity.dat", GEOIP_MEMORY_CACHE ) or die; my $gi6 = Geo::IP->open( "$p/GeoIPv6.dat", GEOIP_STANDARD ) or die; my $gim6 = Geo::IP->open( "$p/GeoIPv6.dat", GEOIP_MEMORY_CACHE ) or die; my $gii = Geo::IP->open( "$p/GeoIPISP.dat", GEOIP_STANDARD ) or die; my $giim = Geo::IP->open( "$p/GeoIPISP.dat", GEOIP_MEMORY_CACHE ) or die; my $cnt; timethese( -10, { country_v6_std => sub { $gi6->country_code_by_addr_v6( '::' . $ips[ ++$cnt % 1e5 ] ); }, country_v6_mem => sub { $gim6->country_code_by_addr_v6( '::' . $ips[ ++$cnt % 1e5 ] ); }, country_std => sub { $gi->country_code_by_addr( $ips[ ++$cnt % 1e5 ] ); }, country_mem => sub { $gim->country_code_by_addr( $ips[ ++$cnt % 1e5 ] ); }, city_std => sub { $gic->record_by_addr( $ips[ ++$cnt % 1e5 ] ); }, city_mem => sub { $gicm->record_by_addr( $ips[ ++$cnt % 1e5 ] ); }, isp_std => sub { $gii->name_by_addr( $ips[ ++$cnt % 1e5 ] ); }, isp_mem => sub { $giim->name_by_addr( $ips[ ++$cnt % 1e5 ] ); }, } ); Geo-IP-1.51/example/netspeedcell.pl0000755000175000017500000000031713167530465015567 0ustar greggreg#!/usr/local/bin/perl use strict; use warnings; use Geo::IP; my $gi = Geo::IP->open( "/usr/local/share/GeoIP/GeoIPNetSpeedCell.dat", GEOIP_STANDARD ); print $gi->name_by_addr("24.24.24.24"), $/; Geo-IP-1.51/example/netspeed.pl0000755000175000017500000000075113167530465014731 0ustar greggreg#!/usr/local/bin/perl use strict; use warnings; use Geo::IP; my $gi = Geo::IP->open( "/usr/local/share/GeoIP/GeoIPNetSpeed.dat", GEOIP_STANDARD ); my $netspeed = $gi->id_by_name("24.24.24.24"); if ( $netspeed == GEOIP_UNKNOWN_SPEED ) { print "Unknown\n"; } elsif ( $netspeed == GEOIP_DIALUP_SPEED ) { print "Dialup\n"; } elsif ( $netspeed == GEOIP_CABLEDSL_SPEED ) { print "Cable/DSL\n"; } elsif ( $netspeed == GEOIP_CORPORATE_SPEED ) { print "Corporate\n"; } Geo-IP-1.51/example/city.pl0000755000175000017500000000124513167530465014071 0ustar greggreg#!/usr/bin/perl use strict; use warnings; use autodie; use Geo::IP; my $gi = Geo::IP->open( '/usr/local/share/GeoIP/GeoIPCity.dat', GEOIP_STANDARD ); while ( my $host = ) { chomp $host; my $r = $gi->record_by_name($host); if ($r) { print join( "\t", $r->country_code, $r->country_name, $r->city, $r->region, $r->region_name, $r->postal_code, $r->latitude, $r->longitude, $r->metro_code, $r->area_code ) . "\n"; } else { print "UNDEF\n"; } } __DATA__ 12.10.1.4 0.0.0.0 66.108.94.158 yahoo.com amazon.com 4.2.144.64 24.24.24.24 80.24.24.24 Geo-IP-1.51/example/region.pl0000755000175000017500000000057513167530465014411 0ustar greggreg#!/usr/bin/perl use strict; use warnings; use Test; use Geo::IP; my $gi = Geo::IP->open( "/usr/local/share/GeoIP/GeoIPRegion.dat", GEOIP_STANDARD ); while () { chomp; my ( $country, $region ) = $gi->region_by_name($_); print join( "\t", $_, $country, $region ) . "\n"; } __DATA__ 12.10.1.4 66.108.94.158 yahoo.com amazon.com 4.2.144.64 202.6.131.17 Geo-IP-1.51/example/country_v6.pl0000755000175000017500000000067313167530465015243 0ustar greggreg#!/usr/bin/perl use strict; use warnings; use Geo::IP; my $gi = Geo::IP->open( "/usr/local/share/GeoIP/GeoIPv6.dat", GEOIP_STANDARD ); die "Please install the CAPI for IPv6 support\n" unless $gi->api eq 'CAPI'; while () { chomp; my ($cc) = $gi->country_code_by_addr_v6($_) || ''; print join( "\t", $_, $cc ) . "\n"; } __DATA__ ::24.24.24.24 2001:4860:0:1001::68 2002:1818:1818:: 2001:638:500:101:2e0:81ff:fe24:37c6 Geo-IP-1.51/example/geolite-mirror-simple.pl0000644000175000017500000000332713167530465017350 0ustar greggreg#!/usr/bin/perl use strict; use warnings; our $VERSION = '0.02'; use LWP::Simple qw/ mirror RC_NOT_MODIFIED RC_OK $ua /; use File::Copy qw/ mv /; use File::Spec; use PerlIO::gzip; # --- maxmind.com - please send comments to support@maxmind.com # # mirror various maxmind databases from geolite.maxmind.com. # The script download only changed files, unzip the files and # move it into the desired directory. # # Here is a sample cron entry that check daily for new files. # 34 15 * * * /usr/local/bin/geolite-mirror-simple.pl # adjust the path to your needs. Make sure the directories exists -d ( my $download_dir = '/usr/local/share/GeoIP/download' ) or die $!; -d ( my $dest_dir = '/usr/local/share/GeoIP' ) or die $!; # --- remove lines you do not need # geoip customers should rename or remove GeoIP.dat.gz and GeoIPCity.dat.gz # This example overwrite your GeoIPCity.dat database! my %mirror = ( # local-filename geolite-name 'GeoIP.dat.gz' => 'GeoLiteCountry/GeoIP.dat.gz', 'GeoIPCity.dat.gz' => 'GeoLiteCity.dat.gz', 'GeoIPv6.dat.gz' => 'GeoIPv6.dat.gz', 'GeoIPASNum.dat.gz' => 'asnum/GeoIPASNum.dat.gz' ); $ua->agent("MaxMind-geolite-mirror-simple/$VERSION"); my $dl_path = 'http://geolite.maxmind.com/download/geoip/database/'; chdir $download_dir or die $!; for my $f ( keys %mirror ) { my $rc = mirror( $dl_path . $mirror{$f}, $f ); next if $rc == RC_NOT_MODIFIED; if ( $rc == RC_OK ) { ( my $outfile = $f ) =~ s/\.gz$//; open my $in, '<:gzip', $f or die $!; open my $out, '>', $outfile or die $!; print $out $_ or die $! while <$in>; mv( $outfile, File::Spec->catfile( $dest_dir, $outfile ) ) or die $!; } } exit 0; Geo-IP-1.51/example/org.pl0000755000175000017500000000120213167530465013701 0ustar greggreg#!/usr/bin/perl use strict; use warnings; use Geo::IP; # here we are using GeoIP ISP my $gi = Geo::IP->open( "/usr/local/share/GeoIP/GeoIPISP.dat", GEOIP_STANDARD ); # uncomment for GeoIP Organization #my $gi = Geo::IP->open("/usr/local/share/GeoIP/GeoIPOrg.dat", GEOIP_STANDARD); # uncomment for GeoIP Domain Name #my $gi = Geo::IP->open("/usr/local/share/GeoIP/GeoIPDomain.dat", GEOIP_STANDARD); while () { chomp; my ($org) = $gi->org_by_name($_); my $netmask = $gi->last_netmask; print join( "\t", $_, $org, $netmask ) . "\n"; } __DATA__ 12.10.1.4 66.108.94.158 yahoo.com amazon.com 4.2.144.64 24.24.24.24 Geo-IP-1.51/ppport.h0000644000175000017500000060553013167530465012632 0ustar greggreg#if 0 <<'SKIP'; #endif /* ---------------------------------------------------------------------- ppport.h -- Perl/Pollution/Portability Version 3.36 Automatically created by Devel::PPPort running under perl 5.026001. Do NOT edit this file directly! -- Edit PPPort_pm.PL and the includes in parts/inc/ instead. Use 'perldoc ppport.h' to view the documentation below. ---------------------------------------------------------------------- SKIP =pod =head1 NAME ppport.h - Perl/Pollution/Portability version 3.36 =head1 SYNOPSIS perl ppport.h [options] [source files] Searches current directory for files if no [source files] are given --help show short help --version show version --patch=file write one patch file with changes --copy=suffix write changed copies with suffix --diff=program use diff program and options --compat-version=version provide compatibility with Perl version --cplusplus accept C++ comments --quiet don't output anything except fatal errors --nodiag don't show diagnostics --nohints don't show hints --nochanges don't suggest changes --nofilter don't filter input files --strip strip all script and doc functionality from ppport.h --list-provided list provided API --list-unsupported list unsupported API --api-info=name show Perl API portability information =head1 COMPATIBILITY This version of F is designed to support operation with Perl installations back to 5.003, and has been tested up to 5.20. =head1 OPTIONS =head2 --help Display a brief usage summary. =head2 --version Display the version of F. =head2 --patch=I If this option is given, a single patch file will be created if any changes are suggested. This requires a working diff program to be installed on your system. =head2 --copy=I If this option is given, a copy of each file will be saved with the given suffix that contains the suggested changes. This does not require any external programs. Note that this does not automagically add a dot between the original filename and the suffix. If you want the dot, you have to include it in the option argument. If neither C<--patch> or C<--copy> are given, the default is to simply print the diffs for each file. This requires either C or a C program to be installed. =head2 --diff=I Manually set the diff program and options to use. The default is to use C, when installed, and output unified context diffs. =head2 --compat-version=I Tell F to check for compatibility with the given Perl version. The default is to check for compatibility with Perl version 5.003. You can use this option to reduce the output of F if you intend to be backward compatible only down to a certain Perl version. =head2 --cplusplus Usually, F will detect C++ style comments and replace them with C style comments for portability reasons. Using this option instructs F to leave C++ comments untouched. =head2 --quiet Be quiet. Don't print anything except fatal errors. =head2 --nodiag Don't output any diagnostic messages. Only portability alerts will be printed. =head2 --nohints Don't output any hints. Hints often contain useful portability notes. Warnings will still be displayed. =head2 --nochanges Don't suggest any changes. Only give diagnostic output and hints unless these are also deactivated. =head2 --nofilter Don't filter the list of input files. By default, files not looking like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped. =head2 --strip Strip all script and documentation functionality from F. This reduces the size of F dramatically and may be useful if you want to include F in smaller modules without increasing their distribution size too much. The stripped F will have a C<--unstrip> option that allows you to undo the stripping, but only if an appropriate C module is installed. =head2 --list-provided Lists the API elements for which compatibility is provided by F. Also lists if it must be explicitly requested, if it has dependencies, and if there are hints or warnings for it. =head2 --list-unsupported Lists the API elements that are known not to be supported by F and below which version of Perl they probably won't be available or work. =head2 --api-info=I Show portability information for API elements matching I. If I is surrounded by slashes, it is interpreted as a regular expression. =head1 DESCRIPTION In order for a Perl extension (XS) module to be as portable as possible across differing versions of Perl itself, certain steps need to be taken. =over 4 =item * Including this header is the first major one. This alone will give you access to a large part of the Perl API that hasn't been available in earlier Perl releases. Use perl ppport.h --list-provided to see which API elements are provided by ppport.h. =item * You should avoid using deprecated parts of the API. For example, using global Perl variables without the C prefix is deprecated. Also, some API functions used to have a C prefix. Using this form is also deprecated. You can safely use the supported API, as F will provide wrappers for older Perl versions. =item * If you use one of a few functions or variables that were not present in earlier versions of Perl, and that can't be provided using a macro, you have to explicitly request support for these functions by adding one or more C<#define>s in your source code before the inclusion of F. These functions or variables will be marked C in the list shown by C<--list-provided>. Depending on whether you module has a single or multiple files that use such functions or variables, you want either C or global variants. For a C function or variable (used only in a single source file), use: #define NEED_function #define NEED_variable For a global function or variable (used in multiple source files), use: #define NEED_function_GLOBAL #define NEED_variable_GLOBAL Note that you mustn't have more than one global request for the same function or variable in your project. Function / Variable Static Request Global Request ----------------------------------------------------------------------------------------- PL_parser NEED_PL_parser NEED_PL_parser_GLOBAL PL_signals NEED_PL_signals NEED_PL_signals_GLOBAL SvRX() NEED_SvRX NEED_SvRX_GLOBAL caller_cx() NEED_caller_cx NEED_caller_cx_GLOBAL eval_pv() NEED_eval_pv NEED_eval_pv_GLOBAL grok_bin() NEED_grok_bin NEED_grok_bin_GLOBAL grok_hex() NEED_grok_hex NEED_grok_hex_GLOBAL grok_number() NEED_grok_number NEED_grok_number_GLOBAL grok_numeric_radix() NEED_grok_numeric_radix NEED_grok_numeric_radix_GLOBAL grok_oct() NEED_grok_oct NEED_grok_oct_GLOBAL gv_fetchpvn_flags() NEED_gv_fetchpvn_flags NEED_gv_fetchpvn_flags_GLOBAL load_module() NEED_load_module NEED_load_module_GLOBAL mg_findext() NEED_mg_findext NEED_mg_findext_GLOBAL my_snprintf() NEED_my_snprintf NEED_my_snprintf_GLOBAL my_sprintf() NEED_my_sprintf NEED_my_sprintf_GLOBAL my_strlcat() NEED_my_strlcat NEED_my_strlcat_GLOBAL my_strlcpy() NEED_my_strlcpy NEED_my_strlcpy_GLOBAL newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL newRV_noinc() NEED_newRV_noinc NEED_newRV_noinc_GLOBAL newSV_type() NEED_newSV_type NEED_newSV_type_GLOBAL newSVpvn_flags() NEED_newSVpvn_flags NEED_newSVpvn_flags_GLOBAL newSVpvn_share() NEED_newSVpvn_share NEED_newSVpvn_share_GLOBAL pv_display() NEED_pv_display NEED_pv_display_GLOBAL pv_escape() NEED_pv_escape NEED_pv_escape_GLOBAL pv_pretty() NEED_pv_pretty NEED_pv_pretty_GLOBAL sv_2pv_flags() NEED_sv_2pv_flags NEED_sv_2pv_flags_GLOBAL sv_2pvbyte() NEED_sv_2pvbyte NEED_sv_2pvbyte_GLOBAL sv_catpvf_mg() NEED_sv_catpvf_mg NEED_sv_catpvf_mg_GLOBAL sv_catpvf_mg_nocontext() NEED_sv_catpvf_mg_nocontext NEED_sv_catpvf_mg_nocontext_GLOBAL sv_pvn_force_flags() NEED_sv_pvn_force_flags NEED_sv_pvn_force_flags_GLOBAL sv_setpvf_mg() NEED_sv_setpvf_mg NEED_sv_setpvf_mg_GLOBAL sv_setpvf_mg_nocontext() NEED_sv_setpvf_mg_nocontext NEED_sv_setpvf_mg_nocontext_GLOBAL sv_unmagicext() NEED_sv_unmagicext NEED_sv_unmagicext_GLOBAL vload_module() NEED_vload_module NEED_vload_module_GLOBAL vnewSVpvf() NEED_vnewSVpvf NEED_vnewSVpvf_GLOBAL warner() NEED_warner NEED_warner_GLOBAL To avoid namespace conflicts, you can change the namespace of the explicitly exported functions / variables using the C macro. Just C<#define> the macro before including C: #define DPPP_NAMESPACE MyOwnNamespace_ #include "ppport.h" The default namespace is C. =back The good thing is that most of the above can be checked by running F on your source code. See the next section for details. =head1 EXAMPLES To verify whether F is needed for your module, whether you should make any changes to your code, and whether any special defines should be used, F can be run as a Perl script to check your source code. Simply say: perl ppport.h The result will usually be a list of patches suggesting changes that should at least be acceptable, if not necessarily the most efficient solution, or a fix for all possible problems. If you know that your XS module uses features only available in newer Perl releases, if you're aware that it uses C++ comments, and if you want all suggestions as a single patch file, you could use something like this: perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff If you only want your code to be scanned without any suggestions for changes, use: perl ppport.h --nochanges You can specify a different C program or options, using the C<--diff> option: perl ppport.h --diff='diff -C 10' This would output context diffs with 10 lines of context. If you want to create patched copies of your files instead, use: perl ppport.h --copy=.new To display portability information for the C function, use: perl ppport.h --api-info=newSVpvn Since the argument to C<--api-info> can be a regular expression, you can use perl ppport.h --api-info=/_nomg$/ to display portability information for all C<_nomg> functions or perl ppport.h --api-info=/./ to display information for all known API elements. =head1 BUGS If this version of F is causing failure during the compilation of this module, please check if newer versions of either this module or C are available on CPAN before sending a bug report. If F was generated using the latest version of C and is causing failure of this module, please file a bug report here: L Please include the following information: =over 4 =item 1. The complete output from running "perl -V" =item 2. This file. =item 3. The name and version of the module you were trying to build. =item 4. A full log of the build that failed. =item 5. Any other information that you think could be relevant. =back For the latest version of this code, please get the C module from CPAN. =head1 COPYRIGHT Version 3.x, Copyright (c) 2004-2013, Marcus Holland-Moritz. Version 2.x, Copyright (C) 2001, Paul Marquess. Version 1.x, Copyright (C) 1999, Kenneth Albanowski. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO See L. =cut use strict; # Disable broken TRIE-optimization BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if $] >= 5.009004 && $] <= 5.009005 } my $VERSION = 3.36; my %opt = ( quiet => 0, diag => 1, hints => 1, changes => 1, cplusplus => 0, filter => 1, strip => 0, version => 0, ); my($ppport) = $0 =~ /([\w.]+)$/; my $LF = '(?:\r\n|[\r\n])'; # line feed my $HS = "[ \t]"; # horizontal whitespace # Never use C comments in this file! my $ccs = '/'.'*'; my $cce = '*'.'/'; my $rccs = quotemeta $ccs; my $rcce = quotemeta $cce; eval { require Getopt::Long; Getopt::Long::GetOptions(\%opt, qw( help quiet diag! filter! hints! changes! cplusplus strip version patch=s copy=s diff=s compat-version=s list-provided list-unsupported api-info=s )) or usage(); }; if ($@ and grep /^-/, @ARGV) { usage() if "@ARGV" =~ /^--?h(?:elp)?$/; die "Getopt::Long not found. Please don't use any options.\n"; } if ($opt{version}) { print "This is $0 $VERSION.\n"; exit 0; } usage() if $opt{help}; strip() if $opt{strip}; if (exists $opt{'compat-version'}) { my($r,$v,$s) = eval { parse_version($opt{'compat-version'}) }; if ($@) { die "Invalid version number format: '$opt{'compat-version'}'\n"; } die "Only Perl 5 is supported\n" if $r != 5; die "Invalid version number: $opt{'compat-version'}\n" if $v >= 1000 || $s >= 1000; $opt{'compat-version'} = sprintf "%d.%03d%03d", $r, $v, $s; } else { $opt{'compat-version'} = 5; } my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/ ? ( $1 => { ($2 ? ( base => $2 ) : ()), ($3 ? ( todo => $3 ) : ()), (index($4, 'v') >= 0 ? ( varargs => 1 ) : ()), (index($4, 'p') >= 0 ? ( provided => 1 ) : ()), (index($4, 'n') >= 0 ? ( nothxarg => 1 ) : ()), } ) : die "invalid spec: $_" } qw( ASCII_TO_NEED||5.007001|n AvFILLp|5.004050||p AvFILL||| BhkDISABLE||5.024000| BhkENABLE||5.024000| BhkENTRY_set||5.024000| BhkENTRY||| BhkFLAGS||| CALL_BLOCK_HOOKS||| CLASS|||n CPERLscope|5.005000||p CX_CURPAD_SAVE||| CX_CURPAD_SV||| C_ARRAY_END|5.013002||p C_ARRAY_LENGTH|5.008001||p CopFILEAV|5.006000||p CopFILEGV_set|5.006000||p CopFILEGV|5.006000||p CopFILESV|5.006000||p CopFILE_set|5.006000||p CopFILE|5.006000||p CopSTASHPV_set|5.006000||p CopSTASHPV|5.006000||p CopSTASH_eq|5.006000||p CopSTASH_set|5.006000||p CopSTASH|5.006000||p CopyD|5.009002|5.004050|p Copy||| CvPADLIST||5.008001| CvSTASH||| CvWEAKOUTSIDE||| DECLARATION_FOR_LC_NUMERIC_MANIPULATION||5.021010|n DEFSV_set|5.010001||p DEFSV|5.004050||p DO_UTF8||5.006000| END_EXTERN_C|5.005000||p ENTER||| ERRSV|5.004050||p EXTEND||| EXTERN_C|5.005000||p F0convert|||n FREETMPS||| GIMME_V||5.004000|n GIMME|||n GROK_NUMERIC_RADIX|5.007002||p G_ARRAY||| G_DISCARD||| G_EVAL||| G_METHOD|5.006001||p G_NOARGS||| G_SCALAR||| G_VOID||5.004000| GetVars||| GvAV||| GvCV||| GvHV||| GvSV||| Gv_AMupdate||5.011000| HEf_SVKEY|5.003070||p HeHASH||5.003070| HeKEY||5.003070| HeKLEN||5.003070| HePV||5.004000| HeSVKEY_force||5.003070| HeSVKEY_set||5.004000| HeSVKEY||5.003070| HeUTF8|5.010001|5.008000|p HeVAL||5.003070| HvENAMELEN||5.015004| HvENAMEUTF8||5.015004| HvENAME||5.013007| HvNAMELEN_get|5.009003||p HvNAMELEN||5.015004| HvNAMEUTF8||5.015004| HvNAME_get|5.009003||p HvNAME||| INT2PTR|5.006000||p IN_LOCALE_COMPILETIME|5.007002||p IN_LOCALE_RUNTIME|5.007002||p IN_LOCALE|5.007002||p IN_PERL_COMPILETIME|5.008001||p IS_NUMBER_GREATER_THAN_UV_MAX|5.007002||p IS_NUMBER_INFINITY|5.007002||p IS_NUMBER_IN_UV|5.007002||p IS_NUMBER_NAN|5.007003||p IS_NUMBER_NEG|5.007002||p IS_NUMBER_NOT_INT|5.007002||p IVSIZE|5.006000||p IVTYPE|5.006000||p IVdf|5.006000||p LEAVE||| LINKLIST||5.013006| LVRET||| MARK||| MULTICALL||5.024000| MUTABLE_PTR|5.010001||p MUTABLE_SV|5.010001||p MY_CXT_CLONE|5.009002||p MY_CXT_INIT|5.007003||p MY_CXT|5.007003||p MoveD|5.009002|5.004050|p Move||| NATIVE_TO_NEED||5.007001|n NOOP|5.005000||p NUM2PTR|5.006000||p NVTYPE|5.006000||p NVef|5.006001||p NVff|5.006001||p NVgf|5.006001||p Newxc|5.009003||p Newxz|5.009003||p Newx|5.009003||p Nullav||| Nullch||| Nullcv||| Nullhv||| Nullsv||| OP_CLASS||5.013007| OP_DESC||5.007003| OP_NAME||5.007003| OP_TYPE_IS_OR_WAS||5.019010| OP_TYPE_IS||5.019007| ORIGMARK||| OpHAS_SIBLING|5.021007||p OpLASTSIB_set|5.021011||p OpMAYBESIB_set|5.021011||p OpMORESIB_set|5.021011||p OpSIBLING|5.021007||p PAD_BASE_SV||| PAD_CLONE_VARS||| PAD_COMPNAME_FLAGS||| PAD_COMPNAME_GEN_set||| PAD_COMPNAME_GEN||| PAD_COMPNAME_OURSTASH||| PAD_COMPNAME_PV||| PAD_COMPNAME_TYPE||| PAD_RESTORE_LOCAL||| PAD_SAVE_LOCAL||| PAD_SAVE_SETNULLPAD||| PAD_SETSV||| PAD_SET_CUR_NOSAVE||| PAD_SET_CUR||| PAD_SVl||| PAD_SV||| PERLIO_FUNCS_CAST|5.009003||p PERLIO_FUNCS_DECL|5.009003||p PERL_ABS|5.008001||p PERL_BCDVERSION|5.024000||p PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p PERL_HASH|5.003070||p PERL_INT_MAX|5.003070||p PERL_INT_MIN|5.003070||p PERL_LONG_MAX|5.003070||p PERL_LONG_MIN|5.003070||p PERL_MAGIC_arylen|5.007002||p PERL_MAGIC_backref|5.007002||p PERL_MAGIC_bm|5.007002||p PERL_MAGIC_collxfrm|5.007002||p PERL_MAGIC_dbfile|5.007002||p PERL_MAGIC_dbline|5.007002||p PERL_MAGIC_defelem|5.007002||p PERL_MAGIC_envelem|5.007002||p PERL_MAGIC_env|5.007002||p PERL_MAGIC_ext|5.007002||p PERL_MAGIC_fm|5.007002||p PERL_MAGIC_glob|5.024000||p PERL_MAGIC_isaelem|5.007002||p PERL_MAGIC_isa|5.007002||p PERL_MAGIC_mutex|5.024000||p PERL_MAGIC_nkeys|5.007002||p PERL_MAGIC_overload_elem|5.024000||p PERL_MAGIC_overload_table|5.007002||p PERL_MAGIC_overload|5.024000||p PERL_MAGIC_pos|5.007002||p PERL_MAGIC_qr|5.007002||p PERL_MAGIC_regdata|5.007002||p PERL_MAGIC_regdatum|5.007002||p PERL_MAGIC_regex_global|5.007002||p PERL_MAGIC_shared_scalar|5.007003||p PERL_MAGIC_shared|5.007003||p PERL_MAGIC_sigelem|5.007002||p PERL_MAGIC_sig|5.007002||p PERL_MAGIC_substr|5.007002||p PERL_MAGIC_sv|5.007002||p PERL_MAGIC_taint|5.007002||p PERL_MAGIC_tiedelem|5.007002||p PERL_MAGIC_tiedscalar|5.007002||p PERL_MAGIC_tied|5.007002||p PERL_MAGIC_utf8|5.008001||p PERL_MAGIC_uvar_elem|5.007003||p PERL_MAGIC_uvar|5.007002||p PERL_MAGIC_vec|5.007002||p PERL_MAGIC_vstring|5.008001||p PERL_PV_ESCAPE_ALL|5.009004||p PERL_PV_ESCAPE_FIRSTCHAR|5.009004||p PERL_PV_ESCAPE_NOBACKSLASH|5.009004||p PERL_PV_ESCAPE_NOCLEAR|5.009004||p PERL_PV_ESCAPE_QUOTE|5.009004||p PERL_PV_ESCAPE_RE|5.009005||p PERL_PV_ESCAPE_UNI_DETECT|5.009004||p PERL_PV_ESCAPE_UNI|5.009004||p PERL_PV_PRETTY_DUMP|5.009004||p PERL_PV_PRETTY_ELLIPSES|5.010000||p PERL_PV_PRETTY_LTGT|5.009004||p PERL_PV_PRETTY_NOCLEAR|5.010000||p PERL_PV_PRETTY_QUOTE|5.009004||p PERL_PV_PRETTY_REGPROP|5.009004||p PERL_QUAD_MAX|5.003070||p PERL_QUAD_MIN|5.003070||p PERL_REVISION|5.006000||p PERL_SCAN_ALLOW_UNDERSCORES|5.007003||p PERL_SCAN_DISALLOW_PREFIX|5.007003||p PERL_SCAN_GREATER_THAN_UV_MAX|5.007003||p PERL_SCAN_SILENT_ILLDIGIT|5.008001||p PERL_SHORT_MAX|5.003070||p PERL_SHORT_MIN|5.003070||p PERL_SIGNALS_UNSAFE_FLAG|5.008001||p PERL_SUBVERSION|5.006000||p PERL_SYS_INIT3||5.006000| PERL_SYS_INIT||| PERL_SYS_TERM||5.024000| PERL_UCHAR_MAX|5.003070||p PERL_UCHAR_MIN|5.003070||p PERL_UINT_MAX|5.003070||p PERL_UINT_MIN|5.003070||p PERL_ULONG_MAX|5.003070||p PERL_ULONG_MIN|5.003070||p PERL_UNUSED_ARG|5.009003||p PERL_UNUSED_CONTEXT|5.009004||p PERL_UNUSED_DECL|5.007002||p PERL_UNUSED_RESULT|5.021001||p PERL_UNUSED_VAR|5.007002||p PERL_UQUAD_MAX|5.003070||p PERL_UQUAD_MIN|5.003070||p PERL_USE_GCC_BRACE_GROUPS|5.009004||p PERL_USHORT_MAX|5.003070||p PERL_USHORT_MIN|5.003070||p PERL_VERSION|5.006000||p PL_DBsignal|5.005000||p PL_DBsingle|||pn PL_DBsub|||pn PL_DBtrace|||pn PL_Sv|5.005000||p PL_bufend|5.024000||p PL_bufptr|5.024000||p PL_check||5.006000| PL_compiling|5.004050||p PL_comppad_name||5.017004| PL_comppad||5.008001| PL_copline|5.024000||p PL_curcop|5.004050||p PL_curpad||5.005000| PL_curstash|5.004050||p PL_debstash|5.004050||p PL_defgv|5.004050||p PL_diehook|5.004050||p PL_dirty|5.004050||p PL_dowarn|||pn PL_errgv|5.004050||p PL_error_count|5.024000||p PL_expect|5.024000||p PL_hexdigit|5.005000||p PL_hints|5.005000||p PL_in_my_stash|5.024000||p PL_in_my|5.024000||p PL_keyword_plugin||5.011002| PL_last_in_gv|||n PL_laststatval|5.005000||p PL_lex_state|5.024000||p PL_lex_stuff|5.024000||p PL_linestr|5.024000||p PL_modglobal||5.005000|n PL_na|5.004050||pn PL_no_modify|5.006000||p PL_ofsgv|||n PL_opfreehook||5.011000|n PL_parser|5.009005||p PL_peepp||5.007003|n PL_perl_destruct_level|5.004050||p PL_perldb|5.004050||p PL_ppaddr|5.006000||p PL_rpeepp||5.013005|n PL_rsfp_filters|5.024000||p PL_rsfp|5.024000||p PL_rs|||n PL_signals|5.008001||p PL_stack_base|5.004050||p PL_stack_sp|5.004050||p PL_statcache|5.005000||p PL_stdingv|5.004050||p PL_sv_arenaroot|5.004050||p PL_sv_no|5.004050||pn PL_sv_undef|5.004050||pn PL_sv_yes|5.004050||pn PL_tainted|5.004050||p PL_tainting|5.004050||p PL_tokenbuf|5.024000||p POP_MULTICALL||5.024000| POPi|||n POPl|||n POPn|||n POPpbytex||5.007001|n POPpx||5.005030|n POPp|||n POPs|||n POPul||5.006000|n POPu||5.004000|n PTR2IV|5.006000||p PTR2NV|5.006000||p PTR2UV|5.006000||p PTR2nat|5.009003||p PTR2ul|5.007001||p PTRV|5.006000||p PUSHMARK||| PUSH_MULTICALL||5.024000| PUSHi||| PUSHmortal|5.009002||p PUSHn||| PUSHp||| PUSHs||| PUSHu|5.004000||p PUTBACK||| PadARRAY||5.024000| PadMAX||5.024000| PadlistARRAY||5.024000| PadlistMAX||5.024000| PadlistNAMESARRAY||5.024000| PadlistNAMESMAX||5.024000| PadlistNAMES||5.024000| PadlistREFCNT||5.017004| PadnameIsOUR||| PadnameIsSTATE||| PadnameLEN||5.024000| PadnameOURSTASH||| PadnameOUTER||| PadnamePV||5.024000| PadnameREFCNT_dec||5.024000| PadnameREFCNT||5.024000| PadnameSV||5.024000| PadnameTYPE||| PadnameUTF8||5.021007| PadnamelistARRAY||5.024000| PadnamelistMAX||5.024000| PadnamelistREFCNT_dec||5.024000| PadnamelistREFCNT||5.024000| PerlIO_clearerr||5.007003| PerlIO_close||5.007003| PerlIO_context_layers||5.009004| PerlIO_eof||5.007003| PerlIO_error||5.007003| PerlIO_fileno||5.007003| PerlIO_fill||5.007003| PerlIO_flush||5.007003| PerlIO_get_base||5.007003| PerlIO_get_bufsiz||5.007003| PerlIO_get_cnt||5.007003| PerlIO_get_ptr||5.007003| PerlIO_read||5.007003| PerlIO_restore_errno||| PerlIO_save_errno||| PerlIO_seek||5.007003| PerlIO_set_cnt||5.007003| PerlIO_set_ptrcnt||5.007003| PerlIO_setlinebuf||5.007003| PerlIO_stderr||5.007003| PerlIO_stdin||5.007003| PerlIO_stdout||5.007003| PerlIO_tell||5.007003| PerlIO_unread||5.007003| PerlIO_write||5.007003| Perl_signbit||5.009005|n PoisonFree|5.009004||p PoisonNew|5.009004||p PoisonWith|5.009004||p Poison|5.008000||p READ_XDIGIT||5.017006| RESTORE_LC_NUMERIC||5.024000| RETVAL|||n Renewc||| Renew||| SAVECLEARSV||| SAVECOMPPAD||| SAVEPADSV||| SAVETMPS||| SAVE_DEFSV|5.004050||p SPAGAIN||| SP||| START_EXTERN_C|5.005000||p START_MY_CXT|5.007003||p STMT_END|||p STMT_START|||p STORE_LC_NUMERIC_FORCE_TO_UNDERLYING||5.024000| STORE_LC_NUMERIC_SET_TO_NEEDED||5.024000| STR_WITH_LEN|5.009003||p ST||| SV_CONST_RETURN|5.009003||p SV_COW_DROP_PV|5.008001||p SV_COW_SHARED_HASH_KEYS|5.009005||p SV_GMAGIC|5.007002||p SV_HAS_TRAILING_NUL|5.009004||p SV_IMMEDIATE_UNREF|5.007001||p SV_MUTABLE_RETURN|5.009003||p SV_NOSTEAL|5.009002||p SV_SMAGIC|5.009003||p SV_UTF8_NO_ENCODING|5.008001||p SVfARG|5.009005||p SVf_UTF8|5.006000||p SVf|5.006000||p SVt_INVLIST||5.019002| SVt_IV||| SVt_NULL||| SVt_NV||| SVt_PVAV||| SVt_PVCV||| SVt_PVFM||| SVt_PVGV||| SVt_PVHV||| SVt_PVIO||| SVt_PVIV||| SVt_PVLV||| SVt_PVMG||| SVt_PVNV||| SVt_PV||| SVt_REGEXP||5.011000| Safefree||| Slab_Alloc||| Slab_Free||| Slab_to_ro||| Slab_to_rw||| StructCopy||| SvCUR_set||| SvCUR||| SvEND||| SvGAMAGIC||5.006001| SvGETMAGIC|5.004050||p SvGROW||| SvIOK_UV||5.006000| SvIOK_notUV||5.006000| SvIOK_off||| SvIOK_only_UV||5.006000| SvIOK_only||| SvIOK_on||| SvIOKp||| SvIOK||| SvIVX||| SvIV_nomg|5.009001||p SvIV_set||| SvIVx||| SvIV||| SvIsCOW_shared_hash||5.008003| SvIsCOW||5.008003| SvLEN_set||| SvLEN||| SvLOCK||5.007003| SvMAGIC_set|5.009003||p SvNIOK_off||| SvNIOKp||| SvNIOK||| SvNOK_off||| SvNOK_only||| SvNOK_on||| SvNOKp||| SvNOK||| SvNVX||| SvNV_nomg||5.013002| SvNV_set||| SvNVx||| SvNV||| SvOK||| SvOOK_offset||5.011000| SvOOK||| SvPOK_off||| SvPOK_only_UTF8||5.006000| SvPOK_only||| SvPOK_on||| SvPOKp||| SvPOK||| SvPVX_const|5.009003||p SvPVX_mutable|5.009003||p SvPVX||| SvPV_const|5.009003||p SvPV_flags_const_nolen|5.009003||p SvPV_flags_const|5.009003||p SvPV_flags_mutable|5.009003||p SvPV_flags|5.007002||p SvPV_force_flags_mutable|5.009003||p SvPV_force_flags_nolen|5.009003||p SvPV_force_flags|5.007002||p SvPV_force_mutable|5.009003||p SvPV_force_nolen|5.009003||p SvPV_force_nomg_nolen|5.009003||p SvPV_force_nomg|5.007002||p SvPV_force|||p SvPV_mutable|5.009003||p SvPV_nolen_const|5.009003||p SvPV_nolen|5.006000||p SvPV_nomg_const_nolen|5.009003||p SvPV_nomg_const|5.009003||p SvPV_nomg_nolen|5.013007||p SvPV_nomg|5.007002||p SvPV_renew|5.009003||p SvPV_set||| SvPVbyte_force||5.009002| SvPVbyte_nolen||5.006000| SvPVbytex_force||5.006000| SvPVbytex||5.006000| SvPVbyte|5.006000||p SvPVutf8_force||5.006000| SvPVutf8_nolen||5.006000| SvPVutf8x_force||5.006000| SvPVutf8x||5.006000| SvPVutf8||5.006000| SvPVx||| SvPV||| SvREFCNT_dec_NN||5.017007| SvREFCNT_dec||| SvREFCNT_inc_NN|5.009004||p SvREFCNT_inc_simple_NN|5.009004||p SvREFCNT_inc_simple_void_NN|5.009004||p SvREFCNT_inc_simple_void|5.009004||p SvREFCNT_inc_simple|5.009004||p SvREFCNT_inc_void_NN|5.009004||p SvREFCNT_inc_void|5.009004||p SvREFCNT_inc|||p SvREFCNT||| SvROK_off||| SvROK_on||| SvROK||| SvRV_set|5.009003||p SvRV||| SvRXOK|5.009005||p SvRX|5.009005||p SvSETMAGIC||| SvSHARED_HASH|5.009003||p SvSHARE||5.007003| SvSTASH_set|5.009003||p SvSTASH||| SvSetMagicSV_nosteal||5.004000| SvSetMagicSV||5.004000| SvSetSV_nosteal||5.004000| SvSetSV||| SvTAINTED_off||5.004000| SvTAINTED_on||5.004000| SvTAINTED||5.004000| SvTAINT||| SvTHINKFIRST||| SvTRUE_nomg||5.013006| SvTRUE||| SvTYPE||| SvUNLOCK||5.007003| SvUOK|5.007001|5.006000|p SvUPGRADE||| SvUTF8_off||5.006000| SvUTF8_on||5.006000| SvUTF8||5.006000| SvUVXx|5.004000||p SvUVX|5.004000||p SvUV_nomg|5.009001||p SvUV_set|5.009003||p SvUVx|5.004000||p SvUV|5.004000||p SvVOK||5.008001| SvVSTRING_mg|5.009004||p THIS|||n UNDERBAR|5.009002||p UTF8SKIP||5.006000| UTF8_MAXBYTES|5.009002||p UVCHR_SKIP||5.022000| UVSIZE|5.006000||p UVTYPE|5.006000||p UVXf|5.007001||p UVof|5.006000||p UVuf|5.006000||p UVxf|5.006000||p WARN_ALL|5.006000||p WARN_AMBIGUOUS|5.006000||p WARN_ASSERTIONS|5.024000||p WARN_BAREWORD|5.006000||p WARN_CLOSED|5.006000||p WARN_CLOSURE|5.006000||p WARN_DEBUGGING|5.006000||p WARN_DEPRECATED|5.006000||p WARN_DIGIT|5.006000||p WARN_EXEC|5.006000||p WARN_EXITING|5.006000||p WARN_GLOB|5.006000||p WARN_INPLACE|5.006000||p WARN_INTERNAL|5.006000||p WARN_IO|5.006000||p WARN_LAYER|5.008000||p WARN_MALLOC|5.006000||p WARN_MISC|5.006000||p WARN_NEWLINE|5.006000||p WARN_NUMERIC|5.006000||p WARN_ONCE|5.006000||p WARN_OVERFLOW|5.006000||p WARN_PACK|5.006000||p WARN_PARENTHESIS|5.006000||p WARN_PIPE|5.006000||p WARN_PORTABLE|5.006000||p WARN_PRECEDENCE|5.006000||p WARN_PRINTF|5.006000||p WARN_PROTOTYPE|5.006000||p WARN_QW|5.006000||p WARN_RECURSION|5.006000||p WARN_REDEFINE|5.006000||p WARN_REGEXP|5.006000||p WARN_RESERVED|5.006000||p WARN_SEMICOLON|5.006000||p WARN_SEVERE|5.006000||p WARN_SIGNAL|5.006000||p WARN_SUBSTR|5.006000||p WARN_SYNTAX|5.006000||p WARN_TAINT|5.006000||p WARN_THREADS|5.008000||p WARN_UNINITIALIZED|5.006000||p WARN_UNOPENED|5.006000||p WARN_UNPACK|5.006000||p WARN_UNTIE|5.006000||p WARN_UTF8|5.006000||p WARN_VOID|5.006000||p WIDEST_UTYPE|5.015004||p XCPT_CATCH|5.009002||p XCPT_RETHROW|5.009002||p XCPT_TRY_END|5.009002||p XCPT_TRY_START|5.009002||p XPUSHi||| XPUSHmortal|5.009002||p XPUSHn||| XPUSHp||| XPUSHs||| XPUSHu|5.004000||p XSPROTO|5.010000||p XSRETURN_EMPTY||| XSRETURN_IV||| XSRETURN_NO||| XSRETURN_NV||| XSRETURN_PV||| XSRETURN_UNDEF||| XSRETURN_UV|5.008001||p XSRETURN_YES||| XSRETURN|||p XST_mIV||| XST_mNO||| XST_mNV||| XST_mPV||| XST_mUNDEF||| XST_mUV|5.008001||p XST_mYES||| XS_APIVERSION_BOOTCHECK||5.024000| XS_EXTERNAL||5.024000| XS_INTERNAL||5.024000| XS_VERSION_BOOTCHECK||5.024000| XS_VERSION||| XSprePUSH|5.006000||p XS||| XopDISABLE||5.024000| XopENABLE||5.024000| XopENTRYCUSTOM||5.024000| XopENTRY_set||5.024000| XopENTRY||5.024000| XopFLAGS||5.013007| ZeroD|5.009002||p Zero||| _aMY_CXT|5.007003||p _add_range_to_invlist||| _append_range_to_invlist||| _core_swash_init||| _get_encoding||| _get_regclass_nonbitmap_data||| _get_swash_invlist||| _invlistEQ||| _invlist_array_init|||n _invlist_contains_cp|||n _invlist_dump||| _invlist_intersection_maybe_complement_2nd||| _invlist_intersection||| _invlist_invert||| _invlist_len|||n _invlist_populate_swatch|||n _invlist_search|||n _invlist_subtract||| _invlist_union_maybe_complement_2nd||| _invlist_union||| _is_cur_LC_category_utf8||| _is_in_locale_category||5.021001| _is_uni_FOO||5.017008| _is_uni_perl_idcont||5.017008| _is_uni_perl_idstart||5.017007| _is_utf8_FOO||5.017008| _is_utf8_char_slow||5.021001|n _is_utf8_idcont||5.021001| _is_utf8_idstart||5.021001| _is_utf8_mark||5.017008| _is_utf8_perl_idcont||5.017008| _is_utf8_perl_idstart||5.017007| _is_utf8_xidcont||5.021001| _is_utf8_xidstart||5.021001| _load_PL_utf8_foldclosures||| _make_exactf_invlist||| _new_invlist_C_array||| _new_invlist||| _pMY_CXT|5.007003||p _setlocale_debug_string|||n _setup_canned_invlist||| _swash_inversion_hash||| _swash_to_invlist||| _to_fold_latin1||| _to_uni_fold_flags||5.014000| _to_upper_title_latin1||| _to_utf8_case||| _to_utf8_fold_flags||5.019009| _to_utf8_lower_flags||5.019009| _to_utf8_title_flags||5.019009| _to_utf8_upper_flags||5.019009| _warn_problematic_locale|||n aMY_CXT_|5.007003||p aMY_CXT|5.007003||p aTHXR_|5.024000||p aTHXR|5.024000||p aTHX_|5.006000||p aTHX|5.006000||p add_above_Latin1_folds||| add_cp_to_invlist||| add_data|||n add_multi_match||| add_utf16_textfilter||| adjust_size_and_find_bucket|||n advance_one_LB||| advance_one_SB||| advance_one_WB||| alloc_maybe_populate_EXACT||| alloccopstash||| allocmy||| amagic_call||| amagic_cmp_locale||| amagic_cmp||| amagic_deref_call||5.013007| amagic_i_ncmp||| amagic_is_enabled||| amagic_ncmp||| anonymise_cv_maybe||| any_dup||| ao||| append_utf8_from_native_byte||5.019004|n apply_attrs_my||| apply_attrs_string||5.006001| apply_attrs||| apply||| assert_uft8_cache_coherent||| assignment_type||| atfork_lock||5.007003|n atfork_unlock||5.007003|n av_arylen_p||5.009003| av_clear||| av_create_and_push||5.009005| av_create_and_unshift_one||5.009005| av_delete||5.006000| av_exists||5.006000| av_extend_guts||| av_extend||| av_fetch||| av_fill||| av_iter_p||5.011000| av_len||| av_make||| av_pop||| av_push||| av_reify||| av_shift||| av_store||| av_tindex||5.017009| av_top_index||5.017009| av_undef||| av_unshift||| ax|||n backup_one_LB||| backup_one_SB||| backup_one_WB||| bad_type_gv||| bad_type_pv||| bind_match||| block_end||5.004000| block_gimme||5.004000| block_start||5.004000| blockhook_register||5.013003| boolSV|5.004000||p boot_core_PerlIO||| boot_core_UNIVERSAL||| boot_core_mro||| bytes_cmp_utf8||5.013007| bytes_from_utf8||5.007001| bytes_to_utf8||5.006001| cBOOL|5.013000||p call_argv|5.006000||p call_atexit||5.006000| call_list||5.004000| call_method|5.006000||p call_pv|5.006000||p call_sv|5.006000||p caller_cx|5.013005|5.006000|p calloc||5.007002|n cando||| cast_i32||5.006000|n cast_iv||5.006000|n cast_ulong||5.006000|n cast_uv||5.006000|n check_locale_boundary_crossing||| check_type_and_open||| check_uni||| check_utf8_print||| checkcomma||| ckWARN|5.006000||p ck_entersub_args_core||| ck_entersub_args_list||5.013006| ck_entersub_args_proto_or_list||5.013006| ck_entersub_args_proto||5.013006| ck_warner_d||5.011001|v ck_warner||5.011001|v ckwarn_common||| ckwarn_d||5.009003| ckwarn||5.009003| clear_defarray||5.023008| clear_placeholders||| clear_special_blocks||| clone_params_del|||n clone_params_new|||n closest_cop||| cntrl_to_mnemonic|||n compute_EXACTish|||n construct_ahocorasick_from_trie||| cop_fetch_label||5.015001| cop_free||| cop_hints_2hv||5.013007| cop_hints_fetch_pvn||5.013007| cop_hints_fetch_pvs||5.013007| cop_hints_fetch_pv||5.013007| cop_hints_fetch_sv||5.013007| cop_store_label||5.015001| cophh_2hv||5.013007| cophh_copy||5.013007| cophh_delete_pvn||5.013007| cophh_delete_pvs||5.013007| cophh_delete_pv||5.013007| cophh_delete_sv||5.013007| cophh_fetch_pvn||5.013007| cophh_fetch_pvs||5.013007| cophh_fetch_pv||5.013007| cophh_fetch_sv||5.013007| cophh_free||5.013007| cophh_new_empty||5.024000| cophh_store_pvn||5.013007| cophh_store_pvs||5.013007| cophh_store_pv||5.013007| cophh_store_sv||5.013007| core_prototype||| coresub_op||| cr_textfilter||| create_eval_scope||| croak_memory_wrap||5.019003|n croak_no_mem|||n croak_no_modify||5.013003|n croak_nocontext|||vn croak_popstack|||n croak_sv||5.013001| croak_xs_usage||5.010001|n croak|||v csighandler||5.009003|n current_re_engine||| curse||| custom_op_desc||5.007003| custom_op_get_field||| custom_op_name||5.007003| custom_op_register||5.013007| custom_op_xop||5.013007| cv_ckproto_len_flags||| cv_clone_into||| cv_clone||| cv_const_sv_or_av|||n cv_const_sv||5.003070|n cv_dump||| cv_forget_slab||| cv_get_call_checker||5.013006| cv_name||5.021005| cv_set_call_checker_flags||5.021004| cv_set_call_checker||5.013006| cv_undef_flags||| cv_undef||| cvgv_from_hek||| cvgv_set||| cvstash_set||| cx_dump||5.005000| cx_dup||| cx_popblock||5.023008| cx_popeval||5.023008| cx_popformat||5.023008| cx_popgiven||5.023008| cx_poploop||5.023008| cx_popsub_args||5.023008| cx_popsub_common||5.023008| cx_popsub||5.023008| cx_popwhen||5.023008| cx_pushblock||5.023008| cx_pusheval||5.023008| cx_pushformat||5.023008| cx_pushgiven||5.023008| cx_pushloop_for||5.023008| cx_pushloop_plain||5.023008| cx_pushsub||5.023008| cx_pushwhen||5.023008| cx_topblock||5.023008| cxinc||| dAXMARK|5.009003||p dAX|5.007002||p dITEMS|5.007002||p dMARK||| dMULTICALL||5.009003| dMY_CXT_SV|5.007003||p dMY_CXT|5.007003||p dNOOP|5.006000||p dORIGMARK||| dSP||| dTHR|5.004050||p dTHXR|5.024000||p dTHXa|5.006000||p dTHXoa|5.006000||p dTHX|5.006000||p dUNDERBAR|5.009002||p dVAR|5.009003||p dXCPT|5.009002||p dXSARGS||| dXSI32||| dXSTARG|5.006000||p deb_curcv||| deb_nocontext|||vn deb_stack_all||| deb_stack_n||| debop||5.005000| debprofdump||5.005000| debprof||| debstackptrs||5.007003| debstack||5.007003| debug_start_match||| deb||5.007003|v defelem_target||| del_sv||| delete_eval_scope||| delimcpy||5.004000|n deprecate_commaless_var_list||| despatch_signals||5.007001| destroy_matcher||| die_nocontext|||vn die_sv||5.013001| die_unwind||| die|||v dirp_dup||| div128||| djSP||| do_aexec5||| do_aexec||| do_aspawn||| do_binmode||5.004050| do_chomp||| do_close||| do_delete_local||| do_dump_pad||| do_eof||| do_exec3||| do_execfree||| do_exec||| do_gv_dump||5.006000| do_gvgv_dump||5.006000| do_hv_dump||5.006000| do_ipcctl||| do_ipcget||| do_join||| do_magic_dump||5.006000| do_msgrcv||| do_msgsnd||| do_ncmp||| do_oddball||| do_op_dump||5.006000| do_open6||| do_open9||5.006000| do_open_raw||| do_openn||5.007001| do_open||5.003070| do_pmop_dump||5.006000| do_print||| do_readline||| do_seek||| do_semop||| do_shmio||| do_smartmatch||| do_spawn_nowait||| do_spawn||| do_sprintf||| do_sv_dump||5.006000| do_sysseek||| do_tell||| do_trans_complex_utf8||| do_trans_complex||| do_trans_count_utf8||| do_trans_count||| do_trans_simple_utf8||| do_trans_simple||| do_trans||| do_vecget||| do_vecset||| do_vop||| docatch||| doeval_compile||| dofile||| dofindlabel||| doform||| doing_taint||5.008001|n dooneliner||| doopen_pm||| doparseform||| dopoptoeval||| dopoptogivenfor||| dopoptolabel||| dopoptoloop||| dopoptosub_at||| dopoptowhen||| doref||5.009003| dounwind||| dowantarray||| drand48_init_r|||n drand48_r|||n dtrace_probe_call||| dtrace_probe_load||| dtrace_probe_op||| dtrace_probe_phase||| dump_all_perl||| dump_all||5.006000| dump_c_backtrace||| dump_eval||5.006000| dump_exec_pos||| dump_form||5.006000| dump_indent||5.006000|v dump_mstats||| dump_packsubs_perl||| dump_packsubs||5.006000| dump_sub_perl||| dump_sub||5.006000| dump_sv_child||| dump_trie_interim_list||| dump_trie_interim_table||| dump_trie||| dump_vindent||5.006000| dumpuntil||| dup_attrlist||| edit_distance|||n emulate_cop_io||| eval_pv|5.006000||p eval_sv|5.006000||p exec_failed||| expect_number||| fbm_compile||5.005000| fbm_instr||5.005000| feature_is_enabled||| filter_add||| filter_del||| filter_gets||| filter_read||| finalize_optree||| finalize_op||| find_and_forget_pmops||| find_array_subscript||| find_beginning||| find_byclass||| find_default_stash||| find_hash_subscript||| find_in_my_stash||| find_lexical_cv||| find_runcv_where||| find_runcv||5.008001| find_rundefsvoffset||5.009002| find_rundefsv||5.013002| find_script||| find_uninit_var||| first_symbol|||n fixup_errno_string||| foldEQ_latin1||5.013008|n foldEQ_locale||5.013002|n foldEQ_utf8_flags||5.013010| foldEQ_utf8||5.013002| foldEQ||5.013002|n fold_constants||| forbid_setid||| force_ident_maybe_lex||| force_ident||| force_list||| force_next||| force_strict_version||| force_version||| force_word||| forget_pmop||| form_nocontext|||vn form_short_octal_warning||| form||5.004000|v fp_dup||| fprintf_nocontext|||vn free_c_backtrace||| free_global_struct||| free_tied_hv_pool||| free_tmps||| gen_constant_list||| get_ANYOF_cp_list_for_ssc||| get_and_check_backslash_N_name||| get_aux_mg||| get_av|5.006000||p get_c_backtrace_dump||| get_c_backtrace||| get_context||5.006000|n get_cvn_flags||| get_cvs|5.011000||p get_cv|5.006000||p get_db_sub||| get_debug_opts||| get_hash_seed||| get_hv|5.006000||p get_invlist_iter_addr|||n get_invlist_offset_addr|||n get_invlist_previous_index_addr|||n get_mstats||| get_no_modify||| get_num||| get_op_descs||5.005000| get_op_names||5.005000| get_opargs||| get_ppaddr||5.006000| get_re_arg||| get_sv|5.006000||p get_vtbl||5.005030| getcwd_sv||5.007002| getenv_len||| glob_2number||| glob_assign_glob||| gp_dup||| gp_free||| gp_ref||| grok_atoUV|||n grok_bin|5.007003||p grok_bslash_N||| grok_bslash_c||| grok_bslash_o||| grok_bslash_x||| grok_hex|5.007003||p grok_infnan||5.021004| grok_number_flags||5.021002| grok_number|5.007002||p grok_numeric_radix|5.007002||p grok_oct|5.007003||p group_end||| gv_AVadd||| gv_HVadd||| gv_IOadd||| gv_SVadd||| gv_add_by_type||5.011000| gv_autoload4||5.004000| gv_autoload_pvn||5.015004| gv_autoload_pv||5.015004| gv_autoload_sv||5.015004| gv_check||| gv_const_sv||5.009003| gv_dump||5.006000| gv_efullname3||5.003070| gv_efullname4||5.006001| gv_efullname||| gv_fetchfile_flags||5.009005| gv_fetchfile||| gv_fetchmeth_autoload||5.007003| gv_fetchmeth_internal||| gv_fetchmeth_pv_autoload||5.015004| gv_fetchmeth_pvn_autoload||5.015004| gv_fetchmeth_pvn||5.015004| gv_fetchmeth_pv||5.015004| gv_fetchmeth_sv_autoload||5.015004| gv_fetchmeth_sv||5.015004| gv_fetchmethod_autoload||5.004000| gv_fetchmethod_pv_flags||5.015004| gv_fetchmethod_pvn_flags||5.015004| gv_fetchmethod_sv_flags||5.015004| gv_fetchmethod||| gv_fetchmeth||| gv_fetchpvn_flags|5.009002||p gv_fetchpvs|5.009004||p gv_fetchpv||| gv_fetchsv||| gv_fullname3||5.003070| gv_fullname4||5.006001| gv_fullname||| gv_handler||5.007001| gv_init_pvn||| gv_init_pv||5.015004| gv_init_svtype||| gv_init_sv||5.015004| gv_init||| gv_is_in_main||| gv_magicalize_isa||| gv_magicalize||| gv_name_set||5.009004| gv_override||| gv_setref||| gv_stashpvn_internal||| gv_stashpvn|5.003070||p gv_stashpvs|5.009003||p gv_stashpv||| gv_stashsvpvn_cached||| gv_stashsv||| gv_try_downgrade||| handle_named_backref||| handle_possible_posix||| handle_regex_sets||| he_dup||| hek_dup||| hfree_next_entry||| hfreeentries||| hsplit||| hv_assert||| hv_auxinit_internal|||n hv_auxinit||| hv_backreferences_p||| hv_clear_placeholders||5.009001| hv_clear||| hv_common_key_len||5.010000| hv_common||5.010000| hv_copy_hints_hv||5.009004| hv_delayfree_ent||5.004000| hv_delete_common||| hv_delete_ent||5.003070| hv_delete||| hv_eiter_p||5.009003| hv_eiter_set||5.009003| hv_ename_add||| hv_ename_delete||| hv_exists_ent||5.003070| hv_exists||| hv_fetch_ent||5.003070| hv_fetchs|5.009003||p hv_fetch||| hv_fill||5.013002| hv_free_ent_ret||| hv_free_ent||5.004000| hv_iterinit||| hv_iterkeysv||5.003070| hv_iterkey||| hv_iternext_flags||5.008000| hv_iternextsv||| hv_iternext||| hv_iterval||| hv_kill_backrefs||| hv_ksplit||5.003070| hv_magic_check|||n hv_magic||| hv_name_set||5.009003| hv_notallowed||| hv_placeholders_get||5.009003| hv_placeholders_p||| hv_placeholders_set||5.009003| hv_rand_set||5.018000| hv_riter_p||5.009003| hv_riter_set||5.009003| hv_scalar||5.009001| hv_store_ent||5.003070| hv_store_flags||5.008000| hv_stores|5.009004||p hv_store||| hv_undef_flags||| hv_undef||| ibcmp_locale||5.004000| ibcmp_utf8||5.007003| ibcmp||| incline||| incpush_if_exists||| incpush_use_sep||| incpush||| ingroup||| init_argv_symbols||| init_constants||| init_dbargs||| init_debugger||| init_global_struct||| init_i18nl10n||5.006000| init_i18nl14n||5.006000| init_ids||| init_interp||| init_main_stash||| init_perllib||| init_postdump_symbols||| init_predump_symbols||| init_stacks||5.005000| init_tm||5.007002| inplace_aassign||| instr|||n intro_my||5.004000| intuit_method||| intuit_more||| invert||| invlist_array|||n invlist_clear||| invlist_clone||| invlist_contents||| invlist_extend||| invlist_highest|||n invlist_is_iterating|||n invlist_iterfinish|||n invlist_iterinit|||n invlist_iternext|||n invlist_max|||n invlist_previous_index|||n invlist_replace_list_destroys_src||| invlist_set_len||| invlist_set_previous_index|||n invlist_trim|||n invoke_exception_hook||| io_close||| isALNUMC|5.006000||p isALNUM_lazy||5.021001| isALPHANUMERIC||5.017008| isALPHA||| isASCII|5.006000||p isBLANK|5.006001||p isCNTRL|5.006000||p isDIGIT||| isFOO_lc||| isFOO_utf8_lc||| isGCB|||n isGRAPH|5.006000||p isIDCONT||5.017008| isIDFIRST_lazy||5.021001| isIDFIRST||| isLB||| isLOWER||| isOCTAL||5.013005| isPRINT|5.004000||p isPSXSPC|5.006001||p isPUNCT|5.006000||p isSB||| isSPACE||| isUPPER||| isUTF8_CHAR||5.021001| isWB||| isWORDCHAR||5.013006| isXDIGIT|5.006000||p is_an_int||| is_ascii_string||5.011000| is_handle_constructor|||n is_invariant_string||5.021007|n is_lvalue_sub||5.007001| is_safe_syscall||5.019004| is_ssc_worth_it|||n is_uni_alnum_lc||5.006000| is_uni_alnumc_lc||5.017007| is_uni_alnumc||5.017007| is_uni_alnum||5.006000| is_uni_alpha_lc||5.006000| is_uni_alpha||5.006000| is_uni_ascii_lc||5.006000| is_uni_ascii||5.006000| is_uni_blank_lc||5.017002| is_uni_blank||5.017002| is_uni_cntrl_lc||5.006000| is_uni_cntrl||5.006000| is_uni_digit_lc||5.006000| is_uni_digit||5.006000| is_uni_graph_lc||5.006000| is_uni_graph||5.006000| is_uni_idfirst_lc||5.006000| is_uni_idfirst||5.006000| is_uni_lower_lc||5.006000| is_uni_lower||5.006000| is_uni_print_lc||5.006000| is_uni_print||5.006000| is_uni_punct_lc||5.006000| is_uni_punct||5.006000| is_uni_space_lc||5.006000| is_uni_space||5.006000| is_uni_upper_lc||5.006000| is_uni_upper||5.006000| is_uni_xdigit_lc||5.006000| is_uni_xdigit||5.006000| is_utf8_alnumc||5.017007| is_utf8_alnum||5.006000| is_utf8_alpha||5.006000| is_utf8_ascii||5.006000| is_utf8_blank||5.017002| is_utf8_char_buf||5.015008|n is_utf8_char||5.006000|n is_utf8_cntrl||5.006000| is_utf8_common||| is_utf8_digit||5.006000| is_utf8_graph||5.006000| is_utf8_idcont||5.008000| is_utf8_idfirst||5.006000| is_utf8_lower||5.006000| is_utf8_mark||5.006000| is_utf8_perl_space||5.011001| is_utf8_perl_word||5.011001| is_utf8_posix_digit||5.011001| is_utf8_print||5.006000| is_utf8_punct||5.006000| is_utf8_space||5.006000| is_utf8_string_loclen||5.009003|n is_utf8_string_loc||5.008001|n is_utf8_string||5.006001|n is_utf8_upper||5.006000| is_utf8_xdigit||5.006000| is_utf8_xidcont||5.013010| is_utf8_xidfirst||5.013010| isa_lookup||| isinfnansv||| isinfnan||5.021004|n items|||n ix|||n jmaybe||| join_exact||| keyword_plugin_standard||| keyword||| leave_adjust_stacks||5.023008| leave_scope||| lex_bufutf8||5.011002| lex_discard_to||5.011002| lex_grow_linestr||5.011002| lex_next_chunk||5.011002| lex_peek_unichar||5.011002| lex_read_space||5.011002| lex_read_to||5.011002| lex_read_unichar||5.011002| lex_start||5.009005| lex_stuff_pvn||5.011002| lex_stuff_pvs||5.013005| lex_stuff_pv||5.013006| lex_stuff_sv||5.011002| lex_unstuff||5.011002| listkids||| list||| load_module_nocontext|||vn load_module|5.006000||pv localize||| looks_like_bool||| looks_like_number||| lop||| mPUSHi|5.009002||p mPUSHn|5.009002||p mPUSHp|5.009002||p mPUSHs|5.010001||p mPUSHu|5.009002||p mXPUSHi|5.009002||p mXPUSHn|5.009002||p mXPUSHp|5.009002||p mXPUSHs|5.010001||p mXPUSHu|5.009002||p magic_clear_all_env||| magic_cleararylen_p||| magic_clearenv||| magic_clearhints||| magic_clearhint||| magic_clearisa||| magic_clearpack||| magic_clearsig||| magic_copycallchecker||| magic_dump||5.006000| magic_existspack||| magic_freearylen_p||| magic_freeovrld||| magic_getarylen||| magic_getdebugvar||| magic_getdefelem||| magic_getnkeys||| magic_getpack||| magic_getpos||| magic_getsig||| magic_getsubstr||| magic_gettaint||| magic_getuvar||| magic_getvec||| magic_get||| magic_killbackrefs||| magic_methcall1||| magic_methcall|||v magic_methpack||| magic_nextpack||| magic_regdata_cnt||| magic_regdatum_get||| magic_regdatum_set||| magic_scalarpack||| magic_set_all_env||| magic_setarylen||| magic_setcollxfrm||| magic_setdbline||| magic_setdebugvar||| magic_setdefelem||| magic_setenv||| magic_sethint||| magic_setisa||| magic_setlvref||| magic_setmglob||| magic_setnkeys||| magic_setpack||| magic_setpos||| magic_setregexp||| magic_setsig||| magic_setsubstr||| magic_settaint||| magic_setutf8||| magic_setuvar||| magic_setvec||| magic_set||| magic_sizepack||| magic_wipepack||| make_matcher||| make_trie||| malloc_good_size|||n malloced_size|||n malloc||5.007002|n markstack_grow||5.021001| matcher_matches_sv||| maybe_multimagic_gv||| mayberelocate||| measure_struct||| memEQs|5.009005||p memEQ|5.004000||p memNEs|5.009005||p memNE|5.004000||p mem_collxfrm||| mem_log_alloc|||n mem_log_common|||n mem_log_free|||n mem_log_realloc|||n mess_alloc||| mess_nocontext|||vn mess_sv||5.013001| mess||5.006000|v mfree||5.007002|n mg_clear||| mg_copy||| mg_dup||| mg_find_mglob||| mg_findext|5.013008||pn mg_find|||n mg_free_type||5.013006| mg_free||| mg_get||| mg_length||5.005000| mg_localize||| mg_magical|||n mg_set||| mg_size||5.005000| mini_mktime||5.007002|n minus_v||| missingterm||| mode_from_discipline||| modkids||| more_bodies||| more_sv||| moreswitches||| move_proto_attr||| mro_clean_isarev||| mro_gather_and_rename||| mro_get_from_name||5.010001| mro_get_linear_isa_dfs||| mro_get_linear_isa||5.009005| mro_get_private_data||5.010001| mro_isa_changed_in||| mro_meta_dup||| mro_meta_init||| mro_method_changed_in||5.009005| mro_package_moved||| mro_register||5.010001| mro_set_mro||5.010001| mro_set_private_data||5.010001| mul128||| mulexp10|||n multideref_stringify||| my_atof2||5.007002| my_atof||5.006000| my_attrs||| my_bcopy||5.004050|n my_bytes_to_utf8|||n my_bzero|||n my_chsize||| my_clearenv||| my_cxt_index||| my_cxt_init||| my_dirfd||5.009005|n my_exit_jump||| my_exit||| my_failure_exit||5.004000| my_fflush_all||5.006000| my_fork||5.007003|n my_kid||| my_lstat_flags||| my_lstat||5.024000| my_memcmp|||n my_memset|||n my_pclose||5.003070| my_popen_list||5.007001| my_popen||5.003070| my_setenv||| my_setlocale||| my_snprintf|5.009004||pvn my_socketpair||5.007003|n my_sprintf|5.009003||pvn my_stat_flags||| my_stat||5.024000| my_strerror||5.021001| my_strftime||5.007002| my_strlcat|5.009004||pn my_strlcpy|5.009004||pn my_unexec||| my_vsnprintf||5.009004|n need_utf8|||n newANONATTRSUB||5.006000| newANONHASH||| newANONLIST||| newANONSUB||| newASSIGNOP||| newATTRSUB_x||| newATTRSUB||5.006000| newAVREF||| newAV||| newBINOP||| newCONDOP||| newCONSTSUB_flags||5.015006| newCONSTSUB|5.004050||p newCVREF||| newDEFSVOP||5.021006| newFORM||| newFOROP||5.013007| newGIVENOP||5.009003| newGIVWHENOP||| newGP||| newGVOP||| newGVREF||| newGVgen_flags||5.015004| newGVgen||| newHVREF||| newHVhv||5.005000| newHV||| newIO||| newLISTOP||| newLOGOP||| newLOOPEX||| newLOOPOP||| newMETHOP_internal||| newMETHOP_named||5.021005| newMETHOP||5.021005| newMYSUB||5.017004| newNULLLIST||| newOP||| newPADNAMELIST||5.021007|n newPADNAMEouter||5.021007|n newPADNAMEpvn||5.021007|n newPADOP||| newPMOP||| newPROG||| newPVOP||| newRANGE||| newRV_inc|5.004000||p newRV_noinc|5.004000||p newRV||| newSLICEOP||| newSTATEOP||| newSTUB||| newSUB||| newSVOP||| newSVREF||| newSV_type|5.009005||p newSVavdefelem||| newSVhek||5.009003| newSViv||| newSVnv||| newSVpadname||5.017004| newSVpv_share||5.013006| newSVpvf_nocontext|||vn newSVpvf||5.004000|v newSVpvn_flags|5.010001||p newSVpvn_share|5.007001||p newSVpvn_utf8|5.010001||p newSVpvn|5.004050||p newSVpvs_flags|5.010001||p newSVpvs_share|5.009003||p newSVpvs|5.009003||p newSVpv||| newSVrv||| newSVsv||| newSVuv|5.006000||p newSV||| newUNOP_AUX||5.021007| newUNOP||| newWHENOP||5.009003| newWHILEOP||5.013007| newXS_deffile||| newXS_flags||5.009004| newXS_len_flags||| newXSproto||5.006000| newXS||5.006000| new_collate||5.006000| new_constant||| new_ctype||5.006000| new_he||| new_logop||| new_numeric||5.006000| new_stackinfo||5.005000| new_version||5.009000| new_warnings_bitfield||| next_symbol||| nextargv||| nextchar||| ninstr|||n no_bareword_allowed||| no_fh_allowed||| no_op||| noperl_die|||vn not_a_number||| not_incrementable||| nothreadhook||5.008000| nuke_stacks||| num_overflow|||n oopsAV||| oopsHV||| op_append_elem||5.013006| op_append_list||5.013006| op_clear||| op_contextualize||5.013006| op_convert_list||5.021006| op_dump||5.006000| op_free||| op_integerize||| op_linklist||5.013006| op_lvalue_flags||| op_lvalue||5.013007| op_null||5.007002| op_parent|||n op_prepend_elem||5.013006| op_refcnt_dec||| op_refcnt_inc||| op_refcnt_lock||5.009002| op_refcnt_unlock||5.009002| op_relocate_sv||| op_scope||5.013007| op_sibling_splice||5.021002|n op_std_init||| op_unscope||| open_script||| openn_cleanup||| openn_setup||| opmethod_stash||| opslab_force_free||| opslab_free_nopad||| opslab_free||| output_or_return_posix_warnings||| pMY_CXT_|5.007003||p pMY_CXT|5.007003||p pTHX_|5.006000||p pTHX|5.006000||p packWARN|5.007003||p pack_cat||5.007003| pack_rec||| package_version||| package||| packlist||5.008001| pad_add_anon||5.008001| pad_add_name_pvn||5.015001| pad_add_name_pvs||5.015001| pad_add_name_pv||5.015001| pad_add_name_sv||5.015001| pad_add_weakref||| pad_alloc_name||| pad_alloc||| pad_block_start||| pad_check_dup||| pad_compname_type||5.009003| pad_findlex||| pad_findmy_pvn||5.015001| pad_findmy_pvs||5.015001| pad_findmy_pv||5.015001| pad_findmy_sv||5.015001| pad_fixup_inner_anons||| pad_free||| pad_leavemy||| pad_new||5.008001| pad_push||| pad_reset||| pad_setsv||| pad_sv||| pad_swipe||| pad_tidy||5.008001| padlist_dup||| padlist_store||| padname_dup||| padname_free||| padnamelist_dup||| padnamelist_fetch||5.021007|n padnamelist_free||| padnamelist_store||5.021007| parse_arithexpr||5.013008| parse_barestmt||5.013007| parse_block||5.013007| parse_body||| parse_fullexpr||5.013008| parse_fullstmt||5.013005| parse_gv_stash_name||| parse_ident||| parse_label||5.013007| parse_listexpr||5.013008| parse_lparen_question_flags||| parse_stmtseq||5.013006| parse_subsignature||| parse_termexpr||5.013008| parse_unicode_opts||| parser_dup||| parser_free_nexttoke_ops||| parser_free||| path_is_searchable|||n peep||| pending_ident||| perl_alloc_using|||n perl_alloc|||n perl_clone_using|||n perl_clone|||n perl_construct|||n perl_destruct||5.007003|n perl_free|||n perl_parse||5.006000|n perl_run|||n pidgone||| pm_description||| pmop_dump||5.006000| pmruntime||| pmtrans||| pop_scope||| populate_ANYOF_from_invlist||| populate_isa|||v pregcomp||5.009005| pregexec||| pregfree2||5.011000| pregfree||| prescan_version||5.011004| printbuf||| printf_nocontext|||vn process_special_blocks||| ptr_hash|||n ptr_table_clear||5.009005| ptr_table_fetch||5.009005| ptr_table_find|||n ptr_table_free||5.009005| ptr_table_new||5.009005| ptr_table_split||5.009005| ptr_table_store||5.009005| push_scope||| put_charclass_bitmap_innards_common||| put_charclass_bitmap_innards_invlist||| put_charclass_bitmap_innards||| put_code_point||| put_range||| pv_display|5.006000||p pv_escape|5.009004||p pv_pretty|5.009004||p pv_uni_display||5.007003| qerror||| qsortsvu||| quadmath_format_needed|||n quadmath_format_single|||n re_compile||5.009005| re_croak2||| re_dup_guts||| re_exec_indentf|||v re_indentf|||v re_intuit_start||5.019001| re_intuit_string||5.006000| re_op_compile||| re_printf|||v realloc||5.007002|n reentrant_free||5.024000| reentrant_init||5.024000| reentrant_retry||5.024000|vn reentrant_size||5.024000| ref_array_or_hash||| refcounted_he_chain_2hv||| refcounted_he_fetch_pvn||| refcounted_he_fetch_pvs||| refcounted_he_fetch_pv||| refcounted_he_fetch_sv||| refcounted_he_free||| refcounted_he_inc||| refcounted_he_new_pvn||| refcounted_he_new_pvs||| refcounted_he_new_pv||| refcounted_he_new_sv||| refcounted_he_value||| refkids||| refto||| ref||5.024000| reg2Lanode||| reg_check_named_buff_matched|||n reg_named_buff_all||5.009005| reg_named_buff_exists||5.009005| reg_named_buff_fetch||5.009005| reg_named_buff_firstkey||5.009005| reg_named_buff_iter||| reg_named_buff_nextkey||5.009005| reg_named_buff_scalar||5.009005| reg_named_buff||| reg_node||| reg_numbered_buff_fetch||| reg_numbered_buff_length||| reg_numbered_buff_store||| reg_qr_package||| reg_recode||| reg_scan_name||| reg_skipcomment|||n reg_temp_copy||| reganode||| regatom||| regbranch||| regclass_swash||5.009004| regclass||| regcppop||| regcppush||| regcurly|||n regdump_extflags||| regdump_intflags||| regdump||5.005000| regdupe_internal||| regex_set_precedence|||n regexec_flags||5.005000| regfree_internal||5.009005| reghop3|||n reghop4|||n reghopmaybe3|||n reginclass||| reginitcolors||5.006000| reginsert||| regmatch||| regnext||5.005000| regnode_guts||| regpiece||| regprop||| regrepeat||| regtail_study||| regtail||| regtry||| reg||| repeatcpy|||n report_evil_fh||| report_redefined_cv||| report_uninit||| report_wrongway_fh||| require_pv||5.006000| require_tie_mod||| restore_magic||| rninstr|||n rpeep||| rsignal_restore||| rsignal_save||| rsignal_state||5.004000| rsignal||5.004000| run_body||| run_user_filter||| runops_debug||5.005000| runops_standard||5.005000| rv2cv_op_cv||5.013006| rvpv_dup||| rxres_free||| rxres_restore||| rxres_save||| safesyscalloc||5.006000|n safesysfree||5.006000|n safesysmalloc||5.006000|n safesysrealloc||5.006000|n same_dirent||| save_I16||5.004000| save_I32||| save_I8||5.006000| save_adelete||5.011000| save_aelem_flags||5.011000| save_aelem||5.004050| save_alloc||5.006000| save_aptr||| save_ary||| save_bool||5.008001| save_clearsv||| save_delete||| save_destructor_x||5.006000| save_destructor||5.006000| save_freeop||| save_freepv||| save_freesv||| save_generic_pvref||5.006001| save_generic_svref||5.005030| save_gp||5.004000| save_hash||| save_hdelete||5.011000| save_hek_flags|||n save_helem_flags||5.011000| save_helem||5.004050| save_hints||5.010001| save_hptr||| save_int||| save_item||| save_iv||5.005000| save_lines||| save_list||| save_long||| save_magic_flags||| save_mortalizesv||5.007001| save_nogv||| save_op||5.005000| save_padsv_and_mortalize||5.010001| save_pptr||| save_pushi32ptr||5.010001| save_pushptri32ptr||| save_pushptrptr||5.010001| save_pushptr||5.010001| save_re_context||5.006000| save_scalar_at||| save_scalar||| save_set_svflags||5.009000| save_shared_pvref||5.007003| save_sptr||| save_strlen||| save_svref||| save_vptr||5.006000| savepvn||| savepvs||5.009003| savepv||| savesharedpvn||5.009005| savesharedpvs||5.013006| savesharedpv||5.007003| savesharedsvpv||5.013006| savestack_grow_cnt||5.008001| savestack_grow||| savesvpv||5.009002| savetmps||5.023008| sawparens||| scalar_mod_type|||n scalarboolean||| scalarkids||| scalarseq||| scalarvoid||| scalar||| scan_bin||5.006000| scan_commit||| scan_const||| scan_formline||| scan_heredoc||| scan_hex||| scan_ident||| scan_inputsymbol||| scan_num||5.007001| scan_oct||| scan_pat||| scan_str||| scan_subst||| scan_trans||| scan_version||5.009001| scan_vstring||5.009005| scan_word||| search_const||| seed||5.008001| sequence_num||| set_ANYOF_arg||| set_caret_X||| set_context||5.006000|n set_numeric_local||5.006000| set_numeric_radix||5.006000| set_numeric_standard||5.006000| set_padlist|||n setdefout||| share_hek_flags||| share_hek||5.004000| should_warn_nl|||n si_dup||| sighandler|||n simplify_sort||| skip_to_be_ignored_text||| skipspace_flags||| softref2xv||| sortcv_stacked||| sortcv_xsub||| sortcv||| sortsv_flags||5.009003| sortsv||5.007003| space_join_names_mortal||| ss_dup||| ssc_add_range||| ssc_and||| ssc_anything||| ssc_clear_locale|||n ssc_cp_and||| ssc_finalize||| ssc_init||| ssc_intersection||| ssc_is_anything|||n ssc_is_cp_posixl_init|||n ssc_or||| ssc_union||| stack_grow||| start_glob||| start_subparse||5.004000| stdize_locale||| strEQ||| strGE||| strGT||| strLE||| strLT||| strNE||| str_to_version||5.006000| strip_return||| strnEQ||| strnNE||| study_chunk||| sub_crush_depth||| sublex_done||| sublex_push||| sublex_start||| sv_2bool_flags||5.013006| sv_2bool||| sv_2cv||| sv_2io||| sv_2iuv_common||| sv_2iuv_non_preserve||| sv_2iv_flags||5.009001| sv_2iv||| sv_2mortal||| sv_2num||| sv_2nv_flags||5.013001| sv_2pv_flags|5.007002||p sv_2pv_nolen|5.006000||p sv_2pvbyte_nolen|5.006000||p sv_2pvbyte|5.006000||p sv_2pvutf8_nolen||5.006000| sv_2pvutf8||5.006000| sv_2pv||| sv_2uv_flags||5.009001| sv_2uv|5.004000||p sv_add_arena||| sv_add_backref||| sv_backoff|||n sv_bless||| sv_buf_to_ro||| sv_buf_to_rw||| sv_cat_decode||5.008001| sv_catpv_flags||5.013006| sv_catpv_mg|5.004050||p sv_catpv_nomg||5.013006| sv_catpvf_mg_nocontext|||pvn sv_catpvf_mg|5.006000|5.004000|pv sv_catpvf_nocontext|||vn sv_catpvf||5.004000|v sv_catpvn_flags||5.007002| sv_catpvn_mg|5.004050||p sv_catpvn_nomg|5.007002||p sv_catpvn||| sv_catpvs_flags||5.013006| sv_catpvs_mg||5.013006| sv_catpvs_nomg||5.013006| sv_catpvs|5.009003||p sv_catpv||| sv_catsv_flags||5.007002| sv_catsv_mg|5.004050||p sv_catsv_nomg|5.007002||p sv_catsv||| sv_chop||| sv_clean_all||| sv_clean_objs||| sv_clear||| sv_cmp_flags||5.013006| sv_cmp_locale_flags||5.013006| sv_cmp_locale||5.004000| sv_cmp||| sv_collxfrm_flags||5.013006| sv_collxfrm||| sv_copypv_flags||5.017002| sv_copypv_nomg||5.017002| sv_copypv||| sv_dec_nomg||5.013002| sv_dec||| sv_del_backref||| sv_derived_from_pvn||5.015004| sv_derived_from_pv||5.015004| sv_derived_from_sv||5.015004| sv_derived_from||5.004000| sv_destroyable||5.010000| sv_display||| sv_does_pvn||5.015004| sv_does_pv||5.015004| sv_does_sv||5.015004| sv_does||5.009004| sv_dump||| sv_dup_common||| sv_dup_inc_multiple||| sv_dup_inc||| sv_dup||| sv_eq_flags||5.013006| sv_eq||| sv_exp_grow||| sv_force_normal_flags||5.007001| sv_force_normal||5.006000| sv_free2||| sv_free_arenas||| sv_free||| sv_get_backrefs||5.021008|n sv_gets||5.003070| sv_grow||| sv_i_ncmp||| sv_inc_nomg||5.013002| sv_inc||| sv_insert_flags||5.010001| sv_insert||| sv_isa||| sv_isobject||| sv_iv||5.005000| sv_kill_backrefs||| sv_len_utf8_nomg||| sv_len_utf8||5.006000| sv_len||| sv_magic_portable|5.024000|5.004000|p sv_magicext_mglob||| sv_magicext||5.007003| sv_magic||| sv_mortalcopy_flags||| sv_mortalcopy||| sv_ncmp||| sv_newmortal||| sv_newref||| sv_nolocking||5.007003| sv_nosharing||5.007003| sv_nounlocking||| sv_nv||5.005000| sv_only_taint_gmagic|||n sv_or_pv_pos_u2b||| sv_peek||5.005000| sv_pos_b2u_flags||5.019003| sv_pos_b2u_midway||| sv_pos_b2u||5.006000| sv_pos_u2b_cached||| sv_pos_u2b_flags||5.011005| sv_pos_u2b_forwards|||n sv_pos_u2b_midway|||n sv_pos_u2b||5.006000| sv_pvbyten_force||5.006000| sv_pvbyten||5.006000| sv_pvbyte||5.006000| sv_pvn_force_flags|5.007002||p sv_pvn_force||| sv_pvn_nomg|5.007003|5.005000|p sv_pvn||5.005000| sv_pvutf8n_force||5.006000| sv_pvutf8n||5.006000| sv_pvutf8||5.006000| sv_pv||5.006000| sv_recode_to_utf8||5.007003| sv_reftype||| sv_ref||5.015004| sv_replace||| sv_report_used||| sv_resetpvn||| sv_reset||| sv_rvweaken||5.006000| sv_sethek||| sv_setiv_mg|5.004050||p sv_setiv||| sv_setnv_mg|5.006000||p sv_setnv||| sv_setpv_mg|5.004050||p sv_setpvf_mg_nocontext|||pvn sv_setpvf_mg|5.006000|5.004000|pv sv_setpvf_nocontext|||vn sv_setpvf||5.004000|v sv_setpviv_mg||5.008001| sv_setpviv||5.008001| sv_setpvn_mg|5.004050||p sv_setpvn||| sv_setpvs_mg||5.013006| sv_setpvs|5.009004||p sv_setpv||| sv_setref_iv||| sv_setref_nv||| sv_setref_pvn||| sv_setref_pvs||5.024000| sv_setref_pv||| sv_setref_uv||5.007001| sv_setsv_cow||| sv_setsv_flags||5.007002| sv_setsv_mg|5.004050||p sv_setsv_nomg|5.007002||p sv_setsv||| sv_setuv_mg|5.004050||p sv_setuv|5.004000||p sv_tainted||5.004000| sv_taint||5.004000| sv_true||5.005000| sv_unglob||| sv_uni_display||5.007003| sv_unmagicext|5.013008||p sv_unmagic||| sv_unref_flags||5.007001| sv_unref||| sv_untaint||5.004000| sv_upgrade||| sv_usepvn_flags||5.009004| sv_usepvn_mg|5.004050||p sv_usepvn||| sv_utf8_decode||5.006000| sv_utf8_downgrade||5.006000| sv_utf8_encode||5.006000| sv_utf8_upgrade_flags_grow||5.011000| sv_utf8_upgrade_flags||5.007002| sv_utf8_upgrade_nomg||5.007002| sv_utf8_upgrade||5.007001| sv_uv|5.005000||p sv_vcatpvf_mg|5.006000|5.004000|p sv_vcatpvfn_flags||5.017002| sv_vcatpvfn||5.004000| sv_vcatpvf|5.006000|5.004000|p sv_vsetpvf_mg|5.006000|5.004000|p sv_vsetpvfn||5.004000| sv_vsetpvf|5.006000|5.004000|p svtype||| swallow_bom||| swash_fetch||5.007002| swash_init||5.006000| swash_scan_list_line||| swatch_get||| sync_locale||5.021004| sys_init3||5.010000|n sys_init||5.010000|n sys_intern_clear||| sys_intern_dup||| sys_intern_init||| sys_term||5.010000|n taint_env||| taint_proper||| tied_method|||v tmps_grow_p||| toFOLD_utf8||5.019001| toFOLD_uvchr||5.023009| toFOLD||5.019001| toLOWER_L1||5.019001| toLOWER_LC||5.004000| toLOWER_utf8||5.015007| toLOWER_uvchr||5.023009| toLOWER||| toTITLE_utf8||5.015007| toTITLE_uvchr||5.023009| toTITLE||5.019001| toUPPER_utf8||5.015007| toUPPER_uvchr||5.023009| toUPPER||| to_byte_substr||| to_lower_latin1|||n to_uni_fold||5.007003| to_uni_lower_lc||5.006000| to_uni_lower||5.007003| to_uni_title_lc||5.006000| to_uni_title||5.007003| to_uni_upper_lc||5.006000| to_uni_upper||5.007003| to_utf8_case||5.007003| to_utf8_fold||5.015007| to_utf8_lower||5.015007| to_utf8_substr||| to_utf8_title||5.015007| to_utf8_upper||5.015007| tokenize_use||| tokeq||| tokereport||| too_few_arguments_pv||| too_many_arguments_pv||| translate_substr_offsets|||n try_amagic_bin||| try_amagic_un||| uiv_2buf|||n unlnk||| unpack_rec||| unpack_str||5.007003| unpackstring||5.008001| unreferenced_to_tmp_stack||| unshare_hek_or_pvn||| unshare_hek||| unsharepvn||5.003070| unwind_handler_stack||| update_debugger_info||| upg_version||5.009005| usage||| utf16_textfilter||| utf16_to_utf8_reversed||5.006001| utf16_to_utf8||5.006001| utf8_distance||5.006000| utf8_hop||5.006000|n utf8_length||5.007001| utf8_mg_len_cache_update||| utf8_mg_pos_cache_update||| utf8_to_bytes||5.006001| utf8_to_uvchr_buf||5.015009| utf8_to_uvchr||5.007001| utf8_to_uvuni_buf||5.015009| utf8_to_uvuni||5.007001| utf8n_to_uvchr||5.007001| utf8n_to_uvuni||5.007001| utilize||| uvchr_to_utf8_flags||5.007003| uvchr_to_utf8||5.007001| uvoffuni_to_utf8_flags||5.019004| uvuni_to_utf8_flags||5.007003| uvuni_to_utf8||5.007001| valid_utf8_to_uvchr||5.015009| valid_utf8_to_uvuni||5.015009| validate_proto||| validate_suid||| varname||| vcmp||5.009000| vcroak||5.006000| vdeb||5.007003| vform||5.006000| visit||| vivify_defelem||| vivify_ref||| vload_module|5.006000||p vmess||5.006000| vnewSVpvf|5.006000|5.004000|p vnormal||5.009002| vnumify||5.009000| vstringify||5.009000| vverify||5.009003| vwarner||5.006000| vwarn||5.006000| wait4pid||| warn_nocontext|||vn warn_sv||5.013001| warner_nocontext|||vn warner|5.006000|5.004000|pv warn|||v was_lvalue_sub||| watch||| whichsig_pvn||5.015004| whichsig_pv||5.015004| whichsig_sv||5.015004| whichsig||| win32_croak_not_implemented|||n with_queued_errors||| wrap_op_checker||5.015008| write_to_stderr||| xs_boot_epilog||| xs_handshake|||vn xs_version_bootcheck||| yyerror_pvn||| yyerror_pv||| yyerror||| yylex||| yyparse||| yyunlex||| yywarn||| ); if (exists $opt{'list-unsupported'}) { my $f; for $f (sort { lc $a cmp lc $b } keys %API) { next unless $API{$f}{todo}; print "$f ", '.'x(40-length($f)), " ", format_version($API{$f}{todo}), "\n"; } exit 0; } # Scan for possible replacement candidates my(%replace, %need, %hints, %warnings, %depends); my $replace = 0; my($hint, $define, $function); sub find_api { my $code = shift; $code =~ s{ / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*) | "[^"\\]*(?:\\.[^"\\]*)*" | '[^'\\]*(?:\\.[^'\\]*)*' }{}egsx; grep { exists $API{$_} } $code =~ /(\w+)/mg; } while () { if ($hint) { my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings; if (m{^\s*\*\s(.*?)\s*$}) { for (@{$hint->[1]}) { $h->{$_} ||= ''; # suppress warning with older perls $h->{$_} .= "$1\n"; } } else { undef $hint } } $hint = [$1, [split /,?\s+/, $2]] if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$}; if ($define) { if ($define->[1] =~ /\\$/) { $define->[1] .= $_; } else { if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) { my @n = find_api($define->[1]); push @{$depends{$define->[0]}}, @n if @n } undef $define; } } $define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)}; if ($function) { if (/^}/) { if (exists $API{$function->[0]}) { my @n = find_api($function->[1]); push @{$depends{$function->[0]}}, @n if @n } undef $function; } else { $function->[1] .= $_; } } $function = [$1, ''] if m{^DPPP_\(my_(\w+)\)}; $replace = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$}; $replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)}; $replace{$2} = $1 if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+).*$rccs\s+Replace\s+$rcce}; $replace{$1} = $2 if m{^\s*$rccs\s+Replace (\w+) with (\w+)\s+$rcce\s*$}; if (m{^\s*$rccs\s+(\w+(\s*,\s*\w+)*)\s+depends\s+on\s+(\w+(\s*,\s*\w+)*)\s+$rcce\s*$}) { my @deps = map { s/\s+//g; $_ } split /,/, $3; my $d; for $d (map { s/\s+//g; $_ } split /,/, $1) { push @{$depends{$d}}, @deps; } } $need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)}; } for (values %depends) { my %s; $_ = [sort grep !$s{$_}++, @$_]; } if (exists $opt{'api-info'}) { my $f; my $count = 0; my $match = $opt{'api-info'} =~ m!^/(.*)/$! ? $1 : "^\Q$opt{'api-info'}\E\$"; for $f (sort { lc $a cmp lc $b } keys %API) { next unless $f =~ /$match/; print "\n=== $f ===\n\n"; my $info = 0; if ($API{$f}{base} || $API{$f}{todo}) { my $base = format_version($API{$f}{base} || $API{$f}{todo}); print "Supported at least starting from perl-$base.\n"; $info++; } if ($API{$f}{provided}) { my $todo = $API{$f}{todo} ? format_version($API{$f}{todo}) : "5.003"; print "Support by $ppport provided back to perl-$todo.\n"; print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f}; print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f}; print "\n$hints{$f}" if exists $hints{$f}; print "\nWARNING:\n$warnings{$f}" if exists $warnings{$f}; $info++; } print "No portability information available.\n" unless $info; $count++; } $count or print "Found no API matching '$opt{'api-info'}'."; print "\n"; exit 0; } if (exists $opt{'list-provided'}) { my $f; for $f (sort { lc $a cmp lc $b } keys %API) { next unless $API{$f}{provided}; my @flags; push @flags, 'explicit' if exists $need{$f}; push @flags, 'depend' if exists $depends{$f}; push @flags, 'hint' if exists $hints{$f}; push @flags, 'warning' if exists $warnings{$f}; my $flags = @flags ? ' ['.join(', ', @flags).']' : ''; print "$f$flags\n"; } exit 0; } my @files; my @srcext = qw( .xs .c .h .cc .cpp -c.inc -xs.inc ); my $srcext = join '|', map { quotemeta $_ } @srcext; if (@ARGV) { my %seen; for (@ARGV) { if (-e) { if (-f) { push @files, $_ unless $seen{$_}++; } else { warn "'$_' is not a file.\n" } } else { my @new = grep { -f } glob $_ or warn "'$_' does not exist.\n"; push @files, grep { !$seen{$_}++ } @new; } } } else { eval { require File::Find; File::Find::find(sub { $File::Find::name =~ /($srcext)$/i and push @files, $File::Find::name; }, '.'); }; if ($@) { @files = map { glob "*$_" } @srcext; } } if (!@ARGV || $opt{filter}) { my(@in, @out); my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files; for (@files) { my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i; push @{ $out ? \@out : \@in }, $_; } if (@ARGV && @out) { warning("Skipping the following files (use --nofilter to avoid this):\n| ", join "\n| ", @out); } @files = @in; } die "No input files given!\n" unless @files; my(%files, %global, %revreplace); %revreplace = reverse %replace; my $filename; my $patch_opened = 0; for $filename (@files) { unless (open IN, "<$filename") { warn "Unable to read from $filename: $!\n"; next; } info("Scanning $filename ..."); my $c = do { local $/; }; close IN; my %file = (orig => $c, changes => 0); # Temporarily remove C/XS comments and strings from the code my @ccom; $c =~ s{ ( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]* | ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* ) | ( ^$HS*\#[^\r\n]* | "[^"\\]*(?:\\.[^"\\]*)*" | '[^'\\]*(?:\\.[^'\\]*)*' | / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* ) ) }{ defined $2 and push @ccom, $2; defined $1 ? $1 : "$ccs$#ccom$cce" }mgsex; $file{ccom} = \@ccom; $file{code} = $c; $file{has_inc_ppport} = $c =~ /^$HS*#$HS*include[^\r\n]+\b\Q$ppport\E\b/m; my $func; for $func (keys %API) { my $match = $func; $match .= "|$revreplace{$func}" if exists $revreplace{$func}; if ($c =~ /\b(?:Perl_)?($match)\b/) { $file{uses_replace}{$1}++ if exists $revreplace{$func} && $1 eq $revreplace{$func}; $file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/; if (exists $API{$func}{provided}) { $file{uses_provided}{$func}++; if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) { $file{uses}{$func}++; my @deps = rec_depend($func); if (@deps) { $file{uses_deps}{$func} = \@deps; for (@deps) { $file{uses}{$_} = 0 unless exists $file{uses}{$_}; } } for ($func, @deps) { $file{needs}{$_} = 'static' if exists $need{$_}; } } } if (exists $API{$func}{todo} && $API{$func}{todo} > $opt{'compat-version'}) { if ($c =~ /\b$func\b/) { $file{uses_todo}{$func}++; } } } } while ($c =~ /^$HS*#$HS*define$HS+(NEED_(\w+?)(_GLOBAL)?)\b/mg) { if (exists $need{$2}) { $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++; } else { warning("Possibly wrong #define $1 in $filename") } } for (qw(uses needs uses_todo needed_global needed_static)) { for $func (keys %{$file{$_}}) { push @{$global{$_}{$func}}, $filename; } } $files{$filename} = \%file; } # Globally resolve NEED_'s my $need; for $need (keys %{$global{needs}}) { if (@{$global{needs}{$need}} > 1) { my @targets = @{$global{needs}{$need}}; my @t = grep $files{$_}{needed_global}{$need}, @targets; @targets = @t if @t; @t = grep /\.xs$/i, @targets; @targets = @t if @t; my $target = shift @targets; $files{$target}{needs}{$need} = 'global'; for (@{$global{needs}{$need}}) { $files{$_}{needs}{$need} = 'extern' if $_ ne $target; } } } for $filename (@files) { exists $files{$filename} or next; info("=== Analyzing $filename ==="); my %file = %{$files{$filename}}; my $func; my $c = $file{code}; my $warnings = 0; for $func (sort keys %{$file{uses_Perl}}) { if ($API{$func}{varargs}) { unless ($API{$func}{nothxarg}) { my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))} { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge); if ($changes) { warning("Doesn't pass interpreter argument aTHX to Perl_$func"); $file{changes} += $changes; } } } else { warning("Uses Perl_$func instead of $func"); $file{changes} += ($c =~ s{\bPerl_$func(\s*)\((\s*aTHX_?)?\s*} {$func$1(}g); } } for $func (sort keys %{$file{uses_replace}}) { warning("Uses $func instead of $replace{$func}"); $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g); } for $func (sort keys %{$file{uses_provided}}) { if ($file{uses}{$func}) { if (exists $file{uses_deps}{$func}) { diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}})); } else { diag("Uses $func"); } } $warnings += hint($func); } unless ($opt{quiet}) { for $func (sort keys %{$file{uses_todo}}) { print "*** WARNING: Uses $func, which may not be portable below perl ", format_version($API{$func}{todo}), ", even with '$ppport'\n"; $warnings++; } } for $func (sort keys %{$file{needed_static}}) { my $message = ''; if (not exists $file{uses}{$func}) { $message = "No need to define NEED_$func if $func is never used"; } elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') { $message = "No need to define NEED_$func when already needed globally"; } if ($message) { diag($message); $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg); } } for $func (sort keys %{$file{needed_global}}) { my $message = ''; if (not exists $global{uses}{$func}) { $message = "No need to define NEED_${func}_GLOBAL if $func is never used"; } elsif (exists $file{needs}{$func}) { if ($file{needs}{$func} eq 'extern') { $message = "No need to define NEED_${func}_GLOBAL when already needed globally"; } elsif ($file{needs}{$func} eq 'static') { $message = "No need to define NEED_${func}_GLOBAL when only used in this file"; } } if ($message) { diag($message); $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg); } } $file{needs_inc_ppport} = keys %{$file{uses}}; if ($file{needs_inc_ppport}) { my $pp = ''; for $func (sort keys %{$file{needs}}) { my $type = $file{needs}{$func}; next if $type eq 'extern'; my $suffix = $type eq 'global' ? '_GLOBAL' : ''; unless (exists $file{"needed_$type"}{$func}) { if ($type eq 'global') { diag("Files [@{$global{needs}{$func}}] need $func, adding global request"); } else { diag("File needs $func, adding static request"); } $pp .= "#define NEED_$func$suffix\n"; } } if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) { $pp = ''; $file{changes}++; } unless ($file{has_inc_ppport}) { diag("Needs to include '$ppport'"); $pp .= qq(#include "$ppport"\n) } if ($pp) { $file{changes} += ($c =~ s/^($HS*#$HS*define$HS+NEED_\w+.*?)^/$1$pp/ms) || ($c =~ s/^(?=$HS*#$HS*include.*\Q$ppport\E)/$pp/m) || ($c =~ s/^($HS*#$HS*include.*XSUB.*\s*?)^/$1$pp/m) || ($c =~ s/^/$pp/); } } else { if ($file{has_inc_ppport}) { diag("No need to include '$ppport'"); $file{changes} += ($c =~ s/^$HS*?#$HS*include.*\Q$ppport\E.*?$LF//m); } } # put back in our C comments my $ix; my $cppc = 0; my @ccom = @{$file{ccom}}; for $ix (0 .. $#ccom) { if (!$opt{cplusplus} && $ccom[$ix] =~ s!^//!!) { $cppc++; $file{changes} += $c =~ s/$rccs$ix$rcce/$ccs$ccom[$ix] $cce/; } else { $c =~ s/$rccs$ix$rcce/$ccom[$ix]/; } } if ($cppc) { my $s = $cppc != 1 ? 's' : ''; warning("Uses $cppc C++ style comment$s, which is not portable"); } my $s = $warnings != 1 ? 's' : ''; my $warn = $warnings ? " ($warnings warning$s)" : ''; info("Analysis completed$warn"); if ($file{changes}) { if (exists $opt{copy}) { my $newfile = "$filename$opt{copy}"; if (-e $newfile) { error("'$newfile' already exists, refusing to write copy of '$filename'"); } else { local *F; if (open F, ">$newfile") { info("Writing copy of '$filename' with changes to '$newfile'"); print F $c; close F; } else { error("Cannot open '$newfile' for writing: $!"); } } } elsif (exists $opt{patch} || $opt{changes}) { if (exists $opt{patch}) { unless ($patch_opened) { if (open PATCH, ">$opt{patch}") { $patch_opened = 1; } else { error("Cannot open '$opt{patch}' for writing: $!"); delete $opt{patch}; $opt{changes} = 1; goto fallback; } } mydiff(\*PATCH, $filename, $c); } else { fallback: info("Suggested changes:"); mydiff(\*STDOUT, $filename, $c); } } else { my $s = $file{changes} == 1 ? '' : 's'; info("$file{changes} potentially required change$s detected"); } } else { info("Looks good"); } } close PATCH if $patch_opened; exit 0; sub try_use { eval "use @_;"; return $@ eq '' } sub mydiff { local *F = shift; my($file, $str) = @_; my $diff; if (exists $opt{diff}) { $diff = run_diff($opt{diff}, $file, $str); } if (!defined $diff and try_use('Text::Diff')) { $diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' }); $diff = <
$tmp") { print F $str; close F; if (open F, "$prog $file $tmp |") { while () { s/\Q$tmp\E/$file.patched/; $diff .= $_; } close F; unlink $tmp; return $diff; } unlink $tmp; } else { error("Cannot open '$tmp' for writing: $!"); } return undef; } sub rec_depend { my($func, $seen) = @_; return () unless exists $depends{$func}; $seen = {%{$seen||{}}}; return () if $seen->{$func}++; my %s; grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}}; } sub parse_version { my $ver = shift; if ($ver =~ /^(\d+)\.(\d+)\.(\d+)$/) { return ($1, $2, $3); } elsif ($ver !~ /^\d+\.[\d_]+$/) { die "cannot parse version '$ver'\n"; } $ver =~ s/_//g; $ver =~ s/$/000000/; my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/; $v = int $v; $s = int $s; if ($r < 5 || ($r == 5 && $v < 6)) { if ($s % 10) { die "cannot parse version '$ver'\n"; } } return ($r, $v, $s); } sub format_version { my $ver = shift; $ver =~ s/$/000000/; my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/; $v = int $v; $s = int $s; if ($r < 5 || ($r == 5 && $v < 6)) { if ($s % 10) { die "invalid version '$ver'\n"; } $s /= 10; $ver = sprintf "%d.%03d", $r, $v; $s > 0 and $ver .= sprintf "_%02d", $s; return $ver; } return sprintf "%d.%d.%d", $r, $v, $s; } sub info { $opt{quiet} and return; print @_, "\n"; } sub diag { $opt{quiet} and return; $opt{diag} and print @_, "\n"; } sub warning { $opt{quiet} and return; print "*** ", @_, "\n"; } sub error { print "*** ERROR: ", @_, "\n"; } my %given_hints; my %given_warnings; sub hint { $opt{quiet} and return; my $func = shift; my $rv = 0; if (exists $warnings{$func} && !$given_warnings{$func}++) { my $warn = $warnings{$func}; $warn =~ s!^!*** !mg; print "*** WARNING: $func\n", $warn; $rv++; } if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) { my $hint = $hints{$func}; $hint =~ s/^/ /mg; print " --- hint for $func ---\n", $hint; } $rv; } sub usage { my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms; my %M = ( 'I' => '*' ); $usage =~ s/^\s*perl\s+\S+/$^X $0/; $usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g; print < }; my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms; $copy =~ s/^(?=\S+)/ /gms; $self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms; $self =~ s/^SKIP.*(?=^__DATA__)/SKIP if (\@ARGV && \$ARGV[0] eq '--unstrip') { eval { require Devel::PPPort }; \$@ and die "Cannot require Devel::PPPort, please install.\\n"; if (eval \$Devel::PPPort::VERSION < $VERSION) { die "$0 was originally generated with Devel::PPPort $VERSION.\\n" . "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n" . "Please install a newer version, or --unstrip will not work.\\n"; } Devel::PPPort::WriteFile(\$0); exit 0; } print <$0" or die "cannot strip $0: $!\n"; print OUT "$pl$c\n"; exit 0; } __DATA__ */ #ifndef _P_P_PORTABILITY_H_ #define _P_P_PORTABILITY_H_ #ifndef DPPP_NAMESPACE # define DPPP_NAMESPACE DPPP_ #endif #define DPPP_CAT2(x,y) CAT2(x,y) #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name) #ifndef PERL_REVISION # if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION)) # define PERL_PATCHLEVEL_H_IMPLICIT # include # endif # if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL))) # include # endif # ifndef PERL_REVISION # define PERL_REVISION (5) /* Replace: 1 */ # define PERL_VERSION PATCHLEVEL # define PERL_SUBVERSION SUBVERSION /* Replace PERL_PATCHLEVEL with PERL_VERSION */ /* Replace: 0 */ # endif #endif #define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10)) #define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION)) /* It is very unlikely that anyone will try to use this with Perl 6 (or greater), but who knows. */ #if PERL_REVISION != 5 # error ppport.h only works with Perl version 5 #endif /* PERL_REVISION != 5 */ #ifndef dTHR # define dTHR dNOOP #endif #ifndef dTHX # define dTHX dNOOP #endif #ifndef dTHXa # define dTHXa(x) dNOOP #endif #ifndef pTHX # define pTHX void #endif #ifndef pTHX_ # define pTHX_ #endif #ifndef aTHX # define aTHX #endif #ifndef aTHX_ # define aTHX_ #endif #if (PERL_BCDVERSION < 0x5006000) # ifdef USE_THREADS # define aTHXR thr # define aTHXR_ thr, # else # define aTHXR # define aTHXR_ # endif # define dTHXR dTHR #else # define aTHXR aTHX # define aTHXR_ aTHX_ # define dTHXR dTHX #endif #ifndef dTHXoa # define dTHXoa(x) dTHXa(x) #endif #ifdef I_LIMITS # include #endif #ifndef PERL_UCHAR_MIN # define PERL_UCHAR_MIN ((unsigned char)0) #endif #ifndef PERL_UCHAR_MAX # ifdef UCHAR_MAX # define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX) # else # ifdef MAXUCHAR # define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR) # else # define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0) # endif # endif #endif #ifndef PERL_USHORT_MIN # define PERL_USHORT_MIN ((unsigned short)0) #endif #ifndef PERL_USHORT_MAX # ifdef USHORT_MAX # define PERL_USHORT_MAX ((unsigned short)USHORT_MAX) # else # ifdef MAXUSHORT # define PERL_USHORT_MAX ((unsigned short)MAXUSHORT) # else # ifdef USHRT_MAX # define PERL_USHORT_MAX ((unsigned short)USHRT_MAX) # else # define PERL_USHORT_MAX ((unsigned short)~(unsigned)0) # endif # endif # endif #endif #ifndef PERL_SHORT_MAX # ifdef SHORT_MAX # define PERL_SHORT_MAX ((short)SHORT_MAX) # else # ifdef MAXSHORT /* Often used in */ # define PERL_SHORT_MAX ((short)MAXSHORT) # else # ifdef SHRT_MAX # define PERL_SHORT_MAX ((short)SHRT_MAX) # else # define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1)) # endif # endif # endif #endif #ifndef PERL_SHORT_MIN # ifdef SHORT_MIN # define PERL_SHORT_MIN ((short)SHORT_MIN) # else # ifdef MINSHORT # define PERL_SHORT_MIN ((short)MINSHORT) # else # ifdef SHRT_MIN # define PERL_SHORT_MIN ((short)SHRT_MIN) # else # define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3)) # endif # endif # endif #endif #ifndef PERL_UINT_MAX # ifdef UINT_MAX # define PERL_UINT_MAX ((unsigned int)UINT_MAX) # else # ifdef MAXUINT # define PERL_UINT_MAX ((unsigned int)MAXUINT) # else # define PERL_UINT_MAX (~(unsigned int)0) # endif # endif #endif #ifndef PERL_UINT_MIN # define PERL_UINT_MIN ((unsigned int)0) #endif #ifndef PERL_INT_MAX # ifdef INT_MAX # define PERL_INT_MAX ((int)INT_MAX) # else # ifdef MAXINT /* Often used in */ # define PERL_INT_MAX ((int)MAXINT) # else # define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1)) # endif # endif #endif #ifndef PERL_INT_MIN # ifdef INT_MIN # define PERL_INT_MIN ((int)INT_MIN) # else # ifdef MININT # define PERL_INT_MIN ((int)MININT) # else # define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3)) # endif # endif #endif #ifndef PERL_ULONG_MAX # ifdef ULONG_MAX # define PERL_ULONG_MAX ((unsigned long)ULONG_MAX) # else # ifdef MAXULONG # define PERL_ULONG_MAX ((unsigned long)MAXULONG) # else # define PERL_ULONG_MAX (~(unsigned long)0) # endif # endif #endif #ifndef PERL_ULONG_MIN # define PERL_ULONG_MIN ((unsigned long)0L) #endif #ifndef PERL_LONG_MAX # ifdef LONG_MAX # define PERL_LONG_MAX ((long)LONG_MAX) # else # ifdef MAXLONG # define PERL_LONG_MAX ((long)MAXLONG) # else # define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1)) # endif # endif #endif #ifndef PERL_LONG_MIN # ifdef LONG_MIN # define PERL_LONG_MIN ((long)LONG_MIN) # else # ifdef MINLONG # define PERL_LONG_MIN ((long)MINLONG) # else # define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3)) # endif # endif #endif #if defined(HAS_QUAD) && (defined(convex) || defined(uts)) # ifndef PERL_UQUAD_MAX # ifdef ULONGLONG_MAX # define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX) # else # ifdef MAXULONGLONG # define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG) # else # define PERL_UQUAD_MAX (~(unsigned long long)0) # endif # endif # endif # ifndef PERL_UQUAD_MIN # define PERL_UQUAD_MIN ((unsigned long long)0L) # endif # ifndef PERL_QUAD_MAX # ifdef LONGLONG_MAX # define PERL_QUAD_MAX ((long long)LONGLONG_MAX) # else # ifdef MAXLONGLONG # define PERL_QUAD_MAX ((long long)MAXLONGLONG) # else # define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1)) # endif # endif # endif # ifndef PERL_QUAD_MIN # ifdef LONGLONG_MIN # define PERL_QUAD_MIN ((long long)LONGLONG_MIN) # else # ifdef MINLONGLONG # define PERL_QUAD_MIN ((long long)MINLONGLONG) # else # define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3)) # endif # endif # endif #endif /* This is based on code from 5.003 perl.h */ #ifdef HAS_QUAD # ifdef cray #ifndef IVTYPE # define IVTYPE int #endif #ifndef IV_MIN # define IV_MIN PERL_INT_MIN #endif #ifndef IV_MAX # define IV_MAX PERL_INT_MAX #endif #ifndef UV_MIN # define UV_MIN PERL_UINT_MIN #endif #ifndef UV_MAX # define UV_MAX PERL_UINT_MAX #endif # ifdef INTSIZE #ifndef IVSIZE # define IVSIZE INTSIZE #endif # endif # else # if defined(convex) || defined(uts) #ifndef IVTYPE # define IVTYPE long long #endif #ifndef IV_MIN # define IV_MIN PERL_QUAD_MIN #endif #ifndef IV_MAX # define IV_MAX PERL_QUAD_MAX #endif #ifndef UV_MIN # define UV_MIN PERL_UQUAD_MIN #endif #ifndef UV_MAX # define UV_MAX PERL_UQUAD_MAX #endif # ifdef LONGLONGSIZE #ifndef IVSIZE # define IVSIZE LONGLONGSIZE #endif # endif # else #ifndef IVTYPE # define IVTYPE long #endif #ifndef IV_MIN # define IV_MIN PERL_LONG_MIN #endif #ifndef IV_MAX # define IV_MAX PERL_LONG_MAX #endif #ifndef UV_MIN # define UV_MIN PERL_ULONG_MIN #endif #ifndef UV_MAX # define UV_MAX PERL_ULONG_MAX #endif # ifdef LONGSIZE #ifndef IVSIZE # define IVSIZE LONGSIZE #endif # endif # endif # endif #ifndef IVSIZE # define IVSIZE 8 #endif #ifndef LONGSIZE # define LONGSIZE 8 #endif #ifndef PERL_QUAD_MIN # define PERL_QUAD_MIN IV_MIN #endif #ifndef PERL_QUAD_MAX # define PERL_QUAD_MAX IV_MAX #endif #ifndef PERL_UQUAD_MIN # define PERL_UQUAD_MIN UV_MIN #endif #ifndef PERL_UQUAD_MAX # define PERL_UQUAD_MAX UV_MAX #endif #else #ifndef IVTYPE # define IVTYPE long #endif #ifndef LONGSIZE # define LONGSIZE 4 #endif #ifndef IV_MIN # define IV_MIN PERL_LONG_MIN #endif #ifndef IV_MAX # define IV_MAX PERL_LONG_MAX #endif #ifndef UV_MIN # define UV_MIN PERL_ULONG_MIN #endif #ifndef UV_MAX # define UV_MAX PERL_ULONG_MAX #endif #endif #ifndef IVSIZE # ifdef LONGSIZE # define IVSIZE LONGSIZE # else # define IVSIZE 4 /* A bold guess, but the best we can make. */ # endif #endif #ifndef UVTYPE # define UVTYPE unsigned IVTYPE #endif #ifndef UVSIZE # define UVSIZE IVSIZE #endif #ifndef sv_setuv # define sv_setuv(sv, uv) \ STMT_START { \ UV TeMpUv = uv; \ if (TeMpUv <= IV_MAX) \ sv_setiv(sv, TeMpUv); \ else \ sv_setnv(sv, (double)TeMpUv); \ } STMT_END #endif #ifndef newSVuv # define newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv)) #endif #ifndef sv_2uv # define sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv))) #endif #ifndef SvUVX # define SvUVX(sv) ((UV)SvIVX(sv)) #endif #ifndef SvUVXx # define SvUVXx(sv) SvUVX(sv) #endif #ifndef SvUV # define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv)) #endif #ifndef SvUVx # define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv)) #endif /* Hint: sv_uv * Always use the SvUVx() macro instead of sv_uv(). */ #ifndef sv_uv # define sv_uv(sv) SvUVx(sv) #endif #if !defined(SvUOK) && defined(SvIOK_UV) # define SvUOK(sv) SvIOK_UV(sv) #endif #ifndef XST_mUV # define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) ) #endif #ifndef XSRETURN_UV # define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END #endif #ifndef PUSHu # define PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END #endif #ifndef XPUSHu # define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END #endif #ifdef HAS_MEMCMP #ifndef memNE # define memNE(s1,s2,l) (memcmp(s1,s2,l)) #endif #ifndef memEQ # define memEQ(s1,s2,l) (!memcmp(s1,s2,l)) #endif #else #ifndef memNE # define memNE(s1,s2,l) (bcmp(s1,s2,l)) #endif #ifndef memEQ # define memEQ(s1,s2,l) (!bcmp(s1,s2,l)) #endif #endif #ifndef memEQs # define memEQs(s1, l, s2) \ (sizeof(s2)-1 == l && memEQ(s1, (s2 ""), (sizeof(s2)-1))) #endif #ifndef memNEs # define memNEs(s1, l, s2) !memEQs(s1, l, s2) #endif #ifndef MoveD # define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t)) #endif #ifndef CopyD # define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t)) #endif #ifdef HAS_MEMSET #ifndef ZeroD # define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t)) #endif #else #ifndef ZeroD # define ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)), d) #endif #endif #ifndef PoisonWith # define PoisonWith(d,n,t,b) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t)) #endif #ifndef PoisonNew # define PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB) #endif #ifndef PoisonFree # define PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF) #endif #ifndef Poison # define Poison(d,n,t) PoisonFree(d,n,t) #endif #ifndef Newx # define Newx(v,n,t) New(0,v,n,t) #endif #ifndef Newxc # define Newxc(v,n,t,c) Newc(0,v,n,t,c) #endif #ifndef Newxz # define Newxz(v,n,t) Newz(0,v,n,t) #endif #ifndef PERL_MAGIC_qr # define PERL_MAGIC_qr 'r' #endif #ifndef cBOOL # define cBOOL(cbool) ((cbool) ? (bool)1 : (bool)0) #endif #ifndef OpHAS_SIBLING # define OpHAS_SIBLING(o) (cBOOL((o)->op_sibling)) #endif #ifndef OpSIBLING # define OpSIBLING(o) (0 + (o)->op_sibling) #endif #ifndef OpMORESIB_set # define OpMORESIB_set(o, sib) ((o)->op_sibling = (sib)) #endif #ifndef OpLASTSIB_set # define OpLASTSIB_set(o, parent) ((o)->op_sibling = NULL) #endif #ifndef OpMAYBESIB_set # define OpMAYBESIB_set(o, sib, parent) ((o)->op_sibling = (sib)) #endif #ifndef SvRX #if defined(NEED_SvRX) static void * DPPP_(my_SvRX)(pTHX_ SV *rv); static #else extern void * DPPP_(my_SvRX)(pTHX_ SV *rv); #endif #ifdef SvRX # undef SvRX #endif #define SvRX(a) DPPP_(my_SvRX)(aTHX_ a) #if defined(NEED_SvRX) || defined(NEED_SvRX_GLOBAL) void * DPPP_(my_SvRX)(pTHX_ SV *rv) { if (SvROK(rv)) { SV *sv = SvRV(rv); if (SvMAGICAL(sv)) { MAGIC *mg = mg_find(sv, PERL_MAGIC_qr); if (mg && mg->mg_obj) { return mg->mg_obj; } } } return 0; } #endif #endif #ifndef SvRXOK # define SvRXOK(sv) (!!SvRX(sv)) #endif #ifndef PERL_UNUSED_DECL # ifdef HASATTRIBUTE # if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER) # define PERL_UNUSED_DECL # else # define PERL_UNUSED_DECL __attribute__((unused)) # endif # else # define PERL_UNUSED_DECL # endif #endif #ifndef PERL_UNUSED_ARG # if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */ # include # define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x)) # else # define PERL_UNUSED_ARG(x) ((void)x) # endif #endif #ifndef PERL_UNUSED_VAR # define PERL_UNUSED_VAR(x) ((void)x) #endif #ifndef PERL_UNUSED_CONTEXT # ifdef USE_ITHREADS # define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl) # else # define PERL_UNUSED_CONTEXT # endif #endif #ifndef PERL_UNUSED_RESULT # if defined(__GNUC__) && defined(HASATTRIBUTE_WARN_UNUSED_RESULT) # define PERL_UNUSED_RESULT(v) STMT_START { __typeof__(v) z = (v); (void)sizeof(z); } STMT_END # else # define PERL_UNUSED_RESULT(v) ((void)(v)) # endif #endif #ifndef NOOP # define NOOP /*EMPTY*/(void)0 #endif #ifndef dNOOP # define dNOOP extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL #endif #ifndef NVTYPE # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) # define NVTYPE long double # else # define NVTYPE double # endif typedef NVTYPE NV; #endif #ifndef INT2PTR # if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) # define PTRV UV # define INT2PTR(any,d) (any)(d) # else # if PTRSIZE == LONGSIZE # define PTRV unsigned long # else # define PTRV unsigned # endif # define INT2PTR(any,d) (any)(PTRV)(d) # endif #endif #ifndef PTR2ul # if PTRSIZE == LONGSIZE # define PTR2ul(p) (unsigned long)(p) # else # define PTR2ul(p) INT2PTR(unsigned long,p) # endif #endif #ifndef PTR2nat # define PTR2nat(p) (PTRV)(p) #endif #ifndef NUM2PTR # define NUM2PTR(any,d) (any)PTR2nat(d) #endif #ifndef PTR2IV # define PTR2IV(p) INT2PTR(IV,p) #endif #ifndef PTR2UV # define PTR2UV(p) INT2PTR(UV,p) #endif #ifndef PTR2NV # define PTR2NV(p) NUM2PTR(NV,p) #endif #undef START_EXTERN_C #undef END_EXTERN_C #undef EXTERN_C #ifdef __cplusplus # define START_EXTERN_C extern "C" { # define END_EXTERN_C } # define EXTERN_C extern "C" #else # define START_EXTERN_C # define END_EXTERN_C # define EXTERN_C extern #endif #if defined(PERL_GCC_PEDANTIC) # ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN # define PERL_GCC_BRACE_GROUPS_FORBIDDEN # endif #endif #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus) # ifndef PERL_USE_GCC_BRACE_GROUPS # define PERL_USE_GCC_BRACE_GROUPS # endif #endif #undef STMT_START #undef STMT_END #ifdef PERL_USE_GCC_BRACE_GROUPS # define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */ # define STMT_END ) #else # if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__) # define STMT_START if (1) # define STMT_END else (void)0 # else # define STMT_START do # define STMT_END while (0) # endif #endif #ifndef boolSV # define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no) #endif /* DEFSV appears first in 5.004_56 */ #ifndef DEFSV # define DEFSV GvSV(PL_defgv) #endif #ifndef SAVE_DEFSV # define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv)) #endif #ifndef DEFSV_set # define DEFSV_set(sv) (DEFSV = (sv)) #endif /* Older perls (<=5.003) lack AvFILLp */ #ifndef AvFILLp # define AvFILLp AvFILL #endif #ifndef ERRSV # define ERRSV get_sv("@",FALSE) #endif /* Hint: gv_stashpvn * This function's backport doesn't support the length parameter, but * rather ignores it. Portability can only be ensured if the length * parameter is used for speed reasons, but the length can always be * correctly computed from the string argument. */ #ifndef gv_stashpvn # define gv_stashpvn(str,len,create) gv_stashpv(str,create) #endif /* Replace: 1 */ #ifndef get_cv # define get_cv perl_get_cv #endif #ifndef get_sv # define get_sv perl_get_sv #endif #ifndef get_av # define get_av perl_get_av #endif #ifndef get_hv # define get_hv perl_get_hv #endif /* Replace: 0 */ #ifndef dUNDERBAR # define dUNDERBAR dNOOP #endif #ifndef UNDERBAR # define UNDERBAR DEFSV #endif #ifndef dAX # define dAX I32 ax = MARK - PL_stack_base + 1 #endif #ifndef dITEMS # define dITEMS I32 items = SP - MARK #endif #ifndef dXSTARG # define dXSTARG SV * targ = sv_newmortal() #endif #ifndef dAXMARK # define dAXMARK I32 ax = POPMARK; \ register SV ** const mark = PL_stack_base + ax++ #endif #ifndef XSprePUSH # define XSprePUSH (sp = PL_stack_base + ax - 1) #endif #if (PERL_BCDVERSION < 0x5005000) # undef XSRETURN # define XSRETURN(off) \ STMT_START { \ PL_stack_sp = PL_stack_base + ax + ((off) - 1); \ return; \ } STMT_END #endif #ifndef XSPROTO # define XSPROTO(name) void name(pTHX_ CV* cv) #endif #ifndef SVfARG # define SVfARG(p) ((void*)(p)) #endif #ifndef PERL_ABS # define PERL_ABS(x) ((x) < 0 ? -(x) : (x)) #endif #ifndef dVAR # define dVAR dNOOP #endif #ifndef SVf # define SVf "_" #endif #ifndef UTF8_MAXBYTES # define UTF8_MAXBYTES UTF8_MAXLEN #endif #ifndef CPERLscope # define CPERLscope(x) x #endif #ifndef PERL_HASH # define PERL_HASH(hash,str,len) \ STMT_START { \ const char *s_PeRlHaSh = str; \ I32 i_PeRlHaSh = len; \ U32 hash_PeRlHaSh = 0; \ while (i_PeRlHaSh--) \ hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \ (hash) = hash_PeRlHaSh; \ } STMT_END #endif #ifndef PERLIO_FUNCS_DECL # ifdef PERLIO_FUNCS_CONST # define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs # define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs) # else # define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs # define PERLIO_FUNCS_CAST(funcs) (funcs) # endif #endif /* provide these typedefs for older perls */ #if (PERL_BCDVERSION < 0x5009003) # ifdef ARGSproto typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto); # else typedef OP* (CPERLscope(*Perl_ppaddr_t))(pTHX); # endif typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*); #endif #ifndef isPSXSPC # define isPSXSPC(c) (isSPACE(c) || (c) == '\v') #endif #ifndef isBLANK # define isBLANK(c) ((c) == ' ' || (c) == '\t') #endif #ifdef EBCDIC #ifndef isALNUMC # define isALNUMC(c) isalnum(c) #endif #ifndef isASCII # define isASCII(c) isascii(c) #endif #ifndef isCNTRL # define isCNTRL(c) iscntrl(c) #endif #ifndef isGRAPH # define isGRAPH(c) isgraph(c) #endif #ifndef isPRINT # define isPRINT(c) isprint(c) #endif #ifndef isPUNCT # define isPUNCT(c) ispunct(c) #endif #ifndef isXDIGIT # define isXDIGIT(c) isxdigit(c) #endif #else # if (PERL_BCDVERSION < 0x5010000) /* Hint: isPRINT * The implementation in older perl versions includes all of the * isSPACE() characters, which is wrong. The version provided by * Devel::PPPort always overrides a present buggy version. */ # undef isPRINT # endif #ifdef HAS_QUAD # ifdef U64TYPE # define WIDEST_UTYPE U64TYPE # else # define WIDEST_UTYPE Quad_t # endif #else # define WIDEST_UTYPE U32 #endif #ifndef isALNUMC # define isALNUMC(c) (isALPHA(c) || isDIGIT(c)) #endif #ifndef isASCII # define isASCII(c) ((WIDEST_UTYPE) (c) <= 127) #endif #ifndef isCNTRL # define isCNTRL(c) ((WIDEST_UTYPE) (c) < ' ' || (c) == 127) #endif #ifndef isGRAPH # define isGRAPH(c) (isALNUM(c) || isPUNCT(c)) #endif #ifndef isPRINT # define isPRINT(c) (((c) >= 32 && (c) < 127)) #endif #ifndef isPUNCT # define isPUNCT(c) (((c) >= 33 && (c) <= 47) || ((c) >= 58 && (c) <= 64) || ((c) >= 91 && (c) <= 96) || ((c) >= 123 && (c) <= 126)) #endif #ifndef isXDIGIT # define isXDIGIT(c) (isDIGIT(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) #endif #endif /* Until we figure out how to support this in older perls... */ #if (PERL_BCDVERSION >= 0x5008000) #ifndef HeUTF8 # define HeUTF8(he) ((HeKLEN(he) == HEf_SVKEY) ? \ SvUTF8(HeKEY_sv(he)) : \ (U32)HeKUTF8(he)) #endif #endif #ifndef C_ARRAY_LENGTH # define C_ARRAY_LENGTH(a) (sizeof(a)/sizeof((a)[0])) #endif #ifndef C_ARRAY_END # define C_ARRAY_END(a) ((a) + C_ARRAY_LENGTH(a)) #endif #ifndef PERL_SIGNALS_UNSAFE_FLAG #define PERL_SIGNALS_UNSAFE_FLAG 0x0001 #if (PERL_BCDVERSION < 0x5008000) # define D_PPP_PERL_SIGNALS_INIT PERL_SIGNALS_UNSAFE_FLAG #else # define D_PPP_PERL_SIGNALS_INIT 0 #endif #if defined(NEED_PL_signals) static U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT; #elif defined(NEED_PL_signals_GLOBAL) U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT; #else extern U32 DPPP_(my_PL_signals); #endif #define PL_signals DPPP_(my_PL_signals) #endif /* Hint: PL_ppaddr * Calling an op via PL_ppaddr requires passing a context argument * for threaded builds. Since the context argument is different for * 5.005 perls, you can use aTHXR (supplied by ppport.h), which will * automatically be defined as the correct argument. */ #if (PERL_BCDVERSION <= 0x5005005) /* Replace: 1 */ # define PL_ppaddr ppaddr # define PL_no_modify no_modify /* Replace: 0 */ #endif #if (PERL_BCDVERSION <= 0x5004005) /* Replace: 1 */ # define PL_DBsignal DBsignal # define PL_DBsingle DBsingle # define PL_DBsub DBsub # define PL_DBtrace DBtrace # define PL_Sv Sv # define PL_bufend bufend # define PL_bufptr bufptr # define PL_compiling compiling # define PL_copline copline # define PL_curcop curcop # define PL_curstash curstash # define PL_debstash debstash # define PL_defgv defgv # define PL_diehook diehook # define PL_dirty dirty # define PL_dowarn dowarn # define PL_errgv errgv # define PL_error_count error_count # define PL_expect expect # define PL_hexdigit hexdigit # define PL_hints hints # define PL_in_my in_my # define PL_laststatval laststatval # define PL_lex_state lex_state # define PL_lex_stuff lex_stuff # define PL_linestr linestr # define PL_na na # define PL_perl_destruct_level perl_destruct_level # define PL_perldb perldb # define PL_rsfp_filters rsfp_filters # define PL_rsfp rsfp # define PL_stack_base stack_base # define PL_stack_sp stack_sp # define PL_statcache statcache # define PL_stdingv stdingv # define PL_sv_arenaroot sv_arenaroot # define PL_sv_no sv_no # define PL_sv_undef sv_undef # define PL_sv_yes sv_yes # define PL_tainted tainted # define PL_tainting tainting # define PL_tokenbuf tokenbuf /* Replace: 0 */ #endif /* Warning: PL_parser * For perl versions earlier than 5.9.5, this is an always * non-NULL dummy. Also, it cannot be dereferenced. Don't * use it if you can avoid is and unless you absolutely know * what you're doing. * If you always check that PL_parser is non-NULL, you can * define DPPP_PL_parser_NO_DUMMY to avoid the creation of * a dummy parser structure. */ #if (PERL_BCDVERSION >= 0x5009005) # ifdef DPPP_PL_parser_NO_DUMMY # define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \ (croak("panic: PL_parser == NULL in %s:%d", \ __FILE__, __LINE__), (yy_parser *) NULL))->var) # else # ifdef DPPP_PL_parser_NO_DUMMY_WARNING # define D_PPP_parser_dummy_warning(var) # else # define D_PPP_parser_dummy_warning(var) \ warn("warning: dummy PL_" #var " used in %s:%d", __FILE__, __LINE__), # endif # define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \ (D_PPP_parser_dummy_warning(var) &DPPP_(dummy_PL_parser)))->var) #if defined(NEED_PL_parser) static yy_parser DPPP_(dummy_PL_parser); #elif defined(NEED_PL_parser_GLOBAL) yy_parser DPPP_(dummy_PL_parser); #else extern yy_parser DPPP_(dummy_PL_parser); #endif # endif /* PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf depends on PL_parser */ /* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf * Do not use this variable unless you know exactly what you're * doing. It is internal to the perl parser and may change or even * be removed in the future. As of perl 5.9.5, you have to check * for (PL_parser != NULL) for this variable to have any effect. * An always non-NULL PL_parser dummy is provided for earlier * perl versions. * If PL_parser is NULL when you try to access this variable, a * dummy is being accessed instead and a warning is issued unless * you define DPPP_PL_parser_NO_DUMMY_WARNING. * If DPPP_PL_parser_NO_DUMMY is defined, the code trying to access * this variable will croak with a panic message. */ # define PL_expect D_PPP_my_PL_parser_var(expect) # define PL_copline D_PPP_my_PL_parser_var(copline) # define PL_rsfp D_PPP_my_PL_parser_var(rsfp) # define PL_rsfp_filters D_PPP_my_PL_parser_var(rsfp_filters) # define PL_linestr D_PPP_my_PL_parser_var(linestr) # define PL_bufptr D_PPP_my_PL_parser_var(bufptr) # define PL_bufend D_PPP_my_PL_parser_var(bufend) # define PL_lex_state D_PPP_my_PL_parser_var(lex_state) # define PL_lex_stuff D_PPP_my_PL_parser_var(lex_stuff) # define PL_tokenbuf D_PPP_my_PL_parser_var(tokenbuf) # define PL_in_my D_PPP_my_PL_parser_var(in_my) # define PL_in_my_stash D_PPP_my_PL_parser_var(in_my_stash) # define PL_error_count D_PPP_my_PL_parser_var(error_count) #else /* ensure that PL_parser != NULL and cannot be dereferenced */ # define PL_parser ((void *) 1) #endif #ifndef mPUSHs # define mPUSHs(s) PUSHs(sv_2mortal(s)) #endif #ifndef PUSHmortal # define PUSHmortal PUSHs(sv_newmortal()) #endif #ifndef mPUSHp # define mPUSHp(p,l) sv_setpvn(PUSHmortal, (p), (l)) #endif #ifndef mPUSHn # define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n)) #endif #ifndef mPUSHi # define mPUSHi(i) sv_setiv(PUSHmortal, (IV)(i)) #endif #ifndef mPUSHu # define mPUSHu(u) sv_setuv(PUSHmortal, (UV)(u)) #endif #ifndef mXPUSHs # define mXPUSHs(s) XPUSHs(sv_2mortal(s)) #endif #ifndef XPUSHmortal # define XPUSHmortal XPUSHs(sv_newmortal()) #endif #ifndef mXPUSHp # define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END #endif #ifndef mXPUSHn # define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END #endif #ifndef mXPUSHi # define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END #endif #ifndef mXPUSHu # define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END #endif /* Replace: 1 */ #ifndef call_sv # define call_sv perl_call_sv #endif #ifndef call_pv # define call_pv perl_call_pv #endif #ifndef call_argv # define call_argv perl_call_argv #endif #ifndef call_method # define call_method perl_call_method #endif #ifndef eval_sv # define eval_sv perl_eval_sv #endif /* Replace: 0 */ #ifndef PERL_LOADMOD_DENY # define PERL_LOADMOD_DENY 0x1 #endif #ifndef PERL_LOADMOD_NOIMPORT # define PERL_LOADMOD_NOIMPORT 0x2 #endif #ifndef PERL_LOADMOD_IMPORT_OPS # define PERL_LOADMOD_IMPORT_OPS 0x4 #endif #ifndef G_METHOD # define G_METHOD 64 # ifdef call_sv # undef call_sv # endif # if (PERL_BCDVERSION < 0x5006000) # define call_sv(sv, flags) ((flags) & G_METHOD ? perl_call_method((char *) SvPV_nolen_const(sv), \ (flags) & ~G_METHOD) : perl_call_sv(sv, flags)) # else # define call_sv(sv, flags) ((flags) & G_METHOD ? Perl_call_method(aTHX_ (char *) SvPV_nolen_const(sv), \ (flags) & ~G_METHOD) : Perl_call_sv(aTHX_ sv, flags)) # endif #endif /* Replace perl_eval_pv with eval_pv */ #ifndef eval_pv #if defined(NEED_eval_pv) static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error); static #else extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error); #endif #ifdef eval_pv # undef eval_pv #endif #define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b) #define Perl_eval_pv DPPP_(my_eval_pv) #if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL) SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error) { dSP; SV* sv = newSVpv(p, 0); PUSHMARK(sp); eval_sv(sv, G_SCALAR); SvREFCNT_dec(sv); SPAGAIN; sv = POPs; PUTBACK; if (croak_on_error && SvTRUE(GvSV(errgv))) croak(SvPVx(GvSV(errgv), na)); return sv; } #endif #endif #ifndef vload_module #if defined(NEED_vload_module) static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args); static #else extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args); #endif #ifdef vload_module # undef vload_module #endif #define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d) #define Perl_vload_module DPPP_(my_vload_module) #if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL) void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args) { dTHR; dVAR; OP *veop, *imop; OP * const modname = newSVOP(OP_CONST, 0, name); /* 5.005 has a somewhat hacky force_normal that doesn't croak on SvREADONLY() if PL_compling is true. Current perls take care in ck_require() to correctly turn off SvREADONLY before calling force_normal_flags(). This seems a better fix than fudging PL_compling */ SvREADONLY_off(((SVOP*)modname)->op_sv); modname->op_private |= OPpCONST_BARE; if (ver) { veop = newSVOP(OP_CONST, 0, ver); } else veop = NULL; if (flags & PERL_LOADMOD_NOIMPORT) { imop = sawparens(newNULLLIST()); } else if (flags & PERL_LOADMOD_IMPORT_OPS) { imop = va_arg(*args, OP*); } else { SV *sv; imop = NULL; sv = va_arg(*args, SV*); while (sv) { imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv)); sv = va_arg(*args, SV*); } } { const line_t ocopline = PL_copline; COP * const ocurcop = PL_curcop; const int oexpect = PL_expect; #if (PERL_BCDVERSION >= 0x5004000) utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0), veop, modname, imop); #elif (PERL_BCDVERSION > 0x5003000) utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(), veop, modname, imop); #else utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(), modname, imop); #endif PL_expect = oexpect; PL_copline = ocopline; PL_curcop = ocurcop; } } #endif #endif #ifndef load_module #if defined(NEED_load_module) static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...); static #else extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...); #endif #ifdef load_module # undef load_module #endif #define load_module DPPP_(my_load_module) #define Perl_load_module DPPP_(my_load_module) #if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL) void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...) { va_list args; va_start(args, ver); vload_module(flags, name, ver, &args); va_end(args); } #endif #endif #ifndef newRV_inc # define newRV_inc(sv) newRV(sv) /* Replace */ #endif #ifndef newRV_noinc #if defined(NEED_newRV_noinc) static SV * DPPP_(my_newRV_noinc)(SV *sv); static #else extern SV * DPPP_(my_newRV_noinc)(SV *sv); #endif #ifdef newRV_noinc # undef newRV_noinc #endif #define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a) #define Perl_newRV_noinc DPPP_(my_newRV_noinc) #if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL) SV * DPPP_(my_newRV_noinc)(SV *sv) { SV *rv = (SV *)newRV(sv); SvREFCNT_dec(sv); return rv; } #endif #endif /* Hint: newCONSTSUB * Returns a CV* as of perl-5.7.1. This return value is not supported * by Devel::PPPort. */ /* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */ #if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005) #if defined(NEED_newCONSTSUB) static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv); static #else extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv); #endif #ifdef newCONSTSUB # undef newCONSTSUB #endif #define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c) #define Perl_newCONSTSUB DPPP_(my_newCONSTSUB) #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL) /* This is just a trick to avoid a dependency of newCONSTSUB on PL_parser */ /* (There's no PL_parser in perl < 5.005, so this is completely safe) */ #define D_PPP_PL_copline PL_copline void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv) { U32 oldhints = PL_hints; HV *old_cop_stash = PL_curcop->cop_stash; HV *old_curstash = PL_curstash; line_t oldline = PL_curcop->cop_line; PL_curcop->cop_line = D_PPP_PL_copline; PL_hints &= ~HINT_BLOCK_SCOPE; if (stash) PL_curstash = PL_curcop->cop_stash = stash; newSUB( #if (PERL_BCDVERSION < 0x5003022) start_subparse(), #elif (PERL_BCDVERSION == 0x5003022) start_subparse(0), #else /* 5.003_23 onwards */ start_subparse(FALSE, 0), #endif newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)), newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */ newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv)) ); PL_hints = oldhints; PL_curcop->cop_stash = old_cop_stash; PL_curstash = old_curstash; PL_curcop->cop_line = oldline; } #endif #endif /* * Boilerplate macros for initializing and accessing interpreter-local * data from C. All statics in extensions should be reworked to use * this, if you want to make the extension thread-safe. See ext/re/re.xs * for an example of the use of these macros. * * Code that uses these macros is responsible for the following: * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts" * 2. Declare a typedef named my_cxt_t that is a structure that contains * all the data that needs to be interpreter-local. * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t. * 4. Use the MY_CXT_INIT macro such that it is called exactly once * (typically put in the BOOT: section). * 5. Use the members of the my_cxt_t structure everywhere as * MY_CXT.member. * 6. Use the dMY_CXT macro (a declaration) in all the functions that * access MY_CXT. */ #if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \ defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT) #ifndef START_MY_CXT /* This must appear in all extensions that define a my_cxt_t structure, * right after the definition (i.e. at file scope). The non-threads * case below uses it to declare the data as static. */ #define START_MY_CXT #if (PERL_BCDVERSION < 0x5004068) /* Fetches the SV that keeps the per-interpreter data. */ #define dMY_CXT_SV \ SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE) #else /* >= perl5.004_68 */ #define dMY_CXT_SV \ SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \ sizeof(MY_CXT_KEY)-1, TRUE) #endif /* < perl5.004_68 */ /* This declaration should be used within all functions that use the * interpreter-local data. */ #define dMY_CXT \ dMY_CXT_SV; \ my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv)) /* Creates and zeroes the per-interpreter data. * (We allocate my_cxtp in a Perl SV so that it will be released when * the interpreter goes away.) */ #define MY_CXT_INIT \ dMY_CXT_SV; \ /* newSV() allocates one more than needed */ \ my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\ Zero(my_cxtp, 1, my_cxt_t); \ sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) /* This macro must be used to access members of the my_cxt_t structure. * e.g. MYCXT.some_data */ #define MY_CXT (*my_cxtp) /* Judicious use of these macros can reduce the number of times dMY_CXT * is used. Use is similar to pTHX, aTHX etc. */ #define pMY_CXT my_cxt_t *my_cxtp #define pMY_CXT_ pMY_CXT, #define _pMY_CXT ,pMY_CXT #define aMY_CXT my_cxtp #define aMY_CXT_ aMY_CXT, #define _aMY_CXT ,aMY_CXT #endif /* START_MY_CXT */ #ifndef MY_CXT_CLONE /* Clones the per-interpreter data. */ #define MY_CXT_CLONE \ dMY_CXT_SV; \ my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\ Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\ sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) #endif #else /* single interpreter */ #ifndef START_MY_CXT #define START_MY_CXT static my_cxt_t my_cxt; #define dMY_CXT_SV dNOOP #define dMY_CXT dNOOP #define MY_CXT_INIT NOOP #define MY_CXT my_cxt #define pMY_CXT void #define pMY_CXT_ #define _pMY_CXT #define aMY_CXT #define aMY_CXT_ #define _aMY_CXT #endif /* START_MY_CXT */ #ifndef MY_CXT_CLONE #define MY_CXT_CLONE NOOP #endif #endif #ifndef IVdf # if IVSIZE == LONGSIZE # define IVdf "ld" # define UVuf "lu" # define UVof "lo" # define UVxf "lx" # define UVXf "lX" # elif IVSIZE == INTSIZE # define IVdf "d" # define UVuf "u" # define UVof "o" # define UVxf "x" # define UVXf "X" # else # error "cannot define IV/UV formats" # endif #endif #ifndef NVef # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \ defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000) /* Not very likely, but let's try anyway. */ # define NVef PERL_PRIeldbl # define NVff PERL_PRIfldbl # define NVgf PERL_PRIgldbl # else # define NVef "e" # define NVff "f" # define NVgf "g" # endif #endif #ifndef SvREFCNT_inc # ifdef PERL_USE_GCC_BRACE_GROUPS # define SvREFCNT_inc(sv) \ ({ \ SV * const _sv = (SV*)(sv); \ if (_sv) \ (SvREFCNT(_sv))++; \ _sv; \ }) # else # define SvREFCNT_inc(sv) \ ((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL) # endif #endif #ifndef SvREFCNT_inc_simple # ifdef PERL_USE_GCC_BRACE_GROUPS # define SvREFCNT_inc_simple(sv) \ ({ \ if (sv) \ (SvREFCNT(sv))++; \ (SV *)(sv); \ }) # else # define SvREFCNT_inc_simple(sv) \ ((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL) # endif #endif #ifndef SvREFCNT_inc_NN # ifdef PERL_USE_GCC_BRACE_GROUPS # define SvREFCNT_inc_NN(sv) \ ({ \ SV * const _sv = (SV*)(sv); \ SvREFCNT(_sv)++; \ _sv; \ }) # else # define SvREFCNT_inc_NN(sv) \ (PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv) # endif #endif #ifndef SvREFCNT_inc_void # ifdef PERL_USE_GCC_BRACE_GROUPS # define SvREFCNT_inc_void(sv) \ ({ \ SV * const _sv = (SV*)(sv); \ if (_sv) \ (void)(SvREFCNT(_sv)++); \ }) # else # define SvREFCNT_inc_void(sv) \ (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0) # endif #endif #ifndef SvREFCNT_inc_simple_void # define SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END #endif #ifndef SvREFCNT_inc_simple_NN # define SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv)) #endif #ifndef SvREFCNT_inc_void_NN # define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv))) #endif #ifndef SvREFCNT_inc_simple_void_NN # define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv))) #endif #ifndef newSV_type #if defined(NEED_newSV_type) static SV* DPPP_(my_newSV_type)(pTHX_ svtype const t); static #else extern SV* DPPP_(my_newSV_type)(pTHX_ svtype const t); #endif #ifdef newSV_type # undef newSV_type #endif #define newSV_type(a) DPPP_(my_newSV_type)(aTHX_ a) #define Perl_newSV_type DPPP_(my_newSV_type) #if defined(NEED_newSV_type) || defined(NEED_newSV_type_GLOBAL) SV* DPPP_(my_newSV_type)(pTHX_ svtype const t) { SV* const sv = newSV(0); sv_upgrade(sv, t); return sv; } #endif #endif #if (PERL_BCDVERSION < 0x5006000) # define D_PPP_CONSTPV_ARG(x) ((char *) (x)) #else # define D_PPP_CONSTPV_ARG(x) (x) #endif #ifndef newSVpvn # define newSVpvn(data,len) ((data) \ ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \ : newSV(0)) #endif #ifndef newSVpvn_utf8 # define newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0) #endif #ifndef SVf_UTF8 # define SVf_UTF8 0 #endif #ifndef newSVpvn_flags #if defined(NEED_newSVpvn_flags) static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags); static #else extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags); #endif #ifdef newSVpvn_flags # undef newSVpvn_flags #endif #define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c) #define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags) #if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL) SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags) { SV *sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len); SvFLAGS(sv) |= (flags & SVf_UTF8); return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv; } #endif #endif /* Backwards compatibility stuff... :-( */ #if !defined(NEED_sv_2pv_flags) && defined(NEED_sv_2pv_nolen) # define NEED_sv_2pv_flags #endif #if !defined(NEED_sv_2pv_flags_GLOBAL) && defined(NEED_sv_2pv_nolen_GLOBAL) # define NEED_sv_2pv_flags_GLOBAL #endif /* Hint: sv_2pv_nolen * Use the SvPV_nolen() or SvPV_nolen_const() macros instead of sv_2pv_nolen(). */ #ifndef sv_2pv_nolen # define sv_2pv_nolen(sv) SvPV_nolen(sv) #endif #ifdef SvPVbyte /* Hint: SvPVbyte * Does not work in perl-5.6.1, ppport.h implements a version * borrowed from perl-5.7.3. */ #if (PERL_BCDVERSION < 0x5007000) #if defined(NEED_sv_2pvbyte) static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp); static #else extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp); #endif #ifdef sv_2pvbyte # undef sv_2pvbyte #endif #define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b) #define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte) #if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL) char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp) { sv_utf8_downgrade(sv,0); return SvPV(sv,*lp); } #endif /* Hint: sv_2pvbyte * Use the SvPVbyte() macro instead of sv_2pvbyte(). */ #undef SvPVbyte #define SvPVbyte(sv, lp) \ ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp)) #endif #else # define SvPVbyte SvPV # define sv_2pvbyte sv_2pv #endif #ifndef sv_2pvbyte_nolen # define sv_2pvbyte_nolen(sv) sv_2pv_nolen(sv) #endif /* Hint: sv_pvn * Always use the SvPV() macro instead of sv_pvn(). */ /* Hint: sv_pvn_force * Always use the SvPV_force() macro instead of sv_pvn_force(). */ /* If these are undefined, they're not handled by the core anyway */ #ifndef SV_IMMEDIATE_UNREF # define SV_IMMEDIATE_UNREF 0 #endif #ifndef SV_GMAGIC # define SV_GMAGIC 0 #endif #ifndef SV_COW_DROP_PV # define SV_COW_DROP_PV 0 #endif #ifndef SV_UTF8_NO_ENCODING # define SV_UTF8_NO_ENCODING 0 #endif #ifndef SV_NOSTEAL # define SV_NOSTEAL 0 #endif #ifndef SV_CONST_RETURN # define SV_CONST_RETURN 0 #endif #ifndef SV_MUTABLE_RETURN # define SV_MUTABLE_RETURN 0 #endif #ifndef SV_SMAGIC # define SV_SMAGIC 0 #endif #ifndef SV_HAS_TRAILING_NUL # define SV_HAS_TRAILING_NUL 0 #endif #ifndef SV_COW_SHARED_HASH_KEYS # define SV_COW_SHARED_HASH_KEYS 0 #endif #if (PERL_BCDVERSION < 0x5007002) #if defined(NEED_sv_2pv_flags) static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags); static #else extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags); #endif #ifdef sv_2pv_flags # undef sv_2pv_flags #endif #define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c) #define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags) #if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL) char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags) { STRLEN n_a = (STRLEN) flags; return sv_2pv(sv, lp ? lp : &n_a); } #endif #if defined(NEED_sv_pvn_force_flags) static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags); static #else extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags); #endif #ifdef sv_pvn_force_flags # undef sv_pvn_force_flags #endif #define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c) #define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags) #if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL) char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags) { STRLEN n_a = (STRLEN) flags; return sv_pvn_force(sv, lp ? lp : &n_a); } #endif #endif #if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) ) # define DPPP_SVPV_NOLEN_LP_ARG &PL_na #else # define DPPP_SVPV_NOLEN_LP_ARG 0 #endif #ifndef SvPV_const # define SvPV_const(sv, lp) SvPV_flags_const(sv, lp, SV_GMAGIC) #endif #ifndef SvPV_mutable # define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC) #endif #ifndef SvPV_flags # define SvPV_flags(sv, lp, flags) \ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags)) #endif #ifndef SvPV_flags_const # define SvPV_flags_const(sv, lp, flags) \ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \ (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN)) #endif #ifndef SvPV_flags_const_nolen # define SvPV_flags_const_nolen(sv, flags) \ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ ? SvPVX_const(sv) : \ (const char*) sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN)) #endif #ifndef SvPV_flags_mutable # define SvPV_flags_mutable(sv, lp, flags) \ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \ sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN)) #endif #ifndef SvPV_force # define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC) #endif #ifndef SvPV_force_nolen # define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC) #endif #ifndef SvPV_force_mutable # define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC) #endif #ifndef SvPV_force_nomg # define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0) #endif #ifndef SvPV_force_nomg_nolen # define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0) #endif #ifndef SvPV_force_flags # define SvPV_force_flags(sv, lp, flags) \ ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags)) #endif #ifndef SvPV_force_flags_nolen # define SvPV_force_flags_nolen(sv, flags) \ ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \ ? SvPVX(sv) : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags)) #endif #ifndef SvPV_force_flags_mutable # define SvPV_force_flags_mutable(sv, lp, flags) \ ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \ ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \ : sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN)) #endif #ifndef SvPV_nolen # define SvPV_nolen(sv) \ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC)) #endif #ifndef SvPV_nolen_const # define SvPV_nolen_const(sv) \ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ ? SvPVX_const(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN)) #endif #ifndef SvPV_nomg # define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0) #endif #ifndef SvPV_nomg_const # define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0) #endif #ifndef SvPV_nomg_const_nolen # define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0) #endif #ifndef SvPV_nomg_nolen # define SvPV_nomg_nolen(sv) ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, 0)) #endif #ifndef SvPV_renew # define SvPV_renew(sv,n) STMT_START { SvLEN_set(sv, n); \ SvPV_set((sv), (char *) saferealloc( \ (Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \ } STMT_END #endif #ifndef SvMAGIC_set # define SvMAGIC_set(sv, val) \ STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \ (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END #endif #if (PERL_BCDVERSION < 0x5009003) #ifndef SvPVX_const # define SvPVX_const(sv) ((const char*) (0 + SvPVX(sv))) #endif #ifndef SvPVX_mutable # define SvPVX_mutable(sv) (0 + SvPVX(sv)) #endif #ifndef SvRV_set # define SvRV_set(sv, val) \ STMT_START { assert(SvTYPE(sv) >= SVt_RV); \ (((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END #endif #else #ifndef SvPVX_const # define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv)) #endif #ifndef SvPVX_mutable # define SvPVX_mutable(sv) ((sv)->sv_u.svu_pv) #endif #ifndef SvRV_set # define SvRV_set(sv, val) \ STMT_START { assert(SvTYPE(sv) >= SVt_RV); \ ((sv)->sv_u.svu_rv = (val)); } STMT_END #endif #endif #ifndef SvSTASH_set # define SvSTASH_set(sv, val) \ STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \ (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END #endif #if (PERL_BCDVERSION < 0x5004000) #ifndef SvUV_set # define SvUV_set(sv, val) \ STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \ (((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END #endif #else #ifndef SvUV_set # define SvUV_set(sv, val) \ STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \ (((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END #endif #endif #if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf) #if defined(NEED_vnewSVpvf) static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args); static #else extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args); #endif #ifdef vnewSVpvf # undef vnewSVpvf #endif #define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b) #define Perl_vnewSVpvf DPPP_(my_vnewSVpvf) #if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL) SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args) { register SV *sv = newSV(0); sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); return sv; } #endif #endif #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf) # define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)) #endif #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf) # define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)) #endif #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg) #if defined(NEED_sv_catpvf_mg) static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...); static #else extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...); #endif #define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg) #if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL) void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...) { va_list args; va_start(args, pat); sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); SvSETMAGIC(sv); va_end(args); } #endif #endif #ifdef PERL_IMPLICIT_CONTEXT #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext) #if defined(NEED_sv_catpvf_mg_nocontext) static void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...); static #else extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...); #endif #define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext) #define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext) #if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL) void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...) { dTHX; va_list args; va_start(args, pat); sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); SvSETMAGIC(sv); va_end(args); } #endif #endif #endif /* sv_catpvf_mg depends on sv_catpvf_mg_nocontext */ #ifndef sv_catpvf_mg # ifdef PERL_IMPLICIT_CONTEXT # define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext # else # define sv_catpvf_mg Perl_sv_catpvf_mg # endif #endif #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg) # define sv_vcatpvf_mg(sv, pat, args) \ STMT_START { \ sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \ SvSETMAGIC(sv); \ } STMT_END #endif #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg) #if defined(NEED_sv_setpvf_mg) static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...); static #else extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...); #endif #define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg) #if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL) void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...) { va_list args; va_start(args, pat); sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); SvSETMAGIC(sv); va_end(args); } #endif #endif #ifdef PERL_IMPLICIT_CONTEXT #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext) #if defined(NEED_sv_setpvf_mg_nocontext) static void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...); static #else extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...); #endif #define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext) #define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext) #if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL) void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...) { dTHX; va_list args; va_start(args, pat); sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); SvSETMAGIC(sv); va_end(args); } #endif #endif #endif /* sv_setpvf_mg depends on sv_setpvf_mg_nocontext */ #ifndef sv_setpvf_mg # ifdef PERL_IMPLICIT_CONTEXT # define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext # else # define sv_setpvf_mg Perl_sv_setpvf_mg # endif #endif #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg) # define sv_vsetpvf_mg(sv, pat, args) \ STMT_START { \ sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \ SvSETMAGIC(sv); \ } STMT_END #endif /* Hint: newSVpvn_share * The SVs created by this function only mimic the behaviour of * shared PVs without really being shared. Only use if you know * what you're doing. */ #ifndef newSVpvn_share #if defined(NEED_newSVpvn_share) static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash); static #else extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash); #endif #ifdef newSVpvn_share # undef newSVpvn_share #endif #define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c) #define Perl_newSVpvn_share DPPP_(my_newSVpvn_share) #if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL) SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash) { SV *sv; if (len < 0) len = -len; if (!hash) PERL_HASH(hash, (char*) src, len); sv = newSVpvn((char *) src, len); sv_upgrade(sv, SVt_PVIV); SvIVX(sv) = hash; SvREADONLY_on(sv); SvPOK_on(sv); return sv; } #endif #endif #ifndef SvSHARED_HASH # define SvSHARED_HASH(sv) (0 + SvUVX(sv)) #endif #ifndef HvNAME_get # define HvNAME_get(hv) HvNAME(hv) #endif #ifndef HvNAMELEN_get # define HvNAMELEN_get(hv) (HvNAME_get(hv) ? (I32)strlen(HvNAME_get(hv)) : 0) #endif #ifndef gv_fetchpvn_flags #if defined(NEED_gv_fetchpvn_flags) static GV* DPPP_(my_gv_fetchpvn_flags)(pTHX_ const char* name, STRLEN len, int flags, int types); static #else extern GV* DPPP_(my_gv_fetchpvn_flags)(pTHX_ const char* name, STRLEN len, int flags, int types); #endif #ifdef gv_fetchpvn_flags # undef gv_fetchpvn_flags #endif #define gv_fetchpvn_flags(a,b,c,d) DPPP_(my_gv_fetchpvn_flags)(aTHX_ a,b,c,d) #define Perl_gv_fetchpvn_flags DPPP_(my_gv_fetchpvn_flags) #if defined(NEED_gv_fetchpvn_flags) || defined(NEED_gv_fetchpvn_flags_GLOBAL) GV* DPPP_(my_gv_fetchpvn_flags)(pTHX_ const char* name, STRLEN len, int flags, int types) { char *namepv = savepvn(name, len); GV* stash = gv_fetchpv(namepv, TRUE, SVt_PVHV); Safefree(namepv); return stash; } #endif #endif #ifndef GvSVn # define GvSVn(gv) GvSV(gv) #endif #ifndef isGV_with_GP # define isGV_with_GP(gv) isGV(gv) #endif #ifndef gv_fetchsv # define gv_fetchsv(name, flags, svt) gv_fetchpv(SvPV_nolen_const(name), flags, svt) #endif #ifndef get_cvn_flags # define get_cvn_flags(name, namelen, flags) get_cv(name, flags) #endif #ifndef gv_init_pvn # define gv_init_pvn(gv, stash, ptr, len, flags) gv_init(gv, stash, ptr, len, flags & GV_ADDMULTI ? TRUE : FALSE) #endif #ifndef WARN_ALL # define WARN_ALL 0 #endif #ifndef WARN_CLOSURE # define WARN_CLOSURE 1 #endif #ifndef WARN_DEPRECATED # define WARN_DEPRECATED 2 #endif #ifndef WARN_EXITING # define WARN_EXITING 3 #endif #ifndef WARN_GLOB # define WARN_GLOB 4 #endif #ifndef WARN_IO # define WARN_IO 5 #endif #ifndef WARN_CLOSED # define WARN_CLOSED 6 #endif #ifndef WARN_EXEC # define WARN_EXEC 7 #endif #ifndef WARN_LAYER # define WARN_LAYER 8 #endif #ifndef WARN_NEWLINE # define WARN_NEWLINE 9 #endif #ifndef WARN_PIPE # define WARN_PIPE 10 #endif #ifndef WARN_UNOPENED # define WARN_UNOPENED 11 #endif #ifndef WARN_MISC # define WARN_MISC 12 #endif #ifndef WARN_NUMERIC # define WARN_NUMERIC 13 #endif #ifndef WARN_ONCE # define WARN_ONCE 14 #endif #ifndef WARN_OVERFLOW # define WARN_OVERFLOW 15 #endif #ifndef WARN_PACK # define WARN_PACK 16 #endif #ifndef WARN_PORTABLE # define WARN_PORTABLE 17 #endif #ifndef WARN_RECURSION # define WARN_RECURSION 18 #endif #ifndef WARN_REDEFINE # define WARN_REDEFINE 19 #endif #ifndef WARN_REGEXP # define WARN_REGEXP 20 #endif #ifndef WARN_SEVERE # define WARN_SEVERE 21 #endif #ifndef WARN_DEBUGGING # define WARN_DEBUGGING 22 #endif #ifndef WARN_INPLACE # define WARN_INPLACE 23 #endif #ifndef WARN_INTERNAL # define WARN_INTERNAL 24 #endif #ifndef WARN_MALLOC # define WARN_MALLOC 25 #endif #ifndef WARN_SIGNAL # define WARN_SIGNAL 26 #endif #ifndef WARN_SUBSTR # define WARN_SUBSTR 27 #endif #ifndef WARN_SYNTAX # define WARN_SYNTAX 28 #endif #ifndef WARN_AMBIGUOUS # define WARN_AMBIGUOUS 29 #endif #ifndef WARN_BAREWORD # define WARN_BAREWORD 30 #endif #ifndef WARN_DIGIT # define WARN_DIGIT 31 #endif #ifndef WARN_PARENTHESIS # define WARN_PARENTHESIS 32 #endif #ifndef WARN_PRECEDENCE # define WARN_PRECEDENCE 33 #endif #ifndef WARN_PRINTF # define WARN_PRINTF 34 #endif #ifndef WARN_PROTOTYPE # define WARN_PROTOTYPE 35 #endif #ifndef WARN_QW # define WARN_QW 36 #endif #ifndef WARN_RESERVED # define WARN_RESERVED 37 #endif #ifndef WARN_SEMICOLON # define WARN_SEMICOLON 38 #endif #ifndef WARN_TAINT # define WARN_TAINT 39 #endif #ifndef WARN_THREADS # define WARN_THREADS 40 #endif #ifndef WARN_UNINITIALIZED # define WARN_UNINITIALIZED 41 #endif #ifndef WARN_UNPACK # define WARN_UNPACK 42 #endif #ifndef WARN_UNTIE # define WARN_UNTIE 43 #endif #ifndef WARN_UTF8 # define WARN_UTF8 44 #endif #ifndef WARN_VOID # define WARN_VOID 45 #endif #ifndef WARN_ASSERTIONS # define WARN_ASSERTIONS 46 #endif #ifndef packWARN # define packWARN(a) (a) #endif #ifndef ckWARN # ifdef G_WARN_ON # define ckWARN(a) (PL_dowarn & G_WARN_ON) # else # define ckWARN(a) PL_dowarn # endif #endif #if (PERL_BCDVERSION >= 0x5004000) && !defined(warner) #if defined(NEED_warner) static void DPPP_(my_warner)(U32 err, const char *pat, ...); static #else extern void DPPP_(my_warner)(U32 err, const char *pat, ...); #endif #define Perl_warner DPPP_(my_warner) #if defined(NEED_warner) || defined(NEED_warner_GLOBAL) void DPPP_(my_warner)(U32 err, const char *pat, ...) { SV *sv; va_list args; PERL_UNUSED_ARG(err); va_start(args, pat); sv = vnewSVpvf(pat, &args); va_end(args); sv_2mortal(sv); warn("%s", SvPV_nolen(sv)); } #define warner Perl_warner #define Perl_warner_nocontext Perl_warner #endif #endif /* concatenating with "" ensures that only literal strings are accepted as argument * note that STR_WITH_LEN() can't be used as argument to macros or functions that * under some configurations might be macros */ #ifndef STR_WITH_LEN # define STR_WITH_LEN(s) (s ""), (sizeof(s)-1) #endif #ifndef newSVpvs # define newSVpvs(str) newSVpvn(str "", sizeof(str) - 1) #endif #ifndef newSVpvs_flags # define newSVpvs_flags(str, flags) newSVpvn_flags(str "", sizeof(str) - 1, flags) #endif #ifndef newSVpvs_share # define newSVpvs_share(str) newSVpvn_share(str "", sizeof(str) - 1, 0) #endif #ifndef sv_catpvs # define sv_catpvs(sv, str) sv_catpvn(sv, str "", sizeof(str) - 1) #endif #ifndef sv_setpvs # define sv_setpvs(sv, str) sv_setpvn(sv, str "", sizeof(str) - 1) #endif #ifndef hv_fetchs # define hv_fetchs(hv, key, lval) hv_fetch(hv, key "", sizeof(key) - 1, lval) #endif #ifndef hv_stores # define hv_stores(hv, key, val) hv_store(hv, key "", sizeof(key) - 1, val, 0) #endif #ifndef gv_fetchpvs # define gv_fetchpvs(name, flags, svt) gv_fetchpvn_flags(name "", sizeof(name) - 1, flags, svt) #endif #ifndef gv_stashpvs # define gv_stashpvs(name, flags) gv_stashpvn(name "", sizeof(name) - 1, flags) #endif #ifndef get_cvs # define get_cvs(name, flags) get_cvn_flags(name "", sizeof(name)-1, flags) #endif #ifndef SvGETMAGIC # define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END #endif /* Some random bits for sv_unmagicext. These should probably be pulled in for real and organized at some point */ #ifndef HEf_SVKEY # define HEf_SVKEY -2 #endif #ifndef MUTABLE_PTR #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) # define MUTABLE_PTR(p) ({ void *_p = (p); _p; }) #else # define MUTABLE_PTR(p) ((void *) (p)) #endif #endif #ifndef MUTABLE_SV # define MUTABLE_SV(p) ((SV *)MUTABLE_PTR(p)) #endif /* end of random bits */ #ifndef PERL_MAGIC_sv # define PERL_MAGIC_sv '\0' #endif #ifndef PERL_MAGIC_overload # define PERL_MAGIC_overload 'A' #endif #ifndef PERL_MAGIC_overload_elem # define PERL_MAGIC_overload_elem 'a' #endif #ifndef PERL_MAGIC_overload_table # define PERL_MAGIC_overload_table 'c' #endif #ifndef PERL_MAGIC_bm # define PERL_MAGIC_bm 'B' #endif #ifndef PERL_MAGIC_regdata # define PERL_MAGIC_regdata 'D' #endif #ifndef PERL_MAGIC_regdatum # define PERL_MAGIC_regdatum 'd' #endif #ifndef PERL_MAGIC_env # define PERL_MAGIC_env 'E' #endif #ifndef PERL_MAGIC_envelem # define PERL_MAGIC_envelem 'e' #endif #ifndef PERL_MAGIC_fm # define PERL_MAGIC_fm 'f' #endif #ifndef PERL_MAGIC_regex_global # define PERL_MAGIC_regex_global 'g' #endif #ifndef PERL_MAGIC_isa # define PERL_MAGIC_isa 'I' #endif #ifndef PERL_MAGIC_isaelem # define PERL_MAGIC_isaelem 'i' #endif #ifndef PERL_MAGIC_nkeys # define PERL_MAGIC_nkeys 'k' #endif #ifndef PERL_MAGIC_dbfile # define PERL_MAGIC_dbfile 'L' #endif #ifndef PERL_MAGIC_dbline # define PERL_MAGIC_dbline 'l' #endif #ifndef PERL_MAGIC_mutex # define PERL_MAGIC_mutex 'm' #endif #ifndef PERL_MAGIC_shared # define PERL_MAGIC_shared 'N' #endif #ifndef PERL_MAGIC_shared_scalar # define PERL_MAGIC_shared_scalar 'n' #endif #ifndef PERL_MAGIC_collxfrm # define PERL_MAGIC_collxfrm 'o' #endif #ifndef PERL_MAGIC_tied # define PERL_MAGIC_tied 'P' #endif #ifndef PERL_MAGIC_tiedelem # define PERL_MAGIC_tiedelem 'p' #endif #ifndef PERL_MAGIC_tiedscalar # define PERL_MAGIC_tiedscalar 'q' #endif #ifndef PERL_MAGIC_qr # define PERL_MAGIC_qr 'r' #endif #ifndef PERL_MAGIC_sig # define PERL_MAGIC_sig 'S' #endif #ifndef PERL_MAGIC_sigelem # define PERL_MAGIC_sigelem 's' #endif #ifndef PERL_MAGIC_taint # define PERL_MAGIC_taint 't' #endif #ifndef PERL_MAGIC_uvar # define PERL_MAGIC_uvar 'U' #endif #ifndef PERL_MAGIC_uvar_elem # define PERL_MAGIC_uvar_elem 'u' #endif #ifndef PERL_MAGIC_vstring # define PERL_MAGIC_vstring 'V' #endif #ifndef PERL_MAGIC_vec # define PERL_MAGIC_vec 'v' #endif #ifndef PERL_MAGIC_utf8 # define PERL_MAGIC_utf8 'w' #endif #ifndef PERL_MAGIC_substr # define PERL_MAGIC_substr 'x' #endif #ifndef PERL_MAGIC_defelem # define PERL_MAGIC_defelem 'y' #endif #ifndef PERL_MAGIC_glob # define PERL_MAGIC_glob '*' #endif #ifndef PERL_MAGIC_arylen # define PERL_MAGIC_arylen '#' #endif #ifndef PERL_MAGIC_pos # define PERL_MAGIC_pos '.' #endif #ifndef PERL_MAGIC_backref # define PERL_MAGIC_backref '<' #endif #ifndef PERL_MAGIC_ext # define PERL_MAGIC_ext '~' #endif /* That's the best we can do... */ #ifndef sv_catpvn_nomg # define sv_catpvn_nomg sv_catpvn #endif #ifndef sv_catsv_nomg # define sv_catsv_nomg sv_catsv #endif #ifndef sv_setsv_nomg # define sv_setsv_nomg sv_setsv #endif #ifndef sv_pvn_nomg # define sv_pvn_nomg sv_pvn #endif #ifndef SvIV_nomg # define SvIV_nomg SvIV #endif #ifndef SvUV_nomg # define SvUV_nomg SvUV #endif #ifndef sv_catpv_mg # define sv_catpv_mg(sv, ptr) \ STMT_START { \ SV *TeMpSv = sv; \ sv_catpv(TeMpSv,ptr); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_catpvn_mg # define sv_catpvn_mg(sv, ptr, len) \ STMT_START { \ SV *TeMpSv = sv; \ sv_catpvn(TeMpSv,ptr,len); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_catsv_mg # define sv_catsv_mg(dsv, ssv) \ STMT_START { \ SV *TeMpSv = dsv; \ sv_catsv(TeMpSv,ssv); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_setiv_mg # define sv_setiv_mg(sv, i) \ STMT_START { \ SV *TeMpSv = sv; \ sv_setiv(TeMpSv,i); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_setnv_mg # define sv_setnv_mg(sv, num) \ STMT_START { \ SV *TeMpSv = sv; \ sv_setnv(TeMpSv,num); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_setpv_mg # define sv_setpv_mg(sv, ptr) \ STMT_START { \ SV *TeMpSv = sv; \ sv_setpv(TeMpSv,ptr); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_setpvn_mg # define sv_setpvn_mg(sv, ptr, len) \ STMT_START { \ SV *TeMpSv = sv; \ sv_setpvn(TeMpSv,ptr,len); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_setsv_mg # define sv_setsv_mg(dsv, ssv) \ STMT_START { \ SV *TeMpSv = dsv; \ sv_setsv(TeMpSv,ssv); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_setuv_mg # define sv_setuv_mg(sv, i) \ STMT_START { \ SV *TeMpSv = sv; \ sv_setuv(TeMpSv,i); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_usepvn_mg # define sv_usepvn_mg(sv, ptr, len) \ STMT_START { \ SV *TeMpSv = sv; \ sv_usepvn(TeMpSv,ptr,len); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef SvVSTRING_mg # define SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL) #endif /* Hint: sv_magic_portable * This is a compatibility function that is only available with * Devel::PPPort. It is NOT in the perl core. * Its purpose is to mimic the 5.8.0 behaviour of sv_magic() when * it is being passed a name pointer with namlen == 0. In that * case, perl 5.8.0 and later store the pointer, not a copy of it. * The compatibility can be provided back to perl 5.004. With * earlier versions, the code will not compile. */ #if (PERL_BCDVERSION < 0x5004000) /* code that uses sv_magic_portable will not compile */ #elif (PERL_BCDVERSION < 0x5008000) # define sv_magic_portable(sv, obj, how, name, namlen) \ STMT_START { \ SV *SvMp_sv = (sv); \ char *SvMp_name = (char *) (name); \ I32 SvMp_namlen = (namlen); \ if (SvMp_name && SvMp_namlen == 0) \ { \ MAGIC *mg; \ sv_magic(SvMp_sv, obj, how, 0, 0); \ mg = SvMAGIC(SvMp_sv); \ mg->mg_len = -42; /* XXX: this is the tricky part */ \ mg->mg_ptr = SvMp_name; \ } \ else \ { \ sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \ } \ } STMT_END #else # define sv_magic_portable(a, b, c, d, e) sv_magic(a, b, c, d, e) #endif #if !defined(mg_findext) #if defined(NEED_mg_findext) static MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl); static #else extern MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl); #endif #define mg_findext DPPP_(my_mg_findext) #define Perl_mg_findext DPPP_(my_mg_findext) #if defined(NEED_mg_findext) || defined(NEED_mg_findext_GLOBAL) MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl) { if (sv) { MAGIC *mg; #ifdef AvPAD_NAMELIST assert(!(SvTYPE(sv) == SVt_PVAV && AvPAD_NAMELIST(sv))); #endif for (mg = SvMAGIC (sv); mg; mg = mg->mg_moremagic) { if (mg->mg_type == type && mg->mg_virtual == vtbl) return mg; } } return NULL; } #endif #endif #if !defined(sv_unmagicext) #if defined(NEED_sv_unmagicext) static int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * vtbl); static #else extern int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * vtbl); #endif #ifdef sv_unmagicext # undef sv_unmagicext #endif #define sv_unmagicext(a,b,c) DPPP_(my_sv_unmagicext)(aTHX_ a,b,c) #define Perl_sv_unmagicext DPPP_(my_sv_unmagicext) #if defined(NEED_sv_unmagicext) || defined(NEED_sv_unmagicext_GLOBAL) int DPPP_(my_sv_unmagicext)(pTHX_ SV *const sv, const int type, MGVTBL *vtbl) { MAGIC* mg; MAGIC** mgp; if (SvTYPE(sv) < SVt_PVMG || !SvMAGIC(sv)) return 0; mgp = &(SvMAGIC(sv)); for (mg = *mgp; mg; mg = *mgp) { const MGVTBL* const virt = mg->mg_virtual; if (mg->mg_type == type && virt == vtbl) { *mgp = mg->mg_moremagic; if (virt && virt->svt_free) virt->svt_free(aTHX_ sv, mg); if (mg->mg_ptr && mg->mg_type != PERL_MAGIC_regex_global) { if (mg->mg_len > 0) Safefree(mg->mg_ptr); else if (mg->mg_len == HEf_SVKEY) /* Questionable on older perls... */ SvREFCNT_dec(MUTABLE_SV(mg->mg_ptr)); else if (mg->mg_type == PERL_MAGIC_utf8) Safefree(mg->mg_ptr); } if (mg->mg_flags & MGf_REFCOUNTED) SvREFCNT_dec(mg->mg_obj); Safefree(mg); } else mgp = &mg->mg_moremagic; } if (SvMAGIC(sv)) { if (SvMAGICAL(sv)) /* if we're under save_magic, wait for restore_magic; */ mg_magical(sv); /* else fix the flags now */ } else { SvMAGICAL_off(sv); SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT; } return 0; } #endif #endif #ifdef USE_ITHREADS #ifndef CopFILE # define CopFILE(c) ((c)->cop_file) #endif #ifndef CopFILEGV # define CopFILEGV(c) (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv) #endif #ifndef CopFILE_set # define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv)) #endif #ifndef CopFILESV # define CopFILESV(c) (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv) #endif #ifndef CopFILEAV # define CopFILEAV(c) (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav) #endif #ifndef CopSTASHPV # define CopSTASHPV(c) ((c)->cop_stashpv) #endif #ifndef CopSTASHPV_set # define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch)) #endif #ifndef CopSTASH # define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv) #endif #ifndef CopSTASH_set # define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch) #endif #ifndef CopSTASH_eq # define CopSTASH_eq(c,hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \ || (CopSTASHPV(c) && HvNAME(hv) \ && strEQ(CopSTASHPV(c), HvNAME(hv))))) #endif #else #ifndef CopFILEGV # define CopFILEGV(c) ((c)->cop_filegv) #endif #ifndef CopFILEGV_set # define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv)) #endif #ifndef CopFILE_set # define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv)) #endif #ifndef CopFILESV # define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv) #endif #ifndef CopFILEAV # define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav) #endif #ifndef CopFILE # define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch) #endif #ifndef CopSTASH # define CopSTASH(c) ((c)->cop_stash) #endif #ifndef CopSTASH_set # define CopSTASH_set(c,hv) ((c)->cop_stash = (hv)) #endif #ifndef CopSTASHPV # define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch) #endif #ifndef CopSTASHPV_set # define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD)) #endif #ifndef CopSTASH_eq # define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv)) #endif #endif /* USE_ITHREADS */ #if (PERL_BCDVERSION >= 0x5006000) #ifndef caller_cx # if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL) static I32 DPPP_dopoptosub_at(const PERL_CONTEXT *cxstk, I32 startingblock) { I32 i; for (i = startingblock; i >= 0; i--) { register const PERL_CONTEXT * const cx = &cxstk[i]; switch (CxTYPE(cx)) { default: continue; case CXt_EVAL: case CXt_SUB: case CXt_FORMAT: return i; } } return i; } # endif # if defined(NEED_caller_cx) static const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp); static #else extern const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp); #endif #ifdef caller_cx # undef caller_cx #endif #define caller_cx(a,b) DPPP_(my_caller_cx)(aTHX_ a,b) #define Perl_caller_cx DPPP_(my_caller_cx) #if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL) const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp) { register I32 cxix = DPPP_dopoptosub_at(cxstack, cxstack_ix); register const PERL_CONTEXT *cx; register const PERL_CONTEXT *ccstack = cxstack; const PERL_SI *top_si = PL_curstackinfo; for (;;) { /* we may be in a higher stacklevel, so dig down deeper */ while (cxix < 0 && top_si->si_type != PERLSI_MAIN) { top_si = top_si->si_prev; ccstack = top_si->si_cxstack; cxix = DPPP_dopoptosub_at(ccstack, top_si->si_cxix); } if (cxix < 0) return NULL; /* caller() should not report the automatic calls to &DB::sub */ if (PL_DBsub && GvCV(PL_DBsub) && cxix >= 0 && ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub)) count++; if (!count--) break; cxix = DPPP_dopoptosub_at(ccstack, cxix - 1); } cx = &ccstack[cxix]; if (dbcxp) *dbcxp = cx; if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) { const I32 dbcxix = DPPP_dopoptosub_at(ccstack, cxix - 1); /* We expect that ccstack[dbcxix] is CXt_SUB, anyway, the field below is defined for any cx. */ /* caller() should not report the automatic calls to &DB::sub */ if (PL_DBsub && GvCV(PL_DBsub) && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub)) cx = &ccstack[dbcxix]; } return cx; } # endif #endif /* caller_cx */ #endif /* 5.6.0 */ #ifndef IN_PERL_COMPILETIME # define IN_PERL_COMPILETIME (PL_curcop == &PL_compiling) #endif #ifndef IN_LOCALE_RUNTIME # define IN_LOCALE_RUNTIME (PL_curcop->op_private & HINT_LOCALE) #endif #ifndef IN_LOCALE_COMPILETIME # define IN_LOCALE_COMPILETIME (PL_hints & HINT_LOCALE) #endif #ifndef IN_LOCALE # define IN_LOCALE (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME) #endif #ifndef IS_NUMBER_IN_UV # define IS_NUMBER_IN_UV 0x01 #endif #ifndef IS_NUMBER_GREATER_THAN_UV_MAX # define IS_NUMBER_GREATER_THAN_UV_MAX 0x02 #endif #ifndef IS_NUMBER_NOT_INT # define IS_NUMBER_NOT_INT 0x04 #endif #ifndef IS_NUMBER_NEG # define IS_NUMBER_NEG 0x08 #endif #ifndef IS_NUMBER_INFINITY # define IS_NUMBER_INFINITY 0x10 #endif #ifndef IS_NUMBER_NAN # define IS_NUMBER_NAN 0x20 #endif #ifndef GROK_NUMERIC_RADIX # define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send) #endif #ifndef PERL_SCAN_GREATER_THAN_UV_MAX # define PERL_SCAN_GREATER_THAN_UV_MAX 0x02 #endif #ifndef PERL_SCAN_SILENT_ILLDIGIT # define PERL_SCAN_SILENT_ILLDIGIT 0x04 #endif #ifndef PERL_SCAN_ALLOW_UNDERSCORES # define PERL_SCAN_ALLOW_UNDERSCORES 0x01 #endif #ifndef PERL_SCAN_DISALLOW_PREFIX # define PERL_SCAN_DISALLOW_PREFIX 0x02 #endif #ifndef grok_numeric_radix #if defined(NEED_grok_numeric_radix) static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send); static #else extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send); #endif #ifdef grok_numeric_radix # undef grok_numeric_radix #endif #define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b) #define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix) #if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL) bool DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send) { #ifdef USE_LOCALE_NUMERIC #ifdef PL_numeric_radix_sv if (PL_numeric_radix_sv && IN_LOCALE) { STRLEN len; char* radix = SvPV(PL_numeric_radix_sv, len); if (*sp + len <= send && memEQ(*sp, radix, len)) { *sp += len; return TRUE; } } #else /* older perls don't have PL_numeric_radix_sv so the radix * must manually be requested from locale.h */ #include dTHR; /* needed for older threaded perls */ struct lconv *lc = localeconv(); char *radix = lc->decimal_point; if (radix && IN_LOCALE) { STRLEN len = strlen(radix); if (*sp + len <= send && memEQ(*sp, radix, len)) { *sp += len; return TRUE; } } #endif #endif /* USE_LOCALE_NUMERIC */ /* always try "." if numeric radix didn't match because * we may have data from different locales mixed */ if (*sp < send && **sp == '.') { ++*sp; return TRUE; } return FALSE; } #endif #endif #ifndef grok_number #if defined(NEED_grok_number) static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep); static #else extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep); #endif #ifdef grok_number # undef grok_number #endif #define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c) #define Perl_grok_number DPPP_(my_grok_number) #if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL) int DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep) { const char *s = pv; const char *send = pv + len; const UV max_div_10 = UV_MAX / 10; const char max_mod_10 = UV_MAX % 10; int numtype = 0; int sawinf = 0; int sawnan = 0; while (s < send && isSPACE(*s)) s++; if (s == send) { return 0; } else if (*s == '-') { s++; numtype = IS_NUMBER_NEG; } else if (*s == '+') s++; if (s == send) return 0; /* next must be digit or the radix separator or beginning of infinity */ if (isDIGIT(*s)) { /* UVs are at least 32 bits, so the first 9 decimal digits cannot overflow. */ UV value = *s - '0'; /* This construction seems to be more optimiser friendly. (without it gcc does the isDIGIT test and the *s - '0' separately) With it gcc on arm is managing 6 instructions (6 cycles) per digit. In theory the optimiser could deduce how far to unroll the loop before checking for overflow. */ if (++s < send) { int digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { /* Now got 9 digits, so need to check each time for overflow. */ digit = *s - '0'; while (digit >= 0 && digit <= 9 && (value < max_div_10 || (value == max_div_10 && digit <= max_mod_10))) { value = value * 10 + digit; if (++s < send) digit = *s - '0'; else break; } if (digit >= 0 && digit <= 9 && (s < send)) { /* value overflowed. skip the remaining digits, don't worry about setting *valuep. */ do { s++; } while (s < send && isDIGIT(*s)); numtype |= IS_NUMBER_GREATER_THAN_UV_MAX; goto skip_value; } } } } } } } } } } } } } } } } } } numtype |= IS_NUMBER_IN_UV; if (valuep) *valuep = value; skip_value: if (GROK_NUMERIC_RADIX(&s, send)) { numtype |= IS_NUMBER_NOT_INT; while (s < send && isDIGIT(*s)) /* optional digits after the radix */ s++; } } else if (GROK_NUMERIC_RADIX(&s, send)) { numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; /* valuep assigned below */ /* no digits before the radix means we need digits after it */ if (s < send && isDIGIT(*s)) { do { s++; } while (s < send && isDIGIT(*s)); if (valuep) { /* integer approximation is valid - it's 0. */ *valuep = 0; } } else return 0; } else if (*s == 'I' || *s == 'i') { s++; if (s == send || (*s != 'N' && *s != 'n')) return 0; s++; if (s == send || (*s != 'F' && *s != 'f')) return 0; s++; if (s < send && (*s == 'I' || *s == 'i')) { s++; if (s == send || (*s != 'N' && *s != 'n')) return 0; s++; if (s == send || (*s != 'I' && *s != 'i')) return 0; s++; if (s == send || (*s != 'T' && *s != 't')) return 0; s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0; s++; } sawinf = 1; } else if (*s == 'N' || *s == 'n') { /* XXX TODO: There are signaling NaNs and quiet NaNs. */ s++; if (s == send || (*s != 'A' && *s != 'a')) return 0; s++; if (s == send || (*s != 'N' && *s != 'n')) return 0; s++; sawnan = 1; } else return 0; if (sawinf) { numtype &= IS_NUMBER_NEG; /* Keep track of sign */ numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT; } else if (sawnan) { numtype &= IS_NUMBER_NEG; /* Keep track of sign */ numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT; } else if (s < send) { /* we can have an optional exponent part */ if (*s == 'e' || *s == 'E') { /* The only flag we keep is sign. Blow away any "it's UV" */ numtype &= IS_NUMBER_NEG; numtype |= IS_NUMBER_NOT_INT; s++; if (s < send && (*s == '-' || *s == '+')) s++; if (s < send && isDIGIT(*s)) { do { s++; } while (s < send && isDIGIT(*s)); } else return 0; } } while (s < send && isSPACE(*s)) s++; if (s >= send) return numtype; if (len == 10 && memEQ(pv, "0 but true", 10)) { if (valuep) *valuep = 0; return IS_NUMBER_IN_UV; } return 0; } #endif #endif /* * The grok_* routines have been modified to use warn() instead of * Perl_warner(). Also, 'hexdigit' was the former name of PL_hexdigit, * which is why the stack variable has been renamed to 'xdigit'. */ #ifndef grok_bin #if defined(NEED_grok_bin) static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); static #else extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); #endif #ifdef grok_bin # undef grok_bin #endif #define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d) #define Perl_grok_bin DPPP_(my_grok_bin) #if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL) UV DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) { const char *s = start; STRLEN len = *len_p; UV value = 0; NV value_nv = 0; const UV max_div_2 = UV_MAX / 2; bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; bool overflowed = FALSE; if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) { /* strip off leading b or 0b. for compatibility silently suffer "b" and "0b" as valid binary numbers. */ if (len >= 1) { if (s[0] == 'b') { s++; len--; } else if (len >= 2 && s[0] == '0' && s[1] == 'b') { s+=2; len-=2; } } } for (; len-- && *s; s++) { char bit = *s; if (bit == '0' || bit == '1') { /* Write it in this wonky order with a goto to attempt to get the compiler to make the common case integer-only loop pretty tight. With gcc seems to be much straighter code than old scan_bin. */ redo: if (!overflowed) { if (value <= max_div_2) { value = (value << 1) | (bit - '0'); continue; } /* Bah. We're just overflowed. */ warn("Integer overflow in binary number"); overflowed = TRUE; value_nv = (NV) value; } value_nv *= 2.0; /* If an NV has not enough bits in its mantissa to * represent a UV this summing of small low-order numbers * is a waste of time (because the NV cannot preserve * the low-order bits anyway): we could just remember when * did we overflow and in the end just multiply value_nv by the * right amount. */ value_nv += (NV)(bit - '0'); continue; } if (bit == '_' && len && allow_underscores && (bit = s[1]) && (bit == '0' || bit == '1')) { --len; ++s; goto redo; } if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) warn("Illegal binary digit '%c' ignored", *s); break; } if ( ( overflowed && value_nv > 4294967295.0) #if UVSIZE > 4 || (!overflowed && value > 0xffffffff ) #endif ) { warn("Binary number > 0b11111111111111111111111111111111 non-portable"); } *len_p = s - start; if (!overflowed) { *flags = 0; return value; } *flags = PERL_SCAN_GREATER_THAN_UV_MAX; if (result) *result = value_nv; return UV_MAX; } #endif #endif #ifndef grok_hex #if defined(NEED_grok_hex) static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); static #else extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); #endif #ifdef grok_hex # undef grok_hex #endif #define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d) #define Perl_grok_hex DPPP_(my_grok_hex) #if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL) UV DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) { const char *s = start; STRLEN len = *len_p; UV value = 0; NV value_nv = 0; const UV max_div_16 = UV_MAX / 16; bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; bool overflowed = FALSE; const char *xdigit; if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) { /* strip off leading x or 0x. for compatibility silently suffer "x" and "0x" as valid hex numbers. */ if (len >= 1) { if (s[0] == 'x') { s++; len--; } else if (len >= 2 && s[0] == '0' && s[1] == 'x') { s+=2; len-=2; } } } for (; len-- && *s; s++) { xdigit = strchr((char *) PL_hexdigit, *s); if (xdigit) { /* Write it in this wonky order with a goto to attempt to get the compiler to make the common case integer-only loop pretty tight. With gcc seems to be much straighter code than old scan_hex. */ redo: if (!overflowed) { if (value <= max_div_16) { value = (value << 4) | ((xdigit - PL_hexdigit) & 15); continue; } warn("Integer overflow in hexadecimal number"); overflowed = TRUE; value_nv = (NV) value; } value_nv *= 16.0; /* If an NV has not enough bits in its mantissa to * represent a UV this summing of small low-order numbers * is a waste of time (because the NV cannot preserve * the low-order bits anyway): we could just remember when * did we overflow and in the end just multiply value_nv by the * right amount of 16-tuples. */ value_nv += (NV)((xdigit - PL_hexdigit) & 15); continue; } if (*s == '_' && len && allow_underscores && s[1] && (xdigit = strchr((char *) PL_hexdigit, s[1]))) { --len; ++s; goto redo; } if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) warn("Illegal hexadecimal digit '%c' ignored", *s); break; } if ( ( overflowed && value_nv > 4294967295.0) #if UVSIZE > 4 || (!overflowed && value > 0xffffffff ) #endif ) { warn("Hexadecimal number > 0xffffffff non-portable"); } *len_p = s - start; if (!overflowed) { *flags = 0; return value; } *flags = PERL_SCAN_GREATER_THAN_UV_MAX; if (result) *result = value_nv; return UV_MAX; } #endif #endif #ifndef grok_oct #if defined(NEED_grok_oct) static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); static #else extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); #endif #ifdef grok_oct # undef grok_oct #endif #define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d) #define Perl_grok_oct DPPP_(my_grok_oct) #if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL) UV DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) { const char *s = start; STRLEN len = *len_p; UV value = 0; NV value_nv = 0; const UV max_div_8 = UV_MAX / 8; bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; bool overflowed = FALSE; for (; len-- && *s; s++) { /* gcc 2.95 optimiser not smart enough to figure that this subtraction out front allows slicker code. */ int digit = *s - '0'; if (digit >= 0 && digit <= 7) { /* Write it in this wonky order with a goto to attempt to get the compiler to make the common case integer-only loop pretty tight. */ redo: if (!overflowed) { if (value <= max_div_8) { value = (value << 3) | digit; continue; } /* Bah. We're just overflowed. */ warn("Integer overflow in octal number"); overflowed = TRUE; value_nv = (NV) value; } value_nv *= 8.0; /* If an NV has not enough bits in its mantissa to * represent a UV this summing of small low-order numbers * is a waste of time (because the NV cannot preserve * the low-order bits anyway): we could just remember when * did we overflow and in the end just multiply value_nv by the * right amount of 8-tuples. */ value_nv += (NV)digit; continue; } if (digit == ('_' - '0') && len && allow_underscores && (digit = s[1] - '0') && (digit >= 0 && digit <= 7)) { --len; ++s; goto redo; } /* Allow \octal to work the DWIM way (that is, stop scanning * as soon as non-octal characters are seen, complain only iff * someone seems to want to use the digits eight and nine). */ if (digit == 8 || digit == 9) { if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) warn("Illegal octal digit '%c' ignored", *s); } break; } if ( ( overflowed && value_nv > 4294967295.0) #if UVSIZE > 4 || (!overflowed && value > 0xffffffff ) #endif ) { warn("Octal number > 037777777777 non-portable"); } *len_p = s - start; if (!overflowed) { *flags = 0; return value; } *flags = PERL_SCAN_GREATER_THAN_UV_MAX; if (result) *result = value_nv; return UV_MAX; } #endif #endif #if !defined(my_snprintf) #if defined(NEED_my_snprintf) static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...); static #else extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...); #endif #define my_snprintf DPPP_(my_my_snprintf) #define Perl_my_snprintf DPPP_(my_my_snprintf) #if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL) int DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...) { dTHX; int retval; va_list ap; va_start(ap, format); #ifdef HAS_VSNPRINTF retval = vsnprintf(buffer, len, format, ap); #else retval = vsprintf(buffer, format, ap); #endif va_end(ap); if (retval < 0 || (len > 0 && (Size_t)retval >= len)) Perl_croak(aTHX_ "panic: my_snprintf buffer overflow"); return retval; } #endif #endif #if !defined(my_sprintf) #if defined(NEED_my_sprintf) static int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...); static #else extern int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...); #endif #define my_sprintf DPPP_(my_my_sprintf) #define Perl_my_sprintf DPPP_(my_my_sprintf) #if defined(NEED_my_sprintf) || defined(NEED_my_sprintf_GLOBAL) int DPPP_(my_my_sprintf)(char *buffer, const char* pat, ...) { va_list args; va_start(args, pat); vsprintf(buffer, pat, args); va_end(args); return strlen(buffer); } #endif #endif #ifdef NO_XSLOCKS # ifdef dJMPENV # define dXCPT dJMPENV; int rEtV = 0 # define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0) # define XCPT_TRY_END JMPENV_POP; # define XCPT_CATCH if (rEtV != 0) # define XCPT_RETHROW JMPENV_JUMP(rEtV) # else # define dXCPT Sigjmp_buf oldTOP; int rEtV = 0 # define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0) # define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf); # define XCPT_CATCH if (rEtV != 0) # define XCPT_RETHROW Siglongjmp(top_env, rEtV) # endif #endif #if !defined(my_strlcat) #if defined(NEED_my_strlcat) static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size); static #else extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size); #endif #define my_strlcat DPPP_(my_my_strlcat) #define Perl_my_strlcat DPPP_(my_my_strlcat) #if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL) Size_t DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size) { Size_t used, length, copy; used = strlen(dst); length = strlen(src); if (size > 0 && used < size - 1) { copy = (length >= size - used) ? size - used - 1 : length; memcpy(dst + used, src, copy); dst[used + copy] = '\0'; } return used + length; } #endif #endif #if !defined(my_strlcpy) #if defined(NEED_my_strlcpy) static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size); static #else extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size); #endif #define my_strlcpy DPPP_(my_my_strlcpy) #define Perl_my_strlcpy DPPP_(my_my_strlcpy) #if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL) Size_t DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size) { Size_t length, copy; length = strlen(src); if (size > 0) { copy = (length >= size) ? size - 1 : length; memcpy(dst, src, copy); dst[copy] = '\0'; } return length; } #endif #endif #ifndef PERL_PV_ESCAPE_QUOTE # define PERL_PV_ESCAPE_QUOTE 0x0001 #endif #ifndef PERL_PV_PRETTY_QUOTE # define PERL_PV_PRETTY_QUOTE PERL_PV_ESCAPE_QUOTE #endif #ifndef PERL_PV_PRETTY_ELLIPSES # define PERL_PV_PRETTY_ELLIPSES 0x0002 #endif #ifndef PERL_PV_PRETTY_LTGT # define PERL_PV_PRETTY_LTGT 0x0004 #endif #ifndef PERL_PV_ESCAPE_FIRSTCHAR # define PERL_PV_ESCAPE_FIRSTCHAR 0x0008 #endif #ifndef PERL_PV_ESCAPE_UNI # define PERL_PV_ESCAPE_UNI 0x0100 #endif #ifndef PERL_PV_ESCAPE_UNI_DETECT # define PERL_PV_ESCAPE_UNI_DETECT 0x0200 #endif #ifndef PERL_PV_ESCAPE_ALL # define PERL_PV_ESCAPE_ALL 0x1000 #endif #ifndef PERL_PV_ESCAPE_NOBACKSLASH # define PERL_PV_ESCAPE_NOBACKSLASH 0x2000 #endif #ifndef PERL_PV_ESCAPE_NOCLEAR # define PERL_PV_ESCAPE_NOCLEAR 0x4000 #endif #ifndef PERL_PV_ESCAPE_RE # define PERL_PV_ESCAPE_RE 0x8000 #endif #ifndef PERL_PV_PRETTY_NOCLEAR # define PERL_PV_PRETTY_NOCLEAR PERL_PV_ESCAPE_NOCLEAR #endif #ifndef PERL_PV_PRETTY_DUMP # define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE #endif #ifndef PERL_PV_PRETTY_REGPROP # define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE #endif /* Hint: pv_escape * Note that unicode functionality is only backported to * those perl versions that support it. For older perl * versions, the implementation will fall back to bytes. */ #ifndef pv_escape #if defined(NEED_pv_escape) static char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags); static #else extern char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags); #endif #ifdef pv_escape # undef pv_escape #endif #define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f) #define Perl_pv_escape DPPP_(my_pv_escape) #if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL) char * DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags) { const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\'; const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc; char octbuf[32] = "%123456789ABCDF"; STRLEN wrote = 0; STRLEN chsize = 0; STRLEN readsize = 1; #if defined(is_utf8_string) && defined(utf8_to_uvchr) bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0; #endif const char *pv = str; const char * const end = pv + count; octbuf[0] = esc; if (!(flags & PERL_PV_ESCAPE_NOCLEAR)) sv_setpvs(dsv, ""); #if defined(is_utf8_string) && defined(utf8_to_uvchr) if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count)) isuni = 1; #endif for (; pv < end && (!max || wrote < max) ; pv += readsize) { const UV u = #if defined(is_utf8_string) && defined(utf8_to_uvchr) isuni ? utf8_to_uvchr((U8*)pv, &readsize) : #endif (U8)*pv; const U8 c = (U8)u & 0xFF; if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) { if (flags & PERL_PV_ESCAPE_FIRSTCHAR) chsize = my_snprintf(octbuf, sizeof octbuf, "%" UVxf, u); else chsize = my_snprintf(octbuf, sizeof octbuf, "%cx{%" UVxf "}", esc, u); } else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) { chsize = 1; } else { if (c == dq || c == esc || !isPRINT(c)) { chsize = 2; switch (c) { case '\\' : /* fallthrough */ case '%' : if (c == esc) octbuf[1] = esc; else chsize = 1; break; case '\v' : octbuf[1] = 'v'; break; case '\t' : octbuf[1] = 't'; break; case '\r' : octbuf[1] = 'r'; break; case '\n' : octbuf[1] = 'n'; break; case '\f' : octbuf[1] = 'f'; break; case '"' : if (dq == '"') octbuf[1] = '"'; else chsize = 1; break; default: chsize = my_snprintf(octbuf, sizeof octbuf, pv < end && isDIGIT((U8)*(pv+readsize)) ? "%c%03o" : "%c%o", esc, c); } } else { chsize = 1; } } if (max && wrote + chsize > max) { break; } else if (chsize > 1) { sv_catpvn(dsv, octbuf, chsize); wrote += chsize; } else { char tmp[2]; my_snprintf(tmp, sizeof tmp, "%c", c); sv_catpvn(dsv, tmp, 1); wrote++; } if (flags & PERL_PV_ESCAPE_FIRSTCHAR) break; } if (escaped != NULL) *escaped= pv - str; return SvPVX(dsv); } #endif #endif #ifndef pv_pretty #if defined(NEED_pv_pretty) static char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags); static #else extern char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags); #endif #ifdef pv_pretty # undef pv_pretty #endif #define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g) #define Perl_pv_pretty DPPP_(my_pv_pretty) #if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL) char * DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags) { const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%'; STRLEN escaped; if (!(flags & PERL_PV_PRETTY_NOCLEAR)) sv_setpvs(dsv, ""); if (dq == '"') sv_catpvs(dsv, "\""); else if (flags & PERL_PV_PRETTY_LTGT) sv_catpvs(dsv, "<"); if (start_color != NULL) sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color)); pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR); if (end_color != NULL) sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color)); if (dq == '"') sv_catpvs(dsv, "\""); else if (flags & PERL_PV_PRETTY_LTGT) sv_catpvs(dsv, ">"); if ((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count) sv_catpvs(dsv, "..."); return SvPVX(dsv); } #endif #endif #ifndef pv_display #if defined(NEED_pv_display) static char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim); static #else extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim); #endif #ifdef pv_display # undef pv_display #endif #define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e) #define Perl_pv_display DPPP_(my_pv_display) #if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL) char * DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim) { pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP); if (len > cur && pv[cur] == '\0') sv_catpvs(dsv, "\\0"); return SvPVX(dsv); } #endif #endif #endif /* _P_P_PORTABILITY_H_ */ /* End of File ppport.h */ Geo-IP-1.51/typemap0000644000175000017500000000161513167530465012531 0ustar greggregTYPEMAP char * O_CHAR const char * T_PV GeoIP * O_OBJECT GeoIPRecord * O_OBJECT float T_FLOAT INPUT O_OBJECT if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) ) $var = ($type)SvIV((SV*)SvRV( $arg )); else{ warn( \"${Package}::$func_name() -- $var is not a blessed SV reference\" ); XSRETURN_UNDEF; } # this is just here because a O_CHAR input is required to compile, # should be same as if O_CHAR wasn't defined O_CHAR $var = ($type)SvPVbyte_nolen ($arg) OUTPUT # The Perl object is blessed into 'CLASS', which should be a # char* having the name of the package for the blessing. O_OBJECT sv_setref_pv( $arg, (char *)CLASS, (void*)$var ); # prevent memory leaks with malloc'ed returned char * strings O_CHAR if($var != NULL) { $arg = newSVpv($var, strlen($var)); free($var); sv_2mortal($arg); } Geo-IP-1.51/META.yml0000644000175000017500000005353113167530465012404 0ustar greggreg--- abstract: 'Look up location and network information by IP Address' author: - 'Dave Rolsky ' - 'Greg Oschwald ' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' Test::More: '0.96' warnings: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Geo-IP provides: Geo::IP: file: lib/Geo/IP.pm version: '1.51' Geo::IP::Record: file: lib/Geo/IP/Record.pm version: '1.51' requires: DynaLoader: '0' Exporter: '0' base: '0' strict: '0' vars: '0' resources: bugtracker: https://github.com/maxmind/geoip-api-perl/issues homepage: http://metacpan.org/release/Geo-IP repository: git://github.com/maxmind/geoip-api-perl.git version: '1.51' x_Dist_Zilla: perl: version: '5.026001' plugins: - class: Dist::Zilla::Plugin::Encoding name: Encoding version: '6.010' - class: Dist::Zilla::Plugin::MakeMaker::Runner config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@MAXMIND/MakeMaker::Runner' version: '6.010' - class: Dist::Zilla::Plugin::ManifestSkip name: '@MAXMIND/ManifestSkip' version: '6.010' - class: Dist::Zilla::Plugin::License name: '@MAXMIND/License' version: '6.010' - class: Dist::Zilla::Plugin::ExecDir name: '@MAXMIND/ExecDir' version: '6.010' - class: Dist::Zilla::Plugin::ShareDir name: '@MAXMIND/ShareDir' version: '6.010' - class: Dist::Zilla::Plugin::Manifest name: '@MAXMIND/Manifest' version: '6.010' - class: Dist::Zilla::Plugin::CheckVersionIncrement name: '@MAXMIND/CheckVersionIncrement' version: '0.121750' - class: Dist::Zilla::Plugin::TestRelease name: '@MAXMIND/TestRelease' version: '6.010' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@MAXMIND/ConfirmRelease' version: '6.010' - class: Dist::Zilla::Plugin::Authority name: '@MAXMIND/Authority' version: '1.009' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@MAXMIND/AutoPrereqs' version: '6.010' - class: Dist::Zilla::Plugin::GitHub::Meta name: '@MAXMIND/GitHub::Meta' version: '0.44' - class: Dist::Zilla::Plugin::GitHub::Update config: Dist::Zilla::Plugin::GitHub::Update: metacpan: 1 name: '@MAXMIND/GitHub::Update' version: '0.44' - class: Dist::Zilla::Plugin::MetaResources name: '@MAXMIND/MetaResources' version: '6.010' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: '@MAXMIND/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '6.010' include_underscores: 0 Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' inherit_missing: '1' inherit_version: '1' meta_noindex: '1' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000033' version: '0.004' name: '@MAXMIND/MetaProvides::Package' version: '2.004003' - class: Dist::Zilla::Plugin::Meta::Contributors name: '@MAXMIND/Meta::Contributors' version: '0.003' - class: Dist::Zilla::Plugin::MetaConfig name: '@MAXMIND/MetaConfig' version: '6.010' - class: Dist::Zilla::Plugin::MetaJSON name: '@MAXMIND/MetaJSON' version: '6.010' - class: Dist::Zilla::Plugin::MetaYAML name: '@MAXMIND/MetaYAML' version: '6.010' - class: Dist::Zilla::Plugin::NextRelease name: '@MAXMIND/NextRelease' version: '6.010' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: '@MAXMIND/Test::More with subtest' version: '6.010' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: '@MAXMIND/Modules for use with tidyall' version: '6.010' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: '@MAXMIND/Test::Version which fixes https://github.com/plicease/Test-Version/issues/7' version: '6.010' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::MAXMIND phase: build run_under_travis: 0 skip: [] name: '@MAXMIND/Dist::Zilla::PluginBundle::MAXMIND' version: '0.054' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 1 modules: [] phase: release run_under_travis: 0 skip: - Dist::Zilla::Plugin::MAXMIND::CheckChangesHasContent - Dist::Zilla::Plugin::MAXMIND::Contributors - Dist::Zilla::Plugin::MAXMIND::Git::CheckFor::CorrectBranch - Dist::Zilla::Plugin::MAXMIND::License - Dist::Zilla::Plugin::MAXMIND::TidyAll - Dist::Zilla::Plugin::MAXMIND::VersionProvider - Pod::Weaver::PluginBundle::MAXMIND name: '@MAXMIND/PromptIfStale' version: '0.054' - class: Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable name: '@MAXMIND/Test::Pod::Coverage::Configurable' version: '0.06' - class: Dist::Zilla::Plugin::Test::PodSpelling config: Dist::Zilla::Plugin::Test::PodSpelling: directories: - bin - lib spell_cmd: '' stopwords: - "APNIC\n" - "ARIN\n" - Alders - "Alders'" - Eilam - "Eilam's" - "GEOLOCATION\n" - "GeoIP\n" - "GeoLite\n" - "LACNIC\n" - "LLC\n" - MAXMIND - "MAXMIND's" - MaxMind - "MaxMind's" - "Netspeed\n" - Oschwald - "Oschwald's" - PayPal - Rolsky - "Rolsky's" - "api\n" - "cronjob\n" - "dat\n" - "datadir\n" - "geoip\n" - "geoipupdate\n" - "geolocation\n" - "ipnum\n" - "isp\n" - "netblocks\n" - "netmask\n" - "onwards\n" - "teredo\n" - "whois\n" wordlist: Pod::Wordlist name: '@MAXMIND/Test::PodSpelling' version: '2.007004' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@MAXMIND/PodSyntaxTests' version: '6.010' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@MAXMIND/RunExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::MojibakeTests name: '@MAXMIND/MojibakeTests' version: '0.8' - class: Dist::Zilla::Plugin::Test::CPAN::Changes config: Dist::Zilla::Plugin::Test::CPAN::Changes: changelog: Changes name: '@MAXMIND/Test::CPAN::Changes' version: '0.012' - class: Dist::Zilla::Plugin::Test::CPAN::Meta::JSON name: '@MAXMIND/Test::CPAN::Meta::JSON' version: '0.004' - class: Dist::Zilla::Plugin::Test::EOL config: Dist::Zilla::Plugin::Test::EOL: filename: xt/author/eol.t finder: - ':ExecFiles' - ':InstallModules' - ':TestFiles' trailing_whitespace: 1 name: '@MAXMIND/Test::EOL' version: '0.19' - class: Dist::Zilla::Plugin::Test::NoTabs config: Dist::Zilla::Plugin::Test::NoTabs: filename: xt/author/no-tabs.t finder: - ':InstallModules' - ':ExecFiles' - ':TestFiles' name: '@MAXMIND/Test::NoTabs' version: '0.15' - class: Dist::Zilla::Plugin::Test::Portability config: Dist::Zilla::Plugin::Test::Portability: options: '' name: '@MAXMIND/Test::Portability' version: '2.001000' - class: Dist::Zilla::Plugin::Test::Synopsis name: '@MAXMIND/Test::Synopsis' version: '2.000007' - class: Dist::Zilla::Plugin::Test::TidyAll name: '@MAXMIND/Test::TidyAll' version: '0.04' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '0' fail_on_warning: author fake_home: 0 filename: xt/author/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: develop script_finder: - ':PerlExecFiles' skips: [] switch: [] name: '@MAXMIND/Test::Compile' version: '2.057' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@MAXMIND/Test::ReportPrereqs' version: '0.027' - class: Dist::Zilla::Plugin::Test::Version name: '@MAXMIND/Test::Version' version: '1.09' - class: Dist::Zilla::Plugin::MAXMIND::Contributors name: '@MAXMIND/MAXMIND::Contributors' version: '0.84' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: git_version: 2.11.0 include_authors: 0 include_releaser: 1 order_by: name paths: [] name: '@MAXMIND/Git::Contributors' version: '0.030' - class: Dist::Zilla::Plugin::SurgicalPodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugins: - '@MAXMIND' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.015' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.015' - class: Pod::Weaver::Plugin::SingleEncoding name: '@MAXMIND/SingleEncoding' version: '4.015' - class: Pod::Weaver::Plugin::Transformer name: '@MAXMIND/List' version: '4.015' - class: Pod::Weaver::Plugin::Transformer name: '@MAXMIND/Verbatim' version: '4.015' - class: Pod::Weaver::Section::Region name: '@MAXMIND/header' version: '4.015' - class: Pod::Weaver::Section::Name name: '@MAXMIND/Name' version: '4.015' - class: Pod::Weaver::Section::Version name: '@MAXMIND/Version' version: '4.015' - class: Pod::Weaver::Section::Region name: '@MAXMIND/prelude' version: '4.015' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.015' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.015' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.015' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.015' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.015' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.015' - class: Pod::Weaver::Section::Collect name: TYPES version: '4.015' - class: Pod::Weaver::Section::Leftovers name: '@MAXMIND/Leftovers' version: '4.015' - class: Pod::Weaver::Section::Region name: '@MAXMIND/postlude' version: '4.015' - class: Pod::Weaver::Section::GenerateSection name: '@MAXMIND/generate SUPPORT' version: '1.06' - class: Pod::Weaver::Section::AllowOverride name: '@MAXMIND/allow override SUPPORT' version: '0.05' - class: Pod::Weaver::Section::Authors name: '@MAXMIND/Authors' version: '4.015' - class: Pod::Weaver::Section::Contributors name: '@MAXMIND/Contributors' version: '0.009' - class: Pod::Weaver::Section::Legal name: '@MAXMIND/Legal' version: '4.015' - class: Pod::Weaver::Section::Region name: '@MAXMIND/footer' version: '4.015' name: '@MAXMIND/SurgicalPodWeaver' version: '0.0023' - class: Dist::Zilla::Plugin::MAXMIND::WeaverConfig name: '@MAXMIND/MAXMIND::WeaverConfig' version: '0.84' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@MAXMIND/README.md in build' version: '0.163250' - class: Dist::Zilla::Plugin::GenerateFile::FromShareDir config: Dist::Zilla::Plugin::GenerateFile::FromShareDir: destination_filename: CONTRIBUTING.md dist: Dist-Zilla-PluginBundle-MAXMIND encoding: UTF-8 has_xs: '1' location: build source_filename: CONTRIBUTING.md Dist::Zilla::Role::RepoFileInjector: allow_overwrite: 1 repo_root: . version: '0.007' name: '@MAXMIND/Generate CONTRIBUTING.md' version: '0.013' - class: Dist::Zilla::Plugin::CPANFile name: '@MAXMIND/CPANFile' version: '6.010' - class: Dist::Zilla::Plugin::PPPort name: '@MAXMIND/PPPort' version: '0.008' - class: Dist::Zilla::Plugin::MAXMIND::License name: '@MAXMIND/MAXMIND::License' version: '0.84' - class: Dist::Zilla::Plugin::CheckStrictVersion name: '@MAXMIND/CheckStrictVersion' version: '0.001' - class: Dist::Zilla::Plugin::CheckSelfDependency config: Dist::Zilla::Plugin::CheckSelfDependency: finder: - ':InstallModules' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000033' version: '0.004' name: '@MAXMIND/CheckSelfDependency' version: '0.011' - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@MAXMIND/CheckPrereqsIndexed' version: '0.020' - class: Dist::Zilla::Plugin::MAXMIND::CheckChangesHasContent name: '@MAXMIND/MAXMIND::CheckChangesHasContent' version: '0.84' - class: Dist::Zilla::Plugin::MAXMIND::Git::CheckFor::CorrectBranch config: Dist::Zilla::Role::Git::Repo: git_version: 2.11.0 repo_root: . name: '@MAXMIND/MAXMIND::Git::CheckFor::CorrectBranch' version: '0.84' - class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts config: Dist::Zilla::Role::Git::Repo: git_version: 2.11.0 repo_root: . name: '@MAXMIND/Git::CheckFor::MergeConflicts' version: '0.014' - class: Dist::Zilla::Plugin::MAXMIND::TidyAll name: '@MAXMIND/MAXMIND::TidyAll' version: '0.84' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@MAXMIND/UploadToCPAN' version: '6.010' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - CONTRIBUTING.md - Changes - LICENSE - Makefile.PL - README.md - cpanfile - ppport.h - tidyall.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.11.0 repo_root: . name: '@MAXMIND/Git::Check' version: '2.042' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: v%v%n%n%c Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - CONTRIBUTING.md - Changes - LICENSE - Makefile.PL - README.md - cpanfile - ppport.h - tidyall.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.11.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@MAXMIND/Commit generated files' version: '2.042' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: v1.51 tag_format: v%v tag_message: v%v Dist::Zilla::Role::Git::Repo: git_version: 2.11.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@MAXMIND/Git::Tag' version: '2.042' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: git_version: 2.11.0 repo_root: . name: '@MAXMIND/Git::Push' version: '2.042' - class: Dist::Zilla::Plugin::BumpVersionAfterRelease config: Dist::Zilla::Plugin::BumpVersionAfterRelease: finders: - ':ExecFiles' - ':InstallModules' global: 0 munge_makefile_pl: 1 name: '@MAXMIND/BumpVersionAfterRelease' version: '0.015' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: 'Bump version after release' Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: - (?^:.+) changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.11.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@MAXMIND/Commit version bump' version: '2.042' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: git_version: 2.11.0 repo_root: . name: '@MAXMIND/Push version bump' version: '2.042' - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: - CONTRIBUTING.md - LICENSE - README.md - cpanfile - perlcriticrc - perltidyrc - ppport.h - tidyall.ini exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: Git::GatherDir version: '2.042' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: '@MAXMIND/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '6.010' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.010' x_authority: cpan:MAXMIND x_contributors: - 'asb-cpan ' - 'Boris Zentner ' - 'Boris Zentner ' - 'John SJ Anderson ' - 'Olaf Alders ' - 'Philip A. Prindeville ' - 'shawniverson ' - 'Thomas J Mather ' - 'Tina Mueller ' - 'Will Storey ' x_serialization_backend: 'YAML::Tiny version 1.70' Geo-IP-1.51/lib/0000755000175000017500000000000013167530465011672 5ustar greggregGeo-IP-1.51/lib/Geo/0000755000175000017500000000000013167530465012404 5ustar greggregGeo-IP-1.51/lib/Geo/IP.pm0000644000175000017500000053534713167530465013273 0ustar greggregpackage Geo::IP; use strict; use base qw(Exporter); our $VERSION; our @ISA; our $GEOIP_PP_ONLY = 0; our $XS_VERSION; our @EXPORT = qw( GEOIP_STANDARD GEOIP_MEMORY_CACHE GEOIP_CHECK_CACHE GEOIP_INDEX_CACHE GEOIP_UNKNOWN_SPEED GEOIP_DIALUP_SPEED GEOIP_CABLEDSL_SPEED GEOIP_CORPORATE_SPEED GEOIP_COUNTRY_EDITION GEOIP_REGION_EDITION_REV0 GEOIP_CITY_EDITION_REV0 GEOIP_ORG_EDITION GEOIP_ISP_EDITION GEOIP_CITY_EDITION_REV1 GEOIP_REGION_EDITION_REV1 GEOIP_PROXY_EDITION GEOIP_ASNUM_EDITION GEOIP_NETSPEED_EDITION GEOIP_CHARSET_ISO_8859_1 GEOIP_CHARSET_UTF8 GEOIP_MMAP_CACHE GEOIP_ACCURACYRADIUS_EDITION GEOIP_COUNTRY_EDITION_V6 GEOIP_DOMAIN_EDITION GEOIP_NETSPEED_EDITION_REV1 GEOIP_SILENCE ); BEGIN { $VERSION = '1.51'; eval { # PERL_DL_NONLAZY must be false, or any errors in loading will just # cause the perl code to be tested local $ENV{PERL_DL_NONLAZY} = 0 if $ENV{PERL_DL_NONLAZY}; require DynaLoader; local @ISA = qw(DynaLoader); bootstrap Geo::IP $VERSION; } unless $GEOIP_PP_ONLY || $ENV{GEOIP_PP_ONLY}; } require Geo::IP::Record; sub GEOIP_STANDARD() { 0; } # PP sub GEOIP_MEMORY_CACHE() { 1; } # PP sub GEOIP_CHECK_CACHE() { 2; } sub GEOIP_INDEX_CACHE() { 4; } sub GEOIP_MMAP_CACHE() { 8; } # PP sub GEOIP_SILENCE() { 16; } sub GEOIP_UNKNOWN_SPEED() { 0; } #PP sub GEOIP_DIALUP_SPEED() { 1; } #PP sub GEOIP_CABLEDSL_SPEED() { 2; } #PP sub GEOIP_CORPORATE_SPEED() { 3; } #PP BEGIN { #my $pp = !( defined &_XScompiled && &_XScompiled && !$TESTING_PERL_ONLY ); my $pp = !defined &open; sub GEOIP_COUNTRY_EDITION() { 1; } sub GEOIP_CITY_EDITION_REV1() { 2; } sub GEOIP_REGION_EDITION_REV1() { 3; } sub GEOIP_ISP_EDITION() { 4; } sub GEOIP_ORG_EDITION() { 5; } sub GEOIP_CITY_EDITION_REV0() { 6; } sub GEOIP_REGION_EDITION_REV0() { 7; } sub GEOIP_PROXY_EDITION() { 8; } sub GEOIP_ASNUM_EDITION() { 9; } sub GEOIP_NETSPEED_EDITION() { 10; } sub GEOIP_DOMAIN_EDITION() { 11; } sub GEOIP_COUNTRY_EDITION_V6() { 12; } sub GEOIP_ACCURACYRADIUS_EDITION() { 14; } sub GEOIP_ASNUM_EDITION_V6() { 21; } sub GEOIP_CITY_EDITION_REV1_V6() { 30; } sub GEOIP_CITY_EDITION_REV0_V6() { 31; } sub GEOIP_NETSPEED_EDITION_REV1() { 32; } sub GEOIP_CHARSET_ISO_8859_1() { 0; } sub GEOIP_CHARSET_UTF8() { 1; } # sub api { defined &Geo::IP::Record::_XScompiled ? 'CAPI' : 'PurePerl'; } # cheat --- try to load Sys::Mmap PurePerl only if ($pp) { eval { # wrap into eval again, as workaround for centos / mod_perl issue # seems they use $@ without eval somewhere eval "require Sys::Mmap" ? Sys::Mmap->import : do { for (qw/ PROT_READ MAP_PRIVATE MAP_SHARED /) { no strict 'refs'; my $unused_stub = $_; # we must use a copy *$unused_stub = sub { die 'Sys::Mmap required for mmap support' }; } # for }; # do 1; }; # eval } # pp else { eval << '__CAPI_GLUE__'; # threads should not clone or DESTROY the GeoIP object. sub CLONE_SKIP {1} *name_by_name = *isp_by_name = *org_by_name; *name_by_addr = *isp_by_addr = *org_by_addr; *org_by_name_v6 = *name_by_name_v6; *org_by_addr_v6 = *name_by_addr_v6; __CAPI_GLUE__ } } eval << '__PP_CODE__' unless defined &open; package Geo::IP; use strict; use base qw(Exporter); our $VERSION; our @ISA; our $GEOIP_PP_ONLY = 0; our $XS_VERSION; our @EXPORT = qw( GEOIP_STANDARD GEOIP_MEMORY_CACHE GEOIP_CHECK_CACHE GEOIP_INDEX_CACHE GEOIP_UNKNOWN_SPEED GEOIP_DIALUP_SPEED GEOIP_CABLEDSL_SPEED GEOIP_CORPORATE_SPEED GEOIP_COUNTRY_EDITION GEOIP_REGION_EDITION_REV0 GEOIP_CITY_EDITION_REV0 GEOIP_ORG_EDITION GEOIP_ISP_EDITION GEOIP_CITY_EDITION_REV1 GEOIP_REGION_EDITION_REV1 GEOIP_PROXY_EDITION GEOIP_ASNUM_EDITION GEOIP_NETSPEED_EDITION GEOIP_CHARSET_ISO_8859_1 GEOIP_CHARSET_UTF8 GEOIP_MMAP_CACHE GEOIP_ACCURACYRADIUS_EDITION GEOIP_COUNTRY_EDITION_V6 GEOIP_DOMAIN_EDITION GEOIP_NETSPEED_EDITION_REV1 GEOIP_SILENCE ); use strict; use FileHandle; use File::Spec; require bytes; BEGIN { if ( $] >= 5.008 ) { require Encode; Encode->import(qw/ decode /); } else { *decode = sub { local $_ = $_[1]; use bytes; s/([\x80-\xff])/my $c = ord($1); my $p = $c >= 192 ? 1 : 0; pack ( 'CC' => 0xc2 + $p , $c & ~0x40 ); /ge; return $_; }; } } use vars qw/$PP_OPEN_TYPE_PATH/; use constant FULL_RECORD_LENGTH => 50; use constant GEOIP_COUNTRY_BEGIN => 16776960; use constant RECORD_LENGTH => 3; use constant GEOIP_STATE_BEGIN_REV0 => 16700000; use constant GEOIP_STATE_BEGIN_REV1 => 16000000; use constant STRUCTURE_INFO_MAX_SIZE => 20; use constant DATABASE_INFO_MAX_SIZE => 100; use constant SEGMENT_RECORD_LENGTH => 3; use constant STANDARD_RECORD_LENGTH => 3; use constant ORG_RECORD_LENGTH => 4; use constant MAX_RECORD_LENGTH => 4; use constant MAX_ORG_RECORD_LENGTH => 300; use constant US_OFFSET => 1; use constant CANADA_OFFSET => 677; use constant WORLD_OFFSET => 1353; use constant FIPS_RANGE => 360; my @continents = qw/ -- AS EU EU AS AS NA NA EU AS NA AF AN SA OC EU OC NA AS EU NA AS EU AF EU AS AF AF NA AS SA SA NA AS AN AF EU NA NA AS AF AF AF EU AF OC SA AF AS SA NA NA AF AS AS EU EU AF EU NA NA AF SA EU AF AF AF EU AF EU OC SA OC EU EU EU AF EU NA AS SA AF EU NA AF AF NA AF EU AN NA OC AF SA AS AN NA EU NA EU AS EU AS AS AS AS AS EU EU NA AS AS AF AS AS OC AF NA AS AS AS NA AS AS AS NA EU AS AF AF EU EU EU AF AF EU EU AF OC EU AF AS AS AS OC NA AF NA EU AF AS AF NA AS AF AF OC AF OC AF NA EU EU AS OC OC OC AS NA SA OC OC AS AS EU NA OC NA AS EU OC SA AS AF EU EU AF AS OC AF AF EU AS AF EU EU EU AF EU AF AF SA AF NA AS AF NA AF AN AF AS AS OC AS AF OC AS EU NA OC AS AF EU AF OC NA SA AS EU NA SA NA NA AS OC OC OC AS AF EU AF AF EU AF -- -- -- EU EU EU EU NA NA NA AF /; my @countries = ( undef, qw/ AP EU AD AE AF AG AI AL AM CW AO AQ AR AS AT AU AW AZ BA BB BD BE BF BG BH BI BJ BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR FX GA GB GD GE GF GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IN IO IQ IR IS IT JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR ST SV SY SZ TC TD TF TG TH TJ TK TM TN TO TL TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT RS ZA ZM ME ZW A1 A2 O1 AX GG IM JE BL MF BQ SS O1 / ); my %_id_by_code; for ( 1 .. $#countries ) { $_id_by_code{ $countries[$_] } = $_; } my @code3s = ( undef, qw/ AP EU AND ARE AFG ATG AIA ALB ARM CUW AGO ATA ARG ASM AUT AUS ABW AZE BIH BRB BGD BEL BFA BGR BHR BDI BEN BMU BRN BOL BRA BHS BTN BVT BWA BLR BLZ CAN CCK COD CAF COG CHE CIV COK CHL CMR CHN COL CRI CUB CPV CXR CYP CZE DEU DJI DNK DMA DOM DZA ECU EST EGY ESH ERI ESP ETH FIN FJI FLK FSM FRO FRA FX GAB GBR GRD GEO GUF GHA GIB GRL GMB GIN GLP GNQ GRC SGS GTM GUM GNB GUY HKG HMD HND HRV HTI HUN IDN IRL ISR IND IOT IRQ IRN ISL ITA JAM JOR JPN KEN KGZ KHM KIR COM KNA PRK KOR KWT CYM KAZ LAO LBN LCA LIE LKA LBR LSO LTU LUX LVA LBY MAR MCO MDA MDG MHL MKD MLI MMR MNG MAC MNP MTQ MRT MSR MLT MUS MDV MWI MEX MYS MOZ NAM NCL NER NFK NGA NIC NLD NOR NPL NRU NIU NZL OMN PAN PER PYF PNG PHL PAK POL SPM PCN PRI PSE PRT PLW PRY QAT REU ROU RUS RWA SAU SLB SYC SDN SWE SGP SHN SVN SJM SVK SLE SMR SEN SOM SUR STP SLV SYR SWZ TCA TCD ATF TGO THA TJK TKL TKM TUN TON TLS TUR TTO TUV TWN TZA UKR UGA UMI USA URY UZB VAT VCT VEN VGB VIR VNM VUT WLF WSM YEM MYT SRB ZAF ZMB MNE ZWE A1 A2 O1 ALA GGY IMN JEY BLM MAF BES SSD O1 / ); my @names = ( undef, "Asia/Pacific Region", "Europe", "Andorra", "United Arab Emirates", "Afghanistan", "Antigua and Barbuda", "Anguilla", "Albania", "Armenia", "Curacao", "Angola", "Antarctica", "Argentina", "American Samoa", "Austria", "Australia", "Aruba", "Azerbaijan", "Bosnia and Herzegovina", "Barbados", "Bangladesh", "Belgium", "Burkina Faso", "Bulgaria", "Bahrain", "Burundi", "Benin", "Bermuda", "Brunei Darussalam", "Bolivia", "Brazil", "Bahamas", "Bhutan", "Bouvet Island", "Botswana", "Belarus", "Belize", "Canada", "Cocos (Keeling) Islands", "Congo, The Democratic Republic of the", "Central African Republic", "Congo", "Switzerland", "Cote D'Ivoire", "Cook Islands", "Chile", "Cameroon", "China", "Colombia", "Costa Rica", "Cuba", "Cape Verde", "Christmas Island", "Cyprus", "Czech Republic", "Germany", "Djibouti", "Denmark", "Dominica", "Dominican Republic", "Algeria", "Ecuador", "Estonia", "Egypt", "Western Sahara", "Eritrea", "Spain", "Ethiopia", "Finland", "Fiji", "Falkland Islands (Malvinas)", "Micronesia, Federated States of", "Faroe Islands", "France", "France, Metropolitan", "Gabon", "United Kingdom", "Grenada", "Georgia", "French Guiana", "Ghana", "Gibraltar", "Greenland", "Gambia", "Guinea", "Guadeloupe", "Equatorial Guinea", "Greece", "South Georgia and the South Sandwich Islands", "Guatemala", "Guam", "Guinea-Bissau", "Guyana", "Hong Kong", "Heard Island and McDonald Islands", "Honduras", "Croatia", "Haiti", "Hungary", "Indonesia", "Ireland", "Israel", "India", "British Indian Ocean Territory", "Iraq", "Iran, Islamic Republic of", "Iceland", "Italy", "Jamaica", "Jordan", "Japan", "Kenya", "Kyrgyzstan", "Cambodia", "Kiribati", "Comoros", "Saint Kitts and Nevis", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Cayman Islands", "Kazakhstan", "Lao People's Democratic Republic", "Lebanon", "Saint Lucia", "Liechtenstein", "Sri Lanka", "Liberia", "Lesotho", "Lithuania", "Luxembourg", "Latvia", "Libya", "Morocco", "Monaco", "Moldova, Republic of", "Madagascar", "Marshall Islands", "Macedonia", "Mali", "Myanmar", "Mongolia", "Macau", "Northern Mariana Islands", "Martinique", "Mauritania", "Montserrat", "Malta", "Mauritius", "Maldives", "Malawi", "Mexico", "Malaysia", "Mozambique", "Namibia", "New Caledonia", "Niger", "Norfolk Island", "Nigeria", "Nicaragua", "Netherlands", "Norway", "Nepal", "Nauru", "Niue", "New Zealand", "Oman", "Panama", "Peru", "French Polynesia", "Papua New Guinea", "Philippines", "Pakistan", "Poland", "Saint Pierre and Miquelon", "Pitcairn Islands", "Puerto Rico", "Palestinian Territory", "Portugal", "Palau", "Paraguay", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saudi Arabia", "Solomon Islands", "Seychelles", "Sudan", "Sweden", "Singapore", "Saint Helena", "Slovenia", "Svalbard and Jan Mayen", "Slovakia", "Sierra Leone", "San Marino", "Senegal", "Somalia", "Suriname", "Sao Tome and Principe", "El Salvador", "Syrian Arab Republic", "Swaziland", "Turks and Caicos Islands", "Chad", "French Southern Territories", "Togo", "Thailand", "Tajikistan", "Tokelau", "Turkmenistan", "Tunisia", "Tonga", "Timor-Leste", "Turkey", "Trinidad and Tobago", "Tuvalu", "Taiwan", "Tanzania, United Republic of", "Ukraine", "Uganda", "United States Minor Outlying Islands", "United States", "Uruguay", "Uzbekistan", "Holy See (Vatican City State)", "Saint Vincent and the Grenadines", "Venezuela", "Virgin Islands, British", "Virgin Islands, U.S.", "Vietnam", "Vanuatu", "Wallis and Futuna", "Samoa", "Yemen", "Mayotte", "Serbia", "South Africa", "Zambia", "Montenegro", "Zimbabwe", "Anonymous Proxy", "Satellite Provider", "Other", "Aland Islands", "Guernsey", "Isle of Man", "Jersey", "Saint Barthelemy", "Saint Martin", "Bonaire, Saint Eustatius and Saba", "South Sudan", "Other" ); my %country_region_names = ( 'AD' => { '02' => 'Canillo', '03' => 'Encamp', '04' => 'La Massana', '05' => 'Ordino', '06' => 'Sant Julia de Loria', '07' => 'Andorra la Vella', '08' => 'Escaldes-Engordany' }, 'AE' => { '01' => 'Abu Dhabi', '02' => 'Ajman', '03' => 'Dubai', '04' => 'Fujairah', '05' => 'Ras Al Khaimah', '06' => 'Sharjah', '07' => 'Umm Al Quwain' }, 'AF' => { '01' => 'Badakhshan', '02' => 'Badghis', '03' => 'Baghlan', '05' => 'Bamian', '06' => 'Farah', '07' => 'Faryab', '08' => 'Ghazni', '09' => 'Ghowr', '10' => 'Helmand', '11' => 'Herat', '13' => 'Kabol', '14' => 'Kapisa', '17' => 'Lowgar', '18' => 'Nangarhar', '19' => 'Nimruz', '23' => 'Kandahar', '24' => 'Kondoz', '26' => 'Takhar', '27' => 'Vardak', '28' => 'Zabol', '29' => 'Paktika', '30' => 'Balkh', '31' => 'Jowzjan', '32' => 'Samangan', '33' => 'Sar-e Pol', '34' => 'Konar', '35' => 'Laghman', '36' => 'Paktia', '37' => 'Khowst', '38' => 'Nurestan', '39' => 'Oruzgan', '40' => 'Parvan', '41' => 'Daykondi', '42' => 'Panjshir' }, 'AG' => { '01' => 'Barbuda', '03' => 'Saint George', '04' => 'Saint John', '05' => 'Saint Mary', '06' => 'Saint Paul', '07' => 'Saint Peter', '08' => 'Saint Philip', '09' => 'Redonda' }, 'AL' => { '40' => 'Berat', '41' => 'Diber', '42' => 'Durres', '43' => 'Elbasan', '44' => 'Fier', '45' => 'Gjirokaster', '46' => 'Korce', '47' => 'Kukes', '48' => 'Lezhe', '49' => 'Shkoder', '50' => 'Tirane', '51' => 'Vlore' }, 'AM' => { '01' => 'Aragatsotn', '02' => 'Ararat', '03' => 'Armavir', '04' => 'Geghark\'unik\'', '05' => 'Kotayk\'', '06' => 'Lorri', '07' => 'Shirak', '08' => 'Syunik\'', '09' => 'Tavush', '10' => 'Vayots\' Dzor', '11' => 'Yerevan' }, 'AO' => { '01' => 'Benguela', '02' => 'Bie', '03' => 'Cabinda', '04' => 'Cuando Cubango', '05' => 'Cuanza Norte', '06' => 'Cuanza Sul', '07' => 'Cunene', '08' => 'Huambo', '09' => 'Huila', '12' => 'Malanje', '13' => 'Namibe', '14' => 'Moxico', '15' => 'Uige', '16' => 'Zaire', '17' => 'Lunda Norte', '18' => 'Lunda Sul', '19' => 'Bengo', '20' => 'Luanda' }, 'AR' => { '01' => 'Buenos Aires', '02' => 'Catamarca', '03' => 'Chaco', '04' => 'Chubut', '05' => 'Cordoba', '06' => 'Corrientes', '07' => 'Distrito Federal', '08' => 'Entre Rios', '09' => 'Formosa', '10' => 'Jujuy', '11' => 'La Pampa', '12' => 'La Rioja', '13' => 'Mendoza', '14' => 'Misiones', '15' => 'Neuquen', '16' => 'Rio Negro', '17' => 'Salta', '18' => 'San Juan', '19' => 'San Luis', '20' => 'Santa Cruz', '21' => 'Santa Fe', '22' => 'Santiago del Estero', '23' => 'Tierra del Fuego', '24' => 'Tucuman' }, 'AT' => { '01' => 'Burgenland', '02' => 'Karnten', '03' => 'Niederosterreich', '04' => 'Oberosterreich', '05' => 'Salzburg', '06' => 'Steiermark', '07' => 'Tirol', '08' => 'Vorarlberg', '09' => 'Wien' }, 'AU' => { '01' => 'Australian Capital Territory', '02' => 'New South Wales', '03' => 'Northern Territory', '04' => 'Queensland', '05' => 'South Australia', '06' => 'Tasmania', '07' => 'Victoria', '08' => 'Western Australia' }, 'AZ' => { '01' => 'Abseron', '02' => 'Agcabadi', '03' => 'Agdam', '04' => 'Agdas', '05' => 'Agstafa', '06' => 'Agsu', '07' => 'Ali Bayramli', '08' => 'Astara', '09' => 'Baki', '10' => 'Balakan', '11' => 'Barda', '12' => 'Beylaqan', '13' => 'Bilasuvar', '14' => 'Cabrayil', '15' => 'Calilabad', '16' => 'Daskasan', '17' => 'Davaci', '18' => 'Fuzuli', '19' => 'Gadabay', '20' => 'Ganca', '21' => 'Goranboy', '22' => 'Goycay', '23' => 'Haciqabul', '24' => 'Imisli', '25' => 'Ismayilli', '26' => 'Kalbacar', '27' => 'Kurdamir', '28' => 'Lacin', '29' => 'Lankaran', '30' => 'Lankaran', '31' => 'Lerik', '32' => 'Masalli', '33' => 'Mingacevir', '34' => 'Naftalan', '35' => 'Naxcivan', '36' => 'Neftcala', '37' => 'Oguz', '38' => 'Qabala', '39' => 'Qax', '40' => 'Qazax', '41' => 'Qobustan', '42' => 'Quba', '43' => 'Qubadli', '44' => 'Qusar', '45' => 'Saatli', '46' => 'Sabirabad', '47' => 'Saki', '48' => 'Saki', '49' => 'Salyan', '50' => 'Samaxi', '51' => 'Samkir', '52' => 'Samux', '53' => 'Siyazan', '54' => 'Sumqayit', '55' => 'Susa', '56' => 'Susa', '57' => 'Tartar', '58' => 'Tovuz', '59' => 'Ucar', '60' => 'Xacmaz', '61' => 'Xankandi', '62' => 'Xanlar', '63' => 'Xizi', '64' => 'Xocali', '65' => 'Xocavand', '66' => 'Yardimli', '67' => 'Yevlax', '68' => 'Yevlax', '69' => 'Zangilan', '70' => 'Zaqatala', '71' => 'Zardab' }, 'BA' => { '01' => 'Federation of Bosnia and Herzegovina', '02' => 'Republika Srpska', '03' => 'Brcko District' }, 'BB' => { '01' => 'Christ Church', '02' => 'Saint Andrew', '03' => 'Saint George', '04' => 'Saint James', '05' => 'Saint John', '06' => 'Saint Joseph', '07' => 'Saint Lucy', '08' => 'Saint Michael', '09' => 'Saint Peter', '10' => 'Saint Philip', '11' => 'Saint Thomas' }, 'BD' => { '81' => 'Dhaka', '82' => 'Khulna', '83' => 'Rajshahi', '84' => 'Chittagong', '85' => 'Barisal', '86' => 'Sylhet', '87' => 'Rangpur' }, 'BE' => { '01' => 'Antwerpen', '03' => 'Hainaut', '04' => 'Liege', '05' => 'Limburg', '06' => 'Luxembourg', '07' => 'Namur', '08' => 'Oost-Vlaanderen', '09' => 'West-Vlaanderen', '10' => 'Brabant Wallon', '11' => 'Brussels Hoofdstedelijk Gewest', '12' => 'Vlaams-Brabant', '13' => 'Flanders', '14' => 'Wallonia' }, 'BF' => { '15' => 'Bam', '19' => 'Boulkiemde', '20' => 'Ganzourgou', '21' => 'Gnagna', '28' => 'Kouritenga', '33' => 'Oudalan', '34' => 'Passore', '36' => 'Sanguie', '40' => 'Soum', '42' => 'Tapoa', '44' => 'Zoundweogo', '45' => 'Bale', '46' => 'Banwa', '47' => 'Bazega', '48' => 'Bougouriba', '49' => 'Boulgou', '50' => 'Gourma', '51' => 'Houet', '52' => 'Ioba', '53' => 'Kadiogo', '54' => 'Kenedougou', '55' => 'Komoe', '56' => 'Komondjari', '57' => 'Kompienga', '58' => 'Kossi', '59' => 'Koulpelogo', '60' => 'Kourweogo', '61' => 'Leraba', '62' => 'Loroum', '63' => 'Mouhoun', '64' => 'Namentenga', '65' => 'Naouri', '66' => 'Nayala', '67' => 'Noumbiel', '68' => 'Oubritenga', '69' => 'Poni', '70' => 'Sanmatenga', '71' => 'Seno', '72' => 'Sissili', '73' => 'Sourou', '74' => 'Tuy', '75' => 'Yagha', '76' => 'Yatenga', '77' => 'Ziro', '78' => 'Zondoma' }, 'BG' => { '33' => 'Mikhaylovgrad', '38' => 'Blagoevgrad', '39' => 'Burgas', '40' => 'Dobrich', '41' => 'Gabrovo', '42' => 'Grad Sofiya', '43' => 'Khaskovo', '44' => 'Kurdzhali', '45' => 'Kyustendil', '46' => 'Lovech', '47' => 'Montana', '48' => 'Pazardzhik', '49' => 'Pernik', '50' => 'Pleven', '51' => 'Plovdiv', '52' => 'Razgrad', '53' => 'Ruse', '54' => 'Shumen', '55' => 'Silistra', '56' => 'Sliven', '57' => 'Smolyan', '58' => 'Sofiya', '59' => 'Stara Zagora', '60' => 'Turgovishte', '61' => 'Varna', '62' => 'Veliko Turnovo', '63' => 'Vidin', '64' => 'Vratsa', '65' => 'Yambol' }, 'BH' => { '01' => 'Al Hadd', '02' => 'Al Manamah', '05' => 'Jidd Hafs', '06' => 'Sitrah', '08' => 'Al Mintaqah al Gharbiyah', '09' => 'Mintaqat Juzur Hawar', '10' => 'Al Mintaqah ash Shamaliyah', '11' => 'Al Mintaqah al Wusta', '12' => 'Madinat', '13' => 'Ar Rifa', '14' => 'Madinat Hamad', '15' => 'Al Muharraq', '16' => 'Al Asimah', '17' => 'Al Janubiyah', '18' => 'Ash Shamaliyah', '19' => 'Al Wusta' }, 'BI' => { '02' => 'Bujumbura', '09' => 'Bubanza', '10' => 'Bururi', '11' => 'Cankuzo', '12' => 'Cibitoke', '13' => 'Gitega', '14' => 'Karuzi', '15' => 'Kayanza', '16' => 'Kirundo', '17' => 'Makamba', '18' => 'Muyinga', '19' => 'Ngozi', '20' => 'Rutana', '21' => 'Ruyigi', '22' => 'Muramvya', '23' => 'Mwaro' }, 'BJ' => { '07' => 'Alibori', '08' => 'Atakora', '09' => 'Atlanyique', '10' => 'Borgou', '11' => 'Collines', '12' => 'Kouffo', '13' => 'Donga', '14' => 'Littoral', '15' => 'Mono', '16' => 'Oueme', '17' => 'Plateau', '18' => 'Zou' }, 'BM' => { '01' => 'Devonshire', '02' => 'Hamilton', '03' => 'Hamilton', '04' => 'Paget', '05' => 'Pembroke', '06' => 'Saint George', '07' => 'Saint George\'s', '08' => 'Sandys', '09' => 'Smiths', '10' => 'Southampton', '11' => 'Warwick' }, 'BN' => { '07' => 'Alibori', '08' => 'Belait', '09' => 'Brunei and Muara', '10' => 'Temburong', '11' => 'Collines', '12' => 'Kouffo', '13' => 'Donga', '14' => 'Littoral', '15' => 'Tutong', '16' => 'Oueme', '17' => 'Plateau', '18' => 'Zou' }, 'BO' => { '01' => 'Chuquisaca', '02' => 'Cochabamba', '03' => 'El Beni', '04' => 'La Paz', '05' => 'Oruro', '06' => 'Pando', '07' => 'Potosi', '08' => 'Santa Cruz', '09' => 'Tarija' }, 'BR' => { '01' => 'Acre', '02' => 'Alagoas', '03' => 'Amapa', '04' => 'Amazonas', '05' => 'Bahia', '06' => 'Ceara', '07' => 'Distrito Federal', '08' => 'Espirito Santo', '11' => 'Mato Grosso do Sul', '13' => 'Maranhao', '14' => 'Mato Grosso', '15' => 'Minas Gerais', '16' => 'Para', '17' => 'Paraiba', '18' => 'Parana', '20' => 'Piaui', '21' => 'Rio de Janeiro', '22' => 'Rio Grande do Norte', '23' => 'Rio Grande do Sul', '24' => 'Rondonia', '25' => 'Roraima', '26' => 'Santa Catarina', '27' => 'Sao Paulo', '28' => 'Sergipe', '29' => 'Goias', '30' => 'Pernambuco', '31' => 'Tocantins' }, 'BS' => { '05' => 'Bimini', '06' => 'Cat Island', '10' => 'Exuma', '13' => 'Inagua', '15' => 'Long Island', '16' => 'Mayaguana', '18' => 'Ragged Island', '22' => 'Harbour Island', '23' => 'New Providence', '24' => 'Acklins and Crooked Islands', '25' => 'Freeport', '26' => 'Fresh Creek', '27' => 'Governor\'s Harbour', '28' => 'Green Turtle Cay', '29' => 'High Rock', '30' => 'Kemps Bay', '31' => 'Marsh Harbour', '32' => 'Nichollstown and Berry Islands', '33' => 'Rock Sound', '34' => 'Sandy Point', '35' => 'San Salvador and Rum Cay' }, 'BT' => { '05' => 'Bumthang', '06' => 'Chhukha', '07' => 'Chirang', '08' => 'Daga', '09' => 'Geylegphug', '10' => 'Ha', '11' => 'Lhuntshi', '12' => 'Mongar', '13' => 'Paro', '14' => 'Pemagatsel', '15' => 'Punakha', '16' => 'Samchi', '17' => 'Samdrup', '18' => 'Shemgang', '19' => 'Tashigang', '20' => 'Thimphu', '21' => 'Tongsa', '22' => 'Wangdi Phodrang' }, 'BW' => { '01' => 'Central', '03' => 'Ghanzi', '04' => 'Kgalagadi', '05' => 'Kgatleng', '06' => 'Kweneng', '08' => 'North-East', '09' => 'South-East', '10' => 'Southern', '11' => 'North-West' }, 'BY' => { '01' => 'Brestskaya Voblasts\'', '02' => 'Homyel\'skaya Voblasts\'', '03' => 'Hrodzyenskaya Voblasts\'', '04' => 'Minsk', '05' => 'Minskaya Voblasts\'', '06' => 'Mahilyowskaya Voblasts\'', '07' => 'Vitsyebskaya Voblasts\'' }, 'BZ' => { '01' => 'Belize', '02' => 'Cayo', '03' => 'Corozal', '04' => 'Orange Walk', '05' => 'Stann Creek', '06' => 'Toledo' }, 'CA' => { 'AB' => 'Alberta', 'BC' => 'British Columbia', 'MB' => 'Manitoba', 'NB' => 'New Brunswick', 'NL' => 'Newfoundland', 'NS' => 'Nova Scotia', 'NT' => 'Northwest Territories', 'NU' => 'Nunavut', 'ON' => 'Ontario', 'PE' => 'Prince Edward Island', 'QC' => 'Quebec', 'SK' => 'Saskatchewan', 'YT' => 'Yukon Territory' }, 'CD' => { '01' => 'Bandundu', '02' => 'Equateur', '04' => 'Kasai-Oriental', '05' => 'Katanga', '06' => 'Kinshasa', '08' => 'Bas-Congo', '09' => 'Orientale', '10' => 'Maniema', '11' => 'Nord-Kivu', '12' => 'Sud-Kivu' }, 'CF' => { '01' => 'Bamingui-Bangoran', '02' => 'Basse-Kotto', '03' => 'Haute-Kotto', '04' => 'Mambere-Kadei', '05' => 'Haut-Mbomou', '06' => 'Kemo', '07' => 'Lobaye', '08' => 'Mbomou', '09' => 'Nana-Mambere', '11' => 'Ouaka', '12' => 'Ouham', '13' => 'Ouham-Pende', '14' => 'Cuvette-Ouest', '15' => 'Nana-Grebizi', '16' => 'Sangha-Mbaere', '17' => 'Ombella-Mpoko', '18' => 'Bangui' }, 'CG' => { '01' => 'Bouenza', '04' => 'Kouilou', '05' => 'Lekoumou', '06' => 'Likouala', '07' => 'Niari', '08' => 'Plateaux', '10' => 'Sangha', '11' => 'Pool', '12' => 'Brazzaville', '13' => 'Cuvette', '14' => 'Cuvette-Ouest' }, 'CH' => { '01' => 'Aargau', '02' => 'Ausser-Rhoden', '03' => 'Basel-Landschaft', '04' => 'Basel-Stadt', '05' => 'Bern', '06' => 'Fribourg', '07' => 'Geneve', '08' => 'Glarus', '09' => 'Graubunden', '10' => 'Inner-Rhoden', '11' => 'Luzern', '12' => 'Neuchatel', '13' => 'Nidwalden', '14' => 'Obwalden', '15' => 'Sankt Gallen', '16' => 'Schaffhausen', '17' => 'Schwyz', '18' => 'Solothurn', '19' => 'Thurgau', '20' => 'Ticino', '21' => 'Uri', '22' => 'Valais', '23' => 'Vaud', '24' => 'Zug', '25' => 'Zurich', '26' => 'Jura' }, 'CI' => { '74' => 'Agneby', '75' => 'Bafing', '76' => 'Bas-Sassandra', '77' => 'Denguele', '78' => 'Dix-Huit Montagnes', '79' => 'Fromager', '80' => 'Haut-Sassandra', '81' => 'Lacs', '82' => 'Lagunes', '83' => 'Marahoue', '84' => 'Moyen-Cavally', '85' => 'Moyen-Comoe', '86' => 'N\'zi-Comoe', '87' => 'Savanes', '88' => 'Sud-Bandama', '89' => 'Sud-Comoe', '90' => 'Vallee du Bandama', '91' => 'Worodougou', '92' => 'Zanzan' }, 'CL' => { '01' => 'Valparaiso', '02' => 'Aisen del General Carlos Ibanez del Campo', '03' => 'Antofagasta', '04' => 'Araucania', '05' => 'Atacama', '06' => 'Bio-Bio', '07' => 'Coquimbo', '08' => 'Libertador General Bernardo O\'Higgins', '09' => 'Los Lagos', '10' => 'Magallanes y de la Antartica Chilena', '11' => 'Maule', '12' => 'Region Metropolitana', '13' => 'Tarapaca', '14' => 'Los Lagos', '15' => 'Tarapaca', '16' => 'Arica y Parinacota', '17' => 'Los Rios' }, 'CM' => { '04' => 'Est', '05' => 'Littoral', '07' => 'Nord-Ouest', '08' => 'Ouest', '09' => 'Sud-Ouest', '10' => 'Adamaoua', '11' => 'Centre', '12' => 'Extreme-Nord', '13' => 'Nord', '14' => 'Sud' }, 'CN' => { '01' => 'Anhui', '02' => 'Zhejiang', '03' => 'Jiangxi', '04' => 'Jiangsu', '05' => 'Jilin', '06' => 'Qinghai', '07' => 'Fujian', '08' => 'Heilongjiang', '09' => 'Henan', '10' => 'Hebei', '11' => 'Hunan', '12' => 'Hubei', '13' => 'Xinjiang', '14' => 'Xizang', '15' => 'Gansu', '16' => 'Guangxi', '18' => 'Guizhou', '19' => 'Liaoning', '20' => 'Nei Mongol', '21' => 'Ningxia', '22' => 'Beijing', '23' => 'Shanghai', '24' => 'Shanxi', '25' => 'Shandong', '26' => 'Shaanxi', '28' => 'Tianjin', '29' => 'Yunnan', '30' => 'Guangdong', '31' => 'Hainan', '32' => 'Sichuan', '33' => 'Chongqing' }, 'CO' => { '01' => 'Amazonas', '02' => 'Antioquia', '03' => 'Arauca', '04' => 'Atlantico', '08' => 'Caqueta', '09' => 'Cauca', '10' => 'Cesar', '11' => 'Choco', '12' => 'Cordoba', '14' => 'Guaviare', '15' => 'Guainia', '16' => 'Huila', '17' => 'La Guajira', '19' => 'Meta', '20' => 'Narino', '21' => 'Norte de Santander', '22' => 'Putumayo', '23' => 'Quindio', '24' => 'Risaralda', '25' => 'San Andres y Providencia', '26' => 'Santander', '27' => 'Sucre', '28' => 'Tolima', '29' => 'Valle del Cauca', '30' => 'Vaupes', '31' => 'Vichada', '32' => 'Casanare', '33' => 'Cundinamarca', '34' => 'Distrito Especial', '35' => 'Bolivar', '36' => 'Boyaca', '37' => 'Caldas', '38' => 'Magdalena' }, 'CR' => { '01' => 'Alajuela', '02' => 'Cartago', '03' => 'Guanacaste', '04' => 'Heredia', '06' => 'Limon', '07' => 'Puntarenas', '08' => 'San Jose' }, 'CU' => { '01' => 'Pinar del Rio', '02' => 'Ciudad de la Habana', '03' => 'Matanzas', '04' => 'Isla de la Juventud', '05' => 'Camaguey', '07' => 'Ciego de Avila', '08' => 'Cienfuegos', '09' => 'Granma', '10' => 'Guantanamo', '11' => 'La Habana', '12' => 'Holguin', '13' => 'Las Tunas', '14' => 'Sancti Spiritus', '15' => 'Santiago de Cuba', '16' => 'Villa Clara' }, 'CV' => { '01' => 'Boa Vista', '02' => 'Brava', '04' => 'Maio', '05' => 'Paul', '07' => 'Ribeira Grande', '08' => 'Sal', '10' => 'Sao Nicolau', '11' => 'Sao Vicente', '13' => 'Mosteiros', '14' => 'Praia', '15' => 'Santa Catarina', '16' => 'Santa Cruz', '17' => 'Sao Domingos', '18' => 'Sao Filipe', '19' => 'Sao Miguel', '20' => 'Tarrafal' }, 'CY' => { '01' => 'Famagusta', '02' => 'Kyrenia', '03' => 'Larnaca', '04' => 'Nicosia', '05' => 'Limassol', '06' => 'Paphos' }, 'CZ' => { '52' => 'Hlavni mesto Praha', '78' => 'Jihomoravsky kraj', '79' => 'Jihocesky kraj', '80' => 'Vysocina', '81' => 'Karlovarsky kraj', '82' => 'Kralovehradecky kraj', '83' => 'Liberecky kraj', '84' => 'Olomoucky kraj', '85' => 'Moravskoslezsky kraj', '86' => 'Pardubicky kraj', '87' => 'Plzensky kraj', '88' => 'Stredocesky kraj', '89' => 'Ustecky kraj', '90' => 'Zlinsky kraj' }, 'DE' => { '01' => 'Baden-Wurttemberg', '02' => 'Bayern', '03' => 'Bremen', '04' => 'Hamburg', '05' => 'Hessen', '06' => 'Niedersachsen', '07' => 'Nordrhein-Westfalen', '08' => 'Rheinland-Pfalz', '09' => 'Saarland', '10' => 'Schleswig-Holstein', '11' => 'Brandenburg', '12' => 'Mecklenburg-Vorpommern', '13' => 'Sachsen', '14' => 'Sachsen-Anhalt', '15' => 'Thuringen', '16' => 'Berlin' }, 'DJ' => { '01' => 'Ali Sabieh', '04' => 'Obock', '05' => 'Tadjoura', '06' => 'Dikhil', '07' => 'Djibouti', '08' => 'Arta' }, 'DK' => { '17' => 'Hovedstaden', '18' => 'Midtjylland', '19' => 'Nordjylland', '20' => 'Sjelland', '21' => 'Syddanmark' }, 'DM' => { '02' => 'Saint Andrew', '03' => 'Saint David', '04' => 'Saint George', '05' => 'Saint John', '06' => 'Saint Joseph', '07' => 'Saint Luke', '08' => 'Saint Mark', '09' => 'Saint Patrick', '10' => 'Saint Paul', '11' => 'Saint Peter' }, 'DO' => { '01' => 'Azua', '02' => 'Baoruco', '03' => 'Barahona', '04' => 'Dajabon', '05' => 'Distrito Nacional', '06' => 'Duarte', '08' => 'Espaillat', '09' => 'Independencia', '10' => 'La Altagracia', '11' => 'Elias Pina', '12' => 'La Romana', '14' => 'Maria Trinidad Sanchez', '15' => 'Monte Cristi', '16' => 'Pedernales', '17' => 'Peravia', '18' => 'Puerto Plata', '19' => 'Salcedo', '20' => 'Samana', '21' => 'Sanchez Ramirez', '23' => 'San Juan', '24' => 'San Pedro De Macoris', '25' => 'Santiago', '26' => 'Santiago Rodriguez', '27' => 'Valverde', '28' => 'El Seibo', '29' => 'Hato Mayor', '30' => 'La Vega', '31' => 'Monsenor Nouel', '32' => 'Monte Plata', '33' => 'San Cristobal', '34' => 'Distrito Nacional', '35' => 'Peravia', '36' => 'San Jose de Ocoa', '37' => 'Santo Domingo' }, 'DZ' => { '01' => 'Alger', '03' => 'Batna', '04' => 'Constantine', '06' => 'Medea', '07' => 'Mostaganem', '09' => 'Oran', '10' => 'Saida', '12' => 'Setif', '13' => 'Tiaret', '14' => 'Tizi Ouzou', '15' => 'Tlemcen', '18' => 'Bejaia', '19' => 'Biskra', '20' => 'Blida', '21' => 'Bouira', '22' => 'Djelfa', '23' => 'Guelma', '24' => 'Jijel', '25' => 'Laghouat', '26' => 'Mascara', '27' => 'M\'sila', '29' => 'Oum el Bouaghi', '30' => 'Sidi Bel Abbes', '31' => 'Skikda', '33' => 'Tebessa', '34' => 'Adrar', '35' => 'Ain Defla', '36' => 'Ain Temouchent', '37' => 'Annaba', '38' => 'Bechar', '39' => 'Bordj Bou Arreridj', '40' => 'Boumerdes', '41' => 'Chlef', '42' => 'El Bayadh', '43' => 'El Oued', '44' => 'El Tarf', '45' => 'Ghardaia', '46' => 'Illizi', '47' => 'Khenchela', '48' => 'Mila', '49' => 'Naama', '50' => 'Ouargla', '51' => 'Relizane', '52' => 'Souk Ahras', '53' => 'Tamanghasset', '54' => 'Tindouf', '55' => 'Tipaza', '56' => 'Tissemsilt' }, 'EC' => { '01' => 'Galapagos', '02' => 'Azuay', '03' => 'Bolivar', '04' => 'Canar', '05' => 'Carchi', '06' => 'Chimborazo', '07' => 'Cotopaxi', '08' => 'El Oro', '09' => 'Esmeraldas', '10' => 'Guayas', '11' => 'Imbabura', '12' => 'Loja', '13' => 'Los Rios', '14' => 'Manabi', '15' => 'Morona-Santiago', '17' => 'Pastaza', '18' => 'Pichincha', '19' => 'Tungurahua', '20' => 'Zamora-Chinchipe', '22' => 'Sucumbios', '23' => 'Napo', '24' => 'Orellana' }, 'EE' => { '01' => 'Harjumaa', '02' => 'Hiiumaa', '03' => 'Ida-Virumaa', '04' => 'Jarvamaa', '05' => 'Jogevamaa', '06' => 'Kohtla-Jarve', '07' => 'Laanemaa', '08' => 'Laane-Virumaa', '09' => 'Narva', '10' => 'Parnu', '11' => 'Parnumaa', '12' => 'Polvamaa', '13' => 'Raplamaa', '14' => 'Saaremaa', '15' => 'Sillamae', '16' => 'Tallinn', '17' => 'Tartu', '18' => 'Tartumaa', '19' => 'Valgamaa', '20' => 'Viljandimaa', '21' => 'Vorumaa' }, 'EG' => { '01' => 'Ad Daqahliyah', '02' => 'Al Bahr al Ahmar', '03' => 'Al Buhayrah', '04' => 'Al Fayyum', '05' => 'Al Gharbiyah', '06' => 'Al Iskandariyah', '07' => 'Al Isma\'iliyah', '08' => 'Al Jizah', '09' => 'Al Minufiyah', '10' => 'Al Minya', '11' => 'Al Qahirah', '12' => 'Al Qalyubiyah', '13' => 'Al Wadi al Jadid', '14' => 'Ash Sharqiyah', '15' => 'As Suways', '16' => 'Aswan', '17' => 'Asyut', '18' => 'Bani Suwayf', '19' => 'Bur Sa\'id', '20' => 'Dumyat', '21' => 'Kafr ash Shaykh', '22' => 'Matruh', '23' => 'Qina', '24' => 'Suhaj', '26' => 'Janub Sina\'', '27' => 'Shamal Sina\'', '28' => 'Al Uqsur' }, 'ER' => { '01' => 'Anseba', '02' => 'Debub', '03' => 'Debubawi K\'eyih Bahri', '04' => 'Gash Barka', '05' => 'Ma\'akel', '06' => 'Semenawi K\'eyih Bahri' }, 'ES' => { '07' => 'Islas Baleares', '27' => 'La Rioja', '29' => 'Madrid', '31' => 'Murcia', '32' => 'Navarra', '34' => 'Asturias', '39' => 'Cantabria', '51' => 'Andalucia', '52' => 'Aragon', '53' => 'Canarias', '54' => 'Castilla-La Mancha', '55' => 'Castilla y Leon', '56' => 'Catalonia', '57' => 'Extremadura', '58' => 'Galicia', '59' => 'Pais Vasco', '60' => 'Comunidad Valenciana' }, 'ET' => { '44' => 'Adis Abeba', '45' => 'Afar', '46' => 'Amara', '47' => 'Binshangul Gumuz', '48' => 'Dire Dawa', '49' => 'Gambela Hizboch', '50' => 'Hareri Hizb', '51' => 'Oromiya', '52' => 'Sumale', '53' => 'Tigray', '54' => 'YeDebub Biheroch Bihereseboch na Hizboch' }, 'FI' => { '01' => 'Aland', '06' => 'Lapland', '08' => 'Oulu', '13' => 'Southern Finland', '14' => 'Eastern Finland', '15' => 'Western Finland' }, 'FJ' => { '01' => 'Central', '02' => 'Eastern', '03' => 'Northern', '04' => 'Rotuma', '05' => 'Western' }, 'FM' => { '01' => 'Kosrae', '02' => 'Pohnpei', '03' => 'Chuuk', '04' => 'Yap' }, 'FR' => { '97' => 'Aquitaine', '98' => 'Auvergne', '99' => 'Basse-Normandie', 'A1' => 'Bourgogne', 'A2' => 'Bretagne', 'A3' => 'Centre', 'A4' => 'Champagne-Ardenne', 'A5' => 'Corse', 'A6' => 'Franche-Comte', 'A7' => 'Haute-Normandie', 'A8' => 'Ile-de-France', 'A9' => 'Languedoc-Roussillon', 'B1' => 'Limousin', 'B2' => 'Lorraine', 'B3' => 'Midi-Pyrenees', 'B4' => 'Nord-Pas-de-Calais', 'B5' => 'Pays de la Loire', 'B6' => 'Picardie', 'B7' => 'Poitou-Charentes', 'B8' => 'Provence-Alpes-Cote d\'Azur', 'B9' => 'Rhone-Alpes', 'C1' => 'Alsace' }, 'GA' => { '01' => 'Estuaire', '02' => 'Haut-Ogooue', '03' => 'Moyen-Ogooue', '04' => 'Ngounie', '05' => 'Nyanga', '06' => 'Ogooue-Ivindo', '07' => 'Ogooue-Lolo', '08' => 'Ogooue-Maritime', '09' => 'Woleu-Ntem' }, 'GB' => { 'A1' => 'Barking and Dagenham', 'A2' => 'Barnet', 'A3' => 'Barnsley', 'A4' => 'Bath and North East Somerset', 'A5' => 'Bedfordshire', 'A6' => 'Bexley', 'A7' => 'Birmingham', 'A8' => 'Blackburn with Darwen', 'A9' => 'Blackpool', 'B1' => 'Bolton', 'B2' => 'Bournemouth', 'B3' => 'Bracknell Forest', 'B4' => 'Bradford', 'B5' => 'Brent', 'B6' => 'Brighton and Hove', 'B7' => 'Bristol, City of', 'B8' => 'Bromley', 'B9' => 'Buckinghamshire', 'C1' => 'Bury', 'C2' => 'Calderdale', 'C3' => 'Cambridgeshire', 'C4' => 'Camden', 'C5' => 'Cheshire', 'C6' => 'Cornwall', 'C7' => 'Coventry', 'C8' => 'Croydon', 'C9' => 'Cumbria', 'D1' => 'Darlington', 'D2' => 'Derby', 'D3' => 'Derbyshire', 'D4' => 'Devon', 'D5' => 'Doncaster', 'D6' => 'Dorset', 'D7' => 'Dudley', 'D8' => 'Durham', 'D9' => 'Ealing', 'E1' => 'East Riding of Yorkshire', 'E2' => 'East Sussex', 'E3' => 'Enfield', 'E4' => 'Essex', 'E5' => 'Gateshead', 'E6' => 'Gloucestershire', 'E7' => 'Greenwich', 'E8' => 'Hackney', 'E9' => 'Halton', 'F1' => 'Hammersmith and Fulham', 'F2' => 'Hampshire', 'F3' => 'Haringey', 'F4' => 'Harrow', 'F5' => 'Hartlepool', 'F6' => 'Havering', 'F7' => 'Herefordshire', 'F8' => 'Hertford', 'F9' => 'Hillingdon', 'G1' => 'Hounslow', 'G2' => 'Isle of Wight', 'G3' => 'Islington', 'G4' => 'Kensington and Chelsea', 'G5' => 'Kent', 'G6' => 'Kingston upon Hull, City of', 'G7' => 'Kingston upon Thames', 'G8' => 'Kirklees', 'G9' => 'Knowsley', 'H1' => 'Lambeth', 'H2' => 'Lancashire', 'H3' => 'Leeds', 'H4' => 'Leicester', 'H5' => 'Leicestershire', 'H6' => 'Lewisham', 'H7' => 'Lincolnshire', 'H8' => 'Liverpool', 'H9' => 'London, City of', 'I1' => 'Luton', 'I2' => 'Manchester', 'I3' => 'Medway', 'I4' => 'Merton', 'I5' => 'Middlesbrough', 'I6' => 'Milton Keynes', 'I7' => 'Newcastle upon Tyne', 'I8' => 'Newham', 'I9' => 'Norfolk', 'J1' => 'Northamptonshire', 'J2' => 'North East Lincolnshire', 'J3' => 'North Lincolnshire', 'J4' => 'North Somerset', 'J5' => 'North Tyneside', 'J6' => 'Northumberland', 'J7' => 'North Yorkshire', 'J8' => 'Nottingham', 'J9' => 'Nottinghamshire', 'K1' => 'Oldham', 'K2' => 'Oxfordshire', 'K3' => 'Peterborough', 'K4' => 'Plymouth', 'K5' => 'Poole', 'K6' => 'Portsmouth', 'K7' => 'Reading', 'K8' => 'Redbridge', 'K9' => 'Redcar and Cleveland', 'L1' => 'Richmond upon Thames', 'L2' => 'Rochdale', 'L3' => 'Rotherham', 'L4' => 'Rutland', 'L5' => 'Salford', 'L6' => 'Shropshire', 'L7' => 'Sandwell', 'L8' => 'Sefton', 'L9' => 'Sheffield', 'M1' => 'Slough', 'M2' => 'Solihull', 'M3' => 'Somerset', 'M4' => 'Southampton', 'M5' => 'Southend-on-Sea', 'M6' => 'South Gloucestershire', 'M7' => 'South Tyneside', 'M8' => 'Southwark', 'M9' => 'Staffordshire', 'N1' => 'St. Helens', 'N2' => 'Stockport', 'N3' => 'Stockton-on-Tees', 'N4' => 'Stoke-on-Trent', 'N5' => 'Suffolk', 'N6' => 'Sunderland', 'N7' => 'Surrey', 'N8' => 'Sutton', 'N9' => 'Swindon', 'O1' => 'Tameside', 'O2' => 'Telford and Wrekin', 'O3' => 'Thurrock', 'O4' => 'Torbay', 'O5' => 'Tower Hamlets', 'O6' => 'Trafford', 'O7' => 'Wakefield', 'O8' => 'Walsall', 'O9' => 'Waltham Forest', 'P1' => 'Wandsworth', 'P2' => 'Warrington', 'P3' => 'Warwickshire', 'P4' => 'West Berkshire', 'P5' => 'Westminster', 'P6' => 'West Sussex', 'P7' => 'Wigan', 'P8' => 'Wiltshire', 'P9' => 'Windsor and Maidenhead', 'Q1' => 'Wirral', 'Q2' => 'Wokingham', 'Q3' => 'Wolverhampton', 'Q4' => 'Worcestershire', 'Q5' => 'York', 'Q6' => 'Antrim', 'Q7' => 'Ards', 'Q8' => 'Armagh', 'Q9' => 'Ballymena', 'R1' => 'Ballymoney', 'R2' => 'Banbridge', 'R3' => 'Belfast', 'R4' => 'Carrickfergus', 'R5' => 'Castlereagh', 'R6' => 'Coleraine', 'R7' => 'Cookstown', 'R8' => 'Craigavon', 'R9' => 'Down', 'S1' => 'Dungannon', 'S2' => 'Fermanagh', 'S3' => 'Larne', 'S4' => 'Limavady', 'S5' => 'Lisburn', 'S6' => 'Derry', 'S7' => 'Magherafelt', 'S8' => 'Moyle', 'S9' => 'Newry and Mourne', 'T1' => 'Newtownabbey', 'T2' => 'North Down', 'T3' => 'Omagh', 'T4' => 'Strabane', 'T5' => 'Aberdeen City', 'T6' => 'Aberdeenshire', 'T7' => 'Angus', 'T8' => 'Argyll and Bute', 'T9' => 'Scottish Borders, The', 'U1' => 'Clackmannanshire', 'U2' => 'Dumfries and Galloway', 'U3' => 'Dundee City', 'U4' => 'East Ayrshire', 'U5' => 'East Dunbartonshire', 'U6' => 'East Lothian', 'U7' => 'East Renfrewshire', 'U8' => 'Edinburgh, City of', 'U9' => 'Falkirk', 'V1' => 'Fife', 'V2' => 'Glasgow City', 'V3' => 'Highland', 'V4' => 'Inverclyde', 'V5' => 'Midlothian', 'V6' => 'Moray', 'V7' => 'North Ayrshire', 'V8' => 'North Lanarkshire', 'V9' => 'Orkney', 'W1' => 'Perth and Kinross', 'W2' => 'Renfrewshire', 'W3' => 'Shetland Islands', 'W4' => 'South Ayrshire', 'W5' => 'South Lanarkshire', 'W6' => 'Stirling', 'W7' => 'West Dunbartonshire', 'W8' => 'Eilean Siar', 'W9' => 'West Lothian', 'X1' => 'Isle of Anglesey', 'X2' => 'Blaenau Gwent', 'X3' => 'Bridgend', 'X4' => 'Caerphilly', 'X5' => 'Cardiff', 'X6' => 'Ceredigion', 'X7' => 'Carmarthenshire', 'X8' => 'Conwy', 'X9' => 'Denbighshire', 'Y1' => 'Flintshire', 'Y2' => 'Gwynedd', 'Y3' => 'Merthyr Tydfil', 'Y4' => 'Monmouthshire', 'Y5' => 'Neath Port Talbot', 'Y6' => 'Newport', 'Y7' => 'Pembrokeshire', 'Y8' => 'Powys', 'Y9' => 'Rhondda Cynon Taff', 'Z1' => 'Swansea', 'Z2' => 'Torfaen', 'Z3' => 'Vale of Glamorgan, The', 'Z4' => 'Wrexham', 'Z5' => 'Bedfordshire', 'Z6' => 'Central Bedfordshire', 'Z7' => 'Cheshire East', 'Z8' => 'Cheshire West and Chester', 'Z9' => 'Isles of Scilly' }, 'GD' => { '01' => 'Saint Andrew', '02' => 'Saint David', '03' => 'Saint George', '04' => 'Saint John', '05' => 'Saint Mark', '06' => 'Saint Patrick' }, 'GE' => { '01' => 'Abashis Raioni', '02' => 'Abkhazia', '03' => 'Adigenis Raioni', '04' => 'Ajaria', '05' => 'Akhalgoris Raioni', '06' => 'Akhalk\'alak\'is Raioni', '07' => 'Akhalts\'ikhis Raioni', '08' => 'Akhmetis Raioni', '09' => 'Ambrolauris Raioni', '10' => 'Aspindzis Raioni', '11' => 'Baghdat\'is Raioni', '12' => 'Bolnisis Raioni', '13' => 'Borjomis Raioni', '14' => 'Chiat\'ura', '15' => 'Ch\'khorotsqus Raioni', '16' => 'Ch\'okhatauris Raioni', '17' => 'Dedop\'listsqaros Raioni', '18' => 'Dmanisis Raioni', '19' => 'Dushet\'is Raioni', '20' => 'Gardabanis Raioni', '21' => 'Gori', '22' => 'Goris Raioni', '23' => 'Gurjaanis Raioni', '24' => 'Javis Raioni', '25' => 'K\'arelis Raioni', '26' => 'Kaspis Raioni', '27' => 'Kharagaulis Raioni', '28' => 'Khashuris Raioni', '29' => 'Khobis Raioni', '30' => 'Khonis Raioni', '31' => 'K\'ut\'aisi', '32' => 'Lagodekhis Raioni', '33' => 'Lanch\'khut\'is Raioni', '34' => 'Lentekhis Raioni', '35' => 'Marneulis Raioni', '36' => 'Martvilis Raioni', '37' => 'Mestiis Raioni', '38' => 'Mts\'khet\'is Raioni', '39' => 'Ninotsmindis Raioni', '40' => 'Onis Raioni', '41' => 'Ozurget\'is Raioni', '42' => 'P\'ot\'i', '43' => 'Qazbegis Raioni', '44' => 'Qvarlis Raioni', '45' => 'Rust\'avi', '46' => 'Sach\'kheris Raioni', '47' => 'Sagarejos Raioni', '48' => 'Samtrediis Raioni', '49' => 'Senakis Raioni', '50' => 'Sighnaghis Raioni', '51' => 'T\'bilisi', '52' => 'T\'elavis Raioni', '53' => 'T\'erjolis Raioni', '54' => 'T\'et\'ritsqaros Raioni', '55' => 'T\'ianet\'is Raioni', '56' => 'Tqibuli', '57' => 'Ts\'ageris Raioni', '58' => 'Tsalenjikhis Raioni', '59' => 'Tsalkis Raioni', '60' => 'Tsqaltubo', '61' => 'Vanis Raioni', '62' => 'Zestap\'onis Raioni', '63' => 'Zugdidi', '64' => 'Zugdidis Raioni' }, 'GH' => { '01' => 'Greater Accra', '02' => 'Ashanti', '03' => 'Brong-Ahafo', '04' => 'Central', '05' => 'Eastern', '06' => 'Northern', '08' => 'Volta', '09' => 'Western', '10' => 'Upper East', '11' => 'Upper West' }, 'GL' => { '01' => 'Nordgronland', '02' => 'Ostgronland', '03' => 'Vestgronland' }, 'GM' => { '01' => 'Banjul', '02' => 'Lower River', '03' => 'Central River', '04' => 'Upper River', '05' => 'Western', '07' => 'North Bank' }, 'GN' => { '01' => 'Beyla', '02' => 'Boffa', '03' => 'Boke', '04' => 'Conakry', '05' => 'Dabola', '06' => 'Dalaba', '07' => 'Dinguiraye', '09' => 'Faranah', '10' => 'Forecariah', '11' => 'Fria', '12' => 'Gaoual', '13' => 'Gueckedou', '15' => 'Kerouane', '16' => 'Kindia', '17' => 'Kissidougou', '18' => 'Koundara', '19' => 'Kouroussa', '21' => 'Macenta', '22' => 'Mali', '23' => 'Mamou', '25' => 'Pita', '27' => 'Telimele', '28' => 'Tougue', '29' => 'Yomou', '30' => 'Coyah', '31' => 'Dubreka', '32' => 'Kankan', '33' => 'Koubia', '34' => 'Labe', '35' => 'Lelouma', '36' => 'Lola', '37' => 'Mandiana', '38' => 'Nzerekore', '39' => 'Siguiri' }, 'GQ' => { '03' => 'Annobon', '04' => 'Bioko Norte', '05' => 'Bioko Sur', '06' => 'Centro Sur', '07' => 'Kie-Ntem', '08' => 'Litoral', '09' => 'Wele-Nzas' }, 'GR' => { '01' => 'Evros', '02' => 'Rodhopi', '03' => 'Xanthi', '04' => 'Drama', '05' => 'Serrai', '06' => 'Kilkis', '07' => 'Pella', '08' => 'Florina', '09' => 'Kastoria', '10' => 'Grevena', '11' => 'Kozani', '12' => 'Imathia', '13' => 'Thessaloniki', '14' => 'Kavala', '15' => 'Khalkidhiki', '16' => 'Pieria', '17' => 'Ioannina', '18' => 'Thesprotia', '19' => 'Preveza', '20' => 'Arta', '21' => 'Larisa', '22' => 'Trikala', '23' => 'Kardhitsa', '24' => 'Magnisia', '25' => 'Kerkira', '26' => 'Levkas', '27' => 'Kefallinia', '28' => 'Zakinthos', '29' => 'Fthiotis', '30' => 'Evritania', '31' => 'Aitolia kai Akarnania', '32' => 'Fokis', '33' => 'Voiotia', '34' => 'Evvoia', '35' => 'Attiki', '36' => 'Argolis', '37' => 'Korinthia', '38' => 'Akhaia', '39' => 'Ilia', '40' => 'Messinia', '41' => 'Arkadhia', '42' => 'Lakonia', '43' => 'Khania', '44' => 'Rethimni', '45' => 'Iraklion', '46' => 'Lasithi', '47' => 'Dhodhekanisos', '48' => 'Samos', '49' => 'Kikladhes', '50' => 'Khios', '51' => 'Lesvos' }, 'GT' => { '01' => 'Alta Verapaz', '02' => 'Baja Verapaz', '03' => 'Chimaltenango', '04' => 'Chiquimula', '05' => 'El Progreso', '06' => 'Escuintla', '07' => 'Guatemala', '08' => 'Huehuetenango', '09' => 'Izabal', '10' => 'Jalapa', '11' => 'Jutiapa', '12' => 'Peten', '13' => 'Quetzaltenango', '14' => 'Quiche', '15' => 'Retalhuleu', '16' => 'Sacatepequez', '17' => 'San Marcos', '18' => 'Santa Rosa', '19' => 'Solola', '20' => 'Suchitepequez', '21' => 'Totonicapan', '22' => 'Zacapa' }, 'GW' => { '01' => 'Bafata', '02' => 'Quinara', '04' => 'Oio', '05' => 'Bolama', '06' => 'Cacheu', '07' => 'Tombali', '10' => 'Gabu', '11' => 'Bissau', '12' => 'Biombo' }, 'GY' => { '10' => 'Barima-Waini', '11' => 'Cuyuni-Mazaruni', '12' => 'Demerara-Mahaica', '13' => 'East Berbice-Corentyne', '14' => 'Essequibo Islands-West Demerara', '15' => 'Mahaica-Berbice', '16' => 'Pomeroon-Supenaam', '17' => 'Potaro-Siparuni', '18' => 'Upper Demerara-Berbice', '19' => 'Upper Takutu-Upper Essequibo' }, 'HN' => { '01' => 'Atlantida', '02' => 'Choluteca', '03' => 'Colon', '04' => 'Comayagua', '05' => 'Copan', '06' => 'Cortes', '07' => 'El Paraiso', '08' => 'Francisco Morazan', '09' => 'Gracias a Dios', '10' => 'Intibuca', '11' => 'Islas de la Bahia', '12' => 'La Paz', '13' => 'Lempira', '14' => 'Ocotepeque', '15' => 'Olancho', '16' => 'Santa Barbara', '17' => 'Valle', '18' => 'Yoro' }, 'HR' => { '01' => 'Bjelovarsko-Bilogorska', '02' => 'Brodsko-Posavska', '03' => 'Dubrovacko-Neretvanska', '04' => 'Istarska', '05' => 'Karlovacka', '06' => 'Koprivnicko-Krizevacka', '07' => 'Krapinsko-Zagorska', '08' => 'Licko-Senjska', '09' => 'Medimurska', '10' => 'Osjecko-Baranjska', '11' => 'Pozesko-Slavonska', '12' => 'Primorsko-Goranska', '13' => 'Sibensko-Kninska', '14' => 'Sisacko-Moslavacka', '15' => 'Splitsko-Dalmatinska', '16' => 'Varazdinska', '17' => 'Viroviticko-Podravska', '18' => 'Vukovarsko-Srijemska', '19' => 'Zadarska', '20' => 'Zagrebacka', '21' => 'Grad Zagreb' }, 'HT' => { '03' => 'Nord-Ouest', '06' => 'Artibonite', '07' => 'Centre', '09' => 'Nord', '10' => 'Nord-Est', '11' => 'Ouest', '12' => 'Sud', '13' => 'Sud-Est', '14' => 'Grand\' Anse', '15' => 'Nippes' }, 'HU' => { '01' => 'Bacs-Kiskun', '02' => 'Baranya', '03' => 'Bekes', '04' => 'Borsod-Abauj-Zemplen', '05' => 'Budapest', '06' => 'Csongrad', '07' => 'Debrecen', '08' => 'Fejer', '09' => 'Gyor-Moson-Sopron', '10' => 'Hajdu-Bihar', '11' => 'Heves', '12' => 'Komarom-Esztergom', '13' => 'Miskolc', '14' => 'Nograd', '15' => 'Pecs', '16' => 'Pest', '17' => 'Somogy', '18' => 'Szabolcs-Szatmar-Bereg', '19' => 'Szeged', '20' => 'Jasz-Nagykun-Szolnok', '21' => 'Tolna', '22' => 'Vas', '23' => 'Veszprem', '24' => 'Zala', '25' => 'Gyor', '26' => 'Bekescsaba', '27' => 'Dunaujvaros', '28' => 'Eger', '29' => 'Hodmezovasarhely', '30' => 'Kaposvar', '31' => 'Kecskemet', '32' => 'Nagykanizsa', '33' => 'Nyiregyhaza', '34' => 'Sopron', '35' => 'Szekesfehervar', '36' => 'Szolnok', '37' => 'Szombathely', '38' => 'Tatabanya', '39' => 'Veszprem', '40' => 'Zalaegerszeg', '41' => 'Salgotarjan', '42' => 'Szekszard', '43' => 'Erd' }, 'ID' => { '01' => 'Aceh', '02' => 'Bali', '03' => 'Bengkulu', '04' => 'Jakarta Raya', '05' => 'Jambi', '07' => 'Jawa Tengah', '08' => 'Jawa Timur', '10' => 'Yogyakarta', '11' => 'Kalimantan Barat', '12' => 'Kalimantan Selatan', '13' => 'Kalimantan Tengah', '14' => 'Kalimantan Timur', '15' => 'Lampung', '17' => 'Nusa Tenggara Barat', '18' => 'Nusa Tenggara Timur', '21' => 'Sulawesi Tengah', '22' => 'Sulawesi Tenggara', '24' => 'Sumatera Barat', '26' => 'Sumatera Utara', '28' => 'Maluku', '29' => 'Maluku Utara', '30' => 'Jawa Barat', '31' => 'Sulawesi Utara', '32' => 'Sumatera Selatan', '33' => 'Banten', '34' => 'Gorontalo', '35' => 'Kepulauan Bangka Belitung', '36' => 'Papua', '37' => 'Riau', '38' => 'Sulawesi Selatan', '39' => 'Irian Jaya Barat', '40' => 'Kepulauan Riau', '41' => 'Sulawesi Barat' }, 'IE' => { '01' => 'Carlow', '02' => 'Cavan', '03' => 'Clare', '04' => 'Cork', '06' => 'Donegal', '07' => 'Dublin', '10' => 'Galway', '11' => 'Kerry', '12' => 'Kildare', '13' => 'Kilkenny', '14' => 'Leitrim', '15' => 'Laois', '16' => 'Limerick', '18' => 'Longford', '19' => 'Louth', '20' => 'Mayo', '21' => 'Meath', '22' => 'Monaghan', '23' => 'Offaly', '24' => 'Roscommon', '25' => 'Sligo', '26' => 'Tipperary', '27' => 'Waterford', '29' => 'Westmeath', '30' => 'Wexford', '31' => 'Wicklow' }, 'IL' => { '01' => 'HaDarom', '02' => 'HaMerkaz', '03' => 'HaZafon', '04' => 'Hefa', '05' => 'Tel Aviv', '06' => 'Yerushalayim' }, 'IN' => { '01' => 'Andaman and Nicobar Islands', '02' => 'Andhra Pradesh', '03' => 'Assam', '05' => 'Chandigarh', '06' => 'Dadra and Nagar Haveli', '07' => 'Delhi', '09' => 'Gujarat', '10' => 'Haryana', '11' => 'Himachal Pradesh', '12' => 'Jammu and Kashmir', '13' => 'Kerala', '14' => 'Lakshadweep', '16' => 'Maharashtra', '17' => 'Manipur', '18' => 'Meghalaya', '19' => 'Karnataka', '20' => 'Nagaland', '21' => 'Orissa', '22' => 'Puducherry', '23' => 'Punjab', '24' => 'Rajasthan', '25' => 'Tamil Nadu', '26' => 'Tripura', '28' => 'West Bengal', '29' => 'Sikkim', '30' => 'Arunachal Pradesh', '31' => 'Mizoram', '32' => 'Daman and Diu', '33' => 'Goa', '34' => 'Bihar', '35' => 'Madhya Pradesh', '36' => 'Uttar Pradesh', '37' => 'Chhattisgarh', '38' => 'Jharkhand', '39' => 'Uttarakhand' }, 'IQ' => { '01' => 'Al Anbar', '02' => 'Al Basrah', '03' => 'Al Muthanna', '04' => 'Al Qadisiyah', '05' => 'As Sulaymaniyah', '06' => 'Babil', '07' => 'Baghdad', '08' => 'Dahuk', '09' => 'Dhi Qar', '10' => 'Diyala', '11' => 'Arbil', '12' => 'Karbala\'', '13' => 'At Ta\'mim', '14' => 'Maysan', '15' => 'Ninawa', '16' => 'Wasit', '17' => 'An Najaf', '18' => 'Salah ad Din' }, 'IR' => { '01' => 'Azarbayjan-e Bakhtari', '03' => 'Chahar Mahall va Bakhtiari', '04' => 'Sistan va Baluchestan', '05' => 'Kohkiluyeh va Buyer Ahmadi', '07' => 'Fars', '08' => 'Gilan', '09' => 'Hamadan', '10' => 'Ilam', '11' => 'Hormozgan', '12' => 'Kerman', '13' => 'Bakhtaran', '15' => 'Khuzestan', '16' => 'Kordestan', '17' => 'Mazandaran', '18' => 'Semnan Province', '19' => 'Markazi', '21' => 'Zanjan', '22' => 'Bushehr', '23' => 'Lorestan', '24' => 'Markazi', '25' => 'Semnan', '26' => 'Tehran', '27' => 'Zanjan', '28' => 'Esfahan', '29' => 'Kerman', '30' => 'Khorasan', '31' => 'Yazd', '32' => 'Ardabil', '33' => 'East Azarbaijan', '34' => 'Markazi', '35' => 'Mazandaran', '36' => 'Zanjan', '37' => 'Golestan', '38' => 'Qazvin', '39' => 'Qom', '40' => 'Yazd', '41' => 'Khorasan-e Janubi', '42' => 'Khorasan-e Razavi', '43' => 'Khorasan-e Shemali', '44' => 'Alborz' }, 'IS' => { '03' => 'Arnessysla', '05' => 'Austur-Hunavatnssysla', '06' => 'Austur-Skaftafellssysla', '07' => 'Borgarfjardarsysla', '09' => 'Eyjafjardarsysla', '10' => 'Gullbringusysla', '15' => 'Kjosarsysla', '17' => 'Myrasysla', '20' => 'Nordur-Mulasysla', '21' => 'Nordur-Tingeyjarsysla', '23' => 'Rangarvallasysla', '28' => 'Skagafjardarsysla', '29' => 'Snafellsnes- og Hnappadalssysla', '30' => 'Strandasysla', '31' => 'Sudur-Mulasysla', '32' => 'Sudur-Tingeyjarsysla', '34' => 'Vestur-Bardastrandarsysla', '35' => 'Vestur-Hunavatnssysla', '36' => 'Vestur-Isafjardarsysla', '37' => 'Vestur-Skaftafellssysla', '38' => 'Austurland', '39' => 'Hofuoborgarsvaoio', '40' => 'Norourland Eystra', '41' => 'Norourland Vestra', '42' => 'Suourland', '43' => 'Suournes', '44' => 'Vestfiroir', '45' => 'Vesturland' }, 'IT' => { '01' => 'Abruzzi', '02' => 'Basilicata', '03' => 'Calabria', '04' => 'Campania', '05' => 'Emilia-Romagna', '06' => 'Friuli-Venezia Giulia', '07' => 'Lazio', '08' => 'Liguria', '09' => 'Lombardia', '10' => 'Marche', '11' => 'Molise', '12' => 'Piemonte', '13' => 'Puglia', '14' => 'Sardegna', '15' => 'Sicilia', '16' => 'Toscana', '17' => 'Trentino-Alto Adige', '18' => 'Umbria', '19' => 'Valle d\'Aosta', '20' => 'Veneto' }, 'JM' => { '01' => 'Clarendon', '02' => 'Hanover', '04' => 'Manchester', '07' => 'Portland', '08' => 'Saint Andrew', '09' => 'Saint Ann', '10' => 'Saint Catherine', '11' => 'Saint Elizabeth', '12' => 'Saint James', '13' => 'Saint Mary', '14' => 'Saint Thomas', '15' => 'Trelawny', '16' => 'Westmoreland', '17' => 'Kingston' }, 'JO' => { '02' => 'Al Balqa\'', '09' => 'Al Karak', '12' => 'At Tafilah', '15' => 'Al Mafraq', '16' => 'Amman', '17' => 'Az Zaraqa', '18' => 'Irbid', '19' => 'Ma\'an', '20' => 'Ajlun', '21' => 'Al Aqabah', '22' => 'Jarash', '23' => 'Madaba' }, 'JP' => { '01' => 'Aichi', '02' => 'Akita', '03' => 'Aomori', '04' => 'Chiba', '05' => 'Ehime', '06' => 'Fukui', '07' => 'Fukuoka', '08' => 'Fukushima', '09' => 'Gifu', '10' => 'Gumma', '11' => 'Hiroshima', '12' => 'Hokkaido', '13' => 'Hyogo', '14' => 'Ibaraki', '15' => 'Ishikawa', '16' => 'Iwate', '17' => 'Kagawa', '18' => 'Kagoshima', '19' => 'Kanagawa', '20' => 'Kochi', '21' => 'Kumamoto', '22' => 'Kyoto', '23' => 'Mie', '24' => 'Miyagi', '25' => 'Miyazaki', '26' => 'Nagano', '27' => 'Nagasaki', '28' => 'Nara', '29' => 'Niigata', '30' => 'Oita', '31' => 'Okayama', '32' => 'Osaka', '33' => 'Saga', '34' => 'Saitama', '35' => 'Shiga', '36' => 'Shimane', '37' => 'Shizuoka', '38' => 'Tochigi', '39' => 'Tokushima', '40' => 'Tokyo', '41' => 'Tottori', '42' => 'Toyama', '43' => 'Wakayama', '44' => 'Yamagata', '45' => 'Yamaguchi', '46' => 'Yamanashi', '47' => 'Okinawa' }, 'KE' => { '01' => 'Central', '02' => 'Coast', '03' => 'Eastern', '05' => 'Nairobi Area', '06' => 'North-Eastern', '07' => 'Nyanza', '08' => 'Rift Valley', '09' => 'Western' }, 'KG' => { '01' => 'Bishkek', '02' => 'Chuy', '03' => 'Jalal-Abad', '04' => 'Naryn', '05' => 'Osh', '06' => 'Talas', '07' => 'Ysyk-Kol', '08' => 'Osh', '09' => 'Batken' }, 'KH' => { '01' => 'Batdambang', '02' => 'Kampong Cham', '03' => 'Kampong Chhnang', '04' => 'Kampong Speu', '05' => 'Kampong Thum', '06' => 'Kampot', '07' => 'Kandal', '08' => 'Koh Kong', '09' => 'Kracheh', '10' => 'Mondulkiri', '11' => 'Phnum Penh', '12' => 'Pursat', '13' => 'Preah Vihear', '14' => 'Prey Veng', '15' => 'Ratanakiri Kiri', '16' => 'Siem Reap', '17' => 'Stung Treng', '18' => 'Svay Rieng', '19' => 'Takeo', '22' => 'Phnum Penh', '23' => 'Ratanakiri', '25' => 'Banteay Meanchey', '28' => 'Preah Seihanu', '29' => 'Batdambang', '30' => 'Pailin' }, 'KI' => { '01' => 'Gilbert Islands', '02' => 'Line Islands', '03' => 'Phoenix Islands' }, 'KM' => { '01' => 'Anjouan', '02' => 'Grande Comore', '03' => 'Moheli' }, 'KN' => { '01' => 'Christ Church Nichola Town', '02' => 'Saint Anne Sandy Point', '03' => 'Saint George Basseterre', '04' => 'Saint George Gingerland', '05' => 'Saint James Windward', '06' => 'Saint John Capisterre', '07' => 'Saint John Figtree', '08' => 'Saint Mary Cayon', '09' => 'Saint Paul Capisterre', '10' => 'Saint Paul Charlestown', '11' => 'Saint Peter Basseterre', '12' => 'Saint Thomas Lowland', '13' => 'Saint Thomas Middle Island', '15' => 'Trinity Palmetto Point' }, 'KP' => { '01' => 'Chagang-do', '03' => 'Hamgyong-namdo', '06' => 'Hwanghae-namdo', '07' => 'Hwanghae-bukto', '08' => 'Kaesong-si', '09' => 'Kangwon-do', '11' => 'P\'yongan-bukto', '12' => 'P\'yongyang-si', '13' => 'Yanggang-do', '14' => 'Namp\'o-si', '15' => 'P\'yongan-namdo', '17' => 'Hamgyong-bukto', '18' => 'Najin Sonbong-si' }, 'KR' => { '01' => 'Cheju-do', '03' => 'Cholla-bukto', '05' => 'Ch\'ungch\'ong-bukto', '06' => 'Kangwon-do', '10' => 'Pusan-jikhalsi', '11' => 'Seoul-t\'ukpyolsi', '12' => 'Inch\'on-jikhalsi', '13' => 'Kyonggi-do', '14' => 'Kyongsang-bukto', '15' => 'Taegu-jikhalsi', '16' => 'Cholla-namdo', '17' => 'Ch\'ungch\'ong-namdo', '18' => 'Kwangju-jikhalsi', '19' => 'Taejon-jikhalsi', '20' => 'Kyongsang-namdo', '21' => 'Ulsan-gwangyoksi' }, 'KW' => { '01' => 'Al Ahmadi', '02' => 'Al Kuwayt', '05' => 'Al Jahra', '07' => 'Al Farwaniyah', '08' => 'Hawalli', '09' => 'Mubarak al Kabir' }, 'KY' => { '01' => 'Creek', '02' => 'Eastern', '03' => 'Midland', '04' => 'South Town', '05' => 'Spot Bay', '06' => 'Stake Bay', '07' => 'West End', '08' => 'Western' }, 'KZ' => { '01' => 'Almaty', '02' => 'Almaty City', '03' => 'Aqmola', '04' => 'Aqtobe', '05' => 'Astana', '06' => 'Atyrau', '07' => 'West Kazakhstan', '08' => 'Bayqonyr', '09' => 'Mangghystau', '10' => 'South Kazakhstan', '11' => 'Pavlodar', '12' => 'Qaraghandy', '13' => 'Qostanay', '14' => 'Qyzylorda', '15' => 'East Kazakhstan', '16' => 'North Kazakhstan', '17' => 'Zhambyl' }, 'LA' => { '01' => 'Attapu', '02' => 'Champasak', '03' => 'Houaphan', '04' => 'Khammouan', '05' => 'Louang Namtha', '07' => 'Oudomxai', '08' => 'Phongsali', '09' => 'Saravan', '10' => 'Savannakhet', '11' => 'Vientiane', '13' => 'Xaignabouri', '14' => 'Xiangkhoang', '17' => 'Louangphrabang' }, 'LB' => { '01' => 'Beqaa', '02' => 'Al Janub', '03' => 'Liban-Nord', '04' => 'Beyrouth', '05' => 'Mont-Liban', '06' => 'Liban-Sud', '07' => 'Nabatiye', '08' => 'Beqaa', '09' => 'Liban-Nord', '10' => 'Aakk,r', '11' => 'Baalbek-Hermel' }, 'LC' => { '01' => 'Anse-la-Raye', '02' => 'Dauphin', '03' => 'Castries', '04' => 'Choiseul', '05' => 'Dennery', '06' => 'Gros-Islet', '07' => 'Laborie', '08' => 'Micoud', '09' => 'Soufriere', '10' => 'Vieux-Fort', '11' => 'Praslin' }, 'LI' => { '01' => 'Balzers', '02' => 'Eschen', '03' => 'Gamprin', '04' => 'Mauren', '05' => 'Planken', '06' => 'Ruggell', '07' => 'Schaan', '08' => 'Schellenberg', '09' => 'Triesen', '10' => 'Triesenberg', '11' => 'Vaduz', '21' => 'Gbarpolu', '22' => 'River Gee' }, 'LK' => { '29' => 'Central', '30' => 'North Central', '32' => 'North Western', '33' => 'Sabaragamuwa', '34' => 'Southern', '35' => 'Uva', '36' => 'Western', '37' => 'Eastern', '38' => 'Northern' }, 'LR' => { '01' => 'Bong', '04' => 'Grand Cape Mount', '05' => 'Lofa', '06' => 'Maryland', '07' => 'Monrovia', '09' => 'Nimba', '10' => 'Sino', '11' => 'Grand Bassa', '12' => 'Grand Cape Mount', '13' => 'Maryland', '14' => 'Montserrado', '17' => 'Margibi', '18' => 'River Cess', '19' => 'Grand Gedeh', '20' => 'Lofa', '21' => 'Gbarpolu', '22' => 'River Gee' }, 'LS' => { '10' => 'Berea', '11' => 'Butha-Buthe', '12' => 'Leribe', '13' => 'Mafeteng', '14' => 'Maseru', '15' => 'Mohales Hoek', '16' => 'Mokhotlong', '17' => 'Qachas Nek', '18' => 'Quthing', '19' => 'Thaba-Tseka' }, 'LT' => { '56' => 'Alytaus Apskritis', '57' => 'Kauno Apskritis', '58' => 'Klaipedos Apskritis', '59' => 'Marijampoles Apskritis', '60' => 'Panevezio Apskritis', '61' => 'Siauliu Apskritis', '62' => 'Taurages Apskritis', '63' => 'Telsiu Apskritis', '64' => 'Utenos Apskritis', '65' => 'Vilniaus Apskritis' }, 'LU' => { '01' => 'Diekirch', '02' => 'Grevenmacher', '03' => 'Luxembourg' }, 'LV' => { '01' => 'Aizkraukles', '02' => 'Aluksnes', '03' => 'Balvu', '04' => 'Bauskas', '05' => 'Cesu', '06' => 'Daugavpils', '07' => 'Daugavpils', '08' => 'Dobeles', '09' => 'Gulbenes', '10' => 'Jekabpils', '11' => 'Jelgava', '12' => 'Jelgavas', '13' => 'Jurmala', '14' => 'Kraslavas', '15' => 'Kuldigas', '16' => 'Liepaja', '17' => 'Liepajas', '18' => 'Limbazu', '19' => 'Ludzas', '20' => 'Madonas', '21' => 'Ogres', '22' => 'Preilu', '23' => 'Rezekne', '24' => 'Rezeknes', '25' => 'Riga', '26' => 'Rigas', '27' => 'Saldus', '28' => 'Talsu', '29' => 'Tukuma', '30' => 'Valkas', '31' => 'Valmieras', '32' => 'Ventspils', '33' => 'Ventspils' }, 'LY' => { '03' => 'Al Aziziyah', '05' => 'Al Jufrah', '08' => 'Al Kufrah', '13' => 'Ash Shati\'', '30' => 'Murzuq', '34' => 'Sabha', '41' => 'Tarhunah', '42' => 'Tubruq', '45' => 'Zlitan', '47' => 'Ajdabiya', '48' => 'Al Fatih', '49' => 'Al Jabal al Akhdar', '50' => 'Al Khums', '51' => 'An Nuqat al Khams', '52' => 'Awbari', '53' => 'Az Zawiyah', '54' => 'Banghazi', '55' => 'Darnah', '56' => 'Ghadamis', '57' => 'Gharyan', '58' => 'Misratah', '59' => 'Sawfajjin', '60' => 'Surt', '61' => 'Tarabulus', '62' => 'Yafran' }, 'MA' => { '45' => 'Grand Casablanca', '46' => 'Fes-Boulemane', '47' => 'Marrakech-Tensift-Al Haouz', '48' => 'Meknes-Tafilalet', '49' => 'Rabat-Sale-Zemmour-Zaer', '50' => 'Chaouia-Ouardigha', '51' => 'Doukkala-Abda', '52' => 'Gharb-Chrarda-Beni Hssen', '53' => 'Guelmim-Es Smara', '54' => 'Oriental', '55' => 'Souss-Massa-Dr,a', '56' => 'Tadla-Azilal', '57' => 'Tanger-Tetouan', '58' => 'Taza-Al Hoceima-Taounate', '59' => 'La,youne-Boujdour-Sakia El Hamra' }, 'MC' => { '01' => 'La Condamine', '02' => 'Monaco', '03' => 'Monte-Carlo' }, 'MD' => { '51' => 'Gagauzia', '57' => 'Chisinau', '58' => 'Stinga Nistrului', '59' => 'Anenii Noi', '60' => 'Balti', '61' => 'Basarabeasca', '62' => 'Bender', '63' => 'Briceni', '64' => 'Cahul', '65' => 'Cantemir', '66' => 'Calarasi', '67' => 'Causeni', '68' => 'Cimislia', '69' => 'Criuleni', '70' => 'Donduseni', '71' => 'Drochia', '72' => 'Dubasari', '73' => 'Edinet', '74' => 'Falesti', '75' => 'Floresti', '76' => 'Glodeni', '77' => 'Hincesti', '78' => 'Ialoveni', '79' => 'Leova', '80' => 'Nisporeni', '81' => 'Ocnita', '82' => 'Orhei', '83' => 'Rezina', '84' => 'Riscani', '85' => 'Singerei', '86' => 'Soldanesti', '87' => 'Soroca', '88' => 'Stefan-Voda', '89' => 'Straseni', '90' => 'Taraclia', '91' => 'Telenesti', '92' => 'Ungheni' }, 'MG' => { '01' => 'Antsiranana', '02' => 'Fianarantsoa', '03' => 'Mahajanga', '04' => 'Toamasina', '05' => 'Antananarivo', '06' => 'Toliara' }, 'MK' => { '01' => 'Aracinovo', '02' => 'Bac', '03' => 'Belcista', '04' => 'Berovo', '05' => 'Bistrica', '06' => 'Bitola', '07' => 'Blatec', '08' => 'Bogdanci', '09' => 'Bogomila', '10' => 'Bogovinje', '11' => 'Bosilovo', '12' => 'Brvenica', '13' => 'Cair', '14' => 'Capari', '15' => 'Caska', '16' => 'Cegrane', '17' => 'Centar', '18' => 'Centar Zupa', '19' => 'Cesinovo', '20' => 'Cucer-Sandevo', '21' => 'Debar', '22' => 'Delcevo', '23' => 'Delogozdi', '24' => 'Demir Hisar', '25' => 'Demir Kapija', '26' => 'Dobrusevo', '27' => 'Dolna Banjica', '28' => 'Dolneni', '29' => 'Dorce Petrov', '30' => 'Drugovo', '31' => 'Dzepciste', '32' => 'Gazi Baba', '33' => 'Gevgelija', '34' => 'Gostivar', '35' => 'Gradsko', '36' => 'Ilinden', '37' => 'Izvor', '38' => 'Jegunovce', '39' => 'Kamenjane', '40' => 'Karbinci', '41' => 'Karpos', '42' => 'Kavadarci', '43' => 'Kicevo', '44' => 'Kisela Voda', '45' => 'Klecevce', '46' => 'Kocani', '47' => 'Konce', '48' => 'Kondovo', '49' => 'Konopiste', '50' => 'Kosel', '51' => 'Kratovo', '52' => 'Kriva Palanka', '53' => 'Krivogastani', '54' => 'Krusevo', '55' => 'Kuklis', '56' => 'Kukurecani', '57' => 'Kumanovo', '58' => 'Labunista', '59' => 'Lipkovo', '60' => 'Lozovo', '61' => 'Lukovo', '62' => 'Makedonska Kamenica', '63' => 'Makedonski Brod', '64' => 'Mavrovi Anovi', '65' => 'Meseista', '66' => 'Miravci', '67' => 'Mogila', '68' => 'Murtino', '69' => 'Negotino', '70' => 'Negotino-Polosko', '71' => 'Novaci', '72' => 'Novo Selo', '73' => 'Oblesevo', '74' => 'Ohrid', '75' => 'Orasac', '76' => 'Orizari', '77' => 'Oslomej', '78' => 'Pehcevo', '79' => 'Petrovec', '80' => 'Plasnica', '81' => 'Podares', '82' => 'Prilep', '83' => 'Probistip', '84' => 'Radovis', '85' => 'Rankovce', '86' => 'Resen', '87' => 'Rosoman', '88' => 'Rostusa', '89' => 'Samokov', '90' => 'Saraj', '91' => 'Sipkovica', '92' => 'Sopiste', '93' => 'Sopotnica', '94' => 'Srbinovo', '95' => 'Staravina', '96' => 'Star Dojran', '97' => 'Staro Nagoricane', '98' => 'Stip', '99' => 'Struga', 'A1' => 'Strumica', 'A2' => 'Studenicani', 'A3' => 'Suto Orizari', 'A4' => 'Sveti Nikole', 'A5' => 'Tearce', 'A6' => 'Tetovo', 'A7' => 'Topolcani', 'A8' => 'Valandovo', 'A9' => 'Vasilevo', 'B1' => 'Veles', 'B2' => 'Velesta', 'B3' => 'Vevcani', 'B4' => 'Vinica', 'B5' => 'Vitoliste', 'B6' => 'Vranestica', 'B7' => 'Vrapciste', 'B8' => 'Vratnica', 'B9' => 'Vrutok', 'C1' => 'Zajas', 'C2' => 'Zelenikovo', 'C3' => 'Zelino', 'C4' => 'Zitose', 'C5' => 'Zletovo', 'C6' => 'Zrnovci', 'C8' => 'Cair', 'C9' => 'Caska', 'D2' => 'Debar', 'D3' => 'Demir Hisar', 'D4' => 'Gostivar', 'D5' => 'Jegunovce', 'D6' => 'Kavadarci', 'D7' => 'Kumanovo', 'D8' => 'Makedonski Brod', 'E2' => 'Ohrid', 'E3' => 'Prilep', 'E5' => 'Dojran', 'E6' => 'Struga', 'E7' => 'Strumica', 'E8' => 'Tetovo', 'E9' => 'Valandovo', 'F1' => 'Veles', 'F2' => 'Aerodrom' }, 'ML' => { '01' => 'Bamako', '03' => 'Kayes', '04' => 'Mopti', '05' => 'Segou', '06' => 'Sikasso', '07' => 'Koulikoro', '08' => 'Tombouctou', '09' => 'Gao', '10' => 'Kidal' }, 'MM' => { '01' => 'Rakhine State', '02' => 'Chin State', '03' => 'Irrawaddy', '04' => 'Kachin State', '05' => 'Karan State', '06' => 'Kayah State', '07' => 'Magwe', '08' => 'Mandalay', '09' => 'Pegu', '10' => 'Sagaing', '11' => 'Shan State', '12' => 'Tenasserim', '13' => 'Mon State', '14' => 'Rangoon', '17' => 'Yangon' }, 'MN' => { '01' => 'Arhangay', '02' => 'Bayanhongor', '03' => 'Bayan-Olgiy', '05' => 'Darhan', '06' => 'Dornod', '07' => 'Dornogovi', '08' => 'Dundgovi', '09' => 'Dzavhan', '10' => 'Govi-Altay', '11' => 'Hentiy', '12' => 'Hovd', '13' => 'Hovsgol', '14' => 'Omnogovi', '15' => 'Ovorhangay', '16' => 'Selenge', '17' => 'Suhbaatar', '18' => 'Tov', '19' => 'Uvs', '20' => 'Ulaanbaatar', '21' => 'Bulgan', '22' => 'Erdenet', '23' => 'Darhan-Uul', '24' => 'Govisumber', '25' => 'Orhon' }, 'MO' => { '01' => 'Ilhas', '02' => 'Macau' }, 'MR' => { '01' => 'Hodh Ech Chargui', '02' => 'Hodh El Gharbi', '03' => 'Assaba', '04' => 'Gorgol', '05' => 'Brakna', '06' => 'Trarza', '07' => 'Adrar', '08' => 'Dakhlet Nouadhibou', '09' => 'Tagant', '10' => 'Guidimaka', '11' => 'Tiris Zemmour', '12' => 'Inchiri' }, 'MS' => { '01' => 'Saint Anthony', '02' => 'Saint Georges', '03' => 'Saint Peter' }, 'MU' => { '12' => 'Black River', '13' => 'Flacq', '14' => 'Grand Port', '15' => 'Moka', '16' => 'Pamplemousses', '17' => 'Plaines Wilhems', '18' => 'Port Louis', '19' => 'Riviere du Rempart', '20' => 'Savanne', '21' => 'Agalega Islands', '22' => 'Cargados Carajos', '23' => 'Rodrigues' }, 'MV' => { '01' => 'Seenu', '05' => 'Laamu', '30' => 'Alifu', '31' => 'Baa', '32' => 'Dhaalu', '33' => 'Faafu ', '34' => 'Gaafu Alifu', '35' => 'Gaafu Dhaalu', '36' => 'Haa Alifu', '37' => 'Haa Dhaalu', '38' => 'Kaafu', '39' => 'Lhaviyani', '40' => 'Maale', '41' => 'Meemu', '42' => 'Gnaviyani', '43' => 'Noonu', '44' => 'Raa', '45' => 'Shaviyani', '46' => 'Thaa', '47' => 'Vaavu' }, 'MW' => { '02' => 'Chikwawa', '03' => 'Chiradzulu', '04' => 'Chitipa', '05' => 'Thyolo', '06' => 'Dedza', '07' => 'Dowa', '08' => 'Karonga', '09' => 'Kasungu', '11' => 'Lilongwe', '12' => 'Mangochi', '13' => 'Mchinji', '15' => 'Mzimba', '16' => 'Ntcheu', '17' => 'Nkhata Bay', '18' => 'Nkhotakota', '19' => 'Nsanje', '20' => 'Ntchisi', '21' => 'Rumphi', '22' => 'Salima', '23' => 'Zomba', '24' => 'Blantyre', '25' => 'Mwanza', '26' => 'Balaka', '27' => 'Likoma', '28' => 'Machinga', '29' => 'Mulanje', '30' => 'Phalombe' }, 'MX' => { '01' => 'Aguascalientes', '02' => 'Baja California', '03' => 'Baja California Sur', '04' => 'Campeche', '05' => 'Chiapas', '06' => 'Chihuahua', '07' => 'Coahuila de Zaragoza', '08' => 'Colima', '09' => 'Distrito Federal', '10' => 'Durango', '11' => 'Guanajuato', '12' => 'Guerrero', '13' => 'Hidalgo', '14' => 'Jalisco', '15' => 'Mexico', '16' => 'Michoacan de Ocampo', '17' => 'Morelos', '18' => 'Nayarit', '19' => 'Nuevo Leon', '20' => 'Oaxaca', '21' => 'Puebla', '22' => 'Queretaro de Arteaga', '23' => 'Quintana Roo', '24' => 'San Luis Potosi', '25' => 'Sinaloa', '26' => 'Sonora', '27' => 'Tabasco', '28' => 'Tamaulipas', '29' => 'Tlaxcala', '30' => 'Veracruz-Llave', '31' => 'Yucatan', '32' => 'Zacatecas' }, 'MY' => { '01' => 'Johor', '02' => 'Kedah', '03' => 'Kelantan', '04' => 'Melaka', '05' => 'Negeri Sembilan', '06' => 'Pahang', '07' => 'Perak', '08' => 'Perlis', '09' => 'Pulau Pinang', '11' => 'Sarawak', '12' => 'Selangor', '13' => 'Terengganu', '14' => 'Kuala Lumpur', '15' => 'Labuan', '16' => 'Sabah', '17' => 'Putrajaya' }, 'MZ' => { '01' => 'Cabo Delgado', '02' => 'Gaza', '03' => 'Inhambane', '04' => 'Maputo', '05' => 'Sofala', '06' => 'Nampula', '07' => 'Niassa', '08' => 'Tete', '09' => 'Zambezia', '10' => 'Manica', '11' => 'Maputo' }, 'NA' => { '01' => 'Bethanien', '02' => 'Caprivi Oos', '03' => 'Boesmanland', '04' => 'Gobabis', '05' => 'Grootfontein', '06' => 'Kaokoland', '07' => 'Karibib', '08' => 'Keetmanshoop', '09' => 'Luderitz', '10' => 'Maltahohe', '11' => 'Okahandja', '12' => 'Omaruru', '13' => 'Otjiwarongo', '14' => 'Outjo', '15' => 'Owambo', '16' => 'Rehoboth', '17' => 'Swakopmund', '18' => 'Tsumeb', '20' => 'Karasburg', '21' => 'Windhoek', '22' => 'Damaraland', '23' => 'Hereroland Oos', '24' => 'Hereroland Wes', '25' => 'Kavango', '26' => 'Mariental', '27' => 'Namaland', '28' => 'Caprivi', '29' => 'Erongo', '30' => 'Hardap', '31' => 'Karas', '32' => 'Kunene', '33' => 'Ohangwena', '34' => 'Okavango', '35' => 'Omaheke', '36' => 'Omusati', '37' => 'Oshana', '38' => 'Oshikoto', '39' => 'Otjozondjupa' }, 'NE' => { '01' => 'Agadez', '02' => 'Diffa', '03' => 'Dosso', '04' => 'Maradi', '05' => 'Niamey', '06' => 'Tahoua', '07' => 'Zinder', '08' => 'Niamey' }, 'NG' => { '05' => 'Lagos', '11' => 'Federal Capital Territory', '16' => 'Ogun', '21' => 'Akwa Ibom', '22' => 'Cross River', '23' => 'Kaduna', '24' => 'Katsina', '25' => 'Anambra', '26' => 'Benue', '27' => 'Borno', '28' => 'Imo', '29' => 'Kano', '30' => 'Kwara', '31' => 'Niger', '32' => 'Oyo', '35' => 'Adamawa', '36' => 'Delta', '37' => 'Edo', '39' => 'Jigawa', '40' => 'Kebbi', '41' => 'Kogi', '42' => 'Osun', '43' => 'Taraba', '44' => 'Yobe', '45' => 'Abia', '46' => 'Bauchi', '47' => 'Enugu', '48' => 'Ondo', '49' => 'Plateau', '50' => 'Rivers', '51' => 'Sokoto', '52' => 'Bayelsa', '53' => 'Ebonyi', '54' => 'Ekiti', '55' => 'Gombe', '56' => 'Nassarawa', '57' => 'Zamfara' }, 'NI' => { '01' => 'Boaco', '02' => 'Carazo', '03' => 'Chinandega', '04' => 'Chontales', '05' => 'Esteli', '06' => 'Granada', '07' => 'Jinotega', '08' => 'Leon', '09' => 'Madriz', '10' => 'Managua', '11' => 'Masaya', '12' => 'Matagalpa', '13' => 'Nueva Segovia', '14' => 'Rio San Juan', '15' => 'Rivas', '16' => 'Zelaya', '17' => 'Autonoma Atlantico Norte', '18' => 'Region Autonoma Atlantico Sur' }, 'NL' => { '01' => 'Drenthe', '02' => 'Friesland', '03' => 'Gelderland', '04' => 'Groningen', '05' => 'Limburg', '06' => 'Noord-Brabant', '07' => 'Noord-Holland', '09' => 'Utrecht', '10' => 'Zeeland', '11' => 'Zuid-Holland', '15' => 'Overijssel', '16' => 'Flevoland' }, 'NO' => { '01' => 'Akershus', '02' => 'Aust-Agder', '04' => 'Buskerud', '05' => 'Finnmark', '06' => 'Hedmark', '07' => 'Hordaland', '08' => 'More og Romsdal', '09' => 'Nordland', '10' => 'Nord-Trondelag', '11' => 'Oppland', '12' => 'Oslo', '13' => 'Ostfold', '14' => 'Rogaland', '15' => 'Sogn og Fjordane', '16' => 'Sor-Trondelag', '17' => 'Telemark', '18' => 'Troms', '19' => 'Vest-Agder', '20' => 'Vestfold' }, 'NP' => { '01' => 'Bagmati', '02' => 'Bheri', '03' => 'Dhawalagiri', '04' => 'Gandaki', '05' => 'Janakpur', '06' => 'Karnali', '07' => 'Kosi', '08' => 'Lumbini', '09' => 'Mahakali', '10' => 'Mechi', '11' => 'Narayani', '12' => 'Rapti', '13' => 'Sagarmatha', '14' => 'Seti' }, 'NR' => { '01' => 'Aiwo', '02' => 'Anabar', '03' => 'Anetan', '04' => 'Anibare', '05' => 'Baiti', '06' => 'Boe', '07' => 'Buada', '08' => 'Denigomodu', '09' => 'Ewa', '10' => 'Ijuw', '11' => 'Meneng', '12' => 'Nibok', '13' => 'Uaboe', '14' => 'Yaren' }, 'NZ' => { '10' => 'Chatham Islands', 'E7' => 'Auckland', 'E8' => 'Bay of Plenty', 'E9' => 'Canterbury', 'F1' => 'Gisborne', 'F2' => 'Hawke\'s Bay', 'F3' => 'Manawatu-Wanganui', 'F4' => 'Marlborough', 'F5' => 'Nelson', 'F6' => 'Northland', 'F7' => 'Otago', 'F8' => 'Southland', 'F9' => 'Taranaki', 'G1' => 'Waikato', 'G2' => 'Wellington', 'G3' => 'West Coast' }, 'OM' => { '01' => 'Ad Dakhiliyah', '02' => 'Al Batinah', '03' => 'Al Wusta', '04' => 'Ash Sharqiyah', '05' => 'Az Zahirah', '06' => 'Masqat', '07' => 'Musandam', '08' => 'Zufar' }, 'PA' => { '01' => 'Bocas del Toro', '02' => 'Chiriqui', '03' => 'Cocle', '04' => 'Colon', '05' => 'Darien', '06' => 'Herrera', '07' => 'Los Santos', '08' => 'Panama', '09' => 'San Blas', '10' => 'Veraguas' }, 'PE' => { '01' => 'Amazonas', '02' => 'Ancash', '03' => 'Apurimac', '04' => 'Arequipa', '05' => 'Ayacucho', '06' => 'Cajamarca', '07' => 'Callao', '08' => 'Cusco', '09' => 'Huancavelica', '10' => 'Huanuco', '11' => 'Ica', '12' => 'Junin', '13' => 'La Libertad', '14' => 'Lambayeque', '15' => 'Lima', '16' => 'Loreto', '17' => 'Madre de Dios', '18' => 'Moquegua', '19' => 'Pasco', '20' => 'Piura', '21' => 'Puno', '22' => 'San Martin', '23' => 'Tacna', '24' => 'Tumbes', '25' => 'Ucayali' }, 'PG' => { '01' => 'Central', '02' => 'Gulf', '03' => 'Milne Bay', '04' => 'Northern', '05' => 'Southern Highlands', '06' => 'Western', '07' => 'North Solomons', '08' => 'Chimbu', '09' => 'Eastern Highlands', '10' => 'East New Britain', '11' => 'East Sepik', '12' => 'Madang', '13' => 'Manus', '14' => 'Morobe', '15' => 'New Ireland', '16' => 'Western Highlands', '17' => 'West New Britain', '18' => 'Sandaun', '19' => 'Enga', '20' => 'National Capital' }, 'PH' => { '01' => 'Abra', '02' => 'Agusan del Norte', '03' => 'Agusan del Sur', '04' => 'Aklan', '05' => 'Albay', '06' => 'Antique', '07' => 'Bataan', '08' => 'Batanes', '09' => 'Batangas', '10' => 'Benguet', '11' => 'Bohol', '12' => 'Bukidnon', '13' => 'Bulacan', '14' => 'Cagayan', '15' => 'Camarines Norte', '16' => 'Camarines Sur', '17' => 'Camiguin', '18' => 'Capiz', '19' => 'Catanduanes', '20' => 'Cavite', '21' => 'Cebu', '22' => 'Basilan', '23' => 'Eastern Samar', '24' => 'Davao', '25' => 'Davao del Sur', '26' => 'Davao Oriental', '27' => 'Ifugao', '28' => 'Ilocos Norte', '29' => 'Ilocos Sur', '30' => 'Iloilo', '31' => 'Isabela', '32' => 'Kalinga-Apayao', '33' => 'Laguna', '34' => 'Lanao del Norte', '35' => 'Lanao del Sur', '36' => 'La Union', '37' => 'Leyte', '38' => 'Marinduque', '39' => 'Masbate', '40' => 'Mindoro Occidental', '41' => 'Mindoro Oriental', '42' => 'Misamis Occidental', '43' => 'Misamis Oriental', '44' => 'Mountain', '45' => 'Negros Occidental', '46' => 'Negros Oriental', '47' => 'Nueva Ecija', '48' => 'Nueva Vizcaya', '49' => 'Palawan', '50' => 'Pampanga', '51' => 'Pangasinan', '53' => 'Rizal', '54' => 'Romblon', '55' => 'Samar', '56' => 'Maguindanao', '57' => 'North Cotabato', '58' => 'Sorsogon', '59' => 'Southern Leyte', '60' => 'Sulu', '61' => 'Surigao del Norte', '62' => 'Surigao del Sur', '63' => 'Tarlac', '64' => 'Zambales', '65' => 'Zamboanga del Norte', '66' => 'Zamboanga del Sur', '67' => 'Northern Samar', '68' => 'Quirino', '69' => 'Siquijor', '70' => 'South Cotabato', '71' => 'Sultan Kudarat', '72' => 'Tawitawi', 'A1' => 'Angeles', 'A2' => 'Bacolod', 'A3' => 'Bago', 'A4' => 'Baguio', 'A5' => 'Bais', 'A6' => 'Basilan City', 'A7' => 'Batangas City', 'A8' => 'Butuan', 'A9' => 'Cabanatuan', 'B1' => 'Cadiz', 'B2' => 'Cagayan de Oro', 'B3' => 'Calbayog', 'B4' => 'Caloocan', 'B5' => 'Canlaon', 'B6' => 'Cavite City', 'B7' => 'Cebu City', 'B8' => 'Cotabato', 'B9' => 'Dagupan', 'C1' => 'Danao', 'C2' => 'Dapitan', 'C3' => 'Davao City', 'C4' => 'Dipolog', 'C5' => 'Dumaguete', 'C6' => 'General Santos', 'C7' => 'Gingoog', 'C8' => 'Iligan', 'C9' => 'Iloilo City', 'D1' => 'Iriga', 'D2' => 'La Carlota', 'D3' => 'Laoag', 'D4' => 'Lapu-Lapu', 'D5' => 'Legaspi', 'D6' => 'Lipa', 'D7' => 'Lucena', 'D8' => 'Mandaue', 'D9' => 'Manila', 'E1' => 'Marawi', 'E2' => 'Naga', 'E3' => 'Olongapo', 'E4' => 'Ormoc', 'E5' => 'Oroquieta', 'E6' => 'Ozamis', 'E7' => 'Pagadian', 'E8' => 'Palayan', 'E9' => 'Pasay', 'F1' => 'Puerto Princesa', 'F2' => 'Quezon City', 'F3' => 'Roxas', 'F4' => 'San Carlos', 'F5' => 'San Carlos', 'F6' => 'San Jose', 'F7' => 'San Pablo', 'F8' => 'Silay', 'F9' => 'Surigao', 'G1' => 'Tacloban', 'G2' => 'Tagaytay', 'G3' => 'Tagbilaran', 'G4' => 'Tangub', 'G5' => 'Toledo', 'G6' => 'Trece Martires', 'G7' => 'Zamboanga', 'G8' => 'Aurora', 'H2' => 'Quezon', 'H3' => 'Negros Occidental', 'H9' => 'Biliran', 'I6' => 'Compostela Valley', 'I7' => 'Davao del Norte', 'J3' => 'Guimaras', 'J4' => 'Himamaylan', 'J7' => 'Kalinga', 'K1' => 'Las Pinas', 'K5' => 'Malabon', 'K6' => 'Malaybalay', 'L4' => 'Muntinlupa', 'L5' => 'Navotas', 'L7' => 'Paranaque', 'L9' => 'Passi', 'M5' => 'San Jose del Monte', 'M6' => 'San Juan', 'M8' => 'Santiago', 'M9' => 'Sarangani', 'N1' => 'Sipalay', 'N3' => 'Surigao del Norte', 'P1' => 'Zambales', 'P2' => 'Zamboanga' }, 'PK' => { '01' => 'Federally Administered Tribal Areas', '02' => 'Balochistan', '03' => 'North-West Frontier', '04' => 'Punjab', '05' => 'Sindh', '06' => 'Azad Kashmir', '07' => 'Northern Areas', '08' => 'Islamabad' }, 'PL' => { '72' => 'Dolnoslaskie', '73' => 'Kujawsko-Pomorskie', '74' => 'Lodzkie', '75' => 'Lubelskie', '76' => 'Lubuskie', '77' => 'Malopolskie', '78' => 'Mazowieckie', '79' => 'Opolskie', '80' => 'Podkarpackie', '81' => 'Podlaskie', '82' => 'Pomorskie', '83' => 'Slaskie', '84' => 'Swietokrzyskie', '85' => 'Warminsko-Mazurskie', '86' => 'Wielkopolskie', '87' => 'Zachodniopomorskie' }, 'PS' => { 'GZ' => 'Gaza', 'WE' => 'West Bank' }, 'PT' => { '02' => 'Aveiro', '03' => 'Beja', '04' => 'Braga', '05' => 'Braganca', '06' => 'Castelo Branco', '07' => 'Coimbra', '08' => 'Evora', '09' => 'Faro', '10' => 'Madeira', '11' => 'Guarda', '13' => 'Leiria', '14' => 'Lisboa', '16' => 'Portalegre', '17' => 'Porto', '18' => 'Santarem', '19' => 'Setubal', '20' => 'Viana do Castelo', '21' => 'Vila Real', '22' => 'Viseu', '23' => 'Azores' }, 'PY' => { '01' => 'Alto Parana', '02' => 'Amambay', '04' => 'Caaguazu', '05' => 'Caazapa', '06' => 'Central', '07' => 'Concepcion', '08' => 'Cordillera', '10' => 'Guaira', '11' => 'Itapua', '12' => 'Misiones', '13' => 'Neembucu', '15' => 'Paraguari', '16' => 'Presidente Hayes', '17' => 'San Pedro', '19' => 'Canindeyu', '22' => 'Asuncion', '23' => 'Alto Paraguay', '24' => 'Boqueron' }, 'QA' => { '01' => 'Ad Dawhah', '02' => 'Al Ghuwariyah', '03' => 'Al Jumaliyah', '04' => 'Al Khawr', '05' => 'Al Wakrah Municipality', '06' => 'Ar Rayyan', '08' => 'Madinat ach Shamal', '09' => 'Umm Salal', '10' => 'Al Wakrah', '11' => 'Jariyan al Batnah', '12' => 'Umm Sa\'id' }, 'RO' => { '01' => 'Alba', '02' => 'Arad', '03' => 'Arges', '04' => 'Bacau', '05' => 'Bihor', '06' => 'Bistrita-Nasaud', '07' => 'Botosani', '08' => 'Braila', '09' => 'Brasov', '10' => 'Bucuresti', '11' => 'Buzau', '12' => 'Caras-Severin', '13' => 'Cluj', '14' => 'Constanta', '15' => 'Covasna', '16' => 'Dambovita', '17' => 'Dolj', '18' => 'Galati', '19' => 'Gorj', '20' => 'Harghita', '21' => 'Hunedoara', '22' => 'Ialomita', '23' => 'Iasi', '25' => 'Maramures', '26' => 'Mehedinti', '27' => 'Mures', '28' => 'Neamt', '29' => 'Olt', '30' => 'Prahova', '31' => 'Salaj', '32' => 'Satu Mare', '33' => 'Sibiu', '34' => 'Suceava', '35' => 'Teleorman', '36' => 'Timis', '37' => 'Tulcea', '38' => 'Vaslui', '39' => 'Valcea', '40' => 'Vrancea', '41' => 'Calarasi', '42' => 'Giurgiu', '43' => 'Ilfov' }, 'RS' => { '01' => 'Kosovo', '02' => 'Vojvodina' }, 'RU' => { '01' => 'Adygeya, Republic of', '02' => 'Aginsky Buryatsky AO', '03' => 'Gorno-Altay', '04' => 'Altaisky krai', '05' => 'Amur', '06' => 'Arkhangel\'sk', '07' => 'Astrakhan\'', '08' => 'Bashkortostan', '09' => 'Belgorod', '10' => 'Bryansk', '11' => 'Buryat', '12' => 'Chechnya', '13' => 'Chelyabinsk', '14' => 'Chita', '15' => 'Chukot', '16' => 'Chuvashia', '17' => 'Dagestan', '18' => 'Evenk', '19' => 'Ingush', '20' => 'Irkutsk', '21' => 'Ivanovo', '22' => 'Kabardin-Balkar', '23' => 'Kaliningrad', '24' => 'Kalmyk', '25' => 'Kaluga', '26' => 'Kamchatka', '27' => 'Karachay-Cherkess', '28' => 'Karelia', '29' => 'Kemerovo', '30' => 'Khabarovsk', '31' => 'Khakass', '32' => 'Khanty-Mansiy', '33' => 'Kirov', '34' => 'Komi', '36' => 'Koryak', '37' => 'Kostroma', '38' => 'Krasnodar', '39' => 'Krasnoyarsk', '40' => 'Kurgan', '41' => 'Kursk', '42' => 'Leningrad', '43' => 'Lipetsk', '44' => 'Magadan', '45' => 'Mariy-El', '46' => 'Mordovia', '47' => 'Moskva', '48' => 'Moscow City', '49' => 'Murmansk', '50' => 'Nenets', '51' => 'Nizhegorod', '52' => 'Novgorod', '53' => 'Novosibirsk', '54' => 'Omsk', '55' => 'Orenburg', '56' => 'Orel', '57' => 'Penza', '58' => 'Perm\'', '59' => 'Primor\'ye', '60' => 'Pskov', '61' => 'Rostov', '62' => 'Ryazan\'', '63' => 'Sakha', '64' => 'Sakhalin', '65' => 'Samara', '66' => 'Saint Petersburg City', '67' => 'Saratov', '68' => 'North Ossetia', '69' => 'Smolensk', '70' => 'Stavropol\'', '71' => 'Sverdlovsk', '72' => 'Tambovskaya oblast', '73' => 'Tatarstan', '74' => 'Taymyr', '75' => 'Tomsk', '76' => 'Tula', '77' => 'Tver\'', '78' => 'Tyumen\'', '79' => 'Tuva', '80' => 'Udmurt', '81' => 'Ul\'yanovsk', '83' => 'Vladimir', '84' => 'Volgograd', '85' => 'Vologda', '86' => 'Voronezh', '87' => 'Yamal-Nenets', '88' => 'Yaroslavl\'', '89' => 'Yevrey', '90' => 'Permskiy Kray', '91' => 'Krasnoyarskiy Kray', '92' => 'Kamchatskiy Kray', '93' => 'Zabaykal\'skiy Kray' }, 'RW' => { '01' => 'Butare', '06' => 'Gitarama', '07' => 'Kibungo', '09' => 'Kigali', '11' => 'Est', '12' => 'Kigali', '13' => 'Nord', '14' => 'Ouest', '15' => 'Sud' }, 'SA' => { '02' => 'Al Bahah', '05' => 'Al Madinah', '06' => 'Ash Sharqiyah', '08' => 'Al Qasim', '10' => 'Ar Riyad', '11' => 'Asir Province', '13' => 'Ha\'il', '14' => 'Makkah', '15' => 'Al Hudud ash Shamaliyah', '16' => 'Najran', '17' => 'Jizan', '19' => 'Tabuk', '20' => 'Al Jawf' }, 'SB' => { '03' => 'Malaita', '06' => 'Guadalcanal', '07' => 'Isabel', '08' => 'Makira', '09' => 'Temotu', '10' => 'Central', '11' => 'Western', '12' => 'Choiseul', '13' => 'Rennell and Bellona' }, 'SC' => { '01' => 'Anse aux Pins', '02' => 'Anse Boileau', '03' => 'Anse Etoile', '04' => 'Anse Louis', '05' => 'Anse Royale', '06' => 'Baie Lazare', '07' => 'Baie Sainte Anne', '08' => 'Beau Vallon', '09' => 'Bel Air', '10' => 'Bel Ombre', '11' => 'Cascade', '12' => 'Glacis', '13' => 'Grand\' Anse', '14' => 'Grand\' Anse', '15' => 'La Digue', '16' => 'La Riviere Anglaise', '17' => 'Mont Buxton', '18' => 'Mont Fleuri', '19' => 'Plaisance', '20' => 'Pointe La Rue', '21' => 'Port Glaud', '22' => 'Saint Louis', '23' => 'Takamaka' }, 'SD' => { '27' => 'Al Wusta', '28' => 'Al Istiwa\'iyah', '29' => 'Al Khartum', '30' => 'Ash Shamaliyah', '31' => 'Ash Sharqiyah', '32' => 'Bahr al Ghazal', '33' => 'Darfur', '34' => 'Kurdufan', '35' => 'Upper Nile', '40' => 'Al Wahadah State', '44' => 'Central Equatoria State', '49' => 'Southern Darfur', '50' => 'Southern Kordofan', '52' => 'Kassala', '53' => 'River Nile', '55' => 'Northern Darfur' }, 'SE' => { '02' => 'Blekinge Lan', '03' => 'Gavleborgs Lan', '05' => 'Gotlands Lan', '06' => 'Hallands Lan', '07' => 'Jamtlands Lan', '08' => 'Jonkopings Lan', '09' => 'Kalmar Lan', '10' => 'Dalarnas Lan', '12' => 'Kronobergs Lan', '14' => 'Norrbottens Lan', '15' => 'Orebro Lan', '16' => 'Ostergotlands Lan', '18' => 'Sodermanlands Lan', '21' => 'Uppsala Lan', '22' => 'Varmlands Lan', '23' => 'Vasterbottens Lan', '24' => 'Vasternorrlands Lan', '25' => 'Vastmanlands Lan', '26' => 'Stockholms Lan', '27' => 'Skane Lan', '28' => 'Vastra Gotaland' }, 'SH' => { '01' => 'Ascension', '02' => 'Saint Helena', '03' => 'Tristan da Cunha' }, 'SI' => { '01' => 'Ajdovscina Commune', '02' => 'Beltinci Commune', '03' => 'Bled Commune', '04' => 'Bohinj Commune', '05' => 'Borovnica Commune', '06' => 'Bovec Commune', '07' => 'Brda Commune', '08' => 'Brezice Commune', '09' => 'Brezovica Commune', '11' => 'Celje Commune', '12' => 'Cerklje na Gorenjskem Commune', '13' => 'Cerknica Commune', '14' => 'Cerkno Commune', '15' => 'Crensovci Commune', '16' => 'Crna na Koroskem Commune', '17' => 'Crnomelj Commune', '19' => 'Divaca Commune', '20' => 'Dobrepolje Commune', '22' => 'Dol pri Ljubljani Commune', '24' => 'Dornava Commune', '25' => 'Dravograd Commune', '26' => 'Duplek Commune', '27' => 'Gorenja vas-Poljane Commune', '28' => 'Gorisnica Commune', '29' => 'Gornja Radgona Commune', '30' => 'Gornji Grad Commune', '31' => 'Gornji Petrovci Commune', '32' => 'Grosuplje Commune', '34' => 'Hrastnik Commune', '35' => 'Hrpelje-Kozina Commune', '36' => 'Idrija Commune', '37' => 'Ig Commune', '38' => 'Ilirska Bistrica Commune', '39' => 'Ivancna Gorica Commune', '40' => 'Izola-Isola Commune', '42' => 'Jursinci Commune', '44' => 'Kanal Commune', '45' => 'Kidricevo Commune', '46' => 'Kobarid Commune', '47' => 'Kobilje Commune', '49' => 'Komen Commune', '50' => 'Koper-Capodistria Urban Commune', '51' => 'Kozje Commune', '52' => 'Kranj Commune', '53' => 'Kranjska Gora Commune', '54' => 'Krsko Commune', '55' => 'Kungota Commune', '57' => 'Lasko Commune', '61' => 'Ljubljana Urban Commune', '62' => 'Ljubno Commune', '64' => 'Logatec Commune', '66' => 'Loski Potok Commune', '68' => 'Lukovica Commune', '71' => 'Medvode Commune', '72' => 'Menges Commune', '73' => 'Metlika Commune', '74' => 'Mezica Commune', '76' => 'Mislinja Commune', '77' => 'Moravce Commune', '78' => 'Moravske Toplice Commune', '79' => 'Mozirje Commune', '80' => 'Murska Sobota Urban Commune', '81' => 'Muta Commune', '82' => 'Naklo Commune', '83' => 'Nazarje Commune', '84' => 'Nova Gorica Urban Commune', '86' => 'Odranci Commune', '87' => 'Ormoz Commune', '88' => 'Osilnica Commune', '89' => 'Pesnica Commune', '91' => 'Pivka Commune', '92' => 'Podcetrtek Commune', '94' => 'Postojna Commune', '97' => 'Puconci Commune', '98' => 'Race-Fram Commune', '99' => 'Radece Commune', 'A1' => 'Radenci Commune', 'A2' => 'Radlje ob Dravi Commune', 'A3' => 'Radovljica Commune', 'A6' => 'Rogasovci Commune', 'A7' => 'Rogaska Slatina Commune', 'A8' => 'Rogatec Commune', 'B1' => 'Semic Commune', 'B2' => 'Sencur Commune', 'B3' => 'Sentilj Commune', 'B4' => 'Sentjernej Commune', 'B6' => 'Sevnica Commune', 'B7' => 'Sezana Commune', 'B8' => 'Skocjan Commune', 'B9' => 'Skofja Loka Commune', 'C1' => 'Skofljica Commune', 'C2' => 'Slovenj Gradec Urban Commune', 'C4' => 'Slovenske Konjice Commune', 'C5' => 'Smarje pri Jelsah Commune', 'C6' => 'Smartno ob Paki Commune', 'C7' => 'Sostanj Commune', 'C8' => 'Starse Commune', 'C9' => 'Store Commune', 'D1' => 'Sveti Jurij Commune', 'D2' => 'Tolmin Commune', 'D3' => 'Trbovlje Commune', 'D4' => 'Trebnje Commune', 'D5' => 'Trzic Commune', 'D6' => 'Turnisce Commune', 'D7' => 'Velenje Urban Commune', 'D8' => 'Velike Lasce Commune', 'E1' => 'Vipava Commune', 'E2' => 'Vitanje Commune', 'E3' => 'Vodice Commune', 'E5' => 'Vrhnika Commune', 'E6' => 'Vuzenica Commune', 'E7' => 'Zagorje ob Savi Commune', 'E9' => 'Zavrc Commune', 'F1' => 'Zelezniki Commune', 'F2' => 'Ziri Commune', 'F3' => 'Zrece Commune', 'F4' => 'Benedikt Commune', 'F5' => 'Bistrica ob Sotli Commune', 'F6' => 'Bloke Commune', 'F7' => 'Braslovce Commune', 'F8' => 'Cankova Commune', 'F9' => 'Cerkvenjak Commune', 'G1' => 'Destrnik Commune', 'G2' => 'Dobje Commune', 'G3' => 'Dobrna Commune', 'G4' => 'Dobrova-Horjul-Polhov Gradec Commune', 'G5' => 'Dobrovnik-Dobronak Commune', 'G6' => 'Dolenjske Toplice Commune', 'G7' => 'Domzale Commune', 'G8' => 'Grad Commune', 'G9' => 'Hajdina Commune', 'H1' => 'Hoce-Slivnica Commune', 'H2' => 'Hodos-Hodos Commune', 'H3' => 'Horjul Commune', 'H4' => 'Jesenice Commune', 'H5' => 'Jezersko Commune', 'H6' => 'Kamnik Commune', 'H7' => 'Kocevje Commune', 'H8' => 'Komenda Commune', 'H9' => 'Kostel Commune', 'I1' => 'Krizevci Commune', 'I2' => 'Kuzma Commune', 'I3' => 'Lenart Commune', 'I4' => 'Lendava-Lendva Commune', 'I5' => 'Litija Commune', 'I6' => 'Ljutomer Commune', 'I7' => 'Loska Dolina Commune', 'I8' => 'Lovrenc na Pohorju Commune', 'I9' => 'Luce Commune', 'J1' => 'Majsperk Commune', 'J2' => 'Maribor Commune', 'J3' => 'Markovci Commune', 'J4' => 'Miklavz na Dravskem polju Commune', 'J5' => 'Miren-Kostanjevica Commune', 'J6' => 'Mirna Pec Commune', 'J7' => 'Novo mesto Urban Commune', 'J8' => 'Oplotnica Commune', 'J9' => 'Piran-Pirano Commune', 'K1' => 'Podlehnik Commune', 'K2' => 'Podvelka Commune', 'K3' => 'Polzela Commune', 'K4' => 'Prebold Commune', 'K5' => 'Preddvor Commune', 'K6' => 'Prevalje Commune', 'K7' => 'Ptuj Urban Commune', 'K8' => 'Ravne na Koroskem Commune', 'K9' => 'Razkrizje Commune', 'L1' => 'Ribnica Commune', 'L2' => 'Ribnica na Pohorju Commune', 'L3' => 'Ruse Commune', 'L4' => 'Salovci Commune', 'L5' => 'Selnica ob Dravi Commune', 'L6' => 'Sempeter-Vrtojba Commune', 'L7' => 'Sentjur pri Celju Commune', 'L8' => 'Slovenska Bistrica Commune', 'L9' => 'Smartno pri Litiji Commune', 'M1' => 'Sodrazica Commune', 'M2' => 'Solcava Commune', 'M3' => 'Sveta Ana Commune', 'M4' => 'Sveti Andraz v Slovenskih goricah Commune', 'M5' => 'Tabor Commune', 'M6' => 'Tisina Commune', 'M7' => 'Trnovska vas Commune', 'M8' => 'Trzin Commune', 'M9' => 'Velika Polana Commune', 'N1' => 'Verzej Commune', 'N2' => 'Videm Commune', 'N3' => 'Vojnik Commune', 'N4' => 'Vransko Commune', 'N5' => 'Zalec Commune', 'N6' => 'Zetale Commune', 'N7' => 'Zirovnica Commune', 'N8' => 'Zuzemberk Commune', 'N9' => 'Apace Commune', 'O1' => 'Cirkulane Commune', 'O2' => 'Gorje', 'O3' => 'Kostanjevica na Krki', 'O4' => 'Log-Dragomer', 'O5' => 'Makole', 'O6' => 'Mirna', 'O7' => 'Mokronog-Trebelno', 'O8' => 'Poljcane', 'O9' => 'Recica ob Savinji', 'P1' => 'Rence-Vogrsko', 'P2' => 'Sentrupert', 'P3' => 'Smarjesk Toplice', 'P4' => 'Sredisce ob Dravi', 'P5' => 'Straza', 'P7' => 'Sveti Jurij v Slovenskih Goricah' }, 'SK' => { '01' => 'Banska Bystrica', '02' => 'Bratislava', '03' => 'Kosice', '04' => 'Nitra', '05' => 'Presov', '06' => 'Trencin', '07' => 'Trnava', '08' => 'Zilina' }, 'SL' => { '01' => 'Eastern', '02' => 'Northern', '03' => 'Southern', '04' => 'Western Area' }, 'SM' => { '01' => 'Acquaviva', '02' => 'Chiesanuova', '03' => 'Domagnano', '04' => 'Faetano', '05' => 'Fiorentino', '06' => 'Borgo Maggiore', '07' => 'San Marino', '08' => 'Monte Giardino', '09' => 'Serravalle' }, 'SN' => { '01' => 'Dakar', '03' => 'Diourbel', '05' => 'Tambacounda', '07' => 'Thies', '09' => 'Fatick', '10' => 'Kaolack', '11' => 'Kolda', '12' => 'Ziguinchor', '13' => 'Louga', '14' => 'Saint-Louis', '15' => 'Matam' }, 'SO' => { '01' => 'Bakool', '02' => 'Banaadir', '03' => 'Bari', '04' => 'Bay', '05' => 'Galguduud', '06' => 'Gedo', '07' => 'Hiiraan', '08' => 'Jubbada Dhexe', '09' => 'Jubbada Hoose', '10' => 'Mudug', '11' => 'Nugaal', '12' => 'Sanaag', '13' => 'Shabeellaha Dhexe', '14' => 'Shabeellaha Hoose', '16' => 'Woqooyi Galbeed', '18' => 'Nugaal', '19' => 'Togdheer', '20' => 'Woqooyi Galbeed', '21' => 'Awdal', '22' => 'Sool' }, 'SR' => { '10' => 'Brokopondo', '11' => 'Commewijne', '12' => 'Coronie', '13' => 'Marowijne', '14' => 'Nickerie', '15' => 'Para', '16' => 'Paramaribo', '17' => 'Saramacca', '18' => 'Sipaliwini', '19' => 'Wanica' }, 'SS' => { '01' => 'Central Equatoria', '02' => 'Eastern Equatoria', '03' => 'Jonglei', '04' => 'Lakes', '05' => 'Northern Bahr el Ghazal', '06' => 'Unity', '07' => 'Upper Nile', '08' => 'Warrap', '09' => 'Western Bahr el Ghazal', '10' => 'Western Equatoria' }, 'ST' => { '01' => 'Principe', '02' => 'Sao Tome' }, 'SV' => { '01' => 'Ahuachapan', '02' => 'Cabanas', '03' => 'Chalatenango', '04' => 'Cuscatlan', '05' => 'La Libertad', '06' => 'La Paz', '07' => 'La Union', '08' => 'Morazan', '09' => 'San Miguel', '10' => 'San Salvador', '11' => 'Santa Ana', '12' => 'San Vicente', '13' => 'Sonsonate', '14' => 'Usulutan' }, 'SY' => { '01' => 'Al Hasakah', '02' => 'Al Ladhiqiyah', '03' => 'Al Qunaytirah', '04' => 'Ar Raqqah', '05' => 'As Suwayda\'', '06' => 'Dar', '07' => 'Dayr az Zawr', '08' => 'Rif Dimashq', '09' => 'Halab', '10' => 'Hamah', '11' => 'Hims', '12' => 'Idlib', '13' => 'Dimashq', '14' => 'Tartus' }, 'SZ' => { '01' => 'Hhohho', '02' => 'Lubombo', '03' => 'Manzini', '04' => 'Shiselweni', '05' => 'Praslin' }, 'TD' => { '01' => 'Batha', '02' => 'Biltine', '03' => 'Borkou-Ennedi-Tibesti', '04' => 'Chari-Baguirmi', '05' => 'Guera', '06' => 'Kanem', '07' => 'Lac', '08' => 'Logone Occidental', '09' => 'Logone Oriental', '10' => 'Mayo-Kebbi', '11' => 'Moyen-Chari', '12' => 'Ouaddai', '13' => 'Salamat', '14' => 'Tandjile' }, 'TG' => { '22' => 'Centrale', '23' => 'Kara', '24' => 'Maritime', '25' => 'Plateaux', '26' => 'Savanes' }, 'TH' => { '01' => 'Mae Hong Son', '02' => 'Chiang Mai', '03' => 'Chiang Rai', '04' => 'Nan', '05' => 'Lamphun', '06' => 'Lampang', '07' => 'Phrae', '08' => 'Tak', '09' => 'Sukhothai', '10' => 'Uttaradit', '11' => 'Kamphaeng Phet', '12' => 'Phitsanulok', '13' => 'Phichit', '14' => 'Phetchabun', '15' => 'Uthai Thani', '16' => 'Nakhon Sawan', '17' => 'Nong Khai', '18' => 'Loei', '20' => 'Sakon Nakhon', '21' => 'Nakhon Phanom', '22' => 'Khon Kaen', '23' => 'Kalasin', '24' => 'Maha Sarakham', '25' => 'Roi Et', '26' => 'Chaiyaphum', '27' => 'Nakhon Ratchasima', '28' => 'Buriram', '29' => 'Surin', '30' => 'Sisaket', '31' => 'Narathiwat', '32' => 'Chai Nat', '33' => 'Sing Buri', '34' => 'Lop Buri', '35' => 'Ang Thong', '36' => 'Phra Nakhon Si Ayutthaya', '37' => 'Saraburi', '38' => 'Nonthaburi', '39' => 'Pathum Thani', '40' => 'Krung Thep', '41' => 'Phayao', '42' => 'Samut Prakan', '43' => 'Nakhon Nayok', '44' => 'Chachoengsao', '45' => 'Prachin Buri', '46' => 'Chon Buri', '47' => 'Rayong', '48' => 'Chanthaburi', '49' => 'Trat', '50' => 'Kanchanaburi', '51' => 'Suphan Buri', '52' => 'Ratchaburi', '53' => 'Nakhon Pathom', '54' => 'Samut Songkhram', '55' => 'Samut Sakhon', '56' => 'Phetchaburi', '57' => 'Prachuap Khiri Khan', '58' => 'Chumphon', '59' => 'Ranong', '60' => 'Surat Thani', '61' => 'Phangnga', '62' => 'Phuket', '63' => 'Krabi', '64' => 'Nakhon Si Thammarat', '65' => 'Trang', '66' => 'Phatthalung', '67' => 'Satun', '68' => 'Songkhla', '69' => 'Pattani', '70' => 'Yala', '71' => 'Ubon Ratchathani', '72' => 'Yasothon', '73' => 'Nakhon Phanom', '74' => 'Prachin Buri', '75' => 'Ubon Ratchathani', '76' => 'Udon Thani', '77' => 'Amnat Charoen', '78' => 'Mukdahan', '79' => 'Nong Bua Lamphu', '80' => 'Sa Kaeo', '81' => 'Bueng Kan' }, 'TJ' => { '01' => 'Kuhistoni Badakhshon', '02' => 'Khatlon', '03' => 'Sughd', '04' => 'Dushanbe', '05' => 'Nohiyahoi Tobei Jumhuri' }, 'TL' => { '06' => 'Dili' }, 'TM' => { '01' => 'Ahal', '02' => 'Balkan', '03' => 'Dashoguz', '04' => 'Lebap', '05' => 'Mary' }, 'TN' => { '02' => 'Kasserine', '03' => 'Kairouan', '06' => 'Jendouba', '10' => 'Qafsah', '14' => 'El Kef', '15' => 'Al Mahdia', '16' => 'Al Munastir', '17' => 'Bajah', '18' => 'Bizerte', '19' => 'Nabeul', '22' => 'Siliana', '23' => 'Sousse', '27' => 'Ben Arous', '28' => 'Madanin', '29' => 'Gabes', '31' => 'Kebili', '32' => 'Sfax', '33' => 'Sidi Bou Zid', '34' => 'Tataouine', '35' => 'Tozeur', '36' => 'Tunis', '37' => 'Zaghouan', '38' => 'Aiana', '39' => 'Manouba' }, 'TO' => { '01' => 'Ha', '02' => 'Tongatapu', '03' => 'Vava' }, 'TR' => { '02' => 'Adiyaman', '03' => 'Afyonkarahisar', '04' => 'Agri', '05' => 'Amasya', '07' => 'Antalya', '08' => 'Artvin', '09' => 'Aydin', '10' => 'Balikesir', '11' => 'Bilecik', '12' => 'Bingol', '13' => 'Bitlis', '14' => 'Bolu', '15' => 'Burdur', '16' => 'Bursa', '17' => 'Canakkale', '19' => 'Corum', '20' => 'Denizli', '21' => 'Diyarbakir', '22' => 'Edirne', '23' => 'Elazig', '24' => 'Erzincan', '25' => 'Erzurum', '26' => 'Eskisehir', '28' => 'Giresun', '31' => 'Hatay', '32' => 'Mersin', '33' => 'Isparta', '34' => 'Istanbul', '35' => 'Izmir', '37' => 'Kastamonu', '38' => 'Kayseri', '39' => 'Kirklareli', '40' => 'Kirsehir', '41' => 'Kocaeli', '43' => 'Kutahya', '44' => 'Malatya', '45' => 'Manisa', '46' => 'Kahramanmaras', '48' => 'Mugla', '49' => 'Mus', '50' => 'Nevsehir', '52' => 'Ordu', '53' => 'Rize', '54' => 'Sakarya', '55' => 'Samsun', '57' => 'Sinop', '58' => 'Sivas', '59' => 'Tekirdag', '60' => 'Tokat', '61' => 'Trabzon', '62' => 'Tunceli', '63' => 'Sanliurfa', '64' => 'Usak', '65' => 'Van', '66' => 'Yozgat', '68' => 'Ankara', '69' => 'Gumushane', '70' => 'Hakkari', '71' => 'Konya', '72' => 'Mardin', '73' => 'Nigde', '74' => 'Siirt', '75' => 'Aksaray', '76' => 'Batman', '77' => 'Bayburt', '78' => 'Karaman', '79' => 'Kirikkale', '80' => 'Sirnak', '81' => 'Adana', '82' => 'Cankiri', '83' => 'Gaziantep', '84' => 'Kars', '85' => 'Zonguldak', '86' => 'Ardahan', '87' => 'Bartin', '88' => 'Igdir', '89' => 'Karabuk', '90' => 'Kilis', '91' => 'Osmaniye', '92' => 'Yalova', '93' => 'Duzce' }, 'TT' => { '01' => 'Arima', '02' => 'Caroni', '03' => 'Mayaro', '04' => 'Nariva', '05' => 'Port-of-Spain', '06' => 'Saint Andrew', '07' => 'Saint David', '08' => 'Saint George', '09' => 'Saint Patrick', '10' => 'San Fernando', '11' => 'Tobago', '12' => 'Victoria' }, 'TW' => { '01' => 'Fu-chien', '02' => 'Kao-hsiung', '03' => 'T\'ai-pei', '04' => 'T\'ai-wan' }, 'TZ' => { '02' => 'Pwani', '03' => 'Dodoma', '04' => 'Iringa', '05' => 'Kigoma', '06' => 'Kilimanjaro', '07' => 'Lindi', '08' => 'Mara', '09' => 'Mbeya', '10' => 'Morogoro', '11' => 'Mtwara', '12' => 'Mwanza', '13' => 'Pemba North', '14' => 'Ruvuma', '15' => 'Shinyanga', '16' => 'Singida', '17' => 'Tabora', '18' => 'Tanga', '19' => 'Kagera', '20' => 'Pemba South', '21' => 'Zanzibar Central', '22' => 'Zanzibar North', '23' => 'Dar es Salaam', '24' => 'Rukwa', '25' => 'Zanzibar Urban', '26' => 'Arusha', '27' => 'Manyara' }, 'UA' => { '01' => 'Cherkas\'ka Oblast\'', '02' => 'Chernihivs\'ka Oblast\'', '03' => 'Chernivets\'ka Oblast\'', '04' => 'Dnipropetrovs\'ka Oblast\'', '05' => 'Donets\'ka Oblast\'', '06' => 'Ivano-Frankivs\'ka Oblast\'', '07' => 'Kharkivs\'ka Oblast\'', '08' => 'Khersons\'ka Oblast\'', '09' => 'Khmel\'nyts\'ka Oblast\'', '10' => 'Kirovohrads\'ka Oblast\'', '11' => 'Krym', '12' => 'Kyyiv', '13' => 'Kyyivs\'ka Oblast\'', '14' => 'Luhans\'ka Oblast\'', '15' => 'L\'vivs\'ka Oblast\'', '16' => 'Mykolayivs\'ka Oblast\'', '17' => 'Odes\'ka Oblast\'', '18' => 'Poltavs\'ka Oblast\'', '19' => 'Rivnens\'ka Oblast\'', '20' => 'Sevastopol\'', '21' => 'Sums\'ka Oblast\'', '22' => 'Ternopil\'s\'ka Oblast\'', '23' => 'Vinnyts\'ka Oblast\'', '24' => 'Volyns\'ka Oblast\'', '25' => 'Zakarpats\'ka Oblast\'', '26' => 'Zaporiz\'ka Oblast\'', '27' => 'Zhytomyrs\'ka Oblast\'' }, 'UG' => { '26' => 'Apac', '28' => 'Bundibugyo', '29' => 'Bushenyi', '30' => 'Gulu', '31' => 'Hoima', '33' => 'Jinja', '36' => 'Kalangala', '37' => 'Kampala', '38' => 'Kamuli', '39' => 'Kapchorwa', '40' => 'Kasese', '41' => 'Kibale', '42' => 'Kiboga', '43' => 'Kisoro', '45' => 'Kotido', '46' => 'Kumi', '47' => 'Lira', '50' => 'Masindi', '52' => 'Mbarara', '56' => 'Mubende', '58' => 'Nebbi', '59' => 'Ntungamo', '60' => 'Pallisa', '61' => 'Rakai', '65' => 'Adjumani', '66' => 'Bugiri', '67' => 'Busia', '69' => 'Katakwi', '70' => 'Luwero', '71' => 'Masaka', '72' => 'Moyo', '73' => 'Nakasongola', '74' => 'Sembabule', '76' => 'Tororo', '77' => 'Arua', '78' => 'Iganga', '79' => 'Kabarole', '80' => 'Kaberamaido', '81' => 'Kamwenge', '82' => 'Kanungu', '83' => 'Kayunga', '84' => 'Kitgum', '85' => 'Kyenjojo', '86' => 'Mayuge', '87' => 'Mbale', '88' => 'Moroto', '89' => 'Mpigi', '90' => 'Mukono', '91' => 'Nakapiripirit', '92' => 'Pader', '93' => 'Rukungiri', '94' => 'Sironko', '95' => 'Soroti', '96' => 'Wakiso', '97' => 'Yumbe' }, 'US' => { 'AA' => 'Armed Forces Americas', 'AE' => 'Armed Forces Europe, Middle East, & Canada', 'AK' => 'Alaska', 'AL' => 'Alabama', 'AP' => 'Armed Forces Pacific', 'AR' => 'Arkansas', 'AS' => 'American Samoa', 'AZ' => 'Arizona', 'CA' => 'California', 'CO' => 'Colorado', 'CT' => 'Connecticut', 'DC' => 'District of Columbia', 'DE' => 'Delaware', 'FL' => 'Florida', 'FM' => 'Federated States of Micronesia', 'GA' => 'Georgia', 'GU' => 'Guam', 'HI' => 'Hawaii', 'IA' => 'Iowa', 'ID' => 'Idaho', 'IL' => 'Illinois', 'IN' => 'Indiana', 'KS' => 'Kansas', 'KY' => 'Kentucky', 'LA' => 'Louisiana', 'MA' => 'Massachusetts', 'MD' => 'Maryland', 'ME' => 'Maine', 'MH' => 'Marshall Islands', 'MI' => 'Michigan', 'MN' => 'Minnesota', 'MO' => 'Missouri', 'MP' => 'Northern Mariana Islands', 'MS' => 'Mississippi', 'MT' => 'Montana', 'NC' => 'North Carolina', 'ND' => 'North Dakota', 'NE' => 'Nebraska', 'NH' => 'New Hampshire', 'NJ' => 'New Jersey', 'NM' => 'New Mexico', 'NV' => 'Nevada', 'NY' => 'New York', 'OH' => 'Ohio', 'OK' => 'Oklahoma', 'OR' => 'Oregon', 'PA' => 'Pennsylvania', 'PW' => 'Palau', 'RI' => 'Rhode Island', 'SC' => 'South Carolina', 'SD' => 'South Dakota', 'TN' => 'Tennessee', 'TX' => 'Texas', 'UT' => 'Utah', 'VA' => 'Virginia', 'VI' => 'Virgin Islands', 'VT' => 'Vermont', 'WA' => 'Washington', 'WI' => 'Wisconsin', 'WV' => 'West Virginia', 'WY' => 'Wyoming' }, 'UY' => { '01' => 'Artigas', '02' => 'Canelones', '03' => 'Cerro Largo', '04' => 'Colonia', '05' => 'Durazno', '06' => 'Flores', '07' => 'Florida', '08' => 'Lavalleja', '09' => 'Maldonado', '10' => 'Montevideo', '11' => 'Paysandu', '12' => 'Rio Negro', '13' => 'Rivera', '14' => 'Rocha', '15' => 'Salto', '16' => 'San Jose', '17' => 'Soriano', '18' => 'Tacuarembo', '19' => 'Treinta y Tres' }, 'UZ' => { '01' => 'Andijon', '02' => 'Bukhoro', '03' => 'Farghona', '04' => 'Jizzakh', '05' => 'Khorazm', '06' => 'Namangan', '07' => 'Nawoiy', '08' => 'Qashqadaryo', '09' => 'Qoraqalpoghiston', '10' => 'Samarqand', '11' => 'Sirdaryo', '12' => 'Surkhondaryo', '13' => 'Toshkent', '14' => 'Toshkent', '15' => 'Jizzax' }, 'VC' => { '01' => 'Charlotte', '02' => 'Saint Andrew', '03' => 'Saint David', '04' => 'Saint George', '05' => 'Saint Patrick', '06' => 'Grenadines' }, 'VE' => { '01' => 'Amazonas', '02' => 'Anzoategui', '03' => 'Apure', '04' => 'Aragua', '05' => 'Barinas', '06' => 'Bolivar', '07' => 'Carabobo', '08' => 'Cojedes', '09' => 'Delta Amacuro', '11' => 'Falcon', '12' => 'Guarico', '13' => 'Lara', '14' => 'Merida', '15' => 'Miranda', '16' => 'Monagas', '17' => 'Nueva Esparta', '18' => 'Portuguesa', '19' => 'Sucre', '20' => 'Tachira', '21' => 'Trujillo', '22' => 'Yaracuy', '23' => 'Zulia', '24' => 'Dependencias Federales', '25' => 'Distrito Federal', '26' => 'Vargas' }, 'VN' => { '01' => 'An Giang', '03' => 'Ben Tre', '05' => 'Cao Bang', '09' => 'Dong Thap', '13' => 'Hai Phong', '20' => 'Ho Chi Minh', '21' => 'Kien Giang', '23' => 'Lam Dong', '24' => 'Long An', '30' => 'Quang Ninh', '32' => 'Son La', '33' => 'Tay Ninh', '34' => 'Thanh Hoa', '35' => 'Thai Binh', '37' => 'Tien Giang', '39' => 'Lang Son', '43' => 'Dong Nai', '44' => 'Ha Noi', '45' => 'Ba Ria-Vung Tau', '46' => 'Binh Dinh', '47' => 'Binh Thuan', '49' => 'Gia Lai', '50' => 'Ha Giang', '52' => 'Ha Tinh', '53' => 'Hoa Binh', '54' => 'Khanh Hoa', '55' => 'Kon Tum', '58' => 'Nghe An', '59' => 'Ninh Binh', '60' => 'Ninh Thuan', '61' => 'Phu Yen', '62' => 'Quang Binh', '63' => 'Quang Ngai', '64' => 'Quang Tri', '65' => 'Soc Trang', '66' => 'Thua Thien-Hue', '67' => 'Tra Vinh', '68' => 'Tuyen Quang', '69' => 'Vinh Long', '70' => 'Yen Bai', '71' => 'Bac Giang', '72' => 'Bac Kan', '73' => 'Bac Lieu', '74' => 'Bac Ninh', '75' => 'Binh Duong', '76' => 'Binh Phuoc', '77' => 'Ca Mau', '78' => 'Da Nang', '79' => 'Hai Duong', '80' => 'Ha Nam', '81' => 'Hung Yen', '82' => 'Nam Dinh', '83' => 'Phu Tho', '84' => 'Quang Nam', '85' => 'Thai Nguyen', '86' => 'Vinh Phuc', '87' => 'Can Tho', '88' => 'Dac Lak', '89' => 'Lai Chau', '90' => 'Lao Cai', '91' => 'Dak Nong', '92' => 'Dien Bien', '93' => 'Hau Giang' }, 'VU' => { '05' => 'Ambrym', '06' => 'Aoba', '07' => 'Torba', '08' => 'Efate', '09' => 'Epi', '10' => 'Malakula', '11' => 'Paama', '12' => 'Pentecote', '13' => 'Sanma', '14' => 'Shepherd', '15' => 'Tafea', '16' => 'Malampa', '17' => 'Penama', '18' => 'Shefa' }, 'WS' => { '02' => 'Aiga-i-le-Tai', '03' => 'Atua', '04' => 'Fa', '05' => 'Gaga', '06' => 'Va', '07' => 'Gagaifomauga', '08' => 'Palauli', '09' => 'Satupa', '10' => 'Tuamasaga', '11' => 'Vaisigano' }, 'YE' => { '01' => 'Abyan', '02' => 'Adan', '03' => 'Al Mahrah', '04' => 'Hadramawt', '05' => 'Shabwah', '06' => 'Lahij', '07' => 'Al Bayda\'', '08' => 'Al Hudaydah', '09' => 'Al Jawf', '10' => 'Al Mahwit', '11' => 'Dhamar', '12' => 'Hajjah', '13' => 'Ibb', '14' => 'Ma\'rib', '15' => 'Sa\'dah', '16' => 'San\'a\'', '17' => 'Taizz', '18' => 'Ad Dali', '19' => 'Amran', '20' => 'Al Bayda\'', '21' => 'Al Jawf', '22' => 'Hajjah', '23' => 'Ibb', '24' => 'Lahij', '25' => 'Taizz' }, 'ZA' => { '01' => 'North-Western Province', '02' => 'KwaZulu-Natal', '03' => 'Free State', '05' => 'Eastern Cape', '06' => 'Gauteng', '07' => 'Mpumalanga', '08' => 'Northern Cape', '09' => 'Limpopo', '10' => 'North-West', '11' => 'Western Cape' }, 'ZM' => { '01' => 'Western', '02' => 'Central', '03' => 'Eastern', '04' => 'Luapula', '05' => 'Northern', '06' => 'North-Western', '07' => 'Southern', '08' => 'Copperbelt', '09' => 'Lusaka' }, 'ZW' => { '01' => 'Manicaland', '02' => 'Midlands', '03' => 'Mashonaland Central', '04' => 'Mashonaland East', '05' => 'Mashonaland West', '06' => 'Matabeleland North', '07' => 'Matabeleland South', '08' => 'Masvingo', '09' => 'Bulawayo', '10' => 'Harare' } ); sub continent_code_by_country_code { my $id = $_id_by_code{ $_[1] } || 0; return $continents[$id]; } sub time_zone { Geo::IP::Record->_time_zone( $_[1], $_[2] ) } sub _get_region_name { my ( $ccode, $region ) = @_; return unless $region; return if $region eq '00'; return $country_region_names{$ccode}->{$region} if exists $country_region_names{$ccode}; } # --- unfortunately we do not know the path so we assume the # default path /usr/local/share/GeoIP # if thats not true, you can set $Geo::IP::PP_OPEN_TYPE_PATH # sub open_type { my ( $class, $type, $flags ) = @_; my %type_dat_name_mapper = ( GEOIP_COUNTRY_EDITION() => 'GeoIP', GEOIP_COUNTRY_EDITION_V6() => 'GeoIPv6', GEOIP_REGION_EDITION_REV0() => 'GeoIPRegion', GEOIP_REGION_EDITION_REV1() => 'GeoIPRegion', GEOIP_CITY_EDITION_REV0() => 'GeoIPCity', GEOIP_CITY_EDITION_REV1() => 'GeoIPCity', GEOIP_CITY_EDITION_REV0_V6() => 'GeoIPCityv6', GEOIP_CITY_EDITION_REV1_V6() => 'GeoIPCityv6', GEOIP_ISP_EDITION() => 'GeoIPISP', GEOIP_ORG_EDITION() => 'GeoIPOrg', GEOIP_PROXY_EDITION() => 'GeoIPProxy', GEOIP_ASNUM_EDITION() => 'GeoIPASNum', GEOIP_ASNUM_EDITION_V6() => 'GeoIPASNumv6', GEOIP_NETSPEED_EDITION() => 'GeoIPNetSpeed', GEOIP_NETSPEED_EDITION_REV1() => 'GeoIPNetSpeed', GEOIP_DOMAIN_EDITION() => 'GeoIPDomain', ); # backward compatibility for 2003 databases. $type -= 105 if $type >= 106; my $name = $type_dat_name_mapper{$type}; die("Invalid database type $type\n") unless $name; my $mkpath = sub { File::Spec->catfile( File::Spec->rootdir, @_ ) }; my $path = defined $Geo::IP::PP_OPEN_TYPE_PATH ? $Geo::IP::PP_OPEN_TYPE_PATH : do { $^O eq 'NetWare' ? $mkpath->(qw/ etc GeoIP /) : do { $^O eq 'MSWin32' ? $mkpath->(qw/ GeoIP /) : $mkpath->(qw/ usr local share GeoIP /); } }; my $filename = File::Spec->catfile( $path, $name . '.dat' ); return $class->open( $filename, $flags ); } sub open { die "Geo::IP::open() requires a path name" unless ( @_ > 1 and $_[1] ); my ( $class, $db_file, $flags ) = @_; my $fh = FileHandle->new; my $gi; CORE::open $fh, "$db_file" or die "Error opening $db_file"; binmode($fh); if ( $flags && ( $flags & ( GEOIP_MEMORY_CACHE | GEOIP_MMAP_CACHE ) ) ) { my %self; if ( $flags & GEOIP_MMAP_CACHE ) { die "Sys::Mmap required for MMAP support" unless defined $Sys::Mmap::VERSION; mmap( $self{buf} = undef, 0, PROT_READ, MAP_PRIVATE, $fh ) or die "mmap: $!"; } else { local $/ = undef; $self{buf} = <$fh>; } $self{fh} = $fh; $gi = bless \%self, $class; } else { $gi = bless { fh => $fh }, $class; } $gi->_setup_segments(); return $gi; } sub new { my ( $class, $db_file, $flags ) = @_; # this will be less messy once deprecated new( $path, [$flags] ) # is no longer supported (that's what open() is for) my $def_db_file = '/usr/local/share/GeoIP/GeoIP.dat'; if ( $^O eq 'NetWare' ) { $def_db_file = 'sys:/etc/GeoIP/GeoIP.dat'; } elsif ( $^O eq 'MSWin32' ) { $def_db_file = 'c:/GeoIP/GeoIP.dat'; } if ( !defined $db_file ) { # called as new() $db_file = $def_db_file; } elsif ( $db_file =~ /^\d+$/ ) { # called as new( $flags ) $flags = $db_file; $db_file = $def_db_file; } # else called as new( $database_filename, [$flags] ); $class->open( $db_file, $flags ); } #this function setups the database segments sub _setup_segments { my ($gi) = @_; my $a = 0; my $i = 0; my $j = 0; my $delim; my $buf; $gi->{_charset} = GEOIP_CHARSET_ISO_8859_1; $gi->{"databaseType"} = GEOIP_COUNTRY_EDITION; $gi->{"record_length"} = STANDARD_RECORD_LENGTH; my $filepos = tell( $gi->{fh} ); seek( $gi->{fh}, -3, 2 ); for ( $i = 0 ; $i < STRUCTURE_INFO_MAX_SIZE ; $i++ ) { read( $gi->{fh}, $delim, 3 ); #find the delim if ( $delim eq ( chr(255) . chr(255) . chr(255) ) ) { read( $gi->{fh}, $a, 1 ); #read the databasetype my $database_type = ord($a); # backward compatibility for 2003 databases. $database_type -= 105 if $database_type >= 106; $gi->{"databaseType"} = $database_type; #chose the database segment for the database type #if database Type is GEOIP_REGION_EDITION then use database segment GEOIP_STATE_BEGIN if ( $gi->{"databaseType"} == GEOIP_REGION_EDITION_REV0 ) { $gi->{"databaseSegments"} = GEOIP_STATE_BEGIN_REV0; } elsif ( $gi->{"databaseType"} == GEOIP_REGION_EDITION_REV1 ) { $gi->{"databaseSegments"} = GEOIP_STATE_BEGIN_REV1; } #if database Type is GEOIP_CITY_EDITION, GEOIP_ISP_EDITION or GEOIP_ORG_EDITION then #read in the database segment elsif (( $gi->{"databaseType"} == GEOIP_CITY_EDITION_REV0 ) || ( $gi->{"databaseType"} == GEOIP_CITY_EDITION_REV1 ) || ( $gi->{"databaseType"} == GEOIP_CITY_EDITION_REV0_V6 ) || ( $gi->{"databaseType"} == GEOIP_CITY_EDITION_REV1_V6 ) || ( $gi->{"databaseType"} == GEOIP_ORG_EDITION ) || ( $gi->{"databaseType"} == GEOIP_DOMAIN_EDITION ) || ( $gi->{"databaseType"} == GEOIP_ASNUM_EDITION ) || ( $gi->{"databaseType"} == GEOIP_ASNUM_EDITION_V6 ) || ( $gi->{"databaseType"} == GEOIP_NETSPEED_EDITION_REV1 ) || ( $gi->{"databaseType"} == GEOIP_ISP_EDITION ) ) { $gi->{"databaseSegments"} = 0; #read in the database segment for the database type read( $gi->{fh}, $buf, SEGMENT_RECORD_LENGTH ); for ( $j = 0 ; $j < SEGMENT_RECORD_LENGTH ; $j++ ) { $gi->{"databaseSegments"} += ( ord( substr( $buf, $j, 1 ) ) << ( $j * 8 ) ); } #record length is four for ISP databases and ORG databases #record length is three for country databases, region database and city databases if ( $gi->{"databaseType"} == GEOIP_ORG_EDITION || $gi->{"databaseType"} == GEOIP_ISP_EDITION || $gi->{"databaseType"} == GEOIP_DOMAIN_EDITION ) { $gi->{"record_length"} = ORG_RECORD_LENGTH; } } last; } else { seek( $gi->{fh}, -4, 1 ); } } #if database Type is GEOIP_COUNTY_EDITION then use database segment GEOIP_COUNTRY_BEGIN if ( $gi->{"databaseType"} == GEOIP_COUNTRY_EDITION || $gi->{"databaseType"} == GEOIP_COUNTRY_EDITION_V6 || $gi->{"databaseType"} == GEOIP_NETSPEED_EDITION ) { $gi->{"databaseSegments"} = GEOIP_COUNTRY_BEGIN; } seek( $gi->{fh}, $filepos, 0 ); return $gi; } sub _seek_country { my ( $gi, $ipnum ) = @_; my $fh = $gi->{fh}; my $offset = 0; my ( $x0, $x1 ); my $reclen = $gi->{record_length}; for ( my $depth = 31 ; $depth >= 0 ; $depth-- ) { unless ( exists $gi->{buf} ) { seek $fh, $offset * 2 * $reclen, 0; read $fh, $x0, $reclen; read $fh, $x1, $reclen; } else { $x0 = substr( $gi->{buf}, $offset * 2 * $reclen, $reclen ); $x1 = substr( $gi->{buf}, $offset * 2 * $reclen + $reclen, $reclen ); } $x0 = unpack( "V1", $x0 . "\0" ); $x1 = unpack( "V1", $x1 . "\0" ); if ( $ipnum & ( 1 << $depth ) ) { if ( $x1 >= $gi->{"databaseSegments"} ) { $gi->{last_netmask} = 32 - $depth; return $x1; } $offset = $x1; } else { if ( $x0 >= $gi->{"databaseSegments"} ) { $gi->{last_netmask} = 32 - $depth; return $x0; } $offset = $x0; } } print STDERR "Error Traversing Database for ipnum = $ipnum - Perhaps database is corrupt?"; } sub charset { return $_[0]->{_charset}; } sub set_charset { my ( $gi, $charset ) = @_; my $old_charset = $gi->{_charset}; $gi->{_charset} = $charset; return $old_charset; } #this function returns the country code of ip address sub country_code_by_addr { my ( $gi, $ip_address ) = @_; return unless $ip_address =~ m!^(?:\d{1,3}\.){3}\d{1,3}$!; return $countries[ $gi->id_by_addr($ip_address) ]; } #this function returns the country code3 of ip address sub country_code3_by_addr { my ( $gi, $ip_address ) = @_; return unless $ip_address =~ m!^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$!; return $code3s[ $gi->id_by_addr($ip_address) ]; } #this function returns the name of ip address sub country_name_by_addr { my ( $gi, $ip_address ) = @_; return unless $ip_address =~ m!^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$!; return $names[ $gi->id_by_addr($ip_address) ]; } sub id_by_addr { my ( $gi, $ip_address ) = @_; return unless $ip_address =~ m!^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$!; return $gi->_seek_country( addr_to_num($ip_address) ) - GEOIP_COUNTRY_BEGIN; } #this function returns the country code of domain name sub country_code_by_name { my ( $gi, $host ) = @_; my $country_id = $gi->id_by_name($host); return $countries[$country_id]; } #this function returns the country code3 of domain name sub country_code3_by_name { my ( $gi, $host ) = @_; my $country_id = $gi->id_by_name($host); return $code3s[$country_id]; } #this function returns the country name of domain name sub country_name_by_name { my ( $gi, $host ) = @_; my $country_id = $gi->id_by_name($host); return $names[$country_id]; } sub id_by_name { my ( $gi, $host ) = @_; my $ip_address; if ( $host =~ m!^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$! ) { $ip_address = $host; } else { $ip_address = join( '.', unpack( 'C4', ( gethostbyname($host) )[4] ) ); } return unless $ip_address; return $gi->_seek_country( addr_to_num($ip_address) ) - GEOIP_COUNTRY_BEGIN; } #this function returns the city record as a hash ref sub get_city_record_as_hash { my ( $gi, $host ) = @_; my %gir; @gir{ qw/ country_code country_code3 country_name region city postal_code latitude longitude dma_code area_code continent_code region_name metro_code / } = $gi->get_city_record($host); return defined( $gir{latitude} ) ? bless( \%gir, 'Geo::IP::Record' ) : undef; } *record_by_addr = \&get_city_record_as_hash; *record_by_name = \&get_city_record_as_hash; sub org_by_name { my ( $gi, $host ) = @_; return $gi->org_by_addr( $gi->get_ip_address($host) ); } #this function returns isp or org of the domain name sub org_by_addr { my ( $gi, $ip_address ) = @_; my $seek_org = $gi->_seek_country( addr_to_num($ip_address) ); return $gi->_common_org($seek_org); } sub _common_org { my ($gi, $seek_org) = @_; my $char; my $org_buf; my $record_pointer; if ( $seek_org == $gi->{"databaseSegments"} ) { return undef; } $record_pointer = $seek_org + ( 2 * $gi->{"record_length"} - 1 ) * $gi->{"databaseSegments"}; unless ( exists $gi->{buf} ) { seek( $gi->{"fh"}, $record_pointer, 0 ); read( $gi->{"fh"}, $org_buf, MAX_ORG_RECORD_LENGTH ); } else { $org_buf = substr( $gi->{buf}, $record_pointer, MAX_ORG_RECORD_LENGTH ); } $org_buf = unpack 'Z*' => $org_buf; $org_buf = decode( 'iso-8859-1' => $org_buf ) if $gi->charset == GEOIP_CHARSET_UTF8; return $org_buf; } #this function returns isp or org of the domain name *isp_by_name = \*org_by_name; *isp_by_addr = \*org_by_addr; *name_by_addr = \*org_by_addr; *name_by_name = \*org_by_name; #this function returns the region sub region_by_name { my ( $gi, $host ) = @_; my $ip_address = $gi->get_ip_address($host); return unless $ip_address; if ( $gi->{"databaseType"} == GEOIP_REGION_EDITION_REV0 ) { my $seek_region = $gi->_seek_country( addr_to_num($ip_address) ) - GEOIP_STATE_BEGIN_REV0; if ( $seek_region >= 1000 ) { return ( "US", chr( ( $seek_region - 1000 ) / 26 + 65 ) . chr( ( $seek_region - 1000 ) % 26 + 65 ) ); } else { return ( $countries[$seek_region], "" ); } } elsif ( $gi->{"databaseType"} == GEOIP_REGION_EDITION_REV1 ) { my $seek_region = $gi->_seek_country( addr_to_num($ip_address) ) - GEOIP_STATE_BEGIN_REV1; if ( $seek_region < US_OFFSET ) { return ( "", "" ); } elsif ( $seek_region < CANADA_OFFSET ) { # return a us state return ( "US", chr( ( $seek_region - US_OFFSET ) / 26 + 65 ) . chr( ( $seek_region - US_OFFSET ) % 26 + 65 ) ); } elsif ( $seek_region < WORLD_OFFSET ) { # return a canada province return ( "CA", chr( ( $seek_region - CANADA_OFFSET ) / 26 + 65 ) . chr( ( $seek_region - CANADA_OFFSET ) % 26 + 65 ) ); } else { # return a country of the world my $c = $countries[ ( $seek_region - WORLD_OFFSET ) / FIPS_RANGE ]; my $a2 = ( $seek_region - WORLD_OFFSET ) % FIPS_RANGE; ## my $r = ## chr( ( $a2 / 100 ) + 48 ) ## . chr( ( ( $a2 / 10 ) % 10 ) + 48 ) ## . chr( ( $a2 % 10 ) + 48 ); return ( $c, $a2 ? sprintf( '%03d', $a2 ) : '00' ); } } } *region_by_addr = \®ion_by_name; sub get_ip_address { my ( $gi, $host ) = @_; my $ip_address; #check if host is ip address if ( $host =~ m!^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$! ) { #host is ip address $ip_address = $host; } else { #host is domain name do a dns lookup $ip_address = join( '.', unpack( 'C4', ( gethostbyname($host) )[4] ) ); } return $ip_address; } sub addr_to_num { unpack( N => pack( C4 => split( /\./, $_[0] ) ) ) } sub num_to_addr { join q{.}, unpack( C4 => pack( N => $_[0] ) ) } #sub addr_to_num { # my @a = split( '\.', $_[0] ); # return $a[0] * 16777216 + $a[1] * 65536 + $a[2] * 256 + $a[3]; #} sub database_edition { $_[0]->{databaseType}; } sub database_info { my $gi = shift; my $i = 0; my $buf; my $retval; my $hasStructureInfo = 0; seek( $gi->{fh}, -3, 2 ); for ( my $i = 0 ; $i < STRUCTURE_INFO_MAX_SIZE ; $i++ ) { read( $gi->{fh}, $buf, 3 ); if ( $buf eq ( chr(255) . chr(255) . chr(255) ) ) { $hasStructureInfo = 1; last; } seek( $gi->{fh}, -4, 1 ); } if ( $hasStructureInfo == 1 ) { seek( $gi->{fh}, -6, 1 ); } else { # no structure info, must be pre Sep 2002 database, go back to seek( $gi->{fh}, -3, 2 ); } for ( my $i = 0 ; $i < DATABASE_INFO_MAX_SIZE ; $i++ ) { read( $gi->{fh}, $buf, 3 ); if ( $buf eq ( chr(0) . chr(0) . chr(0) ) ) { read( $gi->{fh}, $retval, $i ); return $retval; } seek( $gi->{fh}, -4, 1 ); } return ''; } sub range_by_ip { my $gi = shift; my $ipnum = addr_to_num(shift); my $c = $gi->_seek_country($ipnum); my $nm = $gi->last_netmask; my $m = 0xffffffff << 32 - $nm; my $left_seek_num = $ipnum & $m; my $right_seek_num = $left_seek_num + ( 0xffffffff & ~$m ); while ( $left_seek_num != 0 and $c == $gi->_seek_country( $left_seek_num - 1 ) ) { my $lm = 0xffffffff << 32 - $gi->last_netmask; $left_seek_num = ( $left_seek_num - 1 ) & $lm; } while ( $right_seek_num != 0xffffffff and $c == $gi->_seek_country( $right_seek_num + 1 ) ) { my $rm = 0xffffffff << 32 - $gi->last_netmask; $right_seek_num = ( $right_seek_num + 1 ) & $rm; $right_seek_num += ( 0xffffffff & ~$rm ); } return ( num_to_addr($left_seek_num), num_to_addr($right_seek_num) ); } sub netmask { $_[0]->{last_netmask} = $_[1] } sub last_netmask { return $_[0]->{last_netmask}; } sub get_city_record { my ( $gi, $host ) = @_; my $ip_address = $gi->get_ip_address($host); return unless $ip_address; #lookup the city my $seek = $gi->_seek_country( addr_to_num($ip_address) ); return if ( $seek == $gi->{databaseSegments} ); return _get_city_record_seek( $gi, $seek ); } #this function returns the city record as a array sub _get_city_record_seek { my ( $gi, $seek_position ) = @_; my $record_buf; my $record_buf_pos; my $char; my $metroarea_combo; my $record_country_code = ''; my $record_country_code3 = ''; my $record_country_name = ''; my $record_region = undef; my $record_city = ''; my $record_postal_code = undef; my $record_latitude = ''; my $record_longitude = ''; my $record_metro_code = 0; my $record_area_code = 0; my $record_continent_code = ''; my $record_region_name = undef; my $str_length = 0; my $i; my $j; #set the record pointer to location of the city record my $record_pointer = $seek_position + ( 2 * $gi->{record_length} - 1 ) * $gi->{databaseSegments}; unless ( exists $gi->{buf} ) { seek( $gi->{fh}, $record_pointer, 0 ); read( $gi->{fh}, $record_buf, FULL_RECORD_LENGTH ); $record_buf_pos = 0; } else { $record_buf = substr( $gi->{buf}, $record_pointer, FULL_RECORD_LENGTH ); $record_buf_pos = 0; } #get the country $char = ord( substr( $record_buf, $record_buf_pos, 1 ) ); $record_country_code = $countries[$char]; #get the country code $record_country_code3 = $code3s[$char]; #get the country code with 3 letters $record_country_name = $names[$char]; #get the country name $record_buf_pos++; # get the continent code $record_continent_code = $continents[$char]; #get the region $char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) ); while ( $char != 0 ) { $str_length++; #get the length of string $char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) ); } if ( $str_length > 0 ) { $record_region = substr( $record_buf, $record_buf_pos, $str_length ); } $record_buf_pos += $str_length + 1; $str_length = 0; #get the city $char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) ); while ( $char != 0 ) { $str_length++; #get the length of string $char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) ); } if ( $str_length > 0 ) { $record_city = substr( $record_buf, $record_buf_pos, $str_length ); } $record_buf_pos += $str_length + 1; $str_length = 0; #get the postal code $char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) ); while ( $char != 0 ) { $str_length++; #get the length of string $char = ord( substr( $record_buf, $record_buf_pos + $str_length, 1 ) ); } if ( $str_length > 0 ) { $record_postal_code = substr( $record_buf, $record_buf_pos, $str_length ); } $record_buf_pos += $str_length + 1; $str_length = 0; my $latitude = 0; my $longitude = 0; #get the latitude for ( $j = 0 ; $j < 3 ; ++$j ) { $char = ord( substr( $record_buf, $record_buf_pos++, 1 ) ); $latitude += ( $char << ( $j * 8 ) ); } $record_latitude = ( $latitude / 10000 ) - 180; #get the longitude for ( $j = 0 ; $j < 3 ; ++$j ) { $char = ord( substr( $record_buf, $record_buf_pos++, 1 ) ); $longitude += ( $char << ( $j * 8 ) ); } $record_longitude = ( $longitude / 10000 ) - 180; #get the metro code and the area code if ( GEOIP_CITY_EDITION_REV1 == $gi->{databaseType} ) { $metroarea_combo = 0; if ( $record_country_code eq 'US' ) { #if the country is US then read the dma/metro area combo for ( $j = 0 ; $j < 3 ; ++$j ) { $char = ord( substr( $record_buf, $record_buf_pos++, 1 ) ); $metroarea_combo += ( $char << ( $j * 8 ) ); } #split the dma/metro area combo into the metro code and the area code $record_metro_code = int( $metroarea_combo / 1000 ); $record_area_code = $metroarea_combo % 1000; } } $record_region_name = _get_region_name( $record_country_code, $record_region ); # the pureperl API must convert the string by themself to UTF8 # using Encode for perl >= 5.008 otherwise use it's own iso-8859-1 to utf8 converter $record_city = decode( 'iso-8859-1' => $record_city ) if $gi->charset == GEOIP_CHARSET_UTF8; return ( $record_country_code, $record_country_code3, $record_country_name, $record_region, $record_city, $record_postal_code, $record_latitude, $record_longitude, $record_metro_code, $record_area_code, $record_continent_code, $record_region_name, $record_metro_code ); } sub DESTROY { my $gi = shift; if ( exists $gi->{buf} && $gi->{flags} && ( $gi->{flags} & GEOIP_MMAP_CACHE ) ) { munmap( $gi->{buf} ) or die "munmap: $!"; delete $gi->{buf}; } } eval <<'__IPV6__' if $] >= 5.014; use Socket qw/ getaddrinfo NI_NUMERICHOST SOCK_STREAM unpack_sockaddr_in6 / ; my $AF_INET6 = eval { Socket::AF_INET6() }; sub id_by_addr_v6 { my ( $gi, $ip_address ) = @_; my $addr = $gi->get_ip_address_v6($ip_address); return unless $addr; return $gi->_seek_country_v6($addr) - GEOIP_COUNTRY_BEGIN; } sub _seek_country_v6 { my ( $gi, $ipnum ) = @_; my $fh = $gi->{fh}; my $offset = 0; my ( $x0, $x1 ); my $reclen = $gi->{record_length}; for my $depth ( 0 .. 127 ) { unless ( exists $gi->{buf} ) { seek $fh, $offset * 2 * $reclen, 0; read $fh, $x0, $reclen; read $fh, $x1, $reclen; } else { $x0 = substr( $gi->{buf}, $offset * 2 * $reclen, $reclen ); $x1 = substr( $gi->{buf}, $offset * 2 * $reclen + $reclen, $reclen ); } $x0 = unpack( "V1", $x0 . "\0" ); $x1 = unpack( "V1", $x1 . "\0" ); if ( vec( $ipnum, $depth ^ 7, 1 ) ) { if ( $x1 >= $gi->{databaseSegments} ) { $gi->{last_netmask} = 1 + $depth; return $x1; } $offset = $x1; } else { if ( $x0 >= $gi->{databaseSegments} ) { $gi->{last_netmask} = 1 + $depth; return $x0; } $offset = $x0; } } print STDERR "Error Traversing Database for ipnum = $ipnum - Perhaps database is corrupt?"; } #this function returns the country code of ip address sub country_code_by_addr_v6 { my ( $gi, $ip_address ) = @_; return $countries[ $gi->id_by_addr_v6($ip_address) ]; } #this function returns the country code3 of ip address sub country_code3_by_addr_v6 { my ( $gi, $ip_address ) = @_; return $code3s[ $gi->id_by_addr_v6($ip_address) ]; } #this function returns the name of ip address sub country_name_by_addr_v6 { my ( $gi, $ip_address ) = @_; return $names[ $gi->id_by_addr_v6($ip_address) ]; } #this function returns the country code of domain name sub country_code_by_name_v6 { my ( $gi, $host ) = @_; my $country_id = $gi->id_by_name_v6($host); return $countries[$country_id]; } #this function returns the country code3 of domain name sub country_code3_by_name_v6 { my ( $gi, $host ) = @_; my $country_id = $gi->id_by_name_v6($host); return $code3s[$country_id]; } #this function returns the country name of domain name sub country_name_by_name_v6 { my ( $gi, $host ) = @_; my $country_id = $gi->id_by_name_v6($host); return $names[$country_id]; } sub id_by_name_v6 { my ( $gi, $host ) = @_; my $addr = $gi->get_ip_address_v6($host); return unless $addr; return $gi->_seek_country_v6($addr) - GEOIP_COUNTRY_BEGIN; } sub org_by_addr_v6 { my ( $gi, $ip_address ) = @_; my $addr = $gi->get_ip_address_v6($ip_address); return unless $addr; my $seek_org = $gi->_seek_country_v6($addr); return $gi->_common_org($seek_org); } *name_by_addr_v6 = \*org_by_addr_v6; *name_by_name_v6 = \*org_by_addr_v6; *org_by_name_v6 = \*org_by_addr_v6; sub get_ip_address_v6 { my ( $gi, $host ) = @_; my $hints = { family => $AF_INET6, socktype => SOCK_STREAM, }; $hints->{flags} = NI_NUMERICHOST if ( $host =~ /:/ ); my ( $err, $data ) = getaddrinfo( $host, undef, $hints ); return $err ? undef : ( unpack_sockaddr_in6( $data->{addr} ) )[1]; } sub get_city_record_v6 { my ( $gi, $host ) = @_; my $ip_address = $gi->get_ip_address_v6($host); return unless $ip_address; #lookup the city my $seek = $gi->_seek_country_v6($ip_address); return if ( $seek == $gi->{databaseSegments} ); return _get_city_record_seek( $gi, $seek ); } #this function returns the city record as a hash ref sub get_city_record_as_hash_v6 { my ( $gi, $host ) = @_; my %gir; @gir{ qw/ country_code country_code3 country_name region city postal_code latitude longitude dma_code area_code continent_code region_name metro_code / } = $gi->get_city_record_v6($host); return defined( $gir{latitude} ) ? bless( \%gir, 'Geo::IP::Record' ) : undef; } *record_by_addr_v6 = \&get_city_record_as_hash_v6; *record_by_name_v6 = \&get_city_record_as_hash_v6; 1; __IPV6__ 1; #sub _XS __PP_CODE__ print STDERR $@ if $@; 1; # ABSTRACT: Look up location and network information by IP Address __END__ =pod =encoding UTF-8 =head1 NAME Geo::IP - Look up location and network information by IP Address =head1 VERSION version 1.51 =head1 SYNOPSIS use Geo::IP; my $gi = Geo::IP->new(GEOIP_MEMORY_CACHE); # look up IP address '24.24.24.24' # returns undef if country is unallocated, or not defined in our database my $country = $gi->country_code_by_addr('24.24.24.24'); $country = $gi->country_code_by_name('yahoo.com'); # $country is equal to "US" use Geo::IP; my $gi = Geo::IP->open("/usr/local/share/GeoIP/GeoIPCity.dat", GEOIP_STANDARD); my $record = $gi->record_by_addr('24.24.24.24'); print $record->country_code, $record->country_code3, $record->country_name, $record->region, $record->region_name, $record->city, $record->postal_code, $record->latitude, $record->longitude, $record->time_zone, $record->area_code, $record->continent_code, $record->metro_code; # the IPv6 support is currently only avail if you use the CAPI which is much # faster anyway. ie: print Geo::IP->api equals to 'CAPI' use Socket; use Socket6; use Geo::IP; my $g = Geo::IP->open('/usr/local/share/GeoIP/GeoIPv6.dat') or die; print $g->country_code_by_ipnum_v6(inet_pton AF_INET6, '::24.24.24.24'); print $g->country_code_by_addr_v6('2a02:e88::'); =head1 DESCRIPTION This module uses the GeoIP Legacy file based database. This database simply contains IP blocks as keys, and countries as values. This database should be more complete and accurate than reverse DNS lookups. This module can be used to automatically select the geographically closest mirror, to analyze your web server logs to determine the countries of your visitors, for credit card fraud detection, and for software export controls. =head1 IP GEOLOCATION USAGE IP geolocation is inherently imprecise. Locations are often near the center of the population. Any location provided by a GeoIP database or web service should not be used to identify a particular address or household. =head1 IP ADDRESS TO COUNTRY DATABASES Free monthly updates to the database are available from http://dev.maxmind.com/geoip/geolite This free database is similar to the database contained in IP::Country, as well as many paid databases. It uses ARIN, RIPE, APNIC, and LACNIC whois to obtain the IP->Country mappings. If you require greater accuracy, MaxMind offers a database on a paid subscription basis. Also included with this is a service that updates your database automatically each month, by running a program called geoipupdate included with the C API from a cronjob. For more details on the differences between the free and paid databases, see: http://www.maxmind.com/en/geolocation_landing Do not miss the city database, described in Geo::IP::Record Make sure to use the F script from the example directory to stay current with the databases. =head1 BENCHMARK the lookups are fast. This is my laptop ( examples/benchmark.pl ): Benchmark: running city_mem, city_std, country_mem, country_std, country_v6_mem, country_v6_std, isp_mem, isp_std for at least 10 CPU seconds... city_mem: 10.3121 wallclock secs (10.30 usr + 0.01 sys = 10.31 CPU) @ 387271.48/s (n=3992769) city_std: 10.0658 wallclock secs ( 2.86 usr + 7.17 sys = 10.03 CPU) @ 54392.62/s (n=545558) country_mem: 10.1772 wallclock secs (10.16 usr + 0.00 sys = 10.16 CPU) @ 1077507.97/s (n=10947481) country_std: 10.1432 wallclock secs ( 2.30 usr + 7.85 sys = 10.15 CPU) @ 83629.56/s (n=848840) country_v6_mem: 10.2579 wallclock secs (10.25 usr + -0.00 sys = 10.25 CPU) @ 365997.37/s (n=3751473) country_v6_std: 10.8541 wallclock secs ( 1.77 usr + 9.07 sys = 10.84 CPU) @ 10110.42/s (n=109597) isp_mem: 10.147 wallclock secs (10.13 usr + 0.01 sys = 10.14 CPU) @ 590109.66/s (n=5983712) isp_std: 10.0484 wallclock secs ( 2.71 usr + 7.33 sys = 10.04 CPU) @ 73186.35/s (n=734791) =head1 CLASS METHODS =over 4 =item $gi = Geo::IP->new( $flags ); Constructs a new Geo::IP object with the default database located inside your system's I, typically I. Flags can be set to either GEOIP_STANDARD, or for faster performance (at a cost of using more memory), GEOIP_MEMORY_CACHE. When using memory cache you can force a reload if the file is updated by setting GEOIP_CHECK_CACHE. GEOIP_INDEX_CACHE caches the most frequently accessed index portion of the database, resulting in faster lookups than GEOIP_STANDARD, but less memory usage than GEOIP_MEMORY_CACHE - useful for larger databases such as GeoIP Legacy Organization and GeoIP City. Note, for GeoIP Country, Region and Netspeed databases, GEOIP_INDEX_CACHE is equivalent to GEOIP_MEMORY_CACHE. Prior to geoip-api version 1.6.3, the C API would leak diagnostic messages onto stderr unconditionally. From Geo::IP v1.44 onwards, the flag squelching this behavior (GEOIP_SILENCE) is implicitly added to the flags passed in new(), open(), and open_type(). To combine flags, use the bitwise OR operator, |. For example, to cache the database in memory, but check for an updated GeoIP.dat file, use: Geo::IP->new( GEOIP_MEMORY_CACHE | GEOIP_CHECK_CACHE ); =item $gi = Geo::IP->open( $database_filename, $flags ); Constructs a new Geo::IP object with the database located at C<$database_filename>. =item $gi = Geo::IP->open_type( $database_type, $flags ); Constructs a new Geo::IP object with the $database_type database located in the standard location. For example $gi = Geo::IP->open_type( GEOIP_CITY_EDITION_REV1 , GEOIP_STANDARD ); opens the database file in the standard location for GeoIP Legacy City, typically I. =back =head1 OBJECT METHODS =over 4 =item $code = $gi->country_code_by_addr( $ipaddr ); Returns the ISO 3166 country code for an IP address. =item $code = $gi->country_code_by_name( $hostname ); Returns the ISO 3166 country code for a hostname. =item $code = $gi->country_code3_by_addr( $ipaddr ); Returns the 3 letter country code for an IP address. =item $code = $gi->country_code3_by_name( $hostname ); Returns the 3 letter country code for a hostname. =item $name = $gi->country_name_by_addr( $ipaddr ); Returns the full country name for an IP address. =item $name = $gi->country_name_by_name( $hostname ); Returns the full country name for a hostname. =item $r = $gi->record_by_addr( $ipaddr ); Returns a Geo::IP::Record object containing city location for an IP address. =item $r = $gi->record_by_name( $hostname ); Returns a Geo::IP::Record object containing city location for a hostname. =item $org = $gi->org_by_addr( $ipaddr ); B use C instead. Returns the Organization, ISP name or Domain Name for an IP address. =item $org = $gi->org_by_name( $hostname ); B use C instead. Returns the Organization, ISP name or Domain Name for a hostname. =item $info = $gi->database_info; Returns database string, includes version, date, build number and copyright notice. =item $old_charset = $gi->set_charset( $charset ); Set the charset for the city name - defaults to GEOIP_CHARSET_ISO_8859_1. To set UTF8, pass GEOIP_CHARSET_UTF8 to set_charset. For perl >= 5.008 the utf8 flag is honored. =item $charset = $gi->charset; Gets the currently used charset. =item ( $country, $region ) = $gi->region_by_addr('24.24.24.24'); Returns a list containing country and region. If region and/or country is unknown, undef is returned. Sure this works only for region databases. =item ( $country, $region ) = $gi->region_by_name('www.xyz.com'); Returns a list containing country and region. If region and/or country is unknown, undef is returned. Sure this works only for region databases. =item $netmask = $gi->last_netmask; Gets netmask of network block from last lookup. =item $gi->netmask(12); Sets netmask for the last lookup =item my ( $from, $to ) = $gi->range_by_ip('24.24.24.24'); Returns the start and end of the current network block. The method tries to join several continuous netblocks. =item $api = $gi->api or $api = Geo::IP->api Returns the currently used API. # prints either CAPI or PurePerl print Geo::IP->api; =item $continent = $gi->continent_code_by_country_code('US'); Returns the continent code by country code. =item $dbe = $gi->database_edition Returns the database_edition of the currently opened database. if ( $gi->database_edition == GEOIP_COUNTRY_EDITION ){ ... } =item $isp = $gi->isp_by_addr('24.24.24.24'); Returns the isp for 24.24.24.24 =item $isp = $gi->isp_by_name('www.maxmind.com'); Returns the isp for www.something.de =item my $time_zone = $gi->time_zone('US', 'AZ'); Returns the time zone for country/region. # undef print $gi->time_zone('US', ''); # America/Phoenix print $gi->time_zone('US', 'AZ'); # Europe/Berlin print $gi->time_zone('DE', '00'); # Europe/Berlin print $gi->time_zone('DE', ''); =item $id = $gi->id_by_addr('24.24.24.24'); Returns the country_id for 24.24.24.24. The country_id might be useful as array index. 0 is unknown. =item $id = $gi->id_by_name('www.maxmind.com'); Returns the country_id for www.maxmind.com. The country_id might be useful as array index. 0 is unknown. =item $cc = $gi->country_code3_by_addr_v6('::24.24.24.24'); =item $cc = $gi->country_code3_by_name_v6('ipv6.google.com'); =item $cc = $gi->country_code_by_addr_v6('2a02:ea0::'); =item $cc = $gi->country_code_by_ipnum_v6($ipnum); use Socket; use Socket6; use Geo::IP; my $g = Geo::IP->open('/usr/local/share/GeoIP/GeoIPv6.dat') or die; print $g->country_code_by_ipnum_v6(inet_pton AF_INET6, '::24.24.24.24'); =item $cc = $gi->country_code_by_name_v6('ipv6.google.com'); =item name_by_addr Returns the Organization, ISP name or Domain Name for a IP address. =item name_by_addr_v6 Returns the Organization, ISP name or Domain Name for an IPv6 address. =item name_by_ipnum_v6 Returns the Organization, ISP name or Domain Name for an ipnum. =item name_by_name Returns the Organization, ISP name or Domain Name for a hostname. =item name_by_name_v6 Returns the Organization, ISP name or Domain Name for a hostname. =item org_by_addr_v6 B use C Returns the Organization, ISP name or Domain Name for an IPv6 address. =item org_by_name_v6 B use C Returns the Organization, ISP name or Domain Name for a hostname. =item teredo Returns the current setting for teredo. =item enable_teredo Enable / disable teredo $gi->enable_teredo(1); # enable $gi->enable_teredo(0); # disable =item lib_version if ( $gi->api eq 'CAPI' ){ print $gi->lib_version; } =back =head1 ISSUE TRACKER AND GIT repo Is available from GitHub, see https://github.com/maxmind/geoip-api-perl =head1 SEE ALSO L - database reader for the GeoIP2 format. =head1 SUPPORT Bugs may be submitted through L. =head1 AUTHORS =over 4 =item * Dave Rolsky =item * Greg Oschwald =back =head1 CONTRIBUTORS =for stopwords asb-cpan Boris Zentner John SJ Anderson Olaf Alders Philip A. Prindeville shawniverson Thomas J Mather Tina Mueller Will Storey =over 4 =item * asb-cpan =item * Boris Zentner =item * Boris Zentner =item * John SJ Anderson =item * Olaf Alders =item * Philip A. Prindeville =item * shawniverson =item * Thomas J Mather =item * Tina Mueller =item * Will Storey =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2002 - 2017 by MaxMind, Inc. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Geo-IP-1.51/lib/Geo/IP/0000755000175000017500000000000013167530465012714 5ustar greggregGeo-IP-1.51/lib/Geo/IP/Record.pod0000644000175000017500000000520213167530465014635 0ustar greggreg=head1 NAME Geo::IP::Record - Contains city information for GeoIP Legacy City Edition =head1 SYNOPSIS use Geo::IP; my $gi = Geo::IP->open("/usr/local/share/GeoIP/GeoIPCity.dat", GEOIP_STANDARD); my $record = $gi->record_by_addr('24.24.24.24'); print $record->country_code, $record->country_code3, $record->country_name, $record->region, $record->region_name, $record->city, $record->postal_code, $record->latitude, $record->longitude, $record->time_zone, $record->area_code, $record->continent_code, $record->metro_code; =head1 DESCRIPTION Geo::IP::Record represents objects containing location information returned by the GeoIP Legacy City database. It works with both the commercial GeoIP Legacy City and free GeoLite Legacy City databases. =head1 OBJECT METHODS =over 4 =item $code = $record->country_code; Returns the ISO 3166 country code from the location object. =item $code3 = $record->country_code3; Returns the ISO 3166 3 letter country code from the location object. =item $name = $record->country_name; Returns the country name from the location object. =item $region = $record->region; Returns the region code from the location object. =item $region = $record->region_name; Returns the region name from the location object. =item $city = $record->city; Returns the city from the location object. =item $postal_code = $record->postal_code; Returns the postal code from the location object. =item $lat = $record->latitude; Returns the approximate latitude of the location associated with the IP address. This value is not precise and should not be used to identify a particular address or household. =item $lon = $record->longitude; Returns the approximate longitude of the location associated with the IP address. This value is not precise and should not be used to identify a particular address or household. =item $time_zone = $record->time_zone; Returns the time zone from the location object. =item $area_code = $record->area_code; Returns the area code from the location object (for city-level US locations only) =item $metro_code = $record->metro_code; Returns the metro code from the location object (for city-level US locations only) =item $continent_code = $record->continent_code; Returns the continent code from the location object. Possible continent codes are AF, AS, EU, NA, OC, SA for Africa, Asia, Europe, North America, Oceania and South America. =back =head1 VERSION 1.51 =head1 AUTHOR Copyright (c) 2016, MaxMind LLC All rights reserved. This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Geo-IP-1.51/lib/Geo/IP/Record.pm0000644000175000017500000004142113167530465014472 0ustar greggregpackage Geo::IP::Record; use strict; our $VERSION = 1.51; use Geo::IP; # use vars qw/$pp/; # here are the missing functions if the C API is used sub latitude { my $gir = shift; return sprintf( "%.4f", $gir->_latitude ); } sub longitude { my $gir = shift; return sprintf( "%.4f", $gir->_longitude ); } BEGIN { $pp = !defined(&Geo::IP::Record::city) || $Geo::IP::GEOIP_PP_ONLY; } eval <<'__PP__' if $pp; for ( qw: country_code country_code3 country_name region region_name city postal_code dma_code area_code continent_code metro_code : ) { no strict qw/ refs /; no warnings qw/ redefine /; my $m = $_; # looks bogus, but it is not! it is a copy not a alias *$_ = sub { $_[0]->{$m} }; } # for the case warnings are globaly enabled with perl -w and the CAPI is absent no warnings qw/ redefine /; sub longitude {sprintf('%.4f', $_[0]->{longitude})} sub latitude {sprintf('%.4f', $_[0]->{latitude})} { my $TIME_ZONE; local $_ = ; # skip first line while () { chomp; next if /^\s*$/; my ( $country, $region, $timezone ) = split /,/, $_, 3; $TIME_ZONE->{$country}->{ $region || '' } = $timezone; } # called from Geo::IP sub _time_zone { my ( undef, $country, $region ) = @_; return undef unless $country; return undef unless defined $TIME_ZONE->{$country}; $region ||= ''; return defined $TIME_ZONE->{$country}->{$region} ? $TIME_ZONE->{$country}->{$region} : $TIME_ZONE->{$country}->{''}; } sub time_zone { my ( $self ) = @_; my ( $country, $region ) = ( $self->country_code, $self->region ); return $self->_time_zone( $country, $region ); } } __PP__ 1; __DATA__ country,region,timezone AD,,Europe/Andorra AE,,Asia/Dubai AF,,Asia/Kabul AG,,America/Antigua AI,,America/Anguilla AL,,Europe/Tirane AM,,Asia/Yerevan AN,,America/Curacao AO,,Africa/Luanda AQ,,Antarctica/South_Pole AR,01,America/Argentina/Buenos_Aires AR,02,America/Argentina/Catamarca AR,03,America/Argentina/Tucuman AR,04,America/Argentina/Rio_Gallegos AR,05,America/Argentina/Cordoba AR,06,America/Argentina/Tucuman AR,07,America/Argentina/Buenos_Aires AR,08,America/Argentina/Buenos_Aires AR,09,America/Argentina/Tucuman AR,10,America/Argentina/Jujuy AR,11,America/Argentina/San_Luis AR,12,America/Argentina/La_Rioja AR,13,America/Argentina/Mendoza AR,14,America/Argentina/Buenos_Aires AR,15,America/Argentina/San_Luis AR,16,America/Argentina/Buenos_Aires AR,17,America/Argentina/Salta AR,18,America/Argentina/San_Juan AR,19,America/Argentina/San_Luis AR,20,America/Argentina/Rio_Gallegos AR,21,America/Argentina/Buenos_Aires AR,22,America/Argentina/Catamarca AR,23,America/Argentina/Ushuaia AR,24,America/Argentina/Tucuman AS,,Pacific/Pago_Pago AT,,Europe/Vienna AU,01,Australia/Sydney AU,02,Australia/Sydney AU,03,Australia/Darwin AU,04,Australia/Brisbane AU,05,Australia/Adelaide AU,06,Australia/Hobart AU,07,Australia/Melbourne AU,08,Australia/Perth AW,,America/Aruba AX,,Europe/Mariehamn AZ,,Asia/Baku BA,,Europe/Sarajevo BB,,America/Barbados BD,,Asia/Dhaka BE,,Europe/Brussels BF,,Africa/Ouagadougou BG,,Europe/Sofia BH,,Asia/Bahrain BI,,Africa/Bujumbura BJ,,Africa/Porto-Novo BL,,America/St_Barthelemy BM,,Atlantic/Bermuda BN,,Asia/Brunei BO,,America/La_Paz BQ,,America/Curacao BR,01,America/Rio_Branco BR,02,America/Maceio BR,03,America/Sao_Paulo BR,04,America/Manaus BR,05,America/Bahia BR,06,America/Fortaleza BR,07,America/Sao_Paulo BR,08,America/Sao_Paulo BR,11,America/Campo_Grande BR,13,America/Belem BR,14,America/Cuiaba BR,15,America/Sao_Paulo BR,16,America/Belem BR,17,America/Recife BR,18,America/Sao_Paulo BR,20,America/Fortaleza BR,21,America/Sao_Paulo BR,22,America/Recife BR,23,America/Sao_Paulo BR,24,America/Porto_Velho BR,25,America/Boa_Vista BR,26,America/Sao_Paulo BR,27,America/Sao_Paulo BR,28,America/Maceio BR,29,America/Sao_Paulo BR,30,America/Recife BR,31,America/Araguaina BS,,America/Nassau BT,,Asia/Thimphu BV,,Antarctica/Syowa BW,,Africa/Gaborone BY,,Europe/Minsk BZ,,America/Belize CA,AB,America/Edmonton CA,BC,America/Vancouver CA,MB,America/Winnipeg CA,NB,America/Halifax CA,NL,America/St_Johns CA,NS,America/Halifax CA,NT,America/Yellowknife CA,NU,America/Rankin_Inlet CA,ON,America/Toronto CA,PE,America/Halifax CA,QC,America/Montreal CA,SK,America/Regina CA,YT,America/Whitehorse CC,,Indian/Cocos CD,01,Africa/Kinshasa CD,02,Africa/Kinshasa CD,03,Africa/Kinshasa CD,04,Africa/Lubumbashi CD,05,Africa/Lubumbashi CD,06,Africa/Kinshasa CD,07,Africa/Lubumbashi CD,08,Africa/Kinshasa CD,09,Africa/Lubumbashi CD,10,Africa/Lubumbashi CD,11,Africa/Lubumbashi CD,12,Africa/Lubumbashi CF,,Africa/Bangui CG,,Africa/Brazzaville CH,,Europe/Zurich CI,,Africa/Abidjan CK,,Pacific/Rarotonga CL,,America/Santiago CM,,Africa/Lagos CN,01,Asia/Shanghai CN,02,Asia/Shanghai CN,03,Asia/Shanghai CN,04,Asia/Shanghai CN,05,Asia/Harbin CN,06,Asia/Chongqing CN,07,Asia/Shanghai CN,08,Asia/Harbin CN,09,Asia/Shanghai CN,10,Asia/Shanghai CN,11,Asia/Chongqing CN,12,Asia/Shanghai CN,13,Asia/Urumqi CN,14,Asia/Chongqing CN,15,Asia/Chongqing CN,16,Asia/Chongqing CN,18,Asia/Chongqing CN,19,Asia/Harbin CN,20,Asia/Harbin CN,21,Asia/Chongqing CN,22,Asia/Harbin CN,23,Asia/Shanghai CN,24,Asia/Chongqing CN,25,Asia/Shanghai CN,26,Asia/Chongqing CN,28,Asia/Shanghai CN,29,Asia/Chongqing CN,30,Asia/Chongqing CN,31,Asia/Chongqing CN,32,Asia/Chongqing CN,33,Asia/Chongqing CO,,America/Bogota CR,,America/Costa_Rica CU,,America/Havana CV,,Atlantic/Cape_Verde CW,,America/Curacao CX,,Indian/Christmas CY,,Asia/Nicosia CZ,,Europe/Prague DE,,Europe/Berlin DJ,,Africa/Djibouti DK,,Europe/Copenhagen DM,,America/Dominica DO,,America/Santo_Domingo DZ,,Africa/Algiers EC,01,Pacific/Galapagos EC,02,America/Guayaquil EC,03,America/Guayaquil EC,04,America/Guayaquil EC,05,America/Guayaquil EC,06,America/Guayaquil EC,07,America/Guayaquil EC,08,America/Guayaquil EC,09,America/Guayaquil EC,10,America/Guayaquil EC,11,America/Guayaquil EC,12,America/Guayaquil EC,13,America/Guayaquil EC,14,America/Guayaquil EC,15,America/Guayaquil EC,17,America/Guayaquil EC,18,America/Guayaquil EC,19,America/Guayaquil EC,20,America/Guayaquil EC,22,America/Guayaquil EC,24,America/Guayaquil EE,,Europe/Tallinn EG,,Africa/Cairo EH,,Africa/El_Aaiun ER,,Africa/Asmara ES,07,Europe/Madrid ES,27,Europe/Madrid ES,29,Europe/Madrid ES,31,Europe/Madrid ES,32,Europe/Madrid ES,34,Europe/Madrid ES,39,Europe/Madrid ES,51,Africa/Ceuta ES,52,Europe/Madrid ES,53,Atlantic/Canary ES,54,Europe/Madrid ES,55,Europe/Madrid ES,56,Europe/Madrid ES,57,Europe/Madrid ES,58,Europe/Madrid ES,59,Europe/Madrid ES,60,Europe/Madrid ET,,Africa/Addis_Ababa FI,,Europe/Helsinki FJ,,Pacific/Fiji FK,,Atlantic/Stanley FM,,Pacific/Pohnpei FO,,Atlantic/Faroe FR,,Europe/Paris FX,,Europe/Paris GA,,Africa/Libreville GB,,Europe/London GD,,America/Grenada GE,,Asia/Tbilisi GF,,America/Cayenne GG,,Europe/Guernsey GH,,Africa/Accra GI,,Europe/Gibraltar GL,01,America/Thule GL,02,America/Godthab GL,03,America/Godthab GM,,Africa/Banjul GN,,Africa/Conakry GP,,America/Guadeloupe GQ,,Africa/Malabo GR,,Europe/Athens GS,,Atlantic/South_Georgia GT,,America/Guatemala GU,,Pacific/Guam GW,,Africa/Bissau GY,,America/Guyana HK,,Asia/Hong_Kong HN,,America/Tegucigalpa HR,,Europe/Zagreb HT,,America/Port-au-Prince HU,,Europe/Budapest ID,01,Asia/Pontianak ID,02,Asia/Makassar ID,03,Asia/Jakarta ID,04,Asia/Jakarta ID,05,Asia/Jakarta ID,06,Asia/Jakarta ID,07,Asia/Jakarta ID,08,Asia/Jakarta ID,09,Asia/Jayapura ID,10,Asia/Jakarta ID,11,Asia/Pontianak ID,12,Asia/Makassar ID,13,Asia/Makassar ID,14,Asia/Makassar ID,15,Asia/Jakarta ID,16,Asia/Makassar ID,17,Asia/Makassar ID,18,Asia/Makassar ID,19,Asia/Pontianak ID,20,Asia/Makassar ID,21,Asia/Makassar ID,22,Asia/Makassar ID,23,Asia/Makassar ID,24,Asia/Jakarta ID,25,Asia/Pontianak ID,26,Asia/Pontianak ID,28,Asia/Jayapura ID,29,Asia/Makassar ID,30,Asia/Jakarta ID,31,Asia/Makassar ID,32,Asia/Jakarta ID,33,Asia/Jakarta ID,34,Asia/Makassar ID,35,Asia/Pontianak ID,36,Asia/Jayapura ID,37,Asia/Pontianak ID,38,Asia/Makassar ID,39,Asia/Jayapura ID,40,Asia/Pontianak ID,41,Asia/Makassar IE,,Europe/Dublin IL,,Asia/Jerusalem IM,,Europe/Isle_of_Man IN,,Asia/Kolkata IO,,Indian/Chagos IQ,,Asia/Baghdad IR,,Asia/Tehran IS,,Atlantic/Reykjavik IT,,Europe/Rome JE,,Europe/Jersey JM,,America/Jamaica JO,,Asia/Amman JP,,Asia/Tokyo KE,,Africa/Nairobi KG,,Asia/Bishkek KH,,Asia/Phnom_Penh KI,,Pacific/Tarawa KM,,Indian/Comoro KN,,America/St_Kitts KP,,Asia/Pyongyang KR,,Asia/Seoul KW,,Asia/Kuwait KY,,America/Cayman KZ,01,Asia/Almaty KZ,02,Asia/Almaty KZ,03,Asia/Qyzylorda KZ,04,Asia/Aqtobe KZ,05,Asia/Qyzylorda KZ,06,Asia/Aqtau KZ,07,Asia/Oral KZ,08,Asia/Qyzylorda KZ,09,Asia/Aqtau KZ,10,Asia/Qyzylorda KZ,11,Asia/Almaty KZ,12,Asia/Qyzylorda KZ,13,Asia/Aqtobe KZ,14,Asia/Qyzylorda KZ,15,Asia/Almaty KZ,16,Asia/Aqtobe KZ,17,Asia/Almaty LA,,Asia/Vientiane LB,,Asia/Beirut LC,,America/St_Lucia LI,,Europe/Vaduz LK,,Asia/Colombo LR,,Africa/Monrovia LS,,Africa/Maseru LT,,Europe/Vilnius LU,,Europe/Luxembourg LV,,Europe/Riga LY,,Africa/Tripoli MA,,Africa/Casablanca MC,,Europe/Monaco MD,,Europe/Chisinau ME,,Europe/Podgorica MF,,America/Marigot MG,,Indian/Antananarivo MH,,Pacific/Kwajalein MK,,Europe/Skopje ML,,Africa/Bamako MM,,Asia/Rangoon MN,06,Asia/Choibalsan MN,11,Asia/Ulaanbaatar MN,17,Asia/Choibalsan MN,19,Asia/Hovd MN,20,Asia/Ulaanbaatar MN,21,Asia/Ulaanbaatar MN,25,Asia/Ulaanbaatar MO,,Asia/Macau MP,,Pacific/Saipan MQ,,America/Martinique MR,,Africa/Nouakchott MS,,America/Montserrat MT,,Europe/Malta MU,,Indian/Mauritius MV,,Indian/Maldives MW,,Africa/Blantyre MX,01,America/Mexico_City MX,02,America/Tijuana MX,03,America/Hermosillo MX,04,America/Merida MX,05,America/Mexico_City MX,06,America/Chihuahua MX,07,America/Monterrey MX,08,America/Mexico_City MX,09,America/Mexico_City MX,10,America/Mazatlan MX,11,America/Mexico_City MX,12,America/Mexico_City MX,13,America/Mexico_City MX,14,America/Mazatlan MX,15,America/Chihuahua MX,16,America/Mexico_City MX,17,America/Mexico_City MX,18,America/Mazatlan MX,19,America/Monterrey MX,20,America/Mexico_City MX,21,America/Mexico_City MX,22,America/Mexico_City MX,23,America/Cancun MX,24,America/Mexico_City MX,25,America/Mazatlan MX,26,America/Hermosillo MX,27,America/Merida MX,28,America/Monterrey MX,29,America/Mexico_City MX,30,America/Mexico_City MX,31,America/Merida MX,32,America/Monterrey MY,01,Asia/Kuala_Lumpur MY,02,Asia/Kuala_Lumpur MY,03,Asia/Kuala_Lumpur MY,04,Asia/Kuala_Lumpur MY,05,Asia/Kuala_Lumpur MY,06,Asia/Kuala_Lumpur MY,07,Asia/Kuala_Lumpur MY,08,Asia/Kuala_Lumpur MY,09,Asia/Kuala_Lumpur MY,11,Asia/Kuching MY,12,Asia/Kuala_Lumpur MY,13,Asia/Kuala_Lumpur MY,14,Asia/Kuala_Lumpur MY,15,Asia/Kuching MY,16,Asia/Kuching MZ,,Africa/Maputo NA,,Africa/Windhoek NC,,Pacific/Noumea NE,,Africa/Niamey NF,,Pacific/Norfolk NG,,Africa/Lagos NI,,America/Managua NL,,Europe/Amsterdam NO,,Europe/Oslo NP,,Asia/Kathmandu NR,,Pacific/Nauru NU,,Pacific/Niue NZ,85,Pacific/Auckland NZ,E7,Pacific/Auckland NZ,E8,Pacific/Auckland NZ,E9,Pacific/Auckland NZ,F1,Pacific/Auckland NZ,F2,Pacific/Auckland NZ,F3,Pacific/Auckland NZ,F4,Pacific/Auckland NZ,F5,Pacific/Auckland NZ,F6,Pacific/Auckland NZ,F7,Pacific/Chatham NZ,F8,Pacific/Auckland NZ,F9,Pacific/Auckland NZ,G1,Pacific/Auckland NZ,G2,Pacific/Auckland NZ,G3,Pacific/Auckland OM,,Asia/Muscat PA,,America/Panama PE,,America/Lima PF,,Pacific/Marquesas PG,,Pacific/Port_Moresby PH,,Asia/Manila PK,,Asia/Karachi PL,,Europe/Warsaw PM,,America/Miquelon PN,,Pacific/Pitcairn PR,,America/Puerto_Rico PS,,Asia/Gaza PT,02,Europe/Lisbon PT,03,Europe/Lisbon PT,04,Europe/Lisbon PT,05,Europe/Lisbon PT,06,Europe/Lisbon PT,07,Europe/Lisbon PT,08,Europe/Lisbon PT,09,Europe/Lisbon PT,10,Atlantic/Madeira PT,11,Europe/Lisbon PT,13,Europe/Lisbon PT,14,Europe/Lisbon PT,16,Europe/Lisbon PT,17,Europe/Lisbon PT,18,Europe/Lisbon PT,19,Europe/Lisbon PT,20,Europe/Lisbon PT,21,Europe/Lisbon PT,22,Europe/Lisbon PT,23,Atlantic/Azores PW,,Pacific/Palau PY,,America/Asuncion QA,,Asia/Qatar RE,,Indian/Reunion RO,,Europe/Bucharest RS,,Europe/Belgrade RU,01,Europe/Volgograd RU,02,Asia/Irkutsk RU,03,Asia/Novokuznetsk RU,04,Asia/Novosibirsk RU,05,Asia/Vladivostok RU,06,Europe/Moscow RU,07,Europe/Volgograd RU,08,Europe/Samara RU,09,Europe/Moscow RU,10,Europe/Moscow RU,11,Asia/Irkutsk RU,12,Europe/Volgograd RU,13,Asia/Yekaterinburg RU,14,Asia/Irkutsk RU,15,Asia/Anadyr RU,16,Europe/Samara RU,17,Europe/Volgograd RU,18,Asia/Krasnoyarsk RU,20,Asia/Irkutsk RU,21,Europe/Moscow RU,22,Europe/Volgograd RU,23,Europe/Kaliningrad RU,24,Europe/Volgograd RU,25,Europe/Moscow RU,26,Asia/Kamchatka RU,27,Europe/Volgograd RU,28,Europe/Moscow RU,29,Asia/Novokuznetsk RU,30,Asia/Vladivostok RU,31,Asia/Krasnoyarsk RU,32,Asia/Omsk RU,33,Asia/Yekaterinburg RU,34,Asia/Yekaterinburg RU,35,Asia/Yekaterinburg RU,36,Asia/Anadyr RU,37,Europe/Moscow RU,38,Europe/Volgograd RU,39,Asia/Krasnoyarsk RU,40,Asia/Yekaterinburg RU,41,Europe/Moscow RU,42,Europe/Moscow RU,43,Europe/Moscow RU,44,Asia/Magadan RU,45,Europe/Samara RU,46,Europe/Samara RU,47,Europe/Moscow RU,48,Europe/Moscow RU,49,Europe/Moscow RU,50,Asia/Yekaterinburg RU,51,Europe/Moscow RU,52,Europe/Moscow RU,53,Asia/Novosibirsk RU,54,Asia/Omsk RU,55,Europe/Samara RU,56,Europe/Moscow RU,57,Europe/Samara RU,58,Asia/Yekaterinburg RU,59,Asia/Vladivostok RU,60,Europe/Kaliningrad RU,61,Europe/Volgograd RU,62,Europe/Moscow RU,63,Asia/Yakutsk RU,64,Asia/Sakhalin RU,65,Europe/Samara RU,66,Europe/Moscow RU,67,Europe/Samara RU,68,Europe/Volgograd RU,69,Europe/Moscow RU,70,Europe/Volgograd RU,71,Asia/Yekaterinburg RU,72,Europe/Moscow RU,73,Europe/Samara RU,74,Asia/Krasnoyarsk RU,75,Asia/Novosibirsk RU,76,Europe/Moscow RU,77,Europe/Moscow RU,78,Asia/Yekaterinburg RU,79,Asia/Irkutsk RU,80,Asia/Yekaterinburg RU,81,Europe/Samara RU,82,Asia/Irkutsk RU,83,Europe/Moscow RU,84,Europe/Volgograd RU,85,Europe/Moscow RU,86,Europe/Moscow RU,87,Asia/Novosibirsk RU,88,Europe/Moscow RU,89,Asia/Vladivostok RU,90,Asia/Yekaterinburg RU,91,Asia/Krasnoyarsk RU,92,Asia/Anadyr RU,93,Asia/Irkutsk RW,,Africa/Kigali SA,,Asia/Riyadh SB,,Pacific/Guadalcanal SC,,Indian/Mahe SD,,Africa/Khartoum SE,,Europe/Stockholm SG,,Asia/Singapore SH,,Atlantic/St_Helena SI,,Europe/Ljubljana SJ,,Arctic/Longyearbyen SK,,Europe/Bratislava SL,,Africa/Freetown SM,,Europe/San_Marino SN,,Africa/Dakar SO,,Africa/Mogadishu SR,,America/Paramaribo SS,,Africa/Juba ST,,Africa/Sao_Tome SV,,America/El_Salvador SX,,America/Curacao SY,,Asia/Damascus SZ,,Africa/Mbabane TC,,America/Grand_Turk TD,,Africa/Ndjamena TF,,Indian/Kerguelen TG,,Africa/Lome TH,,Asia/Bangkok TJ,,Asia/Dushanbe TK,,Pacific/Fakaofo TL,,Asia/Dili TM,,Asia/Ashgabat TN,,Africa/Tunis TO,,Pacific/Tongatapu TR,,Asia/Istanbul TT,,America/Port_of_Spain TV,,Pacific/Funafuti TW,,Asia/Taipei TZ,,Africa/Dar_es_Salaam UA,01,Europe/Kiev UA,02,Europe/Kiev UA,03,Europe/Uzhgorod UA,04,Europe/Zaporozhye UA,05,Europe/Zaporozhye UA,06,Europe/Uzhgorod UA,07,Europe/Zaporozhye UA,08,Europe/Simferopol UA,09,Europe/Kiev UA,10,Europe/Zaporozhye UA,11,Europe/Simferopol UA,12,Europe/Kiev UA,13,Europe/Kiev UA,14,Europe/Zaporozhye UA,15,Europe/Uzhgorod UA,16,Europe/Zaporozhye UA,17,Europe/Simferopol UA,18,Europe/Zaporozhye UA,19,Europe/Kiev UA,20,Europe/Simferopol UA,21,Europe/Kiev UA,22,Europe/Uzhgorod UA,23,Europe/Kiev UA,24,Europe/Uzhgorod UA,25,Europe/Uzhgorod UA,26,Europe/Zaporozhye UA,27,Europe/Kiev UG,,Africa/Kampala UM,,Pacific/Wake US,AK,America/Anchorage US,AL,America/Chicago US,AR,America/Chicago US,AZ,America/Phoenix US,CA,America/Los_Angeles US,CO,America/Denver US,CT,America/New_York US,DC,America/New_York US,DE,America/New_York US,FL,America/New_York US,GA,America/New_York US,HI,Pacific/Honolulu US,IA,America/Chicago US,ID,America/Denver US,IL,America/Chicago US,IN,America/Indiana/Indianapolis US,KS,America/Chicago US,KY,America/New_York US,LA,America/Chicago US,MA,America/New_York US,MD,America/New_York US,ME,America/New_York US,MI,America/New_York US,MN,America/Chicago US,MO,America/Chicago US,MS,America/Chicago US,MT,America/Denver US,NC,America/New_York US,ND,America/Chicago US,NE,America/Chicago US,NH,America/New_York US,NJ,America/New_York US,NM,America/Denver US,NV,America/Los_Angeles US,NY,America/New_York US,OH,America/New_York US,OK,America/Chicago US,OR,America/Los_Angeles US,PA,America/New_York US,RI,America/New_York US,SC,America/New_York US,SD,America/Chicago US,TN,America/Chicago US,TX,America/Chicago US,UT,America/Denver US,VA,America/New_York US,VT,America/New_York US,WA,America/Los_Angeles US,WI,America/Chicago US,WV,America/New_York US,WY,America/Denver UY,,America/Montevideo UZ,01,Asia/Tashkent UZ,02,Asia/Samarkand UZ,03,Asia/Tashkent UZ,05,Asia/Samarkand UZ,06,Asia/Tashkent UZ,07,Asia/Samarkand UZ,08,Asia/Samarkand UZ,09,Asia/Samarkand UZ,10,Asia/Samarkand UZ,12,Asia/Samarkand UZ,13,Asia/Tashkent UZ,14,Asia/Tashkent VA,,Europe/Vatican VC,,America/St_Vincent VE,,America/Caracas VG,,America/Tortola VI,,America/St_Thomas VN,,Asia/Phnom_Penh VU,,Pacific/Efate WF,,Pacific/Wallis WS,,Pacific/Pago_Pago YE,,Asia/Aden YT,,Indian/Mayotte YU,,Europe/Belgrade ZA,,Africa/Johannesburg ZM,,Africa/Lusaka ZW,,Africa/Harare