{"action":"created","comment":{"url":"https://api.github.com/repos/Statoil/libecl/pulls/comments/200557086","pull_request_review_id":134896213,"id":200557086,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDU1NzA4Ng==","diff_hunk":"@@ -166,6 +166,70 @@ int eclfio_get( FILE*, const char* opts, int32_t* recordsize, void* record );\n  */\n int eclfio_put( FILE*, const char* opts, int nmemb, const void* );\n \n+/*\n+ * By default, eclipse writes arrays in blocks of N elements, that is, a 5000\n+ * element integer array is written in e.g. 5 blocks of 1000 elements each, but\n+ * considered the same logical vector spanning multiple physical fortran\n+ * blocks.\n+ *\n+ * The eclfio_get/put functions has no such behavorial restriction, and\n+ * happily writes longer arrays in a single physical block.\n+ *\n+ * To automate handling arrays spanning multiple physical blocks, use\n+ * eclfio_array_get/put. The ecl_default_blocksize function returns a blocksize\n+ * compatible with eclipse's default sizes.\n+ *\n+ * ecl_default_blocksize expects one of the values in ecl_default_blocksizes\n+ * enum, otherwise a negative value is returned.\n+ */\n+#define ECL_DEFAULT_BLOCKSIZE_NUMERIC 1000\n+#define ECL_DEFAULT_BLOCKSIZE_STRING  105\n+int ecl_default_blocksize( int );\n+\n+/*\n+ * eclfio_array_get/put behave differently w.r.t. errors than their simpler\n+ * relatives eclfio_get/put.\n+ *\n+ * When an operation cannot be successfully completed, eclfio_array does *not*\n+ * roll back the file pointer to where it was before the call; rather, it rolls\n+ * back to the physical the failure occured in. It is essentially repeated\n+ * calls to eclfio_get/put.\n+ *\n+ * The blocksize argument should almost always be a value returned from\n+ * ecl_default_blocksize.\n+ *\n+ * These functions can return anything eclfio_get/put returns.\n+ *\n+ * eclfio_array_get expects that the underlying physical blocks maps to the\n+ * size of the array. Assuming an array of 3200 elements:\n+ *\n+ * |1000|1000|1000|200|\n+ *\n+ * If the last block is anything but 200 elements, this function returns an\n+ * error.\n+ *\n+ * The len argument is *how many individual values one element (nmemb) consists\n+ * of*. This is most useful for strings (CNNN), and should otherwise be 1.\n+ */\n+\n+int eclfio_array_get( FILE*,\n+                      const char* opts,\n+                      int len,\n+                      int nmemb,\n+                      void* array );\n+int eclfio_array_put( FILE*,\n+                      const char* opts,\n+                      int len,\n+                      int size,","path":"lib/e3/ecl/fortio.h","position":58,"original_position":58,"commit_id":"e88d7db96b168228fae0cf27ca7dce2ea7a86772","original_commit_id":"e88d7db96b168228fae0cf27ca7dce2ea7a86772","user":{"login":"joakim-hove","id":1321665,"node_id":"MDQ6VXNlcjEzMjE2NjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1321665?v=4","gravatar_id":"","url":"https://api.github.com/users/joakim-hove","html_url":"https://github.com/joakim-hove","followers_url":"https://api.github.com/users/joakim-hove/followers","following_url":"https://api.github.com/users/joakim-hove/following{/other_user}","gists_url":"https://api.github.com/users/joakim-hove/gists{/gist_id}","starred_url":"https://api.github.com/users/joakim-hove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joakim-hove/subscriptions","organizations_url":"https://api.github.com/users/joakim-hove/orgs","repos_url":"https://api.github.com/users/joakim-hove/repos","events_url":"https://api.github.com/users/joakim-hove/events{/privacy}","received_events_url":"https://api.github.com/users/joakim-hove/received_events","type":"User","site_admin":false},"body":"Extra size in header.","created_at":"2018-07-06T06:09:03Z","updated_at":"2018-07-06T06:09:03Z","html_url":"https://github.com/Statoil/libecl/pull/435#discussion_r200557086","pull_request_url":"https://api.github.com/repos/Statoil/libecl/pulls/435","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Statoil/libecl/pulls/comments/200557086"},"html":{"href":"https://github.com/Statoil/libecl/pull/435#discussion_r200557086"},"pull_request":{"href":"https://api.github.com/repos/Statoil/libecl/pulls/435"}}},"pull_request":{"url":"https://api.github.com/repos/Statoil/libecl/pulls/435","id":199467468,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NDY3NDY4","html_url":"https://github.com/Statoil/libecl/pull/435","diff_url":"https://github.com/Statoil/libecl/pull/435.diff","patch_url":"https://github.com/Statoil/libecl/pull/435.patch","issue_url":"https://api.github.com/repos/Statoil/libecl/issues/435","number":435,"state":"open","locked":false,"title":"WIP Add eclfio_array_get/put","user":{"login":"jokva","id":8667957,"node_id":"MDQ6VXNlcjg2Njc5NTc=","avatar_url":"https://avatars2.githubusercontent.com/u/8667957?v=4","gravatar_id":"","url":"https://api.github.com/users/jokva","html_url":"https://github.com/jokva","followers_url":"https://api.github.com/users/jokva/followers","following_url":"https://api.github.com/users/jokva/following{/other_user}","gists_url":"https://api.github.com/users/jokva/gists{/gist_id}","starred_url":"https://api.github.com/users/jokva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jokva/subscriptions","organizations_url":"https://api.github.com/users/jokva/orgs","repos_url":"https://api.github.com/users/jokva/repos","events_url":"https://api.github.com/users/jokva/events{/privacy}","received_events_url":"https://api.github.com/users/jokva/received_events","type":"User","site_admin":false},"body":"These functions provide an abstraction for the eclipse detail of large\r\narrays being written across multiple smaller physical blocks.\r\n\r\nIn effect, it enables reading an eclipse record (the header\r\nkeyword-size-type, followed by the array) as:\r\n\r\n    header = eclfio_get()\r\n    nmemb = parse-header(header)\r\n    return eclfio_array_get(nmemb)\r\n\r\n\r\nRemaining work:\r\n\r\n- tests!\r\n- some considerations on return types\r\n- port ecl2 to use this\r\n\r\nI also propose we add a new data type in opts, `C` or `s`, for the fixed len-8 string. That means the `len` argument to the array function really only makes sense for var-strings (which are special) funky cool functionality where you emulate 64-bit ints by merging two consecutive int32. \r\n\r\n**Task**\r\n_Short description of the task_\r\n\r\n\r\n**Approach**\r\n_Short description of the approach_\r\n\r\n\r\n**Pre un-WIP checklist**\r\n- [ ] Statoil tests pass locally\r\n","created_at":"2018-07-05T13:18:29Z","updated_at":"2018-07-06T06:09:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88c709fb8fc8150bd5dd899368105b97d2c3214f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Statoil/libecl/pulls/435/commits","review_comments_url":"https://api.github.com/repos/Statoil/libecl/pulls/435/comments","review_comment_url":"https://api.github.com/repos/Statoil/libecl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Statoil/libecl/issues/435/comments","statuses_url":"https://api.github.com/repos/Statoil/libecl/statuses/e88d7db96b168228fae0cf27ca7dce2ea7a86772","head":{"label":"jokva:ecl3-fortio-array","ref":"ecl3-fortio-array","sha":"e88d7db96b168228fae0cf27ca7dce2ea7a86772","user":{"login":"jokva","id":8667957,"node_id":"MDQ6VXNlcjg2Njc5NTc=","avatar_url":"https://avatars2.githubusercontent.com/u/8667957?v=4","gravatar_id":"","url":"https://api.github.com/users/jokva","html_url":"https://github.com/jokva","followers_url":"https://api.github.com/users/jokva/followers","following_url":"https://api.github.com/users/jokva/following{/other_user}","gists_url":"https://api.github.com/users/jokva/gists{/gist_id}","starred_url":"https://api.github.com/users/jokva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jokva/subscriptions","organizations_url":"https://api.github.com/users/jokva/orgs","repos_url":"https://api.github.com/users/jokva/repos","events_url":"https://api.github.com/users/jokva/events{/privacy}","received_events_url":"https://api.github.com/users/jokva/received_events","type":"User","site_admin":false},"repo":{"id":90731554,"node_id":"MDEwOlJlcG9zaXRvcnk5MDczMTU1NA==","name":"libecl","full_name":"jokva/libecl","owner":{"login":"jokva","id":8667957,"node_id":"MDQ6VXNlcjg2Njc5NTc=","avatar_url":"https://avatars2.githubusercontent.com/u/8667957?v=4","gravatar_id":"","url":"https://api.github.com/users/jokva","html_url":"https://github.com/jokva","followers_url":"https://api.github.com/users/jokva/followers","following_url":"https://api.github.com/users/jokva/following{/other_user}","gists_url":"https://api.github.com/users/jokva/gists{/gist_id}","starred_url":"https://api.github.com/users/jokva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jokva/subscriptions","organizations_url":"https://api.github.com/users/jokva/orgs","repos_url":"https://api.github.com/users/jokva/repos","events_url":"https://api.github.com/users/jokva/events{/privacy}","received_events_url":"https://api.github.com/users/jokva/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jokva/libecl","description":null,"fork":true,"url":"https://api.github.com/repos/jokva/libecl","forks_url":"https://api.github.com/repos/jokva/libecl/forks","keys_url":"https://api.github.com/repos/jokva/libecl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jokva/libecl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jokva/libecl/teams","hooks_url":"https://api.github.com/repos/jokva/libecl/hooks","issue_events_url":"https://api.github.com/repos/jokva/libecl/issues/events{/number}","events_url":"https://api.github.com/repos/jokva/libecl/events","assignees_url":"https://api.github.com/repos/jokva/libecl/assignees{/user}","branches_url":"https://api.github.com/repos/jokva/libecl/branches{/branch}","tags_url":"https://api.github.com/repos/jokva/libecl/tags","blobs_url":"https://api.github.com/repos/jokva/libecl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jokva/libecl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jokva/libecl/git/refs{/sha}","trees_url":"https://api.github.com/repos/jokva/libecl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jokva/libecl/statuses/{sha}","languages_url":"https://api.github.com/repos/jokva/libecl/languages","stargazers_url":"https://api.github.com/repos/jokva/libecl/stargazers","contributors_url":"https://api.github.com/repos/jokva/libecl/contributors","subscribers_url":"https://api.github.com/repos/jokva/libecl/subscribers","subscription_url":"https://api.github.com/repos/jokva/libecl/subscription","commits_url":"https://api.github.com/repos/jokva/libecl/commits{/sha}","git_commits_url":"https://api.github.com/repos/jokva/libecl/git/commits{/sha}","comments_url":"https://api.github.com/repos/jokva/libecl/comments{/number}","issue_comment_url":"https://api.github.com/repos/jokva/libecl/issues/comments{/number}","contents_url":"https://api.github.com/repos/jokva/libecl/contents/{+path}","compare_url":"https://api.github.com/repos/jokva/libecl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jokva/libecl/merges","archive_url":"https://api.github.com/repos/jokva/libecl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jokva/libecl/downloads","issues_url":"https://api.github.com/repos/jokva/libecl/issues{/number}","pulls_url":"https://api.github.com/repos/jokva/libecl/pulls{/number}","milestones_url":"https://api.github.com/repos/jokva/libecl/milestones{/number}","notifications_url":"https://api.github.com/repos/jokva/libecl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jokva/libecl/labels{/name}","releases_url":"https://api.github.com/repos/jokva/libecl/releases{/id}","deployments_url":"https://api.github.com/repos/jokva/libecl/deployments","created_at":"2017-05-09T10:07:01Z","updated_at":"2017-05-09T10:07:05Z","pushed_at":"2018-07-05T13:20:14Z","git_url":"git://github.com/jokva/libecl.git","ssh_url":"git@github.com:jokva/libecl.git","clone_url":"https://github.com/jokva/libecl.git","svn_url":"https://github.com/jokva/libecl","homepage":null,"size":20887,"stargazers_count":0,"watchers_count":0,"language":"C","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":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Statoil:master","ref":"master","sha":"a7ad416f02f165d5e5995218cee104ce6737e691","user":{"login":"Statoil","id":525862,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyNTg2Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/525862?v=4","gravatar_id":"","url":"https://api.github.com/users/Statoil","html_url":"https://github.com/Statoil","followers_url":"https://api.github.com/users/Statoil/followers","following_url":"https://api.github.com/users/Statoil/following{/other_user}","gists_url":"https://api.github.com/users/Statoil/gists{/gist_id}","starred_url":"https://api.github.com/users/Statoil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Statoil/subscriptions","organizations_url":"https://api.github.com/users/Statoil/orgs","repos_url":"https://api.github.com/users/Statoil/repos","events_url":"https://api.github.com/users/Statoil/events{/privacy}","received_events_url":"https://api.github.com/users/Statoil/received_events","type":"Organization","site_admin":false},"repo":{"id":85172345,"node_id":"MDEwOlJlcG9zaXRvcnk4NTE3MjM0NQ==","name":"libecl","full_name":"Statoil/libecl","owner":{"login":"Statoil","id":525862,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyNTg2Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/525862?v=4","gravatar_id":"","url":"https://api.github.com/users/Statoil","html_url":"https://github.com/Statoil","followers_url":"https://api.github.com/users/Statoil/followers","following_url":"https://api.github.com/users/Statoil/following{/other_user}","gists_url":"https://api.github.com/users/Statoil/gists{/gist_id}","starred_url":"https://api.github.com/users/Statoil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Statoil/subscriptions","organizations_url":"https://api.github.com/users/Statoil/orgs","repos_url":"https://api.github.com/users/Statoil/repos","events_url":"https://api.github.com/users/Statoil/events{/privacy}","received_events_url":"https://api.github.com/users/Statoil/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Statoil/libecl","description":null,"fork":false,"url":"https://api.github.com/repos/Statoil/libecl","forks_url":"https://api.github.com/repos/Statoil/libecl/forks","keys_url":"https://api.github.com/repos/Statoil/libecl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Statoil/libecl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Statoil/libecl/teams","hooks_url":"https://api.github.com/repos/Statoil/libecl/hooks","issue_events_url":"https://api.github.com/repos/Statoil/libecl/issues/events{/number}","events_url":"https://api.github.com/repos/Statoil/libecl/events","assignees_url":"https://api.github.com/repos/Statoil/libecl/assignees{/user}","branches_url":"https://api.github.com/repos/Statoil/libecl/branches{/branch}","tags_url":"https://api.github.com/repos/Statoil/libecl/tags","blobs_url":"https://api.github.com/repos/Statoil/libecl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Statoil/libecl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Statoil/libecl/git/refs{/sha}","trees_url":"https://api.github.com/repos/Statoil/libecl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Statoil/libecl/statuses/{sha}","languages_url":"https://api.github.com/repos/Statoil/libecl/languages","stargazers_url":"https://api.github.com/repos/Statoil/libecl/stargazers","contributors_url":"https://api.github.com/repos/Statoil/libecl/contributors","subscribers_url":"https://api.github.com/repos/Statoil/libecl/subscribers","subscription_url":"https://api.github.com/repos/Statoil/libecl/subscription","commits_url":"https://api.github.com/repos/Statoil/libecl/commits{/sha}","git_commits_url":"https://api.github.com/repos/Statoil/libecl/git/commits{/sha}","comments_url":"https://api.github.com/repos/Statoil/libecl/comments{/number}","issue_comment_url":"https://api.github.com/repos/Statoil/libecl/issues/comments{/number}","contents_url":"https://api.github.com/repos/Statoil/libecl/contents/{+path}","compare_url":"https://api.github.com/repos/Statoil/libecl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Statoil/libecl/merges","archive_url":"https://api.github.com/repos/Statoil/libecl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Statoil/libecl/downloads","issues_url":"https://api.github.com/repos/Statoil/libecl/issues{/number}","pulls_url":"https://api.github.com/repos/Statoil/libecl/pulls{/number}","milestones_url":"https://api.github.com/repos/Statoil/libecl/milestones{/number}","notifications_url":"https://api.github.com/repos/Statoil/libecl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Statoil/libecl/labels{/name}","releases_url":"https://api.github.com/repos/Statoil/libecl/releases{/id}","deployments_url":"https://api.github.com/repos/Statoil/libecl/deployments","created_at":"2017-03-16T08:39:13Z","updated_at":"2018-07-05T13:19:09Z","pushed_at":"2018-07-05T21:34:33Z","git_url":"git://github.com/Statoil/libecl.git","ssh_url":"git@github.com:Statoil/libecl.git","clone_url":"https://github.com/Statoil/libecl.git","svn_url":"https://github.com/Statoil/libecl","homepage":null,"size":20888,"stargazers_count":19,"watchers_count":19,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"archived":false,"open_issues_count":35,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":40,"open_issues":35,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Statoil/libecl/pulls/435"},"html":{"href":"https://github.com/Statoil/libecl/pull/435"},"issue":{"href":"https://api.github.com/repos/Statoil/libecl/issues/435"},"comments":{"href":"https://api.github.com/repos/Statoil/libecl/issues/435/comments"},"review_comments":{"href":"https://api.github.com/repos/Statoil/libecl/pulls/435/comments"},"review_comment":{"href":"https://api.github.com/repos/Statoil/libecl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Statoil/libecl/pulls/435/commits"},"statuses":{"href":"https://api.github.com/repos/Statoil/libecl/statuses/e88d7db96b168228fae0cf27ca7dce2ea7a86772"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"joakim-hove"}}