From: Hyotaek Shim Date: Wed, 26 Jul 2017 02:02:58 +0000 (+0900) Subject: Add GetEnv() by name X-Git-Tag: submit/trunk/20170823.075128~76^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9557c81727b324d3b3567cf956f224cd73e46ae;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Add GetEnv() by name Change-Id: Ibf32a744b6c26fa323ce361c3b0f462a8eb4c496 Signed-off-by: Hyotaek Shim --- diff --git a/src/Tizen.System.PlatformConfig/Interop/Interop.PlatformConfig.cs b/src/Tizen.System.PlatformConfig/Interop/Interop.PlatformConfig.cs index b0b01be..bdcdf7b 100755 --- a/src/Tizen.System.PlatformConfig/Interop/Interop.PlatformConfig.cs +++ b/src/Tizen.System.PlatformConfig/Interop/Interop.PlatformConfig.cs @@ -28,6 +28,7 @@ internal static partial class Interop { [DllImport(Libraries.PlatformConfig, EntryPoint = "tzplatform_getenv", CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr _GetEnv(int id); + [DllImport(Libraries.PlatformConfig, EntryPoint = "tzplatform_getid", CallingConvention = CallingConvention.Cdecl)] internal static extern int GetId(string name); @@ -38,4 +39,3 @@ internal static partial class Interop } } } - diff --git a/src/Tizen.System.PlatformConfig/Tizen.System/PlatformConfig.cs b/src/Tizen.System.PlatformConfig/Tizen.System/PlatformConfig.cs index 6c5aaa4..2a69cd4 100755 --- a/src/Tizen.System.PlatformConfig/Tizen.System/PlatformConfig.cs +++ b/src/Tizen.System.PlatformConfig/Tizen.System/PlatformConfig.cs @@ -24,14 +24,19 @@ namespace Tizen.System [EditorBrowsable(EditorBrowsableState.Never)] public class PlatformConfig { - public static string GetEnv(int id) + public static int GetId(string name) { - return Interop.PlatformConfig.GetEnv(id); + return Interop.PlatformConfig.GetId(name); } - public static int GetId(string name) + public static string GetEnv(int id) { - return Interop.PlatformConfig.GetId(name); + return Interop.PlatformConfig.GetEnv(id); } + + public static string GetEnv(string name) + { + return Interop.PlatformConfig.GetEnv(Interop.PlatformConfig.GetId(name)); + } } }