{"id":1891,"date":"2018-05-21T20:15:51","date_gmt":"2018-05-21T11:15:51","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=1891"},"modified":"2018-05-22T00:11:57","modified_gmt":"2018-05-21T15:11:57","slug":"try-terminal-base-masodon-client-nanotodon","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2018\/05\/21\/try-terminal-base-masodon-client-nanotodon\/","title":{"rendered":"terminal\u3067\u52d5\u4f5c\u3059\u308bMastodon client\u306enanotodon\u3092\u8a66\u3057\u3066\u307f\u305f"},"content":{"rendered":"<p>mikutodon\u3092Debian jessie armhf\u306b\u5165\u308c\u3066\u307f\u305f\uff0eMakefile\u3092\u4fee\u6b63\u3057\u305f\u3089\u52d5\u3044\u305f\u3051\u3069\u6587\u5b57\u5316\u3051\u3059\u308b\uff0e\u3061\u306a\u307f\u306bDebian sid amd64\u3067\u306f\u554f\u984c\u306a\u304f\u52d5\u4f5c\u3057\u305f\uff0e<\/p>\n<ul>\n<li><a href='https:\/\/github.com\/taka-tuos\/nanotodon' title='taka-tuos\/nanotodon: CUI\/C99 mastodon\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3000\u203b\u30b3\u30fc\u30c9\u304c\u30ab\u30aa\u30b9\u3067\u3059'>taka-tuos\/nanotodon: CUI\/C99 mastodon\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3000\u203b\u30b3\u30fc\u30c9\u304c\u30ab\u30aa\u30b9\u3067\u3059<\/a><\/li>\n<\/ul>\n<pre><code class='language-shell' lang='shell'>$ cat \/etc\/debian_version \r\n8.10\r\n$ uname -m\r\narmv7l\r\n<\/code><\/pre>\n<h2>\u30e9\u30a4\u30d6\u30e9\u30ea\u7b49\u5c0e\u5165<\/h2>\n<pre><code class='language-shell' lang='shell'>$ sudo apt install build-essential libcurl4-openssl-dev libjson-c-dev libncurses-dev libncursesw5\r\n$ dpkg-query -W build-essential libcurl4-openssl-dev libjson-c-dev libncurses-dev libncursesw5\r\nbuild-essential 11.7\r\nlibcurl4-openssl-dev:armhf      7.38.0-4+deb8u11\r\nlibjson-c-dev:armhf     0.11-4\r\nlibncurses-dev  \r\nlibncursesw5:armhf      5.9+20140913-1+deb8u2\r\n<\/code><\/pre>\n<p>\uff1c\u8ffd\u8a18\uff1e<br \/>\n\u5165\u3063\u3066\u306a\u3044\u5834\u5408git\u3082\u5fc5\u8981\u3067\u3059\u306d <code>$ sudo apt install git<\/code><br \/>\n\uff1c\uff0f\u8ffd\u8a18\uff1e<\/p>\n<p>source\u5165\u624b<\/p>\n<pre><code class='language-shell' lang='shell'>$ git clone https:\/\/github.com\/taka-tuos\/nanotodon\r\n<\/code><\/pre>\n<h2>make<\/h2>\n<p>\u30b3\u30b1\u305f<\/p>\n<pre><code class='language-makefile' lang='makefile'>$ cd nanotodon\r\n$ make\r\nmake -r nanotodon\r\nmake[1]: Entering directory &#39;\/home\/chip\/src\/nanotodon&#39;\r\ngcc -c -g -o nanotodon.o nanotodon.c\r\nnanotodon.c: In function &#39;stream_event_notify&#39;:\r\nnanotodon.c:110:12: warning: initialization discards &#39;const&#39; qualifier from pointer target type\r\n  char *t = json_object_get_string(notify_type);\r\n            ^\r\nnanotodon.c: At top level:\r\nnanotodon.c:138:6: warning: conflicting types for &#39;stream_event_update&#39;\r\n void stream_event_update(struct json_object *jobj_from_string)\r\n      ^\r\nnanotodon.c:128:3: note: previous implicit declaration of &#39;stream_event_update&#39; was here\r\n   stream_event_update(status);\r\n   ^\r\nnanotodon.c: In function &#39;stream_event_update&#39;:\r\nnanotodon.c:180:14: warning: initialization discards &#39;const&#39; qualifier from pointer target type\r\n  char *src = json_object_get_string(content);\r\n              ^\r\nnanotodon.c:226:3: error: &#39;for&#39; loop initial declarations are only allowed in C99 or C11 mode\r\n   for (int i = 0; i &lt; json_object_array_length(media_attachments); ++i) {\r\n   ^\r\nnanotodon.c:226:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code\r\nnanotodon.c:245:3: error: &#39;for&#39; loop initial declarations are only allowed in C99 or C11 mode\r\n   for(int i = 0; i &lt; term_w - (l + 4); i++) waddstr(scr, &quot; &quot;);\r\n   ^\r\nnanotodon.c: At top level:\r\nnanotodon.c:589:6: warning: conflicting types for &#39;do_htl&#39;\r\n void do_htl()\r\n      ^\r\nnanotodon.c:303:2: note: previous implicit declaration of &#39;do_htl&#39; was here\r\n  do_htl();\r\n  ^\r\nnanotodon.c: In function &#39;do_htl&#39;:\r\nnanotodon.c:618:3: error: &#39;for&#39; loop initial declarations are only allowed in C99 or C11 mode\r\n   for (int i = json_object_array_length(jobj_from_string) - 1; i &gt;= 0; i--) {\r\n   ^\r\nnanotodon.c: In function &#39;main&#39;:\r\nnanotodon.c:751:2: error: &#39;for&#39; loop initial declarations are only allowed in C99 or C11 mode\r\n  for(int i = 0; i &lt; term_w; i++) mvaddch(5, i, &#39;-&#39;);\r\n  ^\r\nnanotodon.c:777:4: error: &#39;for&#39; loop initial declarations are only allowed in C99 or C11 mode\r\n    for(int i = 0; i &lt; term_w; i++) mvaddch(5, i, &#39;-&#39;);\r\n    ^\r\nnanotodon.c:802:3: error: &#39;for&#39; loop initial declarations are only allowed in C99 or C11 mode\r\n   for(int i = 0; i &lt; txt.stringlen; i++) {\r\n   ^\r\nMakefile.in:21: recipe for target &#39;nanotodon.o&#39; failed\r\nmake[1]: *** [nanotodon.o] Error 1\r\nmake[1]: Leaving directory &#39;\/home\/chip\/src\/nanotodon&#39;\r\nMakefile.in:11: recipe for target &#39;default&#39; failed\r\nmake: *** [default] Error 2\r\n<\/code><\/pre>\n<p>Makefile\u3092\u4fee\u6b63\u3057\u305f\u3089\u901a\u3063\u305f<\/p>\n<pre><code class='language-makefile' lang='makefile'>diff --git a\/Makefile b\/Makefile\r\nindex ac1828f..a35ee6a 100644\r\n--- a\/Makefile\r\n+++ b\/Makefile\r\n@@ -1,7 +1,7 @@\r\n TARGET         = nanotodon\r\n OBJS_TARGET    = nanotodon.o\r\n \r\n-CFLAGS = -g\r\n+CFLAGS = -g -std=gnu99\r\n LDFLAGS = \r\n LIBS = -lc -lm -lcurl -ljson-c -lncursesw -lpthread\r\n \r\n<\/code><\/pre>\n<p>\u6587\u5b57\u5316\u3051&gt;&lt;<\/p>\n<p><a data-flickr-embed=\"true\"  href=\"https:\/\/www.flickr.com\/photos\/119142834@N05\/41530745704\/in\/dateposted\/\" title=\"20180521_20:05:50-30304\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm1.staticflickr.com\/829\/41530745704_7515926ff6.jpg\" width=\"500\" height=\"275\" alt=\"20180521_20:05:50-30304\"\/><\/a><\/p>\n<p>Debian sid amd64\u3067\u306fMakefile\u306e\u66f8\u304d\u63db\u3048\u3082\u5fc5\u8981\u306a\u304f\u6587\u5b57\u5316\u3051\u3082\u3057\u306a\u3044\uff0e<\/p>\n<p><a data-flickr-embed=\"true\"  href=\"https:\/\/www.flickr.com\/photos\/119142834@N05\/41350925765\/in\/dateposted\/\" title=\"20180521_20:05:01-31796\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm1.staticflickr.com\/905\/41350925765_3bbca63deb.jpg\" width=\"500\" height=\"274\" alt=\"20180521_20:05:01-31796\"\/><\/a><\/p>\n<pre><code>$ cat \/etc\/debian_version \r\nbuster\/sid\r\n$ uname -m\r\nx86_64\r\n$ dpkg-query -W build-essential libcurl4-openssl-dev libjson-c-dev libncurses-dev libncursesw5\r\nbuild-essential 12.5\r\nlibcurl4-openssl-dev:amd64      7.60.0-1\r\nlibjson-c-dev:amd64     0.12.1-1.3\r\nlibncurses-dev:amd64    6.1+20180210-3\r\nlibncursesw5:amd64      6.1+20180210-3\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>mikutodon\u3092Debian jessie armhf\u306b\u5165\u308c\u3066\u307f\u305f\uff0eMakefile\u3092\u4fee\u6b63\u3057\u305f\u3089\u52d5\u3044\u305f\u3051\u3069\u6587\u5b57\u5316\u3051\u3059\u308b\uff0e\u3061\u306a\u307f\u306bDebian sid amd64\u3067\u306f\u554f\u984c\u306a\u304f\u52d5\u4f5c\u3057\u305f\uff0e taka-tuos\/nanoto [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[7,88,6,199],"tags":[264,333,332],"class_list":["post-1891","post","type-post","status-publish","format-standard","hentry","category-debian-linux","category-jessie-debian-linux","category-linux","category-sid","tag-armhf","tag-mastodon","tag-nanotodon"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/1891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=1891"}],"version-history":[{"count":0,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/1891\/revisions"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=1891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=1891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=1891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}