{"action":"created","comment":{"url":"https://api.github.com/repos/switchbrew/libnx/pulls/comments/206592259","pull_request_review_id":142033646,"id":206592259,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjU5MjI1OQ==","diff_hunk":"@@ -0,0 +1,86 @@\n+#include \"types.h\"\n+#include \"result.h\"\n+#include \"arm/atomics.h\"\n+#include \"kernel/ipc.h\"\n+#include \"services/bpc.h\"\n+#include \"services/sm.h\"\n+\n+static Service g_bpcSrv;\n+static u64 g_refCnt;\n+\n+Result bpcInitialize(void)\n+{\n+    atomicIncrement64(&g_refCnt);\n+\n+    if (serviceIsActive(&g_bpcSrv)) return 0;\n+\n+    Result rc = 0;\n+\n+    rc = smGetService(&g_bpcSrv, \"bpc\");\n+\n+    return rc;\n+}\n+\n+void apmExit(void)\n+{\n+    if (atomicDecrement64(&g_refCnt) == 0)\n+    {\n+        serviceClose(&g_bpcSrv);\n+    }\n+}\n+\n+Result bpcShutdownSystem(void)","path":"nx/source/services/bpc.c","position":32,"original_position":32,"commit_id":"0a77a95fae27ce6da31f380a2cbb19930da6f2e2","original_commit_id":"183ba3822b3a7ba830ff68e4e11b9c8ceda2b577","user":{"login":"yellows8","id":585494,"node_id":"MDQ6VXNlcjU4NTQ5NA==","avatar_url":"https://avatars0.githubusercontent.com/u/585494?v=4","gravatar_id":"","url":"https://api.github.com/users/yellows8","html_url":"https://github.com/yellows8","followers_url":"https://api.github.com/users/yellows8/followers","following_url":"https://api.github.com/users/yellows8/following{/other_user}","gists_url":"https://api.github.com/users/yellows8/gists{/gist_id}","starred_url":"https://api.github.com/users/yellows8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yellows8/subscriptions","organizations_url":"https://api.github.com/users/yellows8/orgs","repos_url":"https://api.github.com/users/yellows8/repos","events_url":"https://api.github.com/users/yellows8/events{/privacy}","received_events_url":"https://api.github.com/users/yellows8/received_events","type":"User","site_admin":false},"body":"Use same spacing style as other libnx cmds.","created_at":"2018-07-31T16:15:13Z","updated_at":"2018-07-31T16:15:13Z","html_url":"https://github.com/switchbrew/libnx/pull/144#discussion_r206592259","pull_request_url":"https://api.github.com/repos/switchbrew/libnx/pulls/144","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/switchbrew/libnx/pulls/comments/206592259"},"html":{"href":"https://github.com/switchbrew/libnx/pull/144#discussion_r206592259"},"pull_request":{"href":"https://api.github.com/repos/switchbrew/libnx/pulls/144"}}},"pull_request":{"url":"https://api.github.com/repos/switchbrew/libnx/pulls/144","id":205087978,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MDg3OTc4","html_url":"https://github.com/switchbrew/libnx/pull/144","diff_url":"https://github.com/switchbrew/libnx/pull/144.diff","patch_url":"https://github.com/switchbrew/libnx/pull/144.patch","issue_url":"https://api.github.com/repos/switchbrew/libnx/issues/144","number":144,"state":"open","locked":false,"title":"Add bpc service with ShutdownSystem and RebootSystem commands","user":{"login":"XorTroll","id":33005497,"node_id":"MDQ6VXNlcjMzMDA1NDk3","avatar_url":"https://avatars2.githubusercontent.com/u/33005497?v=4","gravatar_id":"","url":"https://api.github.com/users/XorTroll","html_url":"https://github.com/XorTroll","followers_url":"https://api.github.com/users/XorTroll/followers","following_url":"https://api.github.com/users/XorTroll/following{/other_user}","gists_url":"https://api.github.com/users/XorTroll/gists{/gist_id}","starred_url":"https://api.github.com/users/XorTroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XorTroll/subscriptions","organizations_url":"https://api.github.com/users/XorTroll/orgs","repos_url":"https://api.github.com/users/XorTroll/repos","events_url":"https://api.github.com/users/XorTroll/events{/privacy}","received_events_url":"https://api.github.com/users/XorTroll/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-31T11:58:29Z","updated_at":"2018-07-31T16:15:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0fa7a44354f20a20e2c2eaf92a7dcea321c49a0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/switchbrew/libnx/pulls/144/commits","review_comments_url":"https://api.github.com/repos/switchbrew/libnx/pulls/144/comments","review_comment_url":"https://api.github.com/repos/switchbrew/libnx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/switchbrew/libnx/issues/144/comments","statuses_url":"https://api.github.com/repos/switchbrew/libnx/statuses/0a77a95fae27ce6da31f380a2cbb19930da6f2e2","head":{"label":"XorTroll:master","ref":"master","sha":"0a77a95fae27ce6da31f380a2cbb19930da6f2e2","user":{"login":"XorTroll","id":33005497,"node_id":"MDQ6VXNlcjMzMDA1NDk3","avatar_url":"https://avatars2.githubusercontent.com/u/33005497?v=4","gravatar_id":"","url":"https://api.github.com/users/XorTroll","html_url":"https://github.com/XorTroll","followers_url":"https://api.github.com/users/XorTroll/followers","following_url":"https://api.github.com/users/XorTroll/following{/other_user}","gists_url":"https://api.github.com/users/XorTroll/gists{/gist_id}","starred_url":"https://api.github.com/users/XorTroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XorTroll/subscriptions","organizations_url":"https://api.github.com/users/XorTroll/orgs","repos_url":"https://api.github.com/users/XorTroll/repos","events_url":"https://api.github.com/users/XorTroll/events{/privacy}","received_events_url":"https://api.github.com/users/XorTroll/received_events","type":"User","site_admin":false},"repo":{"id":143007305,"node_id":"MDEwOlJlcG9zaXRvcnkxNDMwMDczMDU=","name":"libnx","full_name":"XorTroll/libnx","owner":{"login":"XorTroll","id":33005497,"node_id":"MDQ6VXNlcjMzMDA1NDk3","avatar_url":"https://avatars2.githubusercontent.com/u/33005497?v=4","gravatar_id":"","url":"https://api.github.com/users/XorTroll","html_url":"https://github.com/XorTroll","followers_url":"https://api.github.com/users/XorTroll/followers","following_url":"https://api.github.com/users/XorTroll/following{/other_user}","gists_url":"https://api.github.com/users/XorTroll/gists{/gist_id}","starred_url":"https://api.github.com/users/XorTroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XorTroll/subscriptions","organizations_url":"https://api.github.com/users/XorTroll/orgs","repos_url":"https://api.github.com/users/XorTroll/repos","events_url":"https://api.github.com/users/XorTroll/events{/privacy}","received_events_url":"https://api.github.com/users/XorTroll/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/XorTroll/libnx","description":"Library for Switch Homebrew","fork":true,"url":"https://api.github.com/repos/XorTroll/libnx","forks_url":"https://api.github.com/repos/XorTroll/libnx/forks","keys_url":"https://api.github.com/repos/XorTroll/libnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/XorTroll/libnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/XorTroll/libnx/teams","hooks_url":"https://api.github.com/repos/XorTroll/libnx/hooks","issue_events_url":"https://api.github.com/repos/XorTroll/libnx/issues/events{/number}","events_url":"https://api.github.com/repos/XorTroll/libnx/events","assignees_url":"https://api.github.com/repos/XorTroll/libnx/assignees{/user}","branches_url":"https://api.github.com/repos/XorTroll/libnx/branches{/branch}","tags_url":"https://api.github.com/repos/XorTroll/libnx/tags","blobs_url":"https://api.github.com/repos/XorTroll/libnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/XorTroll/libnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/XorTroll/libnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/XorTroll/libnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/XorTroll/libnx/statuses/{sha}","languages_url":"https://api.github.com/repos/XorTroll/libnx/languages","stargazers_url":"https://api.github.com/repos/XorTroll/libnx/stargazers","contributors_url":"https://api.github.com/repos/XorTroll/libnx/contributors","subscribers_url":"https://api.github.com/repos/XorTroll/libnx/subscribers","subscription_url":"https://api.github.com/repos/XorTroll/libnx/subscription","commits_url":"https://api.github.com/repos/XorTroll/libnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/XorTroll/libnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/XorTroll/libnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/XorTroll/libnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/XorTroll/libnx/contents/{+path}","compare_url":"https://api.github.com/repos/XorTroll/libnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/XorTroll/libnx/merges","archive_url":"https://api.github.com/repos/XorTroll/libnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/XorTroll/libnx/downloads","issues_url":"https://api.github.com/repos/XorTroll/libnx/issues{/number}","pulls_url":"https://api.github.com/repos/XorTroll/libnx/pulls{/number}","milestones_url":"https://api.github.com/repos/XorTroll/libnx/milestones{/number}","notifications_url":"https://api.github.com/repos/XorTroll/libnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/XorTroll/libnx/labels{/name}","releases_url":"https://api.github.com/repos/XorTroll/libnx/releases{/id}","deployments_url":"https://api.github.com/repos/XorTroll/libnx/deployments","created_at":"2018-07-31T11:49:58Z","updated_at":"2018-07-31T11:57:24Z","pushed_at":"2018-07-31T11:57:23Z","git_url":"git://github.com/XorTroll/libnx.git","ssh_url":"git@github.com:XorTroll/libnx.git","clone_url":"https://github.com/XorTroll/libnx.git","svn_url":"https://github.com/XorTroll/libnx","homepage":"https://switchbrew.github.io/libnx/","size":2033,"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":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc","node_id":"MDc6TGljZW5zZTEw"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"switchbrew:master","ref":"master","sha":"93dabfab3fc161cc4b7fbb276fc17f2d748f3537","user":{"login":"switchbrew","id":31827450,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxODI3NDUw","avatar_url":"https://avatars3.githubusercontent.com/u/31827450?v=4","gravatar_id":"","url":"https://api.github.com/users/switchbrew","html_url":"https://github.com/switchbrew","followers_url":"https://api.github.com/users/switchbrew/followers","following_url":"https://api.github.com/users/switchbrew/following{/other_user}","gists_url":"https://api.github.com/users/switchbrew/gists{/gist_id}","starred_url":"https://api.github.com/users/switchbrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/switchbrew/subscriptions","organizations_url":"https://api.github.com/users/switchbrew/orgs","repos_url":"https://api.github.com/users/switchbrew/repos","events_url":"https://api.github.com/users/switchbrew/events{/privacy}","received_events_url":"https://api.github.com/users/switchbrew/received_events","type":"Organization","site_admin":false},"repo":{"id":103794142,"node_id":"MDEwOlJlcG9zaXRvcnkxMDM3OTQxNDI=","name":"libnx","full_name":"switchbrew/libnx","owner":{"login":"switchbrew","id":31827450,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxODI3NDUw","avatar_url":"https://avatars3.githubusercontent.com/u/31827450?v=4","gravatar_id":"","url":"https://api.github.com/users/switchbrew","html_url":"https://github.com/switchbrew","followers_url":"https://api.github.com/users/switchbrew/followers","following_url":"https://api.github.com/users/switchbrew/following{/other_user}","gists_url":"https://api.github.com/users/switchbrew/gists{/gist_id}","starred_url":"https://api.github.com/users/switchbrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/switchbrew/subscriptions","organizations_url":"https://api.github.com/users/switchbrew/orgs","repos_url":"https://api.github.com/users/switchbrew/repos","events_url":"https://api.github.com/users/switchbrew/events{/privacy}","received_events_url":"https://api.github.com/users/switchbrew/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/switchbrew/libnx","description":"Library for Switch Homebrew","fork":false,"url":"https://api.github.com/repos/switchbrew/libnx","forks_url":"https://api.github.com/repos/switchbrew/libnx/forks","keys_url":"https://api.github.com/repos/switchbrew/libnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/switchbrew/libnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/switchbrew/libnx/teams","hooks_url":"https://api.github.com/repos/switchbrew/libnx/hooks","issue_events_url":"https://api.github.com/repos/switchbrew/libnx/issues/events{/number}","events_url":"https://api.github.com/repos/switchbrew/libnx/events","assignees_url":"https://api.github.com/repos/switchbrew/libnx/assignees{/user}","branches_url":"https://api.github.com/repos/switchbrew/libnx/branches{/branch}","tags_url":"https://api.github.com/repos/switchbrew/libnx/tags","blobs_url":"https://api.github.com/repos/switchbrew/libnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/switchbrew/libnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/switchbrew/libnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/switchbrew/libnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/switchbrew/libnx/statuses/{sha}","languages_url":"https://api.github.com/repos/switchbrew/libnx/languages","stargazers_url":"https://api.github.com/repos/switchbrew/libnx/stargazers","contributors_url":"https://api.github.com/repos/switchbrew/libnx/contributors","subscribers_url":"https://api.github.com/repos/switchbrew/libnx/subscribers","subscription_url":"https://api.github.com/repos/switchbrew/libnx/subscription","commits_url":"https://api.github.com/repos/switchbrew/libnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/switchbrew/libnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/switchbrew/libnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/switchbrew/libnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/switchbrew/libnx/contents/{+path}","compare_url":"https://api.github.com/repos/switchbrew/libnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/switchbrew/libnx/merges","archive_url":"https://api.github.com/repos/switchbrew/libnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/switchbrew/libnx/downloads","issues_url":"https://api.github.com/repos/switchbrew/libnx/issues{/number}","pulls_url":"https://api.github.com/repos/switchbrew/libnx/pulls{/number}","milestones_url":"https://api.github.com/repos/switchbrew/libnx/milestones{/number}","notifications_url":"https://api.github.com/repos/switchbrew/libnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/switchbrew/libnx/labels{/name}","releases_url":"https://api.github.com/repos/switchbrew/libnx/releases{/id}","deployments_url":"https://api.github.com/repos/switchbrew/libnx/deployments","created_at":"2017-09-17T01:12:38Z","updated_at":"2018-07-31T08:13:10Z","pushed_at":"2018-07-31T11:58:29Z","git_url":"git://github.com/switchbrew/libnx.git","ssh_url":"git@github.com:switchbrew/libnx.git","clone_url":"https://github.com/switchbrew/libnx.git","svn_url":"https://github.com/switchbrew/libnx","homepage":"https://switchbrew.github.io/libnx/","size":2020,"stargazers_count":434,"watchers_count":434,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":61,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc","node_id":"MDc6TGljZW5zZTEw"},"forks":61,"open_issues":2,"watchers":434,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/switchbrew/libnx/pulls/144"},"html":{"href":"https://github.com/switchbrew/libnx/pull/144"},"issue":{"href":"https://api.github.com/repos/switchbrew/libnx/issues/144"},"comments":{"href":"https://api.github.com/repos/switchbrew/libnx/issues/144/comments"},"review_comments":{"href":"https://api.github.com/repos/switchbrew/libnx/pulls/144/comments"},"review_comment":{"href":"https://api.github.com/repos/switchbrew/libnx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/switchbrew/libnx/pulls/144/commits"},"statuses":{"href":"https://api.github.com/repos/switchbrew/libnx/statuses/0a77a95fae27ce6da31f380a2cbb19930da6f2e2"}},"author_association":"NONE"}}
{"actor":{"display_login":"yellows8"}}