[Bundle] Allow other modules to access bundle handle
authorSidharth Gupta <sid92.gupta@samsung.com>
Fri, 25 Mar 2016 05:26:50 +0000 (14:26 +0900)
committerSidharth Gupta <sid92.gupta@samsung.com>
Mon, 28 Mar 2016 08:28:02 +0000 (17:28 +0900)
- Make an internal getter
- Modules such as message port can use this

- Also remove unnecessary CallingConvention from
  PInvoke methods

Signed-off-by: Sidharth Gupta <sid92.gupta@samsung.com>
Change-Id: I954c21c8e619e8ed71c2498da80a23b4410720fc

Tizen.Applications/Interop/Interop.Bundle.cs
Tizen.Applications/Tizen.Applications/Bundle.cs [changed mode: 0755->0644]

index 0c667a1..cb8d11c 100644 (file)
@@ -17,37 +17,37 @@ internal static partial class Interop
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         internal delegate void Iterator(string key, int type, IntPtr keyval, IntPtr userData);
 
-        [DllImport(Libraries.Bundle, EntryPoint = "bundle_create", CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_create")]
         internal static extern IntPtr Create();
 
-        [DllImport(Libraries.Bundle, EntryPoint = "bundle_free", CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_free")]
         internal static extern int Free(IntPtr handle);
 
-        [DllImport(Libraries.Bundle, EntryPoint = "bundle_del", CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_del")]
         internal static extern int RemoveItem(IntPtr handle, string key);
 
-        [DllImport(Libraries.Bundle, EntryPoint = "bundle_add_str", CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_add_str")]
         internal static extern int AddString(IntPtr handle, string key, string value);
 
-        [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_type", CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_type")]
         internal static extern int GetType(IntPtr handle, string key);
 
-        [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_str", CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_str")]
         internal static extern int GetString(IntPtr handle, string key, out IntPtr value);
 
-        [DllImport(Libraries.Bundle, EntryPoint = "bundle_add_byte", CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_add_byte")]
         internal static extern unsafe int AddByte(IntPtr handle, string key, byte* value, int size);
 
-        [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_byte", CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_byte")]
         internal static extern int GetByte(IntPtr handle, string key, out IntPtr value, out int size);
 
-        [DllImport(Libraries.Bundle, EntryPoint = "bundle_add_str_array", CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_add_str_array")]
         internal static extern int AddStringArray(IntPtr handle, string key, string[] value, int size);
 
-        [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_str_array", CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_str_array")]
         internal static extern IntPtr GetStringArray(IntPtr handle, string key, out int size);
 
-        [DllImport(Libraries.Bundle, EntryPoint = "bundle_foreach", CallingConvention = CallingConvention.Cdecl)]
+        [DllImport(Libraries.Bundle, EntryPoint = "bundle_foreach")]
         internal static extern void Foreach(IntPtr handle, Iterator iterator, IntPtr userData);
 
         internal static class UnsafeCode
old mode 100755 (executable)
new mode 100644 (file)
index c9d6dc4..aba2505
@@ -98,6 +98,14 @@ namespace Tizen.Applications
             }
         }
 
+        internal IntPtr Handle
+        {
+            get
+            {
+                return _handle;
+            }
+        }
+
         /// <summary>
         /// Releases any unmanaged resources used by this object.
         /// </summary>