{"action":"created","comment":{"url":"https://api.github.com/repos/symengine/symengine/pulls/comments/86281333","pull_request_review_id":6946357,"id":86281333,"diff_hunk":"@@ -568,6 +568,33 @@ void basic_str_free(char *s)\n     delete[] s;\n }\n \n+int symengine_have_component(const char *c)\n+{\n+    bool t[4] = {};\n+#ifdef HAVE_SYMENGINE_MPFR\n+    t[0] = true;\n+#endif\n+#ifdef HAVE_SYMENGINE_MPC\n+    t[1] = true;\n+#endif\n+#ifdef HAVE_SYMENGINE_FLINT\n+    t[2] = true;\n+#endif\n+#ifdef HAVE_SYMENGINE_ARB\n+    t[3] = true;\n+#endif\n+    const char *component[] = {\"mpfr\", \"mpc\", \"flint\", \"arb\"};\n+    for (int i = 0; i < 4; i++) {\n+        if (std::strcmp(component[i], c) == 0) {\n+            if (t[i])\n+                return 1;\n+            else\n+                return 0;\n+        }\n+    }\n+    return 0;\n+}","path":"symengine/cwrapper.cpp","position":29,"original_position":29,"commit_id":"e39340d2633843b4ae489601a726339f1b3bea75","original_commit_id":"e39340d2633843b4ae489601a726339f1b3bea75","user":{"login":"isuruf","id":5234427,"avatar_url":"https://avatars.githubusercontent.com/u/5234427?v=3","gravatar_id":"","url":"https://api.github.com/users/isuruf","html_url":"https://github.com/isuruf","followers_url":"https://api.github.com/users/isuruf/followers","following_url":"https://api.github.com/users/isuruf/following{/other_user}","gists_url":"https://api.github.com/users/isuruf/gists{/gist_id}","starred_url":"https://api.github.com/users/isuruf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isuruf/subscriptions","organizations_url":"https://api.github.com/users/isuruf/orgs","repos_url":"https://api.github.com/users/isuruf/repos","events_url":"https://api.github.com/users/isuruf/events{/privacy}","received_events_url":"https://api.github.com/users/isuruf/received_events","type":"User","site_admin":false},"body":"Enums are better when you have access to them via headers. This function is needed for libraries using only the shared library like `SymEngine.jl` which doesn't look at the headers. In that case strings are better.\r\nWhen you have access to the headers, you don't need this function at all. You can just use, `HAVE_SYMENGINE_MPFR` to check whether it is installed.","created_at":"2016-11-03T03:08:24Z","updated_at":"2016-11-03T03:08:24Z","html_url":"https://github.com/symengine/symengine/pull/1114#discussion_r86281333","pull_request_url":"https://api.github.com/repos/symengine/symengine/pulls/1114","_links":{"self":{"href":"https://api.github.com/repos/symengine/symengine/pulls/comments/86281333"},"html":{"href":"https://github.com/symengine/symengine/pull/1114#discussion_r86281333"},"pull_request":{"href":"https://api.github.com/repos/symengine/symengine/pulls/1114"}}},"pull_request":{"url":"https://api.github.com/repos/symengine/symengine/pulls/1114","id":92034163,"html_url":"https://github.com/symengine/symengine/pull/1114","diff_url":"https://github.com/symengine/symengine/pull/1114.diff","patch_url":"https://github.com/symengine/symengine/pull/1114.patch","issue_url":"https://api.github.com/repos/symengine/symengine/issues/1114","number":1114,"state":"open","locked":false,"title":"Added Function for Issue #1088 (Second Feature)","user":{"login":"ShikharJ","id":19722966,"avatar_url":"https://avatars.githubusercontent.com/u/19722966?v=3","gravatar_id":"","url":"https://api.github.com/users/ShikharJ","html_url":"https://github.com/ShikharJ","followers_url":"https://api.github.com/users/ShikharJ/followers","following_url":"https://api.github.com/users/ShikharJ/following{/other_user}","gists_url":"https://api.github.com/users/ShikharJ/gists{/gist_id}","starred_url":"https://api.github.com/users/ShikharJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShikharJ/subscriptions","organizations_url":"https://api.github.com/users/ShikharJ/orgs","repos_url":"https://api.github.com/users/ShikharJ/repos","events_url":"https://api.github.com/users/ShikharJ/events{/privacy}","received_events_url":"https://api.github.com/users/ShikharJ/received_events","type":"User","site_admin":false},"body":"Added a function to call to indicate whether some components (namely flint, arb, mpc and mpfr) are installed or not. No tests are added (to prevent travis build failures). However the following links may be referred to for cross-checking the functionality:\r\n(Build #9 For Rejecting Non MPFR builds)\r\nhttps://travis-ci.org/ShikharJ/symengine/builds/172672603\r\n\r\n(Build #8 For Rejecting MPFR builds)\r\nhttps://travis-ci.org/ShikharJ/symengine/builds/172666980\r\nThe above tests have been conducted by patching the following lines of code:\r\nchar *s = \"mpfr\";\r\n(#9)SYMENGINE_C_ASSERT(symengine_have_component(s));\r\n(#8)SYMENGINE_C_ASSERT(!symengine_have_component(s));\r\n","created_at":"2016-11-02T18:58:18Z","updated_at":"2016-11-03T03:08:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9ab0e3eba55d76f7da321aac658e1d1297b4fc7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/symengine/symengine/pulls/1114/commits","review_comments_url":"https://api.github.com/repos/symengine/symengine/pulls/1114/comments","review_comment_url":"https://api.github.com/repos/symengine/symengine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symengine/symengine/issues/1114/comments","statuses_url":"https://api.github.com/repos/symengine/symengine/statuses/e39340d2633843b4ae489601a726339f1b3bea75","head":{"label":"ShikharJ:Issue1088","ref":"Issue1088","sha":"e39340d2633843b4ae489601a726339f1b3bea75","user":{"login":"ShikharJ","id":19722966,"avatar_url":"https://avatars.githubusercontent.com/u/19722966?v=3","gravatar_id":"","url":"https://api.github.com/users/ShikharJ","html_url":"https://github.com/ShikharJ","followers_url":"https://api.github.com/users/ShikharJ/followers","following_url":"https://api.github.com/users/ShikharJ/following{/other_user}","gists_url":"https://api.github.com/users/ShikharJ/gists{/gist_id}","starred_url":"https://api.github.com/users/ShikharJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShikharJ/subscriptions","organizations_url":"https://api.github.com/users/ShikharJ/orgs","repos_url":"https://api.github.com/users/ShikharJ/repos","events_url":"https://api.github.com/users/ShikharJ/events{/privacy}","received_events_url":"https://api.github.com/users/ShikharJ/received_events","type":"User","site_admin":false},"repo":{"id":71805265,"name":"symengine","full_name":"ShikharJ/symengine","owner":{"login":"ShikharJ","id":19722966,"avatar_url":"https://avatars.githubusercontent.com/u/19722966?v=3","gravatar_id":"","url":"https://api.github.com/users/ShikharJ","html_url":"https://github.com/ShikharJ","followers_url":"https://api.github.com/users/ShikharJ/followers","following_url":"https://api.github.com/users/ShikharJ/following{/other_user}","gists_url":"https://api.github.com/users/ShikharJ/gists{/gist_id}","starred_url":"https://api.github.com/users/ShikharJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShikharJ/subscriptions","organizations_url":"https://api.github.com/users/ShikharJ/orgs","repos_url":"https://api.github.com/users/ShikharJ/repos","events_url":"https://api.github.com/users/ShikharJ/events{/privacy}","received_events_url":"https://api.github.com/users/ShikharJ/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ShikharJ/symengine","description":"SymEngine is a fast symbolic manipulation library, written in C++","fork":true,"url":"https://api.github.com/repos/ShikharJ/symengine","forks_url":"https://api.github.com/repos/ShikharJ/symengine/forks","keys_url":"https://api.github.com/repos/ShikharJ/symengine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ShikharJ/symengine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ShikharJ/symengine/teams","hooks_url":"https://api.github.com/repos/ShikharJ/symengine/hooks","issue_events_url":"https://api.github.com/repos/ShikharJ/symengine/issues/events{/number}","events_url":"https://api.github.com/repos/ShikharJ/symengine/events","assignees_url":"https://api.github.com/repos/ShikharJ/symengine/assignees{/user}","branches_url":"https://api.github.com/repos/ShikharJ/symengine/branches{/branch}","tags_url":"https://api.github.com/repos/ShikharJ/symengine/tags","blobs_url":"https://api.github.com/repos/ShikharJ/symengine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ShikharJ/symengine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ShikharJ/symengine/git/refs{/sha}","trees_url":"https://api.github.com/repos/ShikharJ/symengine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ShikharJ/symengine/statuses/{sha}","languages_url":"https://api.github.com/repos/ShikharJ/symengine/languages","stargazers_url":"https://api.github.com/repos/ShikharJ/symengine/stargazers","contributors_url":"https://api.github.com/repos/ShikharJ/symengine/contributors","subscribers_url":"https://api.github.com/repos/ShikharJ/symengine/subscribers","subscription_url":"https://api.github.com/repos/ShikharJ/symengine/subscription","commits_url":"https://api.github.com/repos/ShikharJ/symengine/commits{/sha}","git_commits_url":"https://api.github.com/repos/ShikharJ/symengine/git/commits{/sha}","comments_url":"https://api.github.com/repos/ShikharJ/symengine/comments{/number}","issue_comment_url":"https://api.github.com/repos/ShikharJ/symengine/issues/comments{/number}","contents_url":"https://api.github.com/repos/ShikharJ/symengine/contents/{+path}","compare_url":"https://api.github.com/repos/ShikharJ/symengine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ShikharJ/symengine/merges","archive_url":"https://api.github.com/repos/ShikharJ/symengine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ShikharJ/symengine/downloads","issues_url":"https://api.github.com/repos/ShikharJ/symengine/issues{/number}","pulls_url":"https://api.github.com/repos/ShikharJ/symengine/pulls{/number}","milestones_url":"https://api.github.com/repos/ShikharJ/symengine/milestones{/number}","notifications_url":"https://api.github.com/repos/ShikharJ/symengine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ShikharJ/symengine/labels{/name}","releases_url":"https://api.github.com/repos/ShikharJ/symengine/releases{/id}","deployments_url":"https://api.github.com/repos/ShikharJ/symengine/deployments","created_at":"2016-10-24T15:50:39Z","updated_at":"2016-10-24T15:50:41Z","pushed_at":"2016-11-02T18:53:30Z","git_url":"git://github.com/ShikharJ/symengine.git","ssh_url":"git@github.com:ShikharJ/symengine.git","clone_url":"https://github.com/ShikharJ/symengine.git","svn_url":"https://github.com/ShikharJ/symengine","homepage":"http://sympy.org","size":6185,"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":"symengine:master","ref":"master","sha":"5d123c0e321b8f7a323599092f7cf11045bf77ee","user":{"login":"symengine","id":11509221,"avatar_url":"https://avatars.githubusercontent.com/u/11509221?v=3","gravatar_id":"","url":"https://api.github.com/users/symengine","html_url":"https://github.com/symengine","followers_url":"https://api.github.com/users/symengine/followers","following_url":"https://api.github.com/users/symengine/following{/other_user}","gists_url":"https://api.github.com/users/symengine/gists{/gist_id}","starred_url":"https://api.github.com/users/symengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symengine/subscriptions","organizations_url":"https://api.github.com/users/symengine/orgs","repos_url":"https://api.github.com/users/symengine/repos","events_url":"https://api.github.com/users/symengine/events{/privacy}","received_events_url":"https://api.github.com/users/symengine/received_events","type":"Organization","site_admin":false},"repo":{"id":42376,"name":"symengine","full_name":"symengine/symengine","owner":{"login":"symengine","id":11509221,"avatar_url":"https://avatars.githubusercontent.com/u/11509221?v=3","gravatar_id":"","url":"https://api.github.com/users/symengine","html_url":"https://github.com/symengine","followers_url":"https://api.github.com/users/symengine/followers","following_url":"https://api.github.com/users/symengine/following{/other_user}","gists_url":"https://api.github.com/users/symengine/gists{/gist_id}","starred_url":"https://api.github.com/users/symengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symengine/subscriptions","organizations_url":"https://api.github.com/users/symengine/orgs","repos_url":"https://api.github.com/users/symengine/repos","events_url":"https://api.github.com/users/symengine/events{/privacy}","received_events_url":"https://api.github.com/users/symengine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symengine/symengine","description":"SymEngine is a fast symbolic manipulation library, written in C++","fork":false,"url":"https://api.github.com/repos/symengine/symengine","forks_url":"https://api.github.com/repos/symengine/symengine/forks","keys_url":"https://api.github.com/repos/symengine/symengine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symengine/symengine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symengine/symengine/teams","hooks_url":"https://api.github.com/repos/symengine/symengine/hooks","issue_events_url":"https://api.github.com/repos/symengine/symengine/issues/events{/number}","events_url":"https://api.github.com/repos/symengine/symengine/events","assignees_url":"https://api.github.com/repos/symengine/symengine/assignees{/user}","branches_url":"https://api.github.com/repos/symengine/symengine/branches{/branch}","tags_url":"https://api.github.com/repos/symengine/symengine/tags","blobs_url":"https://api.github.com/repos/symengine/symengine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symengine/symengine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symengine/symengine/git/refs{/sha}","trees_url":"https://api.github.com/repos/symengine/symengine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symengine/symengine/statuses/{sha}","languages_url":"https://api.github.com/repos/symengine/symengine/languages","stargazers_url":"https://api.github.com/repos/symengine/symengine/stargazers","contributors_url":"https://api.github.com/repos/symengine/symengine/contributors","subscribers_url":"https://api.github.com/repos/symengine/symengine/subscribers","subscription_url":"https://api.github.com/repos/symengine/symengine/subscription","commits_url":"https://api.github.com/repos/symengine/symengine/commits{/sha}","git_commits_url":"https://api.github.com/repos/symengine/symengine/git/commits{/sha}","comments_url":"https://api.github.com/repos/symengine/symengine/comments{/number}","issue_comment_url":"https://api.github.com/repos/symengine/symengine/issues/comments{/number}","contents_url":"https://api.github.com/repos/symengine/symengine/contents/{+path}","compare_url":"https://api.github.com/repos/symengine/symengine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symengine/symengine/merges","archive_url":"https://api.github.com/repos/symengine/symengine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symengine/symengine/downloads","issues_url":"https://api.github.com/repos/symengine/symengine/issues{/number}","pulls_url":"https://api.github.com/repos/symengine/symengine/pulls{/number}","milestones_url":"https://api.github.com/repos/symengine/symengine/milestones{/number}","notifications_url":"https://api.github.com/repos/symengine/symengine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symengine/symengine/labels{/name}","releases_url":"https://api.github.com/repos/symengine/symengine/releases{/id}","deployments_url":"https://api.github.com/repos/symengine/symengine/deployments","created_at":"2008-08-13T18:40:14Z","updated_at":"2016-11-02T19:01:09Z","pushed_at":"2016-11-02T18:58:18Z","git_url":"git://github.com/symengine/symengine.git","ssh_url":"git@github.com:symengine/symengine.git","clone_url":"https://github.com/symengine/symengine.git","svn_url":"https://github.com/symengine/symengine","homepage":"http://sympy.org","size":38050,"stargazers_count":194,"watchers_count":194,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":121,"mirror_url":null,"open_issues_count":106,"forks":121,"open_issues":106,"watchers":194,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symengine/symengine/pulls/1114"},"html":{"href":"https://github.com/symengine/symengine/pull/1114"},"issue":{"href":"https://api.github.com/repos/symengine/symengine/issues/1114"},"comments":{"href":"https://api.github.com/repos/symengine/symengine/issues/1114/comments"},"review_comments":{"href":"https://api.github.com/repos/symengine/symengine/pulls/1114/comments"},"review_comment":{"href":"https://api.github.com/repos/symengine/symengine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symengine/symengine/pulls/1114/commits"},"statuses":{"href":"https://api.github.com/repos/symengine/symengine/statuses/e39340d2633843b4ae489601a726339f1b3bea75"}}}}
{"actor":{"display_login":"isuruf"}}