[contacts-service] fixed invalid parameter, api usage
authorJeesun Kim <iamjs.kim@samsung.com>
Wed, 24 Feb 2016 05:16:25 +0000 (14:16 +0900)
committerJeesun Kim <iamjs.kim@samsung.com>
Wed, 24 Feb 2016 05:16:54 +0000 (14:16 +0900)
Signed-off-by: Jeesun Kim <iamjs.kim@samsung.com>
Change-Id: I361b2ed09705d284263e7709814d9bb004643dc8

org.tizen.tutorials/html/native/social/contact_tutorial_n.htm

index eae45ac..b94b969 100644 (file)
@@ -68,7 +68,7 @@
                                <li><a href="#pl_get">Getting Logs</a></li>\r
                                <li><a href="#pl_delete">Deleting a Log</a></li>\r
                                </ul>\r
-                       </li>                   \r
+                       </li>\r
                        <li>Records\r
                                <ul class="toc">\r
                                <li><a href="#insert2">Inserting New Records</a></li>\r
@@ -87,7 +87,7 @@
                                <li><a href="#import">Importing from vCard</a></li>\r
                                <li><a href="#export">Exporting to vCard</a></li>\r
                                </ul></li>\r
-               </ul>        \r
+               </ul>\r
         <p class="toc-title">Related Info</p>\r
         <ul class="toc">\r
             <li><a href="../../../../org.tizen.guides/html/native/social/contact_n.htm">Contacts Guide</a></li>\r
 \r
  <h1>Contacts: Managing Contacts and Groups, and Accessing the Contact Database</h1>\r
 \r
-   \r
+\r
 <p>This tutorial demonstrates how you can manage contacts and groups, and import them to or export them from the vCard format.</p>\r
 \r
 <p>This feature is supported in mobile applications only.</p>\r
                                <li><a href="#parse">Parsing a vCard</a>\r
                                <p>Parse a vCard from a file and insert to the database.</p></li>\r
                                </ul></li>\r
-                       <li>Speed dials \r
+                       <li>Speed dials\r
                                <ul>\r
                                <li><a href="#sd_create">Creating a Speed Dial</a>\r
                                <p>Create a new speed dial.</p></li>\r
                                <li><a href="#sd_delete">Deleting a Speed Dial</a>\r
                                <p>Delete the speed dial from the database.</p></li>\r
                                </ul></li>\r
-                       <li>Phone logs  \r
+                       <li>Phone logs\r
                                <ul>\r
                                <li><a href="#pl_create">Creating a Log</a>\r
                                <p>Create a new log.</p></li>\r
                                <p>Retrieve single log or a list of logs.</p></li>\r
                                <li><a href="#pl_delete">Deleting a Log</a>\r
                                <p>Delete the log from the database.</p></li>\r
-                               </ul>                           \r
+                               </ul>\r
                        </li></ul>\r
-               <h2>Follow-up</h2> \r
+               <h2>Follow-up</h2>\r
                <p>Once we have learned the basics of the Contacts API, we can now move on to more advanced tasks, including:</p>\r
                <ul>\r
                        <li>Records\r
                        <li>Contact settings\r
                                <ul>\r
                                <li><a href="#settings">Managing Contact Settings</a>\r
-                               <p>Change the display settings of contacts.</p></li>                            \r
+                               <p>Change the display settings of contacts.</p></li>\r
                                <li><a href="#sim">Managing Contacts on the SIM Card</a>\r
                                <p>Check that the SIM card is initialized and import contacts from the SIM card.</p></li>\r
                                </ul></li>\r
                                <p>Export contacts to vCard files.</p></li>\r
                                </ul></li>\r
                                </ul>\r
-             \r
+\r
 \r
  <h2 id="init" name="init">Initializing Contacts</h2>\r
 \r
 <p>To start with the Contact Service:</p>\r
-<ol><li>                       \r
+<ol><li>\r
 <p>To use the functions and data types of the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SOCIAL__CONTACTS__SVC__MODULE.html">Contacts</a> API, include the <span style="font-family: Courier New,Courier,monospace">&lt;contacts.h&gt;</span> header file in your application:</p>\r
 <pre class="prettyprint">\r
 #include &lt;contacts.h&gt;\r
-</pre></li>    \r
+</pre></li>\r
 <li>Most of the API functions return error codes, therefore define at the beginning of your code the <span style="font-family: Courier New,Courier,monospace">int</span> type, which is used to store error codes. Each time when a function returns error codes, verify the result of the operation.</li>\r
 <li><p>Call the <span style="font-family: Courier New,Courier,monospace">contacts_connect()</span> function, which connects your application with the Contact Service. Without this function, you cannot get access to the contacts database.</p>\r
 <pre class="prettyprint">int error_code;\r
@@ -379,19 +379,19 @@ error_code = contacts_db_get_all_records(_contacts_person._uri, 0, 0, &amp;list)
 </pre></li>\r
 <li><p id="iterate_c" name="iterate_c">Iterate the list and read the records:</p>\r
 \r
