{"action":"created","comment":{"url":"https://api.github.com/repos/awslabs/aws-c-common/pulls/comments/187488263","pull_request_review_id":119281223,"id":187488263,"diff_hunk":"@@ -61,6 +62,65 @@ static inline struct aws_byte_buf aws_byte_buf_from_array(const uint8_t *c_str,\n     return buf;\n }\n \n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+/**\n+ * No copies, no string allocations. Fills in output with a list of aws_byte_cursor instances where buffer is\n+ * an offset into the input_str and len is the length of that string in the original buffer.\n+ *\n+ * Edge case rules are as follows:\n+ * if the string begins with split_on, an empty string will be the first entry in output\n+ * if the input string has two adjacent split_on tokens, an empty string will be inserted into the output.\n+ * if the input string ends with split_on, an empty string will be appended to the output.\n+ *\n+ * It is the user's responsibility to properly initialize output. Recommended number of preallocated elements from output\n+ * is your most likely guess for the upper bound of the number of elements resulting from the split.\n+ *\n+ * The type that will be stored in output is struct aws_byte_cursor (you'll need this for the item size param).\n+ *\n+ * It is the user's responsibility to make sure the input buffer stays in memory long enough to use the results.\n+ */\n+AWS_COMMON_API int aws_string_split_on_char(struct aws_byte_buf *input_str, char split_on,\n+                                            struct aws_array_list *output);\n+\n+/**\n+* No copies, no string allocations. Fills in output with a list of aws_byte_cursor instances where buffer is\n+* an offset into the input_str and len is the length of that string in the original buffer. N is the max number of splits,\n+* if this value is zero, it will add all splits to the output.\n+*\n+* Edge case rules are as follows:\n+* if the string begins with split_on, an empty string will be the first entry in output\n+* if the input string has two adjacent split_on tokens, an empty string will be inserted into the output.\n+* if the input string ends with split_on, an empty string will be appended to the output.\n+*\n+* It is the user's responsibility to properly initialize output. Recommended number of preallocated elements from output\n+* is your most likely guess for the upper bound of the number of elements resulting from the split.\n+*\n+* The type that will be stored in output is struct aws_byte_cursor (you'll need this for the item size param).\n+*\n+* It is the user's responsibility to make sure the input buffer stays in memory long enough to use the results.\n+*/\n+AWS_COMMON_API int aws_string_split_on_char_n(struct aws_byte_buf *input_str, char split_on,\n+    struct aws_array_list *output, size_t n);\n+\n+/**\n+ * Copies from to to. If to is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be returned.","path":"include/aws/common/byte_buf.h","position":56,"original_position":56,"commit_id":"2a970c245077c4338d13f481b303e3f0d2adeea1","original_commit_id":"2a970c245077c4338d13f481b303e3f0d2adeea1","user":{"login":"JonathanHenson","id":3926469,"avatar_url":"https://avatars2.githubusercontent.com/u/3926469?v=4","gravatar_id":"","url":"https://api.github.com/users/JonathanHenson","html_url":"https://github.com/JonathanHenson","followers_url":"https://api.github.com/users/JonathanHenson/followers","following_url":"https://api.github.com/users/JonathanHenson/following{/other_user}","gists_url":"https://api.github.com/users/JonathanHenson/gists{/gist_id}","starred_url":"https://api.github.com/users/JonathanHenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonathanHenson/subscriptions","organizations_url":"https://api.github.com/users/JonathanHenson/orgs","repos_url":"https://api.github.com/users/JonathanHenson/repos","events_url":"https://api.github.com/users/JonathanHenson/events{/privacy}","received_events_url":"https://api.github.com/users/JonathanHenson/received_events","type":"User","site_admin":false},"body":"It isn’t touched as the bounds check happens first. ","created_at":"2018-05-10T23:34:57Z","updated_at":"2018-05-10T23:34:57Z","html_url":"https://github.com/awslabs/aws-c-common/pull/20#discussion_r187488263","pull_request_url":"https://api.github.com/repos/awslabs/aws-c-common/pulls/20","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-c-common/pulls/comments/187488263"},"html":{"href":"https://github.com/awslabs/aws-c-common/pull/20#discussion_r187488263"},"pull_request":{"href":"https://api.github.com/repos/awslabs/aws-c-common/pulls/20"}},"in_reply_to_id":187485910},"pull_request":{"url":"https://api.github.com/repos/awslabs/aws-c-common/pulls/20","id":176019766,"html_url":"https://github.com/awslabs/aws-c-common/pull/20","diff_url":"https://github.com/awslabs/aws-c-common/pull/20.diff","patch_url":"https://github.com/awslabs/aws-c-common/pull/20.patch","issue_url":"https://api.github.com/repos/awslabs/aws-c-common/issues/20","number":20,"state":"open","locked":false,"title":"String split implementations (needed for http as well as alpn lists).","user":{"login":"JonathanHenson","id":3926469,"avatar_url":"https://avatars2.githubusercontent.com/u/3926469?v=4","gravatar_id":"","url":"https://api.github.com/users/JonathanHenson","html_url":"https://github.com/JonathanHenson","followers_url":"https://api.github.com/users/JonathanHenson/followers","following_url":"https://api.github.com/users/JonathanHenson/following{/other_user}","gists_url":"https://api.github.com/users/JonathanHenson/gists{/gist_id}","starred_url":"https://api.github.com/users/JonathanHenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonathanHenson/subscriptions","organizations_url":"https://api.github.com/users/JonathanHenson/orgs","repos_url":"https://api.github.com/users/JonathanHenson/repos","events_url":"https://api.github.com/users/JonathanHenson/events{/privacy}","received_events_url":"https://api.github.com/users/JonathanHenson/received_events","type":"User","site_admin":false},"body":"String split implementations (needed for http as well as alpn lists).\r\n\r\n\r\nBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.\r\n","created_at":"2018-03-19T20:42:29Z","updated_at":"2018-05-10T23:34:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa71a04bc8309fc3ce58207e04e4f09b1fb13656","assignee":null,"assignees":[],"requested_reviewers":[{"login":"marcomagdy","id":115965,"avatar_url":"https://avatars0.githubusercontent.com/u/115965?v=4","gravatar_id":"","url":"https://api.github.com/users/marcomagdy","html_url":"https://github.com/marcomagdy","followers_url":"https://api.github.com/users/marcomagdy/followers","following_url":"https://api.github.com/users/marcomagdy/following{/other_user}","gists_url":"https://api.github.com/users/marcomagdy/gists{/gist_id}","starred_url":"https://api.github.com/users/marcomagdy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcomagdy/subscriptions","organizations_url":"https://api.github.com/users/marcomagdy/orgs","repos_url":"https://api.github.com/users/marcomagdy/repos","events_url":"https://api.github.com/users/marcomagdy/events{/privacy}","received_events_url":"https://api.github.com/users/marcomagdy/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/awslabs/aws-c-common/pulls/20/commits","review_comments_url":"https://api.github.com/repos/awslabs/aws-c-common/pulls/20/comments","review_comment_url":"https://api.github.com/repos/awslabs/aws-c-common/pulls/comments{/number}","comments_url":"https://api.github.com/repos/awslabs/aws-c-common/issues/20/comments","statuses_url":"https://api.github.com/repos/awslabs/aws-c-common/statuses/2a970c245077c4338d13f481b303e3f0d2adeea1","head":{"label":"awslabs:str-split","ref":"str-split","sha":"2a970c245077c4338d13f481b303e3f0d2adeea1","user":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars0.githubusercontent.com/u/3299148?v=4","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"repo":{"id":117142517,"name":"aws-c-common","full_name":"awslabs/aws-c-common","owner":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars0.githubusercontent.com/u/3299148?v=4","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/awslabs/aws-c-common","description":"Core c99 package for AWS SDK for C. Includes cross-platform primitives, configuration, data structures, and error handling.","fork":false,"url":"https://api.github.com/repos/awslabs/aws-c-common","forks_url":"https://api.github.com/repos/awslabs/aws-c-common/forks","keys_url":"https://api.github.com/repos/awslabs/aws-c-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awslabs/aws-c-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awslabs/aws-c-common/teams","hooks_url":"https://api.github.com/repos/awslabs/aws-c-common/hooks","issue_events_url":"https://api.github.com/repos/awslabs/aws-c-common/issues/events{/number}","events_url":"https://api.github.com/repos/awslabs/aws-c-common/events","assignees_url":"https://api.github.com/repos/awslabs/aws-c-common/assignees{/user}","branches_url":"https://api.github.com/repos/awslabs/aws-c-common/branches{/branch}","tags_url":"https://api.github.com/repos/awslabs/aws-c-common/tags","blobs_url":"https://api.github.com/repos/awslabs/aws-c-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awslabs/aws-c-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awslabs/aws-c-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/awslabs/aws-c-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awslabs/aws-c-common/statuses/{sha}","languages_url":"https://api.github.com/repos/awslabs/aws-c-common/languages","stargazers_url":"https://api.github.com/repos/awslabs/aws-c-common/stargazers","contributors_url":"https://api.github.com/repos/awslabs/aws-c-common/contributors","subscribers_url":"https://api.github.com/repos/awslabs/aws-c-common/subscribers","subscription_url":"https://api.github.com/repos/awslabs/aws-c-common/subscription","commits_url":"https://api.github.com/repos/awslabs/aws-c-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/awslabs/aws-c-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/awslabs/aws-c-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/awslabs/aws-c-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/awslabs/aws-c-common/contents/{+path}","compare_url":"https://api.github.com/repos/awslabs/aws-c-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awslabs/aws-c-common/merges","archive_url":"https://api.github.com/repos/awslabs/aws-c-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awslabs/aws-c-common/downloads","issues_url":"https://api.github.com/repos/awslabs/aws-c-common/issues{/number}","pulls_url":"https://api.github.com/repos/awslabs/aws-c-common/pulls{/number}","milestones_url":"https://api.github.com/repos/awslabs/aws-c-common/milestones{/number}","notifications_url":"https://api.github.com/repos/awslabs/aws-c-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awslabs/aws-c-common/labels{/name}","releases_url":"https://api.github.com/repos/awslabs/aws-c-common/releases{/id}","deployments_url":"https://api.github.com/repos/awslabs/aws-c-common/deployments","created_at":"2018-01-11T19:17:12Z","updated_at":"2018-05-09T20:10:23Z","pushed_at":"2018-05-10T22:56:26Z","git_url":"git://github.com/awslabs/aws-c-common.git","ssh_url":"git@github.com:awslabs/aws-c-common.git","clone_url":"https://github.com/awslabs/aws-c-common.git","svn_url":"https://github.com/awslabs/aws-c-common","homepage":null,"size":253,"stargazers_count":12,"watchers_count":12,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":6,"open_issues":3,"watchers":12,"default_branch":"master"}},"base":{"label":"awslabs:master","ref":"master","sha":"5cd76935edee720cab49bff9d13ed70a2d9a64e9","user":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars0.githubusercontent.com/u/3299148?v=4","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"repo":{"id":117142517,"name":"aws-c-common","full_name":"awslabs/aws-c-common","owner":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars0.githubusercontent.com/u/3299148?v=4","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/awslabs/aws-c-common","description":"Core c99 package for AWS SDK for C. Includes cross-platform primitives, configuration, data structures, and error handling.","fork":false,"url":"https://api.github.com/repos/awslabs/aws-c-common","forks_url":"https://api.github.com/repos/awslabs/aws-c-common/forks","keys_url":"https://api.github.com/repos/awslabs/aws-c-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awslabs/aws-c-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awslabs/aws-c-common/teams","hooks_url":"https://api.github.com/repos/awslabs/aws-c-common/hooks","issue_events_url":"https://api.github.com/repos/awslabs/aws-c-common/issues/events{/number}","events_url":"https://api.github.com/repos/awslabs/aws-c-common/events","assignees_url":"https://api.github.com/repos/awslabs/aws-c-common/assignees{/user}","branches_url":"https://api.github.com/repos/awslabs/aws-c-common/branches{/branch}","tags_url":"https://api.github.com/repos/awslabs/aws-c-common/tags","blobs_url":"https://api.github.com/repos/awslabs/aws-c-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awslabs/aws-c-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awslabs/aws-c-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/awslabs/aws-c-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awslabs/aws-c-common/statuses/{sha}","languages_url":"https://api.github.com/repos/awslabs/aws-c-common/languages","stargazers_url":"https://api.github.com/repos/awslabs/aws-c-common/stargazers","contributors_url":"https://api.github.com/repos/awslabs/aws-c-common/contributors","subscribers_url":"https://api.github.com/repos/awslabs/aws-c-common/subscribers","subscription_url":"https://api.github.com/repos/awslabs/aws-c-common/subscription","commits_url":"https://api.github.com/repos/awslabs/aws-c-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/awslabs/aws-c-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/awslabs/aws-c-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/awslabs/aws-c-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/awslabs/aws-c-common/contents/{+path}","compare_url":"https://api.github.com/repos/awslabs/aws-c-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awslabs/aws-c-common/merges","archive_url":"https://api.github.com/repos/awslabs/aws-c-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awslabs/aws-c-common/downloads","issues_url":"https://api.github.com/repos/awslabs/aws-c-common/issues{/number}","pulls_url":"https://api.github.com/repos/awslabs/aws-c-common/pulls{/number}","milestones_url":"https://api.github.com/repos/awslabs/aws-c-common/milestones{/number}","notifications_url":"https://api.github.com/repos/awslabs/aws-c-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awslabs/aws-c-common/labels{/name}","releases_url":"https://api.github.com/repos/awslabs/aws-c-common/releases{/id}","deployments_url":"https://api.github.com/repos/awslabs/aws-c-common/deployments","created_at":"2018-01-11T19:17:12Z","updated_at":"2018-05-09T20:10:23Z","pushed_at":"2018-05-10T22:56:26Z","git_url":"git://github.com/awslabs/aws-c-common.git","ssh_url":"git@github.com:awslabs/aws-c-common.git","clone_url":"https://github.com/awslabs/aws-c-common.git","svn_url":"https://github.com/awslabs/aws-c-common","homepage":null,"size":253,"stargazers_count":12,"watchers_count":12,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":6,"open_issues":3,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-c-common/pulls/20"},"html":{"href":"https://github.com/awslabs/aws-c-common/pull/20"},"issue":{"href":"https://api.github.com/repos/awslabs/aws-c-common/issues/20"},"comments":{"href":"https://api.github.com/repos/awslabs/aws-c-common/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/awslabs/aws-c-common/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/awslabs/aws-c-common/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/awslabs/aws-c-common/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/awslabs/aws-c-common/statuses/2a970c245077c4338d13f481b303e3f0d2adeea1"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"JonathanHenson"}}