{"action":"created","comment":{"url":"https://api.github.com/repos/SHA2017-badge/Firmware/pulls/comments/129915037","pull_request_review_id":52736300,"id":129915037,"diff_hunk":"@@ -0,0 +1,91 @@\n+#include \"gfx_userfs.h\"\n+\n+bool_t userfs_del(const char * fname){\n+    if(unlink(fname)){\n+        return 1;\n+    }\n+    return 0;\n+}\n+\n+bool_t userfs_exists(const char * fname){\n+    struct stat statbuf;\n+    if(stat(fname, &statbuf) == 0){\n+        return 1;\n+    }\n+    return 0;\n+}\n+\n+long int userfs_filesize(const char * fname){\n+    struct stat statbuf;\n+    if(stat(fname, &statbuf) == 0){\n+        return statbuf.st_size;\n+    }\n+    return 0;\n+}\n+\n+bool_t userfs_ren(const char * oldname, const char * newname){\n+    return rename(oldname, newname) != -1;\n+}\n+\n+bool_t userfs_open(GFILE *f, const char * fname){\n+    switch(f->flags){\n+        case GFILEFLG_READ:\n+            f->obj = fopen(fname, \"r\");\n+            break;\n+        case GFILEFLG_WRITE:\n+            f->obj = fopen(fname, \"w\");\n+            break;\n+        case GFILEFLG_READ|GFILEFLG_WRITE:\n+            f->obj = fopen(fname, \"rw\");\n+            break;\n+        case GFILEFLG_WRITE|GFILEFLG_APPEND:\n+            f->obj = fopen(fname, \"wa\");\n+            break;\n+        default:\n+            f->obj = fopen(fname, \"rw\");\n+            break;\n+            /*return 0;*/\n+    }\n+    f->flags |= GFILEFLG_OPEN;\n+    return f->obj != NULL;\n+}\n+\n+void userfs_close(GFILE *f){\n+    fclose(f->obj);\n+}\n+\n+int userfs_read(GFILE *f, void * buf, int size){\n+    return fread(buf, 1, size, f->obj);\n+}\n+\n+int userfs_write(GFILE *f, const void *buf, int size){\n+    return fwrite(buf, 1, size, f->obj);\n+}\n+\n+bool_t userfs_setpos(GFILE *f, long int pos){\n+    return fseek(f->obj, pos, SEEK_SET) != -1;\n+}\n+\n+long int userfs_getsize(GFILE * f){\n+    long int oldpos = ftell(f->obj);","path":"components/ugfx-glue/gfx_userfs.c","position":70,"original_position":70,"commit_id":"f1db99870330c9e99e7151ecc0ef488e13289a2d","original_commit_id":"f1db99870330c9e99e7151ecc0ef488e13289a2d","user":{"login":"basvs","id":2101851,"avatar_url":"https://avatars2.githubusercontent.com/u/2101851?v=4","gravatar_id":"","url":"https://api.github.com/users/basvs","html_url":"https://github.com/basvs","followers_url":"https://api.github.com/users/basvs/followers","following_url":"https://api.github.com/users/basvs/following{/other_user}","gists_url":"https://api.github.com/users/basvs/gists{/gist_id}","starred_url":"https://api.github.com/users/basvs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basvs/subscriptions","organizations_url":"https://api.github.com/users/basvs/orgs","repos_url":"https://api.github.com/users/basvs/repos","events_url":"https://api.github.com/users/basvs/events{/privacy}","received_events_url":"https://api.github.com/users/basvs/received_events","type":"User","site_admin":false},"body":"Add check if f->obj is set?","created_at":"2017-07-27T18:02:39Z","updated_at":"2017-07-27T18:05:50Z","html_url":"https://github.com/SHA2017-badge/Firmware/pull/150#discussion_r129915037","pull_request_url":"https://api.github.com/repos/SHA2017-badge/Firmware/pulls/150","_links":{"self":{"href":"https://api.github.com/repos/SHA2017-badge/Firmware/pulls/comments/129915037"},"html":{"href":"https://github.com/SHA2017-badge/Firmware/pull/150#discussion_r129915037"},"pull_request":{"href":"https://api.github.com/repos/SHA2017-badge/Firmware/pulls/150"}}},"pull_request":{"url":"https://api.github.com/repos/SHA2017-badge/Firmware/pulls/150","id":132786864,"html_url":"https://github.com/SHA2017-badge/Firmware/pull/150","diff_url":"https://github.com/SHA2017-badge/Firmware/pull/150.diff","patch_url":"https://github.com/SHA2017-badge/Firmware/pull/150.patch","issue_url":"https://api.github.com/repos/SHA2017-badge/Firmware/issues/150","number":150,"state":"open","locked":false,"title":"Added bindings to ESP-IDF native filesystem library for ugfx via USERFS","user":{"login":"aczid","id":28900,"avatar_url":"https://avatars2.githubusercontent.com/u/28900?v=4","gravatar_id":"","url":"https://api.github.com/users/aczid","html_url":"https://github.com/aczid","followers_url":"https://api.github.com/users/aczid/followers","following_url":"https://api.github.com/users/aczid/following{/other_user}","gists_url":"https://api.github.com/users/aczid/gists{/gist_id}","starred_url":"https://api.github.com/users/aczid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aczid/subscriptions","organizations_url":"https://api.github.com/users/aczid/orgs","repos_url":"https://api.github.com/users/aczid/repos","events_url":"https://api.github.com/users/aczid/events{/privacy}","received_events_url":"https://api.github.com/users/aczid/received_events","type":"User","site_admin":false},"body":"With this patch UGFX can finally see the regular filesystem.\r\nAlso requires https://github.com/SHA2017-badge/micropython-esp32/pull/130","created_at":"2017-07-27T16:05:24Z","updated_at":"2017-07-27T18:05:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d7fa9edf10307aee49bca4c305cf5bfab4a37421","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/SHA2017-badge/Firmware/pulls/150/commits","review_comments_url":"https://api.github.com/repos/SHA2017-badge/Firmware/pulls/150/comments","review_comment_url":"https://api.github.com/repos/SHA2017-badge/Firmware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SHA2017-badge/Firmware/issues/150/comments","statuses_url":"https://api.github.com/repos/SHA2017-badge/Firmware/statuses/f1db99870330c9e99e7151ecc0ef488e13289a2d","head":{"label":"aczid:master","ref":"master","sha":"f1db99870330c9e99e7151ecc0ef488e13289a2d","user":{"login":"aczid","id":28900,"avatar_url":"https://avatars2.githubusercontent.com/u/28900?v=4","gravatar_id":"","url":"https://api.github.com/users/aczid","html_url":"https://github.com/aczid","followers_url":"https://api.github.com/users/aczid/followers","following_url":"https://api.github.com/users/aczid/following{/other_user}","gists_url":"https://api.github.com/users/aczid/gists{/gist_id}","starred_url":"https://api.github.com/users/aczid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aczid/subscriptions","organizations_url":"https://api.github.com/users/aczid/orgs","repos_url":"https://api.github.com/users/aczid/repos","events_url":"https://api.github.com/users/aczid/events{/privacy}","received_events_url":"https://api.github.com/users/aczid/received_events","type":"User","site_admin":false},"repo":{"id":93682163,"name":"Firmware","full_name":"aczid/Firmware","owner":{"login":"aczid","id":28900,"avatar_url":"https://avatars2.githubusercontent.com/u/28900?v=4","gravatar_id":"","url":"https://api.github.com/users/aczid","html_url":"https://github.com/aczid","followers_url":"https://api.github.com/users/aczid/followers","following_url":"https://api.github.com/users/aczid/following{/other_user}","gists_url":"https://api.github.com/users/aczid/gists{/gist_id}","starred_url":"https://api.github.com/users/aczid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aczid/subscriptions","organizations_url":"https://api.github.com/users/aczid/orgs","repos_url":"https://api.github.com/users/aczid/repos","events_url":"https://api.github.com/users/aczid/events{/privacy}","received_events_url":"https://api.github.com/users/aczid/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aczid/Firmware","description":"ESP32 firmware for the SHA2017 badge","fork":true,"url":"https://api.github.com/repos/aczid/Firmware","forks_url":"https://api.github.com/repos/aczid/Firmware/forks","keys_url":"https://api.github.com/repos/aczid/Firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aczid/Firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aczid/Firmware/teams","hooks_url":"https://api.github.com/repos/aczid/Firmware/hooks","issue_events_url":"https://api.github.com/repos/aczid/Firmware/issues/events{/number}","events_url":"https://api.github.com/repos/aczid/Firmware/events","assignees_url":"https://api.github.com/repos/aczid/Firmware/assignees{/user}","branches_url":"https://api.github.com/repos/aczid/Firmware/branches{/branch}","tags_url":"https://api.github.com/repos/aczid/Firmware/tags","blobs_url":"https://api.github.com/repos/aczid/Firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aczid/Firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aczid/Firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/aczid/Firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aczid/Firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/aczid/Firmware/languages","stargazers_url":"https://api.github.com/repos/aczid/Firmware/stargazers","contributors_url":"https://api.github.com/repos/aczid/Firmware/contributors","subscribers_url":"https://api.github.com/repos/aczid/Firmware/subscribers","subscription_url":"https://api.github.com/repos/aczid/Firmware/subscription","commits_url":"https://api.github.com/repos/aczid/Firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/aczid/Firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/aczid/Firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/aczid/Firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/aczid/Firmware/contents/{+path}","compare_url":"https://api.github.com/repos/aczid/Firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aczid/Firmware/merges","archive_url":"https://api.github.com/repos/aczid/Firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aczid/Firmware/downloads","issues_url":"https://api.github.com/repos/aczid/Firmware/issues{/number}","pulls_url":"https://api.github.com/repos/aczid/Firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/aczid/Firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/aczid/Firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aczid/Firmware/labels{/name}","releases_url":"https://api.github.com/repos/aczid/Firmware/releases{/id}","deployments_url":"https://api.github.com/repos/aczid/Firmware/deployments","created_at":"2017-06-07T21:41:28Z","updated_at":"2017-06-07T21:41:29Z","pushed_at":"2017-07-27T16:09:33Z","git_url":"git://github.com/aczid/Firmware.git","ssh_url":"git@github.com:aczid/Firmware.git","clone_url":"https://github.com/aczid/Firmware.git","svn_url":"https://github.com/aczid/Firmware","homepage":null,"size":2445,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SHA2017-badge:master","ref":"master","sha":"062245c790acbdf0828f8523b9ae0c47bff9c318","user":{"login":"SHA2017-badge","id":22056781,"avatar_url":"https://avatars1.githubusercontent.com/u/22056781?v=4","gravatar_id":"","url":"https://api.github.com/users/SHA2017-badge","html_url":"https://github.com/SHA2017-badge","followers_url":"https://api.github.com/users/SHA2017-badge/followers","following_url":"https://api.github.com/users/SHA2017-badge/following{/other_user}","gists_url":"https://api.github.com/users/SHA2017-badge/gists{/gist_id}","starred_url":"https://api.github.com/users/SHA2017-badge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SHA2017-badge/subscriptions","organizations_url":"https://api.github.com/users/SHA2017-badge/orgs","repos_url":"https://api.github.com/users/SHA2017-badge/repos","events_url":"https://api.github.com/users/SHA2017-badge/events{/privacy}","received_events_url":"https://api.github.com/users/SHA2017-badge/received_events","type":"Organization","site_admin":false},"repo":{"id":75012957,"name":"Firmware","full_name":"SHA2017-badge/Firmware","owner":{"login":"SHA2017-badge","id":22056781,"avatar_url":"https://avatars1.githubusercontent.com/u/22056781?v=4","gravatar_id":"","url":"https://api.github.com/users/SHA2017-badge","html_url":"https://github.com/SHA2017-badge","followers_url":"https://api.github.com/users/SHA2017-badge/followers","following_url":"https://api.github.com/users/SHA2017-badge/following{/other_user}","gists_url":"https://api.github.com/users/SHA2017-badge/gists{/gist_id}","starred_url":"https://api.github.com/users/SHA2017-badge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SHA2017-badge/subscriptions","organizations_url":"https://api.github.com/users/SHA2017-badge/orgs","repos_url":"https://api.github.com/users/SHA2017-badge/repos","events_url":"https://api.github.com/users/SHA2017-badge/events{/privacy}","received_events_url":"https://api.github.com/users/SHA2017-badge/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SHA2017-badge/Firmware","description":"ESP32 firmware for the SHA2017 badge","fork":false,"url":"https://api.github.com/repos/SHA2017-badge/Firmware","forks_url":"https://api.github.com/repos/SHA2017-badge/Firmware/forks","keys_url":"https://api.github.com/repos/SHA2017-badge/Firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SHA2017-badge/Firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SHA2017-badge/Firmware/teams","hooks_url":"https://api.github.com/repos/SHA2017-badge/Firmware/hooks","issue_events_url":"https://api.github.com/repos/SHA2017-badge/Firmware/issues/events{/number}","events_url":"https://api.github.com/repos/SHA2017-badge/Firmware/events","assignees_url":"https://api.github.com/repos/SHA2017-badge/Firmware/assignees{/user}","branches_url":"https://api.github.com/repos/SHA2017-badge/Firmware/branches{/branch}","tags_url":"https://api.github.com/repos/SHA2017-badge/Firmware/tags","blobs_url":"https://api.github.com/repos/SHA2017-badge/Firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SHA2017-badge/Firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SHA2017-badge/Firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/SHA2017-badge/Firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SHA2017-badge/Firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/SHA2017-badge/Firmware/languages","stargazers_url":"https://api.github.com/repos/SHA2017-badge/Firmware/stargazers","contributors_url":"https://api.github.com/repos/SHA2017-badge/Firmware/contributors","subscribers_url":"https://api.github.com/repos/SHA2017-badge/Firmware/subscribers","subscription_url":"https://api.github.com/repos/SHA2017-badge/Firmware/subscription","commits_url":"https://api.github.com/repos/SHA2017-badge/Firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/SHA2017-badge/Firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/SHA2017-badge/Firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/SHA2017-badge/Firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/SHA2017-badge/Firmware/contents/{+path}","compare_url":"https://api.github.com/repos/SHA2017-badge/Firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SHA2017-badge/Firmware/merges","archive_url":"https://api.github.com/repos/SHA2017-badge/Firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SHA2017-badge/Firmware/downloads","issues_url":"https://api.github.com/repos/SHA2017-badge/Firmware/issues{/number}","pulls_url":"https://api.github.com/repos/SHA2017-badge/Firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/SHA2017-badge/Firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/SHA2017-badge/Firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SHA2017-badge/Firmware/labels{/name}","releases_url":"https://api.github.com/repos/SHA2017-badge/Firmware/releases{/id}","deployments_url":"https://api.github.com/repos/SHA2017-badge/Firmware/deployments","created_at":"2016-11-28T20:49:15Z","updated_at":"2017-07-25T19:38:03Z","pushed_at":"2017-07-27T16:09:34Z","git_url":"git://github.com/SHA2017-badge/Firmware.git","ssh_url":"git@github.com:SHA2017-badge/Firmware.git","clone_url":"https://github.com/SHA2017-badge/Firmware.git","svn_url":"https://github.com/SHA2017-badge/Firmware","homepage":"https://wiki.sha2017.org/w/Badge","size":2444,"stargazers_count":37,"watchers_count":37,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":10,"forks":12,"open_issues":10,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SHA2017-badge/Firmware/pulls/150"},"html":{"href":"https://github.com/SHA2017-badge/Firmware/pull/150"},"issue":{"href":"https://api.github.com/repos/SHA2017-badge/Firmware/issues/150"},"comments":{"href":"https://api.github.com/repos/SHA2017-badge/Firmware/issues/150/comments"},"review_comments":{"href":"https://api.github.com/repos/SHA2017-badge/Firmware/pulls/150/comments"},"review_comment":{"href":"https://api.github.com/repos/SHA2017-badge/Firmware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SHA2017-badge/Firmware/pulls/150/commits"},"statuses":{"href":"https://api.github.com/repos/SHA2017-badge/Firmware/statuses/f1db99870330c9e99e7151ecc0ef488e13289a2d"}}}}
{"actor":{"display_login":"basvs"}}