From patchwork Sat Nov 7 18:47:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 3649 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4CT5q23Yg2z3wlL for ; Sat, 7 Nov 2020 18:47:42 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4CT5py6nWZz1pB; Sat, 7 Nov 2020 18:47:38 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4CT5py656Vz2yb5; Sat, 7 Nov 2020 18:47:38 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4CT5pw60w3z2xGb for ; Sat, 7 Nov 2020 18:47:36 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4CT5pw42fPz1GP; Sat, 7 Nov 2020 18:47:36 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1604774856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0lZe4e7+Mml3lZgYAI7g2eG5NJ9IZy6bvT0IM9KL2eQ=; b=J90u8g6CPqxbjrmDag8eVssOiLfMCT7FwIQsv23BHJ3hyXgSfFebPDfMWbj/Xq7K9STv0L uSTZ2Cdz0dHuZrAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1604774856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0lZe4e7+Mml3lZgYAI7g2eG5NJ9IZy6bvT0IM9KL2eQ=; b=PrQ1WbUe+53KgM6eMxHm49YPUe/bZm367Bo6lHJKys+90rhO0+qDOkKyh3JCH+ovV3TJU2 mUo741+GWPN2odHtUR5fRSBEfHkdagi5ZquT2hbe1nD1LSr+9wRgQOyz8RaGYsTqxXZDDC T6ybIa0SUjlPNCg5C3xs6bjxPe9Xea/XNzIC8BX5JtzKwK0OG4JC0Xsnokheefb7lWQ36E W7VRAe7NHm/Vf4RkhPMNkdLGdkh1sYFbOUalXZDlqGRv4R/LVytZ+MWRBHyzP2RA7c63pN weatTrBGodJTmVNnD+YHSPAl4evN+HdQKJQ1QXcHhxJL24Z/nTknalTuzlBdIg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 3/5] location-functions.pl: Add get_continent_code() function. Date: Sat, 7 Nov 2020 19:47:22 +0100 Message-Id: <20201107184724.3590-3-stefan.schantl@ipfire.org> In-Reply-To: <20201107184724.3590-1-stefan.schantl@ipfire.org> References: <20201107184724.3590-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" This tiny function is used to get the continent code for a given country code. Signed-off-by: Stefan Schantl --- config/cfgroot/location-functions.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/cfgroot/location-functions.pl b/config/cfgroot/location-functions.pl index 483703016..e8db4ba9b 100644 --- a/config/cfgroot/location-functions.pl +++ b/config/cfgroot/location-functions.pl @@ -190,6 +190,16 @@ sub get_locations() { return @sorted_locations; } +# Function to get the continent code of a given country code. +sub get_continent_code($) { + my ($country_code) = @_; + + # Use location module to grab the continent code. + my $continent_code = &Location::get_continent_code($db_handle, $country_code); + + return $continent_code; +} + # Function to check if a given address has one ore more special flags. sub address_has_flags($) { my ($address) = @_;