{"action":"created","comment":{"url":"https://api.github.com/repos/opencosmos/cstruct/pulls/comments/103476985","pull_request_review_id":24263799,"id":103476985,"diff_hunk":"@@ -0,0 +1,340 @@\n+#include \"dynamic_array.h\"\n+\n+// NOTE: When we destroy items, we call the destructor for them \n+// iff the destructor is not NULL.\n+\n+typedef void (*destr)(void *);\n+\n+// Initialiser - sets fields in instance and allocates buffer (via buffer_alloc)\n+void buffer_init(struct buffer *inst, size_t item_size, size_t capacity, \n+                 size_t alloc_by, void (*destructor)(void *))\n+{   \n+    inst->capacity   = 0;\n+    inst->length     = 0;\n+    inst->item_size  = item_size;\n+    inst->alloc_by   = alloc_by;\n+    inst->data       = NULL;\n+    inst->destructor = destructor;\n+    inst->buffer     = NULL;\n+\n+    buffer_alloc(inst, capacity);\n+}\n+\n+// Destructor - frees the buffer, calling the destructor for each item in the buffer\n+void buffer_destroy(struct buffer *inst)\n+{\n+    for(int i = 0; i < inst->capacity; i++){\n+        ((destr)(inst->destructor))(inst->buffer[i]);\n+    }\n+    inst->length = 0;\n+    free(inst->buffer);\n+    inst = NULL;\n+}\n+\n+// If realloc SUCCEDS we modify the size\n+static void try_realloc(struct buffer *inst, size_t new_capacity)\n+{\n+    inst->buffer = realloc_zero(inst->buffer, \n+                                buffer_size(inst) * sizeof(void*),\n+                                new_capacity * sizeof(void*));\n+    for (size_t i = inst->capacity; i < new_capacity; ++i) {\n+        void *succeds =  realloc(inst->buffer[i], inst->item_size);\n+        if (succeds){\n+            inst->buffer[i] = succeds;\n+        } else {\n+            exit(0);\n+        }\n+    }  \n+    \n+    inst->capacity = new_capacity;\n+    if (inst->length > new_capacity) {\n+        inst->length = inst->capacity;\n+    }\n+}\n+\n+// Allocator\n+//  * Reallocates the buffer to a new_capacity, preserving existing items \n+//     (unless new buffer is too small)\n+//  * Reduces length if new capacity is smaller than previous length\n+//  * For new capacity of zero, free() the buffer and set the pointer to NULL\n+//  * When reducing length, call destructor for any items which are being removed\n+void buffer_alloc(struct buffer *inst, size_t new_capacity)\n+{  \n+    if (new_capacity == 0){\n+        buffer_destroy(inst);\n+    } else{\n+        // realloc will free the necessary memory\n+        try_realloc(inst, new_capacity);\n+    }\n+}\n+\n+// Grow the buffer if necessary, to ensure the requested minimum capacity\n+void buffer_reserve(struct buffer *inst, size_t min_capacity)\n+{\n+    if(inst->capacity < min_capacity) {\n+        size_t previous_capacity = inst->capacity;\n+        inst->buffer = realloc_zero(inst->buffer, \n+                       previous_capacity * sizeof(void*), \n+                       min_capacity * sizeof(void*));\n+        \n+        for (size_t i = inst->capacity; i < min_capacity; ++i) {\n+            void *succeds =  realloc(inst->buffer[i], inst->item_size);\n+            if (succeds){\n+                inst->buffer[i] = succeds;\n+            } else {\n+                exit(0);\n+            }\n+        }\n+        inst->capacity = min_capacity;\n+    }\n+}\n+\n+// If realloc needs to increase size, safely increase and \n+// memset the new data to zero;\n+void* realloc_zero(void* old_buffer, size_t old_size, size_t new_size) \n+{\n+    void* new_buffer = realloc(old_buffer, new_size);\n+    if (new_size > old_size && new_buffer) {\n+        size_t diff = new_size - old_size;\n+        void* start = new_buffer + old_size;\n+        memset(start, 0, diff);\n+    } else {\n+        exit(0);\n+    }\n+    return new_buffer;\n+}\n+\n+// Change length of buffer\n+//  * If growing, grow capacity if required and zero-fill new items\n+//  * If shrinking, call destructor for any items which are being removed\n+void buffer_resize(struct buffer *inst, size_t new_length)\n+{   \n+    // growing\n+    if (inst->capacity < new_length) {\n+        buffer_reserve(inst, new_length);\n+    // shrinking\n+    } else if (inst->capacity > new_length) {\n+        for (size_t i = new_length; i < inst->capacity; ++i) {\n+            ((destr)(inst->destructor))(inst->buffer[i]);\n+        }\n+        void *succeds = realloc(inst->buffer, new_length *sizeof(void*));\n+        if (succeds) {\n+            inst->buffer = succeds;\n+        } else {\n+            exit(0);\n+        }\n+    }\n+    inst->capacity = new_length;\n+    if (inst->length > new_length) {\n+        inst->length = inst->capacity;\n+    }\n+}\n+\n+// Append to buffer (if no space, grow buffer by alloc_by items)\n+void buffer_push_back(struct buffer *inst, void *item) \n+{   \n+    size_t length = buffer_size(inst);\n+    ++inst->length;\n+    if (length < inst->capacity) {\n+        void *new_item = buffer_at(inst, length);\n+        if (item) {\n+            memcpy(new_item, item, inst->item_size);\n+        } else {\n+            --inst->length;\n+        }\n+    } else {\n+        buffer_reserve(inst, inst->alloc_by + length);\n+    }\n+}\n+\n+// Pointer to first item in buffer\n+void *buffer_front(struct buffer *inst)\n+{\n+    if (inst) return inst->buffer[0];\n+}\n+\n+// Pointer to last item in buffer\n+void *buffer_back(struct buffer *inst)\n+{\n+    if (inst) return buffer_at(inst, buffer_size(inst) - 1);\n+}\n+\n+// Take last item from buffer\n+//  * return false if buffer is empty\n+//  * copy item to \"out\" if not null\n+//  * call destructor for item being removed\n+//  * reduce length by 1\n+//  * return true\n+bool buffer_pop(struct buffer *inst, void *out)\n+{\n+    if (buffer_empty(inst)){\n+        return false;\n+    } else if (!buffer_back(inst)) {\n+        return false;\n+    } else {\n+        memcpy(out, buffer_back(inst), inst->item_size);\n+        --inst->length;\n+        return true;\n+    }\n+}\n+\n+// Return true if buffer is empty (length == 0)\n+bool buffer_empty(struct buffer *inst){\n+    if (inst){\n+       return (buffer_size(inst) == 0); \n+    } else {\n+        exit(0);\n+    }\n+\n+}\n+\n+// Number of items in the buffer (length)\n+size_t buffer_size(struct buffer *inst)\n+{\n+    if (inst) {\n+        return inst->length;\n+    } else {\n+        exit(0);\n+    }\n+}\n+\n+// Item size of the elements in the buffer(item_size)\n+size_t item_size(struct buffer *inst)\n+{\n+    if (inst) {\n+        return inst->item_size;\n+    } else {\n+        exit(0);\n+    }\n+}\n+\n+// Pointer to nth item in buffer\n+void *buffer_at(struct buffer *inst, size_t index)\n+{\n+    if (index >= inst->length) {\n+        return NULL;\n+    }\n+    return (inst->buffer[index]);\n+}\n+\n+void destruct_size_t_item(void *item){\n+    free(item);\n+}\n+\n+\n+\n+// TESTING\n+#if defined TEST_DYNAMIC_ARRAY\n+\n+struct buffer init()","path":"dynamic_array.c","position":229,"original_position":229,"commit_id":"9a2cf9dec41e2d7ad65ae0fef6402f75fea76653","original_commit_id":"9a2cf9dec41e2d7ad65ae0fef6402f75fea76653","user":{"login":"battlesnake","id":4949354,"avatar_url":"https://avatars.githubusercontent.com/u/4949354?v=3","gravatar_id":"","url":"https://api.github.com/users/battlesnake","html_url":"https://github.com/battlesnake","followers_url":"https://api.github.com/users/battlesnake/followers","following_url":"https://api.github.com/users/battlesnake/following{/other_user}","gists_url":"https://api.github.com/users/battlesnake/gists{/gist_id}","starred_url":"https://api.github.com/users/battlesnake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/battlesnake/subscriptions","organizations_url":"https://api.github.com/users/battlesnake/orgs","repos_url":"https://api.github.com/users/battlesnake/repos","events_url":"https://api.github.com/users/battlesnake/events{/privacy}","received_events_url":"https://api.github.com/users/battlesnake/received_events","type":"User","site_admin":false},"body":"Here, we are returning a struct.  By the C standard, this can result in a lot of memory copying for larger structs (although some compilers will perform a \"return value optimisation\" to eliminate this copying).  It is better to pass a pointer to a struct as an argument, rather than copy-returning the struct.","created_at":"2017-02-28T15:21:33Z","updated_at":"2017-02-28T15:21:33Z","html_url":"https://github.com/opencosmos/cstruct/pull/1#discussion_r103476985","pull_request_url":"https://api.github.com/repos/opencosmos/cstruct/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/opencosmos/cstruct/pulls/comments/103476985"},"html":{"href":"https://github.com/opencosmos/cstruct/pull/1#discussion_r103476985"},"pull_request":{"href":"https://api.github.com/repos/opencosmos/cstruct/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/opencosmos/cstruct/pulls/1","id":108108924,"html_url":"https://github.com/opencosmos/cstruct/pull/1","diff_url":"https://github.com/opencosmos/cstruct/pull/1.diff","patch_url":"https://github.com/opencosmos/cstruct/pull/1.patch","issue_url":"https://api.github.com/repos/opencosmos/cstruct/issues/1","number":1,"state":"open","locked":false,"title":"Implemented dynamic array plus tests","user":{"login":"mihaibarbu94","id":10748895,"avatar_url":"https://avatars.githubusercontent.com/u/10748895?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaibarbu94","html_url":"https://github.com/mihaibarbu94","followers_url":"https://api.github.com/users/mihaibarbu94/followers","following_url":"https://api.github.com/users/mihaibarbu94/following{/other_user}","gists_url":"https://api.github.com/users/mihaibarbu94/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaibarbu94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaibarbu94/subscriptions","organizations_url":"https://api.github.com/users/mihaibarbu94/orgs","repos_url":"https://api.github.com/users/mihaibarbu94/repos","events_url":"https://api.github.com/users/mihaibarbu94/events{/privacy}","received_events_url":"https://api.github.com/users/mihaibarbu94/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-02-27T12:57:48Z","updated_at":"2017-02-28T15:21:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb6ba926cf19b509608a6b906ea5dc14eef1a107","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/opencosmos/cstruct/pulls/1/commits","review_comments_url":"https://api.github.com/repos/opencosmos/cstruct/pulls/1/comments","review_comment_url":"https://api.github.com/repos/opencosmos/cstruct/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencosmos/cstruct/issues/1/comments","statuses_url":"https://api.github.com/repos/opencosmos/cstruct/statuses/9a2cf9dec41e2d7ad65ae0fef6402f75fea76653","head":{"label":"mihaibarbu94:master","ref":"master","sha":"9a2cf9dec41e2d7ad65ae0fef6402f75fea76653","user":{"login":"mihaibarbu94","id":10748895,"avatar_url":"https://avatars.githubusercontent.com/u/10748895?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaibarbu94","html_url":"https://github.com/mihaibarbu94","followers_url":"https://api.github.com/users/mihaibarbu94/followers","following_url":"https://api.github.com/users/mihaibarbu94/following{/other_user}","gists_url":"https://api.github.com/users/mihaibarbu94/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaibarbu94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaibarbu94/subscriptions","organizations_url":"https://api.github.com/users/mihaibarbu94/orgs","repos_url":"https://api.github.com/users/mihaibarbu94/repos","events_url":"https://api.github.com/users/mihaibarbu94/events{/privacy}","received_events_url":"https://api.github.com/users/mihaibarbu94/received_events","type":"User","site_admin":false},"repo":{"id":82563007,"name":"cstruct","full_name":"mihaibarbu94/cstruct","owner":{"login":"mihaibarbu94","id":10748895,"avatar_url":"https://avatars.githubusercontent.com/u/10748895?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaibarbu94","html_url":"https://github.com/mihaibarbu94","followers_url":"https://api.github.com/users/mihaibarbu94/followers","following_url":"https://api.github.com/users/mihaibarbu94/following{/other_user}","gists_url":"https://api.github.com/users/mihaibarbu94/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaibarbu94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaibarbu94/subscriptions","organizations_url":"https://api.github.com/users/mihaibarbu94/orgs","repos_url":"https://api.github.com/users/mihaibarbu94/repos","events_url":"https://api.github.com/users/mihaibarbu94/events{/privacy}","received_events_url":"https://api.github.com/users/mihaibarbu94/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mihaibarbu94/cstruct","description":"C data structures and algorithms (excluding type-safe proxy-macro generators).","fork":true,"url":"https://api.github.com/repos/mihaibarbu94/cstruct","forks_url":"https://api.github.com/repos/mihaibarbu94/cstruct/forks","keys_url":"https://api.github.com/repos/mihaibarbu94/cstruct/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mihaibarbu94/cstruct/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mihaibarbu94/cstruct/teams","hooks_url":"https://api.github.com/repos/mihaibarbu94/cstruct/hooks","issue_events_url":"https://api.github.com/repos/mihaibarbu94/cstruct/issues/events{/number}","events_url":"https://api.github.com/repos/mihaibarbu94/cstruct/events","assignees_url":"https://api.github.com/repos/mihaibarbu94/cstruct/assignees{/user}","branches_url":"https://api.github.com/repos/mihaibarbu94/cstruct/branches{/branch}","tags_url":"https://api.github.com/repos/mihaibarbu94/cstruct/tags","blobs_url":"https://api.github.com/repos/mihaibarbu94/cstruct/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mihaibarbu94/cstruct/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mihaibarbu94/cstruct/git/refs{/sha}","trees_url":"https://api.github.com/repos/mihaibarbu94/cstruct/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mihaibarbu94/cstruct/statuses/{sha}","languages_url":"https://api.github.com/repos/mihaibarbu94/cstruct/languages","stargazers_url":"https://api.github.com/repos/mihaibarbu94/cstruct/stargazers","contributors_url":"https://api.github.com/repos/mihaibarbu94/cstruct/contributors","subscribers_url":"https://api.github.com/repos/mihaibarbu94/cstruct/subscribers","subscription_url":"https://api.github.com/repos/mihaibarbu94/cstruct/subscription","commits_url":"https://api.github.com/repos/mihaibarbu94/cstruct/commits{/sha}","git_commits_url":"https://api.github.com/repos/mihaibarbu94/cstruct/git/commits{/sha}","comments_url":"https://api.github.com/repos/mihaibarbu94/cstruct/comments{/number}","issue_comment_url":"https://api.github.com/repos/mihaibarbu94/cstruct/issues/comments{/number}","contents_url":"https://api.github.com/repos/mihaibarbu94/cstruct/contents/{+path}","compare_url":"https://api.github.com/repos/mihaibarbu94/cstruct/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mihaibarbu94/cstruct/merges","archive_url":"https://api.github.com/repos/mihaibarbu94/cstruct/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mihaibarbu94/cstruct/downloads","issues_url":"https://api.github.com/repos/mihaibarbu94/cstruct/issues{/number}","pulls_url":"https://api.github.com/repos/mihaibarbu94/cstruct/pulls{/number}","milestones_url":"https://api.github.com/repos/mihaibarbu94/cstruct/milestones{/number}","notifications_url":"https://api.github.com/repos/mihaibarbu94/cstruct/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mihaibarbu94/cstruct/labels{/name}","releases_url":"https://api.github.com/repos/mihaibarbu94/cstruct/releases{/id}","deployments_url":"https://api.github.com/repos/mihaibarbu94/cstruct/deployments","created_at":"2017-02-20T13:49:40Z","updated_at":"2017-02-20T13:49:42Z","pushed_at":"2017-02-27T12:55:46Z","git_url":"git://github.com/mihaibarbu94/cstruct.git","ssh_url":"git@github.com:mihaibarbu94/cstruct.git","clone_url":"https://github.com/mihaibarbu94/cstruct.git","svn_url":"https://github.com/mihaibarbu94/cstruct","homepage":null,"size":26,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"opencosmos:master","ref":"master","sha":"2ac5f67427441dd0824ce6d8045d914e0e4b1db4","user":{"login":"opencosmos","id":18408304,"avatar_url":"https://avatars.githubusercontent.com/u/18408304?v=3","gravatar_id":"","url":"https://api.github.com/users/opencosmos","html_url":"https://github.com/opencosmos","followers_url":"https://api.github.com/users/opencosmos/followers","following_url":"https://api.github.com/users/opencosmos/following{/other_user}","gists_url":"https://api.github.com/users/opencosmos/gists{/gist_id}","starred_url":"https://api.github.com/users/opencosmos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencosmos/subscriptions","organizations_url":"https://api.github.com/users/opencosmos/orgs","repos_url":"https://api.github.com/users/opencosmos/repos","events_url":"https://api.github.com/users/opencosmos/events{/privacy}","received_events_url":"https://api.github.com/users/opencosmos/received_events","type":"Organization","site_admin":false},"repo":{"id":82351227,"name":"cstruct","full_name":"opencosmos/cstruct","owner":{"login":"opencosmos","id":18408304,"avatar_url":"https://avatars.githubusercontent.com/u/18408304?v=3","gravatar_id":"","url":"https://api.github.com/users/opencosmos","html_url":"https://github.com/opencosmos","followers_url":"https://api.github.com/users/opencosmos/followers","following_url":"https://api.github.com/users/opencosmos/following{/other_user}","gists_url":"https://api.github.com/users/opencosmos/gists{/gist_id}","starred_url":"https://api.github.com/users/opencosmos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencosmos/subscriptions","organizations_url":"https://api.github.com/users/opencosmos/orgs","repos_url":"https://api.github.com/users/opencosmos/repos","events_url":"https://api.github.com/users/opencosmos/events{/privacy}","received_events_url":"https://api.github.com/users/opencosmos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opencosmos/cstruct","description":"C data structures and algorithms (excluding type-safe proxy-macro generators).","fork":false,"url":"https://api.github.com/repos/opencosmos/cstruct","forks_url":"https://api.github.com/repos/opencosmos/cstruct/forks","keys_url":"https://api.github.com/repos/opencosmos/cstruct/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencosmos/cstruct/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencosmos/cstruct/teams","hooks_url":"https://api.github.com/repos/opencosmos/cstruct/hooks","issue_events_url":"https://api.github.com/repos/opencosmos/cstruct/issues/events{/number}","events_url":"https://api.github.com/repos/opencosmos/cstruct/events","assignees_url":"https://api.github.com/repos/opencosmos/cstruct/assignees{/user}","branches_url":"https://api.github.com/repos/opencosmos/cstruct/branches{/branch}","tags_url":"https://api.github.com/repos/opencosmos/cstruct/tags","blobs_url":"https://api.github.com/repos/opencosmos/cstruct/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencosmos/cstruct/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencosmos/cstruct/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencosmos/cstruct/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencosmos/cstruct/statuses/{sha}","languages_url":"https://api.github.com/repos/opencosmos/cstruct/languages","stargazers_url":"https://api.github.com/repos/opencosmos/cstruct/stargazers","contributors_url":"https://api.github.com/repos/opencosmos/cstruct/contributors","subscribers_url":"https://api.github.com/repos/opencosmos/cstruct/subscribers","subscription_url":"https://api.github.com/repos/opencosmos/cstruct/subscription","commits_url":"https://api.github.com/repos/opencosmos/cstruct/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencosmos/cstruct/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencosmos/cstruct/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencosmos/cstruct/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencosmos/cstruct/contents/{+path}","compare_url":"https://api.github.com/repos/opencosmos/cstruct/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencosmos/cstruct/merges","archive_url":"https://api.github.com/repos/opencosmos/cstruct/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencosmos/cstruct/downloads","issues_url":"https://api.github.com/repos/opencosmos/cstruct/issues{/number}","pulls_url":"https://api.github.com/repos/opencosmos/cstruct/pulls{/number}","milestones_url":"https://api.github.com/repos/opencosmos/cstruct/milestones{/number}","notifications_url":"https://api.github.com/repos/opencosmos/cstruct/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencosmos/cstruct/labels{/name}","releases_url":"https://api.github.com/repos/opencosmos/cstruct/releases{/id}","deployments_url":"https://api.github.com/repos/opencosmos/cstruct/deployments","created_at":"2017-02-18T01:00:14Z","updated_at":"2017-02-18T01:14:27Z","pushed_at":"2017-02-27T12:57:49Z","git_url":"git://github.com/opencosmos/cstruct.git","ssh_url":"git@github.com:opencosmos/cstruct.git","clone_url":"https://github.com/opencosmos/cstruct.git","svn_url":"https://github.com/opencosmos/cstruct","homepage":null,"size":15,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencosmos/cstruct/pulls/1"},"html":{"href":"https://github.com/opencosmos/cstruct/pull/1"},"issue":{"href":"https://api.github.com/repos/opencosmos/cstruct/issues/1"},"comments":{"href":"https://api.github.com/repos/opencosmos/cstruct/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/opencosmos/cstruct/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/opencosmos/cstruct/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencosmos/cstruct/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/opencosmos/cstruct/statuses/9a2cf9dec41e2d7ad65ae0fef6402f75fea76653"}}}}
{"actor":{"display_login":"battlesnake"}}