-  <table class="note"> \r
-   <tbody> \r
-    <tr> \r
-     <th class="note">Note</th> \r
-    </tr> \r
-    <tr> \r
-     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td> \r
-    </tr> \r
-   </tbody> \r
-  </table> \r
-\r
-<ol type="a"><li><p>To get the records from the list, use the <span style="font-family: Courier New,Courier,monospace">contacts_list_get_current_record_p()</span>, and <span style="font-family: Courier New,Courier,monospace">contacts_list_next()</span> or <span style="font-family: Courier New,Courier,monospace">contacts_list_prev()</span> functions. Get the details of each record in the loop.</p>  \r
-  \r
+  <table class="note">\r
+   <tbody>\r
+    <tr>\r
+     <th class="note">Note</th>\r
+    </tr>\r
+    <tr>\r
+     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td>\r
+    </tr>\r
+   </tbody>\r
+  </table>\r
+\r
+<ol type="a"><li><p>To get the records from the list, use the <span style="font-family: Courier New,Courier,monospace">contacts_list_get_current_record_p()</span>, and <span style="font-family: Courier New,Courier,monospace">contacts_list_next()</span> or <span style="font-family: Courier New,Courier,monospace">contacts_list_prev()</span> functions. Get the details of each record in the loop.</p>\r
+\r
 <pre class="prettyprint">contacts_record_h record;\r
 while (contacts_list_get_current_record_p(list, &amp;record) == CONTACTS_ERROR_NONE)\r
 {\r
@@ -415,7 +415,7 @@ while (contacts_list_get_current_record_p(list, &amp;record) == CONTACTS_ERROR_N
 }</pre></li>\r
 <li>The memory for the record data is allocated, and the data is copied from the record by the functions listed further on in this tutorial:\r
 <pre class="prettyprint">\r
-typedef struct \r
+typedef struct\r
 _contacts_gl_person_data\r
 {\r
 &nbsp;&nbsp;&nbsp;int id;\r
@@ -424,7 +424,7 @@ _contacts_gl_person_data
 &nbsp;&nbsp;&nbsp;contacts_list_h associated_contacts;\r
 } contacts_gl_person_data_t;\r
 \r
-static void \r
+static void\r
 _free_gl_person_data(contacts_gl_person_data_t *gl_person_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;if (NULL == gl_person_data)\r
@@ -436,7 +436,7 @@ _free_gl_person_data(contacts_gl_person_data_t *gl_person_data)
 &nbsp;&nbsp;&nbsp;free(gl_person_data);\r
 }\r
 \r
-static contacts_gl_person_data_t* \r
+static contacts_gl_person_data_t*\r
 _create_gl_person_data(contacts_record_h record)\r
 {\r
 &nbsp;&nbsp;&nbsp;contacts_gl_person_data_t *gl_person_data;\r
@@ -481,7 +481,7 @@ _create_gl_person_data(contacts_record_h record)
 <li>Get the display name.\r
 <p>Assuming that you have the person record handle (<span style="font-family: Courier New,Courier,monospace">contacts_record_h</span>), you can access the <span style="font-family: Courier New,Courier,monospace">display_name</span> property. You can read the display name property and print it.</p>\r
 <pre class="prettyprint">\r
-static bool \r
+static bool\r
 _get_display_name(contacts_record_h record, char **display_name)\r
 {\r
 &nbsp;&nbsp;&nbsp;int error_code;\r
@@ -495,7 +495,7 @@ _get_display_name(contacts_record_h record, char **display_name)
 }</pre></li>\r
 <li>Get associated contacts of a person by query:\r
 <pre class="prettyprint">\r
-static bool \r
+static bool\r
 _get_associated_contacts(contacts_record_h record, contacts_list_h *associated_contacts)\r
 {\r
 &nbsp;&nbsp;&nbsp;int error_code;\r
@@ -523,12 +523,12 @@ _get_associated_contacts(contacts_record_h record, contacts_list_h *associated_c
 }</pre></li>\r
 <li>Get phone numbers by iterating the contacts list. The following example shows how to get all the number records and print them.\r
 <pre class="prettyprint">\r
-static void \r
+static void\r
 _print_phone_numbers(contacts_list_h associated_contacts)\r
 {\r
 &nbsp;&nbsp;&nbsp;int error_code;\r
 &nbsp;&nbsp;&nbsp;contacts_record_h contact;\r
-&nbsp;&nbsp;&nbsp;if (NULL == associated_contacts) \r
+&nbsp;&nbsp;&nbsp;if (NULL == associated_contacts)\r
 &nbsp;&nbsp;&nbsp;{\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dlog_print(DLOG_ERROR, LOG_TAG, &quot;associated_contacts is NULL&quot;);\r
 \r
@@ -540,7 +540,7 @@ _print_phone_numbers(contacts_list_h associated_contacts)
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unsigned int count = 0;\r
 \r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error_code = contacts_record_get_child_record_count(contact, _contacts_contact.number, &amp;count);\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (CONTACTS_ERROR_NONE != error_code) \r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (CONTACTS_ERROR_NONE != error_code)\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dlog_print(DLOG_ERROR, LOG_TAG, &quot;contacts_record_get_child_record_count(%d)&quot;, error_code);\r
 \r
@@ -567,7 +567,7 @@ _print_phone_numbers(contacts_list_h associated_contacts)
 <li>Get the default phone number.\r
 <p>If a contact has multiple phone numbers, one of them is defined as the default phone number. A person also has a default phone number. The Contact Service provides the <span style="font-family: Courier New,Courier,monospace">_contacts_person_number</span> view for getting the default phone number of a person. In the default phone number record, the <span style="font-family: Courier New,Courier,monospace">is_primary_default</span> property value is <span style="font-family: Courier New,Courier,monospace">true</span>. The following example shows how to get the default phone number of a person by query.</p>\r
 <pre class="prettyprint">\r
-static bool \r
+static bool\r
 _get_default_phone_number(contacts_record_h record, char **default_phone_number)\r
 {\r
 &nbsp;&nbsp;&nbsp;contacts_query_h query = NULL;\r
@@ -599,12 +599,12 @@ _get_default_phone_number(contacts_record_h record, char **default_phone_number)
 }</pre></li>\r
 <li>Get events by iterating the contacts list:\r
 <pre class="prettyprint">\r
-static void \r
+static void\r
 _print_events(contacts_list_h associated_contacts)\r
 {\r
 &nbsp;&nbsp;&nbsp;int error_code;\r
 &nbsp;&nbsp;&nbsp;contacts_record_h contact;\r
-&nbsp;&nbsp;&nbsp;if (NULL == associated_contacts) \r
+&nbsp;&nbsp;&nbsp;if (NULL == associated_contacts)\r
 &nbsp;&nbsp;&nbsp;{\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dlog_print(DLOG_ERROR, LOG_TAG, &quot;associated_contacts is NULL&quot;);\r
 \r
@@ -616,7 +616,7 @@ _print_events(contacts_list_h associated_contacts)
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unsigned int count = 0;\r
 \r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error_code = contacts_record_get_child_record_count(contact, _contacts_contact.event, &amp;count);\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (CONTACTS_ERROR_NONE != error_code) \r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (CONTACTS_ERROR_NONE != error_code)\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dlog_print(DLOG_ERROR, LOG_TAG, &quot;contacts_record_get_child_record_count(%d)&quot;, error_code);\r
 \r
@@ -854,7 +854,7 @@ contacts_record_destroy(person, true);</pre></li></ul>
 <p>The callback function is called when the person data changes. The following example shows how to update person details in the callback function.</p>\r
 <pre class="prettyprint">\r
 static contacts_gl_person_data_t *_gl_person_data = ...\r
-void \r
+void\r
 _person_changed_callback(const char *view_uri, void *user_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;int error_code;\r
@@ -941,16 +941,16 @@ error_code = contacts_db_get_all_records(_contacts_group._uri, 0, 0, &amp;list);
 \r
 <li>To iterate the list and read the records:\r
 \r
-  <table class="note"> \r
-   <tbody> \r
-    <tr> \r
-     <th class="note">Note</th> \r
-    </tr> \r
-    <tr> \r
-     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td> \r
-    </tr> \r
-   </tbody> \r
-  </table> \r
+  <table class="note">\r
+   <tbody>\r
+    <tr>\r
+     <th class="note">Note</th>\r
+    </tr>\r
+    <tr>\r
+     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td>\r
+    </tr>\r
+   </tbody>\r
+  </table>\r
                <ol type="a">\r
                        <li>\r
                        <p>To get the records from the list, use the <span style="font-family: Courier New,Courier,monospace">contacts_list_get_current_record_p()</span>, and <span style="font-family: Courier New,Courier,monospace">contacts_list_next()</span> or <span style="font-family: Courier New,Courier,monospace">contacts_list_prev()</span> functions. The following example gets the details of each record in the loop.</p>\r
@@ -985,7 +985,7 @@ while (contacts_list_get_current_record_p(list, &amp;record) == CONTACTS_ERROR_N
                        </li>\r
                        <li>The memory for the record data is allocated, and the data is copied from the record by the functions listed in the following example:\r
                        <pre class="prettyprint">\r
-typedef struct \r
+typedef struct\r
 _contacts_gl_group_data\r
 {\r
 &nbsp;&nbsp;&nbsp;int id;\r
@@ -994,7 +994,7 @@ _contacts_gl_group_data
 &nbsp;&nbsp;&nbsp;char *ringtone_path;\r
 } contacts_gl_group_data_t;\r
 \r
-static void \r
+static void\r
 _free_gl_group_data(contacts_gl_group_data_t *gl_group_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;if (NULL == gl_group_data)\r
@@ -1006,7 +1006,7 @@ _free_gl_group_data(contacts_gl_group_data_t *gl_group_data)
 &nbsp;&nbsp;&nbsp;free(gl_group_data);\r
 }\r
 \r
-static contacts_gl_group_data_t* \r
+static contacts_gl_group_data_t*\r
 _create_gl_group_data(contacts_record_h record)\r
 {\r
 &nbsp;&nbsp;&nbsp;contacts_gl_group_data_t *gl_group_data;\r
@@ -1093,16 +1093,16 @@ contacts_query_destroy(query);
 </ol></li>\r
 <li>To iterate the list and read the records:\r
 \r
-  <table class="note"> \r
-   <tbody> \r
-    <tr> \r
-     <th class="note">Note</th> \r
-    </tr> \r
-    <tr> \r
-     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td> \r
-    </tr> \r
-   </tbody> \r
-  </table> \r
+  <table class="note">\r
+   <tbody>\r
+    <tr>\r
+     <th class="note">Note</th>\r
+    </tr>\r
+    <tr>\r
+     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td>\r
+    </tr>\r
+   </tbody>\r
+  </table>\r
 \r
 <ol type="a"><li><p>To get the records from the list, use the <span style="font-family: Courier New,Courier,monospace">contacts_list_get_current_record_p()</span>, and <span style="font-family: Courier New,Courier,monospace">contacts_list_next()</span> or <span style="font-family: Courier New,Courier,monospace">contacts_list_prev()</span> functions. Get the details of each record in the loop.</p>\r
 \r
@@ -1132,7 +1132,7 @@ while (contacts_list_get_current_record_p(list, &amp;record) == CONTACTS_ERROR_N
 }</pre></li>\r
 <li><p>The memory for the record data is allocated, and the data is copied from the record by the functions listed further on in this tutorial:</p>\r
 <pre class="prettyprint">\r
-typedef struct \r
+typedef struct\r
 _contacts_gl_group_data\r
 {\r
 &nbsp;&nbsp;&nbsp;int id;\r
@@ -1141,7 +1141,7 @@ _contacts_gl_group_data
 &nbsp;&nbsp;&nbsp;char *ringtone_path;\r
 } contacts_gl_group_data_t;\r
 \r
-static void \r
+static void\r
 _free_gl_group_data(contacts_gl_group_data_t *gl_group_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;if (NULL == gl_group_data)\r
@@ -1153,7 +1153,7 @@ _free_gl_group_data(contacts_gl_group_data_t *gl_group_data)
 &nbsp;&nbsp;&nbsp;free(gl_group_data);\r
 }\r
 \r
-static contacts_gl_group_data_t* \r
+static contacts_gl_group_data_t*\r
 _create_gl_group_data(contacts_record_h record)\r
 {\r
 &nbsp;&nbsp;&nbsp;contacts_gl_group_data_t *gl_group_data;\r
@@ -1291,7 +1291,7 @@ contacts_query_destroy(query);</pre></li></ol></li></ul>
 </pre></li>\r
 <li>Define the callback function to be called when the group data changes:\r
 <pre class="prettyprint">static contacts_gl_group_data_t *_gl_group_data = ...\r
-static void \r
+static void\r
 _group_changed_callback(const char *view_uri, void *user_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;int error_code;\r
@@ -1366,7 +1366,7 @@ error_code = contacts_vcard_parse_to_contact_foreach(temp_path, // File path of
 \r
 <p>The vCard stream contains multiple contact objects. The callback function is called after parsing each contact. If you return <span style="font-family: Courier New,Courier,monospace">false</span> on the callback function, parsing stops.</p>\r
 <pre class="prettyprint">\r
-static bool \r
+static bool\r
 _vcard_parse_cb(contacts_record_h contact, void *user_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;if (NULL == contact)\r
@@ -1407,7 +1407,7 @@ error_code = contacts_record_set_int(speeddial, _contacts_speeddial. number_id,
 </pre>\r
 </li>\r
 </ol>\r
-  \r
+\r
  <h2 id="sd_insert" name="sd_insert">Inserting a Speed Dial to the Database</h2>\r
 \r
 <p>To insert a speed dial record:</p>\r
@@ -1415,7 +1415,7 @@ error_code = contacts_record_set_int(speeddial, _contacts_speeddial. number_id,
 <pre class="prettyprint">\r
 int added_speeddial_id = -1;\r
 \r
-error_code = contacts_db_insert_record(speeddial, &amp;added_speeddial_id);    \r
+error_code = contacts_db_insert_record(speeddial, &amp;added_speeddial_id);\r
 </pre>\r
 </li>\r
 \r
@@ -1453,18 +1453,18 @@ error_code = contacts_db_get_all_records(_contacts_speeddial._uri, 0, 0, &amp;li
 </li>\r
 \r
 <li>To iterate the list and read the records, you can get the records from the list using the <span style="font-family: Courier New,Courier,monospace">contacts_list_get_current_record_p()</span>, <span style="font-family: Courier New,Courier,monospace">contacts_list_next()</span>, or <span style="font-family: Courier New,Courier,monospace">contacts_list_prev()</span> function. Get the details of each record in the loop.\r
-               \r
-         <table class="note"> \r
-   <tbody> \r
-    <tr> \r
-     <th class="note">Note</th> \r
-    </tr> \r
-    <tr> \r
-     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td> \r
-    </tr> \r
-   </tbody> \r
-  </table>     \r
-               \r
+\r
+         <table class="note">\r
+   <tbody>\r
+    <tr>\r
+     <th class="note">Note</th>\r
+    </tr>\r
+    <tr>\r
+     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td>\r
+    </tr>\r
+   </tbody>\r
+  </table>\r
+\r
 \r
                <pre class="prettyprint">\r
 contacts_record_h record;\r
@@ -1499,7 +1499,7 @@ while (contacts_list_get_current_record_p(list, &amp;record) == CONTACTS_ERROR_N
                <p>The memory for the record data is allocated, and the data is copied from the record by the functions shown in the following example:</p>\r
 \r
                <pre class="prettyprint">\r
-typedef struct \r
+typedef struct\r
 _contacts_gl_speeddial_data\r
 {\r
 &nbsp;&nbsp;&nbsp;int speeddial_number;\r
@@ -1508,7 +1508,7 @@ _contacts_gl_speeddial_data
 &nbsp;&nbsp;&nbsp;char *image_thumbnail_path;\r
 } contacts_gl_speeddial_data_t;\r
 \r
-static void \r
+static void\r
 _free_gl_speeddial_data(contacts_gl_speeddial_data_t *gl_speeddial_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;if (NULL == gl_speeddial_data)\r
@@ -1520,7 +1520,7 @@ _free_gl_speeddial_data(contacts_gl_speeddial_data_t *gl_speeddial_data)
 &nbsp;&nbsp;&nbsp;free(gl_speeddial_data);\r
 }\r
 \r
-static contacts_gl_speeddial_data_t* \r
+static contacts_gl_speeddial_data_t*\r
 _create_gl_speeddial_data(contacts_record_h record)\r
 {\r
 &nbsp;&nbsp;&nbsp;contacts_gl_speeddial_data_t *gl_speeddial_data;\r
@@ -1602,7 +1602,7 @@ error_code = contacts_filter_add_int(filter, _contacts_speeddial.speeddial_numbe
 </pre>\r
        </li>\r
 \r
-       <li>Connect the query with the list: \r
+       <li>Connect the query with the list:\r
        <pre class="prettyprint">\r
 error_code = contacts_query_set_filter(query, filter);\r
 \r
@@ -1611,7 +1611,7 @@ error_code = contacts_db_get_records_with_query(query, 0, 0, &amp;list);
        <p>The third parameter refers to the limit of the results. If 0 is passed, there are no limits. Remember that after all operations, the list must be released.</p>\r
        </li>\r
 \r
-<li>Free the filter and query: \r
+<li>Free the filter and query:\r
 <pre class="prettyprint">\r
 contacts_filter_destroy(filter);\r
 contacts_query_destroy(query);\r
@@ -1622,16 +1622,16 @@ contacts_query_destroy(query);
 \r
 <li>To iterate the list and read the records, you can get the records from the list using the <span style="font-family: Courier New,Courier,monospace">contacts_list_get_current_record_p()</span>, <span style="font-family: Courier New,Courier,monospace">contacts_list_next()</span>, or <span style="font-family: Courier New,Courier,monospace">contacts_list_prev()</span> function. Get the details of each record in the loop.\r
 \r
-  <table class="note"> \r
-   <tbody> \r
-    <tr> \r
-     <th class="note">Note</th> \r
-    </tr> \r
-    <tr> \r
-     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td> \r
-    </tr> \r
-   </tbody> \r
-  </table> \r
+  <table class="note">\r
+   <tbody>\r
+    <tr>\r
+     <th class="note">Note</th>\r
+    </tr>\r
+    <tr>\r
+     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td>\r
+    </tr>\r
+   </tbody>\r
+  </table>\r
 \r
 <pre class="prettyprint">\r
 contacts_record_h record;\r
@@ -1663,7 +1663,7 @@ while (contacts_list_get_current_record_p(list, &amp;record) == CONTACTS_ERROR_N
 </pre>\r
 <p>The memory for the record data is allocated, and the data is copied from the record by the functions shown in the following example.</p>\r
 <pre class="prettyprint">\r
-typedef struct \r
+typedef struct\r
 _contacts_gl_speeddial_data\r
 {\r
 &nbsp;&nbsp;&nbsp;int speeddial_number;\r
@@ -1672,7 +1672,7 @@ _contacts_gl_speeddial_data
 &nbsp;&nbsp;&nbsp;char *image_thumbnail_path;\r
 } contacts_gl_speeddial_data_t;\r
 \r
-static void \r
+static void\r
 _free_gl_speeddial_data(contacts_gl_speeddial_data_t *gl_speeddial_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;if (NULL == gl_speeddial_data)\r
@@ -1684,7 +1684,7 @@ _free_gl_speeddial_data(contacts_gl_speeddial_data_t *gl_speeddial_data)
 &nbsp;&nbsp;&nbsp;free(gl_speeddial_data);\r
 }\r
 \r
-static contacts_gl_speeddial_data_t* \r
+static contacts_gl_speeddial_data_t*\r
 _create_gl_speeddial_data(contacts_record_h record)\r
 {\r
 &nbsp;&nbsp;&nbsp;contacts_gl_speeddial_data_t *gl_speeddial_data;\r
@@ -1735,7 +1735,7 @@ contacts_list_destroy(list, true);</pre></li>
 \r
 <p>To change the number ID of an existing speed dial:</p>\r
 <ol>\r
-<li>Get the speed dial. \r
+<li>Get the speed dial.\r
 <p>To modify a record, you need to have a handle (<span style="font-family: Courier New,Courier,monospace">contacts_record_h</span> type variable) to a memory object representing the record in the database. One of the ways to acquire it is to use the speed dial number:</p>\r
 <pre class="prettyprint">\r
 int speeddial_number = ... // Acquire speed dial number\r
@@ -1777,7 +1777,7 @@ int speeddial_number = ... // Acquire speed dial number
 \r
 error_code = contacts_db_delete_record(_contacts_speeddial._uri, speeddial_number);\r
 </pre>\r
\r
+\r
 \r
  <h2 id="pl_create" name="pl_create">Creating a Log</h2>\r
 \r
@@ -1844,7 +1844,7 @@ if (error_code != CONTACTS_ERROR_NONE)
 \r
 <p>To get all log records one by one, or to filter them by one of the properties:</p>\r
 <ol>\r
-<li>Get a single log record: \r
+<li>Get a single log record:\r
 <ol type="a"><li><p>Use the <span style="font-family: Courier New,Courier,monospace">contacts_db_get_record()</span> function with the appropriate <span style="font-family: Courier New,Courier,monospace">log_id</span>:</p>\r
 <pre class="prettyprint">contacts_record_h log;\r
 int log_id = ... // Acquire log ID\r
@@ -1867,16 +1867,16 @@ if (error_code != CONTACTS_ERROR_NONE)
 \r
 <li>To iterate the list and read the records, you can get the records from the list using the <span style="font-family: Courier New,Courier,monospace">contacts_list_get_current_record_p()</span>, <span style="font-family: Courier New,Courier,monospace">contacts_list_next()</span>, or <span style="font-family: Courier New,Courier,monospace">contacts_list_prev()</span> function. Get the details of each record in the loop.\r
 \r
-  <table class="note"> \r
-   <tbody> \r
-    <tr> \r
-     <th class="note">Note</th> \r
-    </tr> \r
-    <tr> \r
-     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td> \r
-    </tr> \r
-   </tbody> \r
-  </table> \r
+  <table class="note">\r
+   <tbody>\r
+    <tr>\r
+     <th class="note">Note</th>\r
+    </tr>\r
+    <tr>\r
+     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td>\r
+    </tr>\r
+   </tbody>\r
+  </table>\r
 \r
 \r
 <pre class="prettyprint">\r
@@ -1912,7 +1912,7 @@ while (contacts_list_get_current_record_p(list, &amp;record) == CONTACTS_ERROR_N
 <p>The memory for the record data is allocated, and the data is copied from the record by the functions listed further on in this tutorial.</p>\r
 \r
                <pre class="prettyprint">\r
-typedef struct \r
+typedef struct\r
 _contacts_gl_log_data\r
 {\r
 &nbsp;&nbsp;&nbsp;int id;\r
@@ -1921,7 +1921,7 @@ _contacts_gl_log_data
 &nbsp;&nbsp;&nbsp;int log_time;\r
 } contacts_gl_log_data_t;\r
 \r
-static void \r
+static void\r
 _free_gl_log_data(contacts_gl_log_data_t *gl_log_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;if (NULL == gl_log_data)\r
@@ -1931,7 +1931,7 @@ _free_gl_log_data(contacts_gl_log_data_t *gl_log_data)
 &nbsp;&nbsp;&nbsp;free(gl_log_data);\r
 }\r
 \r
-static contacts_gl_log_data_t* \r
+static contacts_gl_log_data_t*\r
 _create_gl_log_data(contacts_record_h record)\r
 {\r
 &nbsp;&nbsp;&nbsp;contacts_gl_log_data_t *gl_log_data;\r
@@ -1948,7 +1948,7 @@ _create_gl_log_data(contacts_record_h record)
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return NULL;\r
 &nbsp;&nbsp;&nbsp;}\r
 &nbsp;&nbsp;&nbsp;if (CONTACTS_ERROR_NONE != contacts_record_get_str(record, _contacts_phone_log.address, &amp;gl_log_data-&gt;address))\r
-&nbsp;&nbsp;&nbsp;{                                                            \r
+&nbsp;&nbsp;&nbsp;{\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dlog_print(DLOG_ERROR, LOG_TAG, &quot;contacts record get string failed &quot;);\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_free_gl_log_data(gl_log_data);\r
 \r
@@ -1993,8 +1993,8 @@ if (error_code != CONTACTS_ERROR_NONE)
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_ERROR, LOG_TAG, &quot;contacts query create failed: %x&quot;, error_code);\r
 </pre>\r
        </li>\r
-       \r
-       <li>Before getting the logs, filter the list. There is a possibility to filter based on various parameters. To create a filter: \r
+\r
+       <li>Before getting the logs, filter the list. There is a possibility to filter based on various parameters. To create a filter:\r
        <pre class="prettyprint">\r
 contacts_filter_h filter = NULL;\r
 \r
@@ -2003,7 +2003,7 @@ if (error_code != CONTACTS_ERROR_NONE)
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_ERROR, LOG_TAG, &quot;contacts filter create failed: %x&quot;, error_code);\r
 </pre>\r
        </li>\r
-       \r
+\r
        <li>Add a condition, such as the log type.\r
        <p>The following example retrieves only those logs which type is <span style="font-family: Courier New,Courier,monospace">CONTACTS_PLOG_TYPE_VOICE_INCOMING</span>.</p>\r
        <pre class="prettyprint">\r
@@ -2011,7 +2011,7 @@ error_code = contacts_filter_add_int(filter, _contacts_phone_log.log_type, CONTA
 if (error_code != CONTACTS_ERROR_NONE)\r
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_ERROR, LOG_TAG, &quot;contacts filter add integer failed: %x&quot;, error_code);\r
 </pre>\r
-        \r
+\r
        <p>To use multiple conditions, add an operator between them:</p>\r
        <pre class="prettyprint">\r
 error_code = contacts_filter_add_operator(filter, CONTACTS_FILTER_OPERATOR_OR);\r
@@ -2022,8 +2022,8 @@ if (error_code != CONTACTS_ERROR_NONE)
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_ERROR, LOG_TAG, &quot;contacts filter add integer failed: %x&quot;, error_code);\r
 </pre>\r
        </li>\r
-       \r
-       <li>Connect the query with the list: \r
+\r
+       <li>Connect the query with the list:\r
        <pre class="prettyprint">\r
 error_code = contacts_query_set_filter(query, filter);\r
 if (error_code != CONTACTS_ERROR_NONE)\r
@@ -2035,8 +2035,8 @@ if (error_code != CONTACTS_ERROR_NONE)
 </pre>\r
        <p>The third parameter refers to the limit of the results. If 0 is passed, there are no limits. After all operations, release the list.</p>\r
        </li>\r
-       \r
-       <li>Free the filter and query: \r
+\r
+       <li>Free the filter and query:\r
        <pre class="prettyprint">\r
 contacts_filter_destroy(filter);\r
 contacts_query_destroy(query);\r
@@ -2048,16 +2048,16 @@ contacts_query_destroy(query);
 <li>To iterate the list and read the records, use the <span style="font-family: Courier New,Courier,monospace">contacts_list_get_current_record_p()</span>, <span style="font-family: Courier New,Courier,monospace">contacts_list_next()</span>, or <span style="font-family: Courier New,Courier,monospace">contacts_list_prev()</span> function. Get the details of each record in the loop.\r
 \r
 \r
-  <table class="note"> \r
-   <tbody> \r
-    <tr> \r
-     <th class="note">Note</th> \r
-    </tr> \r
-    <tr> \r
-     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td> \r
-    </tr> \r
-   </tbody> \r
-  </table> \r
+  <table class="note">\r
+   <tbody>\r
+    <tr>\r
+     <th class="note">Note</th>\r
+    </tr>\r
+    <tr>\r
+     <td class="note">Some functions have the <span style="font-family: Courier New,Courier,monospace">_p</span> postfix. It means that the returned value must not be freed by the application, as it is a pointer to the data in an existing record.</td>\r
+    </tr>\r
+   </tbody>\r
+  </table>\r
 \r
 <pre class="prettyprint">\r
 contacts_record_h record;\r
@@ -2089,7 +2089,7 @@ while (contacts_list_get_current_record_p(list, &amp;record) == CONTACTS_ERROR_N
 </pre>\r
 <p>The memory for the record data is allocated, and the data is copied from the record by the functions listed further on in this tutorial.</p>\r
 <pre class="prettyprint">\r
-typedef struct \r
+typedef struct\r
 _contacts_gl_log_data\r
 {\r
 &nbsp;&nbsp;&nbsp;int id;\r
@@ -2098,7 +2098,7 @@ _contacts_gl_log_data
 &nbsp;&nbsp;&nbsp;int log_time;\r
 } contacts_gl_log_data_t;\r
 \r
-static void \r
+static void\r
 _free_gl_log_data(contacts_gl_log_data_t *gl_log_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;if (NULL == gl_log_data)\r
@@ -2108,7 +2108,7 @@ _free_gl_log_data(contacts_gl_log_data_t *gl_log_data)
 &nbsp;&nbsp;&nbsp;free(gl_log_data);\r
 }\r
 \r
-static contacts_gl_log_data_t* \r
+static contacts_gl_log_data_t*\r
 _create_gl_log_data(contacts_record_h record)\r
 {\r
 &nbsp;&nbsp;&nbsp;contacts_gl_log_data_t *gl_log_data;\r
@@ -2125,7 +2125,7 @@ _create_gl_log_data(contacts_record_h record)
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return NULL;\r
 &nbsp;&nbsp;&nbsp;}\r
 &nbsp;&nbsp;&nbsp;if (CONTACTS_ERROR_NONE != contacts_record_get_str(record, _contacts_phone_log.address, &amp;gl_log_data-&gt;address))\r
-&nbsp;&nbsp;&nbsp;{                                                            \r
+&nbsp;&nbsp;&nbsp;{\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dlog_print(DLOG_ERROR, LOG_TAG, &quot;contacts record get string failed &quot;);\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_free_gl_log_data(gl_log_data);\r
 \r
@@ -2263,8 +2263,8 @@ free(d_name);
 contacts_record_h child_record;\r
 contacts_record_get_child_record_at_p(record, _contacts_contact.name, 0, &amp;child_record);\r
 // In the child_record, you have the record form name view\r
-char *f_name;\r
-contacts_record_get_str(record, _contacts_name.first_name, f_name);\r
+char *f_name = NULL;\r
+contacts_record_get_str(child_record, _contacts_name.first_name, &amp;f_name);\r
 free(f_name);\r
 </pre>\r
 </li>\r
@@ -2276,7 +2276,7 @@ free(f_name);
 contacts_record_h parent_record;\r
 int parent_id;\r
 contacts_record_get_int(record, _contacts_name.contact_id, &amp;parent_id);\r
-contacts_db_get_child_record(_contacts_contact._uri, parent_id, &amp;parent_record);\r
+contacts_db_get_record(_contacts_contact._uri, parent_id, &amp;parent_record);\r
 // In the parent_record, get bool\r
 bool h_email;\r
 contacts_record_get_bool(parent_record, _contacts_contact.has_email, &amp;h_email);\r
@@ -2291,7 +2291,7 @@ contacts_record_get_bool(parent_record, _contacts_contact.has_email, &amp;h_emai
 gldata = _create_gl_data(record);\r
 char * number = gldata-&gt;number;\r
 \r
-typedef struct \r
+typedef struct\r
 _contact_gl_data\r
 {\r
 &nbsp;&nbsp;&nbsp;int id;\r
@@ -2357,7 +2357,7 @@ _create_gl_data(contacts_record_h r_contact)
 <ul><li><p>To get the name details, get the <span style="font-family: Courier New,Courier,monospace;">_contacts_contact.name</span> (representing the child) from the <span style="font-family: Courier New,Courier,monospace;">r_contact</span> parent. Both structures have the <span style="font-family: Courier New,Courier,monospace;">contacts_record_h</span> type. After obtaining a child record, get the desired data from it using the <span style="font-family: Courier New,Courier,monospace;">contacts_record_get_str()</span> function.</p>\r
 \r
 <pre class="prettyprint">\r
-static bool \r
+static bool\r
 _get_contact_last(contacts_record_h r_contact, char **last)\r
 {\r
 &nbsp;&nbsp;&nbsp;contacts_record_h r_name;\r
@@ -2372,7 +2372,7 @@ _get_contact_last(contacts_record_h r_contact, char **last)
 <li><p>Obtain the record ID directly from the parent record. An ID is a unique number representing the record key in the database. You can manipulate a record with functions, such as <span style="font-family: Courier New,Courier,monospace;">contacts_db_get_record()</span> or <span style="font-family: Courier New,Courier,monospace;">contacts_db_delete_records()</span>, if you know their ID.</p>\r
 \r
 <pre class="prettyprint">\r
-static bool \r
+static bool\r
 _get_contact_id(contacts_record_h r_contact, int *id)\r
 {\r
 &nbsp;&nbsp;&nbsp;int error_code;\r
@@ -2386,7 +2386,7 @@ _get_contact_id(contacts_record_h r_contact, int *id)
 <li><p>To get a contact number, check whether it exists using the <span style="font-family: Courier New,Courier,monospace;">contacts_record_get_bool()</span> function. If it exists, use the various <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SOCIAL__CONTACTS__SVC__QUERY__MODULE.html">Query</a> and <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SOCIAL__CONTACTS__SVC__FILTER__MODULE.html">Filter</a> functions from the Contacts API to make a query to get a list. At the end, free any data returned by a function not containing the <span style="font-family: Courier New,Courier,monospace;">_p</span> suffix.</p>\r
 <ul><li>Get a list of all numbers and filter the list to get the default:\r
 <pre class="prettyprint">\r
-static bool \r
+static bool\r
 _get_contact_number(contacts_record_h r_contact, char **number)\r
 {\r
 &nbsp;&nbsp;&nbsp;int id;\r
@@ -2432,7 +2432,7 @@ _get_contact_number(contacts_record_h r_contact, char **number)
 <li><p>Directly access the default number:</p>\r
 \r
 <pre class="prettyprint">\r
-static bool \r
+static bool\r
 _get_contact_number(contacts_record_h r_contact, char **number)\r
 {\r
 &nbsp;&nbsp;&nbsp;int error_code;\r
@@ -2447,12 +2447,24 @@ _get_contact_number(contacts_record_h r_contact, char **number)
 \r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true;\r
 &nbsp;&nbsp;&nbsp;}\r
+&nbsp;&nbsp;&nbsp;int i;\r
+&nbsp;&nbsp;&nbsp;unsigned int count = 0;\r
+&nbsp;&nbsp;&nbsp;bool is_default = false;\r
+&nbsp;&nbsp;&nbsp;error_code = contacts_record_get_child_record_count(contact, _contacts_contact.number, &amp;count);\r
 \r
-&nbsp;&nbsp;&nbsp;error_code = contacts_record_get_child_record_at_p(r_contact, _contacts_contact.number, 0, &amp;r_number);\r
-\r
-&nbsp;&nbsp;&nbsp;error_code = contacts_record_get_str(r_number, _contacts_number.number, number);\r
+&nbsp;&nbsp;&nbsp;for (i = 0; i &lt; count; i++)\r
+&nbsp;&nbsp;&nbsp;{\r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error_code = contacts_record_get_child_record_at_p(r_contact, _contacts_contact.number, i, &amp;r_number);\r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error_code = contacts_record_get_bool(r_number, _contacts_number.is_default, &amp;is_default);\r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(is_default)\r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error_code = contacts_record_get_str(r_number, _contacts_number.number, number);\r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true;\r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r
+&nbsp;&nbsp;&nbsp;}\r
+&nbsp;&nbsp;&nbsp;*number = NULL;\r
 \r
-&nbsp;&nbsp;&nbsp;return true;\r
+&nbsp;&nbsp;&nbsp;return false;\r
 }\r
 </pre>\r
 <p>To get a second number, change the third parameter (<span style="font-family: Courier New,Courier,monospace;">contacts_record_get_child_record_at_p</span>) from 0 to 1.</p></li></ul></li>\r
@@ -2461,7 +2473,7 @@ _get_contact_number(contacts_record_h r_contact, char **number)
 <li><p>Obtain an image directly from the parent record:</p>\r
 \r
 <pre class="prettyprint">\r
-static bool \r
+static bool\r
 _get_contact_image(contacts_record_h r_contact, char **image_path)\r
 {\r
 &nbsp;&nbsp;&nbsp;int error_code;\r
@@ -2477,7 +2489,7 @@ _get_contact_image(contacts_record_h r_contact, char **image_path)
 <li><p>Get the first name as the last name:</p>\r
 \r
 <pre class="prettyprint">\r
-static bool \r
+static bool\r
 _get_contact_first(contacts_record_h r_contact, char **first)\r
 {\r
 &nbsp;&nbsp;&nbsp;contacts_record_h r_name;\r
@@ -2676,7 +2688,7 @@ while (contacts_list_get_current_record_p(list, &amp;record) == 0)
 {\r
 &nbsp;&nbsp;&nbsp;int record_id;\r
 &nbsp;&nbsp;&nbsp;contacts_record_h c_record;\r
-&nbsp;&nbsp;&nbsp;contacts_record_get_int(record, _contacts_name._uri, &amp;contact_id);\r
+&nbsp;&nbsp;&nbsp;contacts_record_get_int(record, _contacts_name.contact_id, &amp;contact_id);\r
 &nbsp;&nbsp;&nbsp;contacts_db_get_record(_contacts_contact._uri, contact_id, &amp;c_record);\r
 &nbsp;&nbsp;&nbsp;gldata = _create_gl_data(c_record);\r
 \r
@@ -2870,13 +2882,13 @@ contacts_setting_set_name_sorting_order(CONTACTS_NAME_SORTING_ORDER_FIRSTLAST);
 <ol type="a"><li>Register callbacks with the <span style="font-family: Courier New,Courier,monospace;">contacts_setting_add_name_display_order_changed_cb()</span> and <span style="font-family: Courier New,Courier,monospace;">contacts_setting_add_name_sorting_order_changed_cb()</span> functions. </li>\r
 <li>Define the callbacks themselves:\r
 <pre class="prettyprint">\r
-static void \r
+static void\r
 display_changed_cb(contacts_name_display_order_e name_display_order, void *user_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_DEBUG, LOG_TAG, &quot;changed display order: %s&quot;, name_display_order==CONTACTS_NAME_DISPLAY_ORDER_FIRSTLAST?&quot;CONTACTS_NAME_DISPLAY_ORDER_FIRSTLAST&quot;:&quot;CONTACTS_NAME_DISPLAY_ORDER_LASTFIRST&quot;);\r
 }\r
 \r
-static void \r
+static void\r
 sorting_changed_cb(contacts_name_sorting_order_e name_display_order, void *user_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;dlog_print(DLOG_DEBUG, LOG_TAG, &quot;changed sorting order: %s&quot;, name_display_order==CONTACTS_NAME_SORTING_ORDER_FIRSTLAST?&quot;CONTACTS_NAME_SORTING_ORDER_FIRSTLAST&quot;:&quot;CONTACTS_NAME_SORTING_ORDER_LASTFIRST&quot;);\r
@@ -2925,7 +2937,7 @@ char * vcard_stream;
 contacts_list_h contacts_list;\r
 int err = contacts_vcard_parse_to_contacts(vcard_stream, contacts_list);\r
 \r
-while (contacts_list_get_current_record_p(list_import, &amp;record) == 0) \r
+while (contacts_list_get_current_record_p(list_import, &amp;record) == 0)\r
 {\r
 &nbsp;&nbsp;&nbsp;// Get next records from file\r
 &nbsp;&nbsp;&nbsp;err = contacts_list_next(list_import);\r
@@ -2936,7 +2948,7 @@ err = contacts_list_destroy(list_import, true);
 <p>You can also use the <span style="font-family: Courier New,Courier,monospace;">contacts_vcard_parse_to_contact_foreach()</span> function. With this function, you have to get the file content manually, and it needs a callback.</p>\r
 \r
 <pre class="prettyprint">\r
-bool \r
+bool\r
 contacts_vcard_cb(contacts_record_h record, void *user_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;// Here you have a record\r
@@ -2957,7 +2969,7 @@ contacts_vcard_cb(contacts_record_h record, void *user_data)
 int internal_storage_id;\r
 char *vcf_path = NULL;\r
 \r
-static bool \r
+static bool\r
 storage_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;if (type == STORAGE_TYPE_INTERNAL)\r
@@ -2970,7 +2982,7 @@ storage_cb(int storage_id, storage_type_e type, storage_state_e state, const cha
 &nbsp;&nbsp;&nbsp;return true;\r
 }\r
 \r
-void \r
+void\r
 _get_storage_path()\r
 {\r
 &nbsp;&nbsp;&nbsp;int error_code = 0;\r
@@ -2985,7 +2997,7 @@ _get_storage_path()
 &nbsp;&nbsp;&nbsp;}\r
 }\r
 \r
-void \r
+void\r
 _import_vcard()\r
 {\r
 &nbsp;&nbsp;&nbsp;int path_len = 0;\r
@@ -3008,7 +3020,7 @@ _import_vcard()
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;continue;\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;char * filepath = malloc(strlen(vcf_path)+strlen(pDirent-&gt;d_name)+4);\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sprintf(filepath, &quot;%s/%s&quot;, vcf_path, pDirent-&gt;d_name);\r
-        \r
+\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Full path to file available through filepath string\r
 \r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;free(filepath);\r
@@ -3028,13 +3040,13 @@ if (bufsize &lt; 1)
 \r
 char * vcard_stream = malloc(sizeof(char) * (bufsize));\r
 memset(vcard_stream, &#39;\0&#39;, sizeof(vcard_stream));\r
-if (fp != NULL) \r
+if (fp != NULL)\r
 {\r
 &nbsp;&nbsp;&nbsp;char str[200];\r
 &nbsp;&nbsp;&nbsp;while(fgets(str, 200, fp) != NULL)\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sprintf(vcard_stream+strlen(vcard_stream), &quot;%s&quot;, str);\r
-&nbsp;&nbsp;&nbsp;fclose(fp); \r
-} \r
+&nbsp;&nbsp;&nbsp;fclose(fp);\r
+}\r
 else\r
 &nbsp;&nbsp;&nbsp;// Error handling\r
 int err = contacts_vcard_parse_to_contacts(vcard_stream, contacts_list);\r
@@ -3044,7 +3056,7 @@ free(vcard_stream);
 <li><p>You can also use the <span style="font-family: Courier New,Courier,monospace;">contacts_vcard_parse_to_contact_foreach()</span> function. It requires a callback and retrieves the file path instead of a file stream.</p>\r
 \r
 <pre class="prettyprint">\r
-bool \r
+bool\r
 contacts_vcard_cb(contacts_record_h record, void *user_data)\r
 {\r
 &nbsp;&nbsp;&nbsp;// Here you have a record\r
@@ -3069,7 +3081,7 @@ contacts_list_h list_import;
 contacts_record_h record;\r
 err = contacts_vcard_parse_to_contacts(content, &amp;list_import);\r
 \r
-while (contacts_list_get_current_record_p(list_import, &amp;record) == 0) \r
+while (contacts_list_get_current_record_p(list_import, &amp;record) == 0)\r
 {\r
 &nbsp;&nbsp;&nbsp;int id = -1;\r
 &nbsp;&nbsp;&nbsp;err = contacts_db_insert_record(record, &amp;id); // Add to list\r
@@ -3079,9 +3091,9 @@ while (contacts_list_get_current_record_p(list_import, &amp;record) == 0)
 \r
 DIR *dir = opendir(folder);\r
 struct dirent *pDirent = NULL;\r
-if (dir) \r
+if (dir)\r
 {\r
-&nbsp;&nbsp;&nbsp;while ((pDirent = readdir(dir)) != NULL) \r
+&nbsp;&nbsp;&nbsp;while ((pDirent = readdir(dir)) != NULL)\r
 &nbsp;&nbsp;&nbsp;{\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (pDirent-&gt;d_type != DT_REG)\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;continue;\r
@@ -3104,19 +3116,19 @@ if (dir)
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Error handling\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int bufsize = ftell(fp);\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewind(fp);\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dlog_print(DLOG_DEBUG, LOG_TAG, &quot;file size: %i&quot;, bufsize); \r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dlog_print(DLOG_DEBUG, LOG_TAG, &quot;file size: %i&quot;, bufsize);\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (bufsize &lt; 1)\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 1;\r
 \r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;char * vcard_stream = malloc(sizeof(char) * (bufsize));\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;memset(vcard_stream, &#39;\0&#39;, sizeof(vcard_stream));\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (fp != NULL) \r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (fp != NULL)\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;char str[150];\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(fgets(str, 150, fp) != NULL)\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sprintf(vcard_stream+strlen(vcard_stream), &quot;%s&quot;, str);\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fclose(fp);\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} \r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 1;\r
 \r
@@ -3126,7 +3138,7 @@ if (dir)
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (err != 0)\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dlog_print(DLOG_ERROR, LOG_TAG, &quot;contacts_vcard_parse_to_contacts failed: %d&quot;, err);\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;free(vcard_stream);\r
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while (contacts_list_get_current_record_p(list_import, &amp;record) == 0) \r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while (contacts_list_get_current_record_p(list_import, &amp;record) == 0)\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int id = -1;\r
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;err = contacts_db_insert_record(record, &amp;id); // Add to list\r
@@ -3190,7 +3202,7 @@ err = contacts_db_get_all_records(_contacts_contact._uri, 0, 0, &amp;list);
 contacts_record_h record;\r
 FILE * file = fopen(file_path, &quot;w&quot;);\r
 \r
-while (contacts_list_get_current_record_p(list, &amp;record) == 0) \r
+while (contacts_list_get_current_record_p(list, &amp;record) == 0)\r
 {\r
 &nbsp;&nbsp;&nbsp;err = contacts_vcard_make_from_contact(record, &amp;vcard_stream);\r
 &nbsp;&nbsp;&nbsp;// Save to file\r
@@ -3225,4 +3237,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
 </script>\r
 \r
 </body>\r
-</html>
\ No newline at end of file
+</html>\r