{"action":"created","comment":{"url":"https://api.github.com/repos/RT-Thread-packages/dstr/pulls/comments/193317737","pull_request_review_id":126262096,"id":193317737,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzMxNzczNw==","diff_hunk":"@@ -0,0 +1,185 @@\n+/*\n+ * File      : examples_dstr.c\n+ * This file is the example code of dstr(dynamic string) package\n+ * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team\n+ *\n+ *  This program is free software; you can redistribute it and/or modify\n+ *  it under the terms of the GNU General Public License as published by\n+ *  the Free Software Foundation; either version 2 of the License, or\n+ *  (at your option) any later version.\n+ *\n+ *  This program is distributed in the hope that it will be useful,\n+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ *  GNU General Public License for more details.\n+ *\n+ *  You should have received a copy of the GNU General Public License along\n+ *  with this program; if not, write to the Free Software Foundation, Inc.,\n+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n+ *\n+ * Change Logs:\n+ * Date           Author       Notes\n+ * 2018-06-06     never        the first version\n+ */\n+\n+#include <rtthread.h>\n+#include <finsh.h>\n+#include \"dstr.h\"\n+\n+void rt_dstr_printf(rt_dstr_t *thiz)\n+{\n+    if (thiz == RT_NULL)\n+        return;\n+    rt_kprintf(\"%s\\n\", thiz->str);\n+}\n+\n+void dstr_test_new(void)\n+{\n+    rt_dstr_t *p = RT_NULL;\n+    \n+    p = rt_dstr_new(\"new dstr\");\n+    rt_dstr_printf(p);\n+    rt_dstr_del(p);\n+}\n+\n+void dstr_test_cat(void)\n+{   \n+    rt_dstr_t *p = RT_NULL;\n+    \n+    p = rt_dstr_new(\"cat\");\n+    \n+    rt_dstr_cat(p, \" dstr\");\n+    \n+    rt_dstr_printf(p);\n+    \n+    rt_dstr_del(p);\n+}\n+\n+void dstr_test_ncat(void)\n+{   \n+    rt_dstr_t *p = RT_NULL;\n+    \n+    p = rt_dstr_new(\"ncat\");\n+    \n+    rt_dstr_ncat(p, \" dstrnnn\", 5);\n+    \n+    rt_dstr_printf(p);\n+    \n+    rt_dstr_del(p);\n+}\n+\n+void dstr_test_cmp(void)\n+{\n+    rt_dstr_t *p1 = RT_NULL;\n+    rt_dstr_t *p2 = RT_NULL;\n+    rt_int8_t res = 0;\n+    \n+    p1 = rt_dstr_new(\"helle\");\n+    p2 = rt_dstr_new(\"hellc\");\n+    \n+    res = rt_dstr_cmp(p1, p2);\n+    rt_kprintf(\"cmp result: %d\\n\", res);","path":"dstr/examples/examples_dstr.c","position":81,"original_position":81,"commit_id":"ae7f0017ec8ed6112e4e7f734496eaba6a33e4f3","original_commit_id":"ae7f0017ec8ed6112e4e7f734496eaba6a33e4f3","user":{"login":"BernardXiong","id":1241087,"node_id":"MDQ6VXNlcjEyNDEwODc=","avatar_url":"https://avatars1.githubusercontent.com/u/1241087?v=4","gravatar_id":"","url":"https://api.github.com/users/BernardXiong","html_url":"https://github.com/BernardXiong","followers_url":"https://api.github.com/users/BernardXiong/followers","following_url":"https://api.github.com/users/BernardXiong/following{/other_user}","gists_url":"https://api.github.com/users/BernardXiong/gists{/gist_id}","starred_url":"https://api.github.com/users/BernardXiong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BernardXiong/subscriptions","organizations_url":"https://api.github.com/users/BernardXiong/orgs","repos_url":"https://api.github.com/users/BernardXiong/repos","events_url":"https://api.github.com/users/BernardXiong/events{/privacy}","received_events_url":"https://api.github.com/users/BernardXiong/received_events","type":"User","site_admin":false},"body":"加入比较动态字符串其中一个是NULL的情况。","created_at":"2018-06-06T07:36:33Z","updated_at":"2018-06-06T07:49:55Z","html_url":"https://github.com/RT-Thread-packages/dstr/pull/1#discussion_r193317737","pull_request_url":"https://api.github.com/repos/RT-Thread-packages/dstr/pulls/1","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/RT-Thread-packages/dstr/pulls/comments/193317737"},"html":{"href":"https://github.com/RT-Thread-packages/dstr/pull/1#discussion_r193317737"},"pull_request":{"href":"https://api.github.com/repos/RT-Thread-packages/dstr/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/RT-Thread-packages/dstr/pulls/1","id":192919636,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyOTE5NjM2","html_url":"https://github.com/RT-Thread-packages/dstr/pull/1","diff_url":"https://github.com/RT-Thread-packages/dstr/pull/1.diff","patch_url":"https://github.com/RT-Thread-packages/dstr/pull/1.patch","issue_url":"https://api.github.com/repos/RT-Thread-packages/dstr/issues/1","number":1,"state":"open","locked":false,"title":"Submit the first version of the dynamic string package","user":{"login":"neverxie","id":39480235,"node_id":"MDQ6VXNlcjM5NDgwMjM1","avatar_url":"https://avatars0.githubusercontent.com/u/39480235?v=4","gravatar_id":"","url":"https://api.github.com/users/neverxie","html_url":"https://github.com/neverxie","followers_url":"https://api.github.com/users/neverxie/followers","following_url":"https://api.github.com/users/neverxie/following{/other_user}","gists_url":"https://api.github.com/users/neverxie/gists{/gist_id}","starred_url":"https://api.github.com/users/neverxie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neverxie/subscriptions","organizations_url":"https://api.github.com/users/neverxie/orgs","repos_url":"https://api.github.com/users/neverxie/repos","events_url":"https://api.github.com/users/neverxie/events{/privacy}","received_events_url":"https://api.github.com/users/neverxie/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-06T07:11:52Z","updated_at":"2018-06-06T07:49:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27b7ceb9504cee4929374e6274ecc840c99b705e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/RT-Thread-packages/dstr/pulls/1/commits","review_comments_url":"https://api.github.com/repos/RT-Thread-packages/dstr/pulls/1/comments","review_comment_url":"https://api.github.com/repos/RT-Thread-packages/dstr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RT-Thread-packages/dstr/issues/1/comments","statuses_url":"https://api.github.com/repos/RT-Thread-packages/dstr/statuses/ae7f0017ec8ed6112e4e7f734496eaba6a33e4f3","head":{"label":"neverxie:nx","ref":"nx","sha":"ae7f0017ec8ed6112e4e7f734496eaba6a33e4f3","user":{"login":"neverxie","id":39480235,"node_id":"MDQ6VXNlcjM5NDgwMjM1","avatar_url":"https://avatars0.githubusercontent.com/u/39480235?v=4","gravatar_id":"","url":"https://api.github.com/users/neverxie","html_url":"https://github.com/neverxie","followers_url":"https://api.github.com/users/neverxie/followers","following_url":"https://api.github.com/users/neverxie/following{/other_user}","gists_url":"https://api.github.com/users/neverxie/gists{/gist_id}","starred_url":"https://api.github.com/users/neverxie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neverxie/subscriptions","organizations_url":"https://api.github.com/users/neverxie/orgs","repos_url":"https://api.github.com/users/neverxie/repos","events_url":"https://api.github.com/users/neverxie/events{/privacy}","received_events_url":"https://api.github.com/users/neverxie/received_events","type":"User","site_admin":false},"repo":{"id":136278107,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYyNzgxMDc=","name":"dstr","full_name":"neverxie/dstr","owner":{"login":"neverxie","id":39480235,"node_id":"MDQ6VXNlcjM5NDgwMjM1","avatar_url":"https://avatars0.githubusercontent.com/u/39480235?v=4","gravatar_id":"","url":"https://api.github.com/users/neverxie","html_url":"https://github.com/neverxie","followers_url":"https://api.github.com/users/neverxie/followers","following_url":"https://api.github.com/users/neverxie/following{/other_user}","gists_url":"https://api.github.com/users/neverxie/gists{/gist_id}","starred_url":"https://api.github.com/users/neverxie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neverxie/subscriptions","organizations_url":"https://api.github.com/users/neverxie/orgs","repos_url":"https://api.github.com/users/neverxie/repos","events_url":"https://api.github.com/users/neverxie/events{/privacy}","received_events_url":"https://api.github.com/users/neverxie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/neverxie/dstr","description":"dynamic string in C","fork":true,"url":"https://api.github.com/repos/neverxie/dstr","forks_url":"https://api.github.com/repos/neverxie/dstr/forks","keys_url":"https://api.github.com/repos/neverxie/dstr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neverxie/dstr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neverxie/dstr/teams","hooks_url":"https://api.github.com/repos/neverxie/dstr/hooks","issue_events_url":"https://api.github.com/repos/neverxie/dstr/issues/events{/number}","events_url":"https://api.github.com/repos/neverxie/dstr/events","assignees_url":"https://api.github.com/repos/neverxie/dstr/assignees{/user}","branches_url":"https://api.github.com/repos/neverxie/dstr/branches{/branch}","tags_url":"https://api.github.com/repos/neverxie/dstr/tags","blobs_url":"https://api.github.com/repos/neverxie/dstr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neverxie/dstr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neverxie/dstr/git/refs{/sha}","trees_url":"https://api.github.com/repos/neverxie/dstr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neverxie/dstr/statuses/{sha}","languages_url":"https://api.github.com/repos/neverxie/dstr/languages","stargazers_url":"https://api.github.com/repos/neverxie/dstr/stargazers","contributors_url":"https://api.github.com/repos/neverxie/dstr/contributors","subscribers_url":"https://api.github.com/repos/neverxie/dstr/subscribers","subscription_url":"https://api.github.com/repos/neverxie/dstr/subscription","commits_url":"https://api.github.com/repos/neverxie/dstr/commits{/sha}","git_commits_url":"https://api.github.com/repos/neverxie/dstr/git/commits{/sha}","comments_url":"https://api.github.com/repos/neverxie/dstr/comments{/number}","issue_comment_url":"https://api.github.com/repos/neverxie/dstr/issues/comments{/number}","contents_url":"https://api.github.com/repos/neverxie/dstr/contents/{+path}","compare_url":"https://api.github.com/repos/neverxie/dstr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neverxie/dstr/merges","archive_url":"https://api.github.com/repos/neverxie/dstr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neverxie/dstr/downloads","issues_url":"https://api.github.com/repos/neverxie/dstr/issues{/number}","pulls_url":"https://api.github.com/repos/neverxie/dstr/pulls{/number}","milestones_url":"https://api.github.com/repos/neverxie/dstr/milestones{/number}","notifications_url":"https://api.github.com/repos/neverxie/dstr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neverxie/dstr/labels{/name}","releases_url":"https://api.github.com/repos/neverxie/dstr/releases{/id}","deployments_url":"https://api.github.com/repos/neverxie/dstr/deployments","created_at":"2018-06-06T05:47:07Z","updated_at":"2018-06-06T05:47:09Z","pushed_at":"2018-06-06T07:06:15Z","git_url":"git://github.com/neverxie/dstr.git","ssh_url":"git@github.com:neverxie/dstr.git","clone_url":"https://github.com/neverxie/dstr.git","svn_url":"https://github.com/neverxie/dstr","homepage":null,"size":17,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"RT-Thread-packages:master","ref":"master","sha":"1209538b82bf74683ab7e23a86663d5cd29a9133","user":{"login":"RT-Thread-packages","id":32235141,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyMjM1MTQx","avatar_url":"https://avatars3.githubusercontent.com/u/32235141?v=4","gravatar_id":"","url":"https://api.github.com/users/RT-Thread-packages","html_url":"https://github.com/RT-Thread-packages","followers_url":"https://api.github.com/users/RT-Thread-packages/followers","following_url":"https://api.github.com/users/RT-Thread-packages/following{/other_user}","gists_url":"https://api.github.com/users/RT-Thread-packages/gists{/gist_id}","starred_url":"https://api.github.com/users/RT-Thread-packages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RT-Thread-packages/subscriptions","organizations_url":"https://api.github.com/users/RT-Thread-packages/orgs","repos_url":"https://api.github.com/users/RT-Thread-packages/repos","events_url":"https://api.github.com/users/RT-Thread-packages/events{/privacy}","received_events_url":"https://api.github.com/users/RT-Thread-packages/received_events","type":"Organization","site_admin":false},"repo":{"id":136276644,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYyNzY2NDQ=","name":"dstr","full_name":"RT-Thread-packages/dstr","owner":{"login":"RT-Thread-packages","id":32235141,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyMjM1MTQx","avatar_url":"https://avatars3.githubusercontent.com/u/32235141?v=4","gravatar_id":"","url":"https://api.github.com/users/RT-Thread-packages","html_url":"https://github.com/RT-Thread-packages","followers_url":"https://api.github.com/users/RT-Thread-packages/followers","following_url":"https://api.github.com/users/RT-Thread-packages/following{/other_user}","gists_url":"https://api.github.com/users/RT-Thread-packages/gists{/gist_id}","starred_url":"https://api.github.com/users/RT-Thread-packages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RT-Thread-packages/subscriptions","organizations_url":"https://api.github.com/users/RT-Thread-packages/orgs","repos_url":"https://api.github.com/users/RT-Thread-packages/repos","events_url":"https://api.github.com/users/RT-Thread-packages/events{/privacy}","received_events_url":"https://api.github.com/users/RT-Thread-packages/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RT-Thread-packages/dstr","description":"dynamic string in C","fork":false,"url":"https://api.github.com/repos/RT-Thread-packages/dstr","forks_url":"https://api.github.com/repos/RT-Thread-packages/dstr/forks","keys_url":"https://api.github.com/repos/RT-Thread-packages/dstr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RT-Thread-packages/dstr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RT-Thread-packages/dstr/teams","hooks_url":"https://api.github.com/repos/RT-Thread-packages/dstr/hooks","issue_events_url":"https://api.github.com/repos/RT-Thread-packages/dstr/issues/events{/number}","events_url":"https://api.github.com/repos/RT-Thread-packages/dstr/events","assignees_url":"https://api.github.com/repos/RT-Thread-packages/dstr/assignees{/user}","branches_url":"https://api.github.com/repos/RT-Thread-packages/dstr/branches{/branch}","tags_url":"https://api.github.com/repos/RT-Thread-packages/dstr/tags","blobs_url":"https://api.github.com/repos/RT-Thread-packages/dstr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RT-Thread-packages/dstr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RT-Thread-packages/dstr/git/refs{/sha}","trees_url":"https://api.github.com/repos/RT-Thread-packages/dstr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RT-Thread-packages/dstr/statuses/{sha}","languages_url":"https://api.github.com/repos/RT-Thread-packages/dstr/languages","stargazers_url":"https://api.github.com/repos/RT-Thread-packages/dstr/stargazers","contributors_url":"https://api.github.com/repos/RT-Thread-packages/dstr/contributors","subscribers_url":"https://api.github.com/repos/RT-Thread-packages/dstr/subscribers","subscription_url":"https://api.github.com/repos/RT-Thread-packages/dstr/subscription","commits_url":"https://api.github.com/repos/RT-Thread-packages/dstr/commits{/sha}","git_commits_url":"https://api.github.com/repos/RT-Thread-packages/dstr/git/commits{/sha}","comments_url":"https://api.github.com/repos/RT-Thread-packages/dstr/comments{/number}","issue_comment_url":"https://api.github.com/repos/RT-Thread-packages/dstr/issues/comments{/number}","contents_url":"https://api.github.com/repos/RT-Thread-packages/dstr/contents/{+path}","compare_url":"https://api.github.com/repos/RT-Thread-packages/dstr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RT-Thread-packages/dstr/merges","archive_url":"https://api.github.com/repos/RT-Thread-packages/dstr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RT-Thread-packages/dstr/downloads","issues_url":"https://api.github.com/repos/RT-Thread-packages/dstr/issues{/number}","pulls_url":"https://api.github.com/repos/RT-Thread-packages/dstr/pulls{/number}","milestones_url":"https://api.github.com/repos/RT-Thread-packages/dstr/milestones{/number}","notifications_url":"https://api.github.com/repos/RT-Thread-packages/dstr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RT-Thread-packages/dstr/labels{/name}","releases_url":"https://api.github.com/repos/RT-Thread-packages/dstr/releases{/id}","deployments_url":"https://api.github.com/repos/RT-Thread-packages/dstr/deployments","created_at":"2018-06-06T05:31:53Z","updated_at":"2018-06-06T05:31:56Z","pushed_at":"2018-06-06T07:11:53Z","git_url":"git://github.com/RT-Thread-packages/dstr.git","ssh_url":"git@github.com:RT-Thread-packages/dstr.git","clone_url":"https://github.com/RT-Thread-packages/dstr.git","svn_url":"https://github.com/RT-Thread-packages/dstr","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RT-Thread-packages/dstr/pulls/1"},"html":{"href":"https://github.com/RT-Thread-packages/dstr/pull/1"},"issue":{"href":"https://api.github.com/repos/RT-Thread-packages/dstr/issues/1"},"comments":{"href":"https://api.github.com/repos/RT-Thread-packages/dstr/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/RT-Thread-packages/dstr/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/RT-Thread-packages/dstr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RT-Thread-packages/dstr/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/RT-Thread-packages/dstr/statuses/ae7f0017ec8ed6112e4e7f734496eaba6a33e4f3"}},"author_association":"NONE"}}
{"actor":{"display_login":"BernardXiong"}}