{"id":4079,"date":"2014-04-19T10:58:15","date_gmt":"2014-04-19T01:58:15","guid":{"rendered":"http:\/\/www.vincentina.net\/?p=4079"},"modified":"2020-02-23T16:32:01","modified_gmt":"2020-02-23T07:32:01","slug":"c%e3%81%a7%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e7%9b%a3%e8%a6%96%e3%81%ae%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%a0%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%88%e3%81%86%e3%80%80%e3%81%9d","status":"publish","type":"post","link":"https:\/\/www.vincentina.net\/?p=4079","title":{"rendered":"C\u3067\u30b5\u30fc\u30d0\u30fc\u76e3\u8996\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\u3000\u305d\u306e1"},"content":{"rendered":"<p><span style=\"color: #ff6600;\">4\/20<\/span> \u3059\u3044\u307e\u305b\u3093\u3001\u53c2\u8003\u30b5\u30a4\u30c8\u304c\u629c\u3051\u3066\u3044\u305f\u306e\u3067\u8ffd\u8a18\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2>\u76db\u5927\u306a\u52d8\u9055\u3044<\/h2>\n<p>\u4eca\u56de\u304b\u3089\u30bf\u30a4\u30c8\u30eb\u901a\u308a\u306e\u4e8b\u3092\u521d\u3081\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002\u601d\u3044\u307e\u3059\u304c\u3001\u307e\u3060\u524d\u6bb5\u968e\u306e\u3068\u3053\u308d\u306b\u3044\u307e\u3059\u3002\u69cb\u60f3\u3092\u7df4\u308a\u306a\u304c\u3089\u4e0b\u5730\u306b\u306a\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u3044\u308b\u3068\u3001\u3042\u308c\uff1f\u3053\u308cfork\u306b\u3059\u308b\u610f\u5473\u306a\u304f\u306a\u3044\u304b\uff1f\u3068\u304b\u3001\u3053\u308c\u305f\u3060\u306e\u30eb\u30fc\u30d7\u3058\u3083\u306a\u3044\u304b\uff1f\u306a\u3069\u306e\u554f\u984c\u306b\u3076\u3061\u5f53\u305f\u3063\u3066\u3001\u307e\u3060\u307e\u3060\u9032\u3081\u3066\u307e\u305b\u3093\u3002<\/p>\n<p>\u305f\u3060<span style=\"font-size: 14pt;\">\u4f5c\u308a\u305f\u3044\u3082\u306e<\/span>\u304c\u3067\u304d\u305f\u306e\u3067\u3001\u524d\u9032\u306f\u3067\u304d\u308b\u3068\u601d\u3046\u306e\u3067\u304c\u3093\u3070\u308b\u3002<\/p>\n<p>\u3063\u3066\u3053\u3068\u3067\u3001\u3084\u306f\u308a\u6bce\u5ea6\u306e\u3054\u3068\u304f\u53c2\u8003\u30b5\u30a4\u30c8\u3092\u6f01\u3063\u3066\u308b\u308f\u3051\u3067\u3059\u304c\u3001\u5b50\u30d7\u30ed\u30bb\u30b9\u306e\u76e3\u8996\u306b\u306f\u30cf\u30c3\u30b7\u30e5\u30c6\u30fc\u30d6\u30eb\u304c\u826f\u3044\u3088\u3068\u3044\u3046\u306e\u3067\u3001\u30cf\u30c3\u30b7\u30e5\u30c6\u30fc\u30d6\u30eb\u3092\u3061\u3087\u3063\u3068\u3055\u308f\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u30cf\u30c3\u30b7\u30e5\u30c6\u30fc\u30d6\u30eb\u3092\u4f7f\u3046\u3068<span style=\"font-size: 12pt;\">\u52b9\u7387\u304c\u3044\u3044<\/span>\u3063\u3066\u3044\u308d\u3093\u306a\u30b5\u30a4\u30c8\u306b\u66f8\u3044\u3066\u3042\u308b\u3093\u3060\u3051\u3069\u3082\u3001\u305f\u3051\u3051\u3093\u306f<span style=\"font-size: 14pt;\">\u30cf\u30c3\u30b7\u30e5\u30c6\u30fc\u30d6\u30eb\uff1d\u30cf\u30c3\u30b7\u30e5\u5024<\/span>\u3068\u601d\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u3066<\/p>\n<p>MD5 cddb2b1673121b9b889f41b0b474c61b\u3000\u2190\u3000\u982d\u306e\u4e2d\u3067\u306f\u3053\u308c\u304c\u51fa\u3066\u3044\u305f\u306e\u3067\u3001<span style=\"font-size: 14pt;\">\u6587\u5b57\u306e\u7f85\u5217\u3092\u4f7f\u3046\u3068\u52b9\u7387\u304c\u3044\u3044<\/span>\u3063\u3066\u306e\u306f<span style=\"font-size: 18pt;\">\u306a\u305c\u306a\u305c\u306a\u30fc\u306b\uff1f<\/span>\u3000\u3060\u3063\u305f\u306e\u3060\u3002<\/p>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3088\u304f\u89e6\u3063\u3066\u307f\u308b\u3068\u3001<span style=\"font-size: 12pt;\">\u9023\u60f3\u914d\u5217\u3060\u3063\u305f\u3002\u30d0\u30ab\u3059\u304e\uff08\u7b11\uff09<\/span><br \/>\nC\u3067\u306f\u9023\u60f3\u914d\u5217\u306f\u4f7f\u3048\u306a\u3044\u306e\u3067\u3001\u9023\u60f3\u914d\u5217\u306e\u52c9\u5f37\u3092\u3057\u305f\u3068\u304d\u306fPHP\u3067\u3084\u3063\u3066\u307f\u305f\u308a\u3057\u3066\u3044\u305f\u3051\u3069\u3001C\u3067\u3082\u4f7f\u3048\u308b\u3088\u3046\u306b\u3067\u304d\u308b\u307f\u305f\u3044\u3002<\/p>\n<p>\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3092\u6d41\u7528\u3057\u3066\u3061\u3087\u3053\u3063\u3068\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u30cf\u30c3\u30b7\u30e5\u306fapr\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u7c21\u5358\u306b\u6d41\u308c\u3092\u63b4\u307f\u305f\u304b\u3063\u305f\u306e\u3067\u4e0a\u304b\u3089\u4e0b\u306b\u3060\u3051\u9032\u3080\u3088\u3046\u306b\u8a18\u8ff0\u3057\u3066\u307e\u3059\u3002<br \/>\n\u3054\u304f\u3054\u304f\u57fa\u672c\u7684\u306a\u9023\u60f3\u914d\u5217\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u30fc\u3059<\/p>\n<pre>#include &lt;stdio.h&gt;\r\n#include &lt;string.h&gt; \/* strcpy( ) strcmp( ) \u306b\u5fc5\u8981 *\/\r\n#include &lt;apr_hash.h&gt;\r\n\r\n\/* INCLUDE: apr_hash.h\r\n * apr_hash_make \/ apr_hash_set \/ apr_hash_get \/\r\n * apr_hash_count \/ apr_hash_first \/ apr_hash_next \/\r\n * apr_hash_this *\/\r\n\r\n\/* \u30cf\u30c3\u30b7\u30e5\u30c6\u30fc\u30d6\u30eb\u306e\u4f8b\r\n * HASHTABLE: apr_hash_make \/ apr_hash_set \/ apr_hash_get \/\r\n * apr_hash_count \/ apr_hash_first \/ apr_hash_next \/ apr_hash_this *\/\r\n\r\nstatic apr_pool_t *pool = NULL;\r\nstatic apr_hash_t *hash = NULL;\r\n\r\nint main(void)\r\n{\r\n \/\/APR\u3092\u521d\u671f\u5316\u3059\u308b\u3002\r\n apr_initialize();\r\n\r\n \/\/\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u3092\u4f5c\u6210\r\n apr_pool_create(&amp;pool, NULL);\r\n\r\n \/\/\u30cf\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3059\u308b\u3002\r\n hash = apr_hash_make(pool);\r\n\r\n \/\/\u8981\u7d20\u3092\u8ffd\u52a0\r\n apr_hash_set(hash, \"\u308a\u3093\u3054\", APR_HASH_KEY_STRING, \"120\u5186\");\r\n apr_hash_set(hash, \"\u3075\u3058\", APR_HASH_KEY_STRING, \"256\u5186\");\r\n apr_hash_set(hash, \"\u3064\u304c\u308b\", APR_HASH_KEY_STRING, \"329\u5186\");\r\n\r\n \/\/\/\/\u30ad\u30fc\u3092\u6307\u5b9a\u3057\u3066\u5185\u5bb9\u3092\u51fa\u529b\r\n printf(\"key = %s val = %s \\n\", \"\u308a\u3093\u3054\", (char*)apr_hash_get(hash, \"\u308a\u3093\u3054\", APR_HASH_KEY_STRING));\r\n\r\n \/\/\u30cf\u30c3\u30b7\u30e5\u306e\u5185\u5bb9\u3092\u51fa\u529b\r\n apr_hash_index_t *hash_index = NULL;\r\n const void *key = NULL;\r\n void *val = NULL;\r\n\r\n printf(\"\u8981\u7d20\u6570[%d]\\n\", apr_hash_count(hash));\r\n\r\n \/\/\u5185\u5bb9\u3092\u51fa\u529b\r\n hash_index = apr_hash_first(pool, hash);\r\n while(hash_index){\r\n apr_hash_this(hash_index, &amp;key, NULL, &amp;val);\r\n printf(\"key = %s, val = %s \\n\", (char*)key, (char*)val);\r\n hash_index = apr_hash_next(hash_index);\r\n }\r\n\r\n \/\/\u8981\u7d20\u3092\u5909\u66f4\u3057\u3066\u307f\u308b\r\n apr_hash_set(hash, \"\u3064\u304c\u308b\", APR_HASH_KEY_STRING, \"790\u5186\");\r\n\r\n \/\/\u51fa\u529b\u3057\u3066\u307f\u308b\r\n printf(\"\u8981\u7d20\u6570[%d]\\n\", apr_hash_count(hash));\r\n\r\n \/\/\u5185\u5bb9\u3092\u51fa\u529b\r\n hash_index = apr_hash_first(pool, hash);\r\n while(hash_index){\r\n apr_hash_this(hash_index, &amp;key, NULL, &amp;val);\r\n printf(\"key = %s, val = %s \\n\", (char*)key, (char*)val);\r\n hash_index = apr_hash_next(hash_index);\r\n }\r\n\r\n \/\/\u8981\u7d20\u3092\u8ffd\u52a0\u3057\u3066\u307f\u308b\r\n apr_hash_set(hash, \"\u307b\u304f\u3068\", APR_HASH_KEY_STRING, \"435\u5186\");\r\n\r\n \/\/\u51fa\u529b\u3057\u3066\u307f\u308b\r\n printf(\"\u8981\u7d20\u6570[%d]\\n\", apr_hash_count(hash));\r\n\r\n \/\/\u5185\u5bb9\u3092\u51fa\u529b\r\n hash_index = apr_hash_first(pool, hash);\r\n while(hash_index){\r\n apr_hash_this(hash_index, &amp;key, NULL, &amp;val);\r\n printf(\"key = %s, val = %s \\n\", (char*)key, (char*)val);\r\n hash_index = apr_hash_next(hash_index);\r\n }\r\n\r\n apr_terminate();\r\n\r\n return 0;\r\n}<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c<\/p>\n<pre># .\/hash_3\r\nkey = \u308a\u3093\u3054 val = 120\u5186\r\n\u8981\u7d20\u6570[3]\r\nkey = \u3075\u3058, val = 256\u5186\r\nkey = \u3064\u304c\u308b, val = 329\u5186\r\nkey = \u308a\u3093\u3054, val = 120\u5186\r\n\u8981\u7d20\u6570[3]\r\nkey = \u3075\u3058, val = 256\u5186\r\nkey = \u3064\u304c\u308b, val = 790\u5186\r\nkey = \u308a\u3093\u3054, val = 120\u5186\r\n\u8981\u7d20\u6570[4]\r\nkey = \u3075\u3058, val = 256\u5186\r\nkey = \u3064\u304c\u308b, val = 790\u5186\r\nkey = \u307b\u304f\u3068, val = 435\u5186\r\nkey = \u308a\u3093\u3054, val = 120\u5186<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u4eca\u56de\u306e\u76e3\u8996\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u308d\u3046\u3068\u601d\u3063\u305f\u7d4c\u7def<\/h2>\n<p>\u8a71\u304c\u5909\u308f\u308a\u307e\u3059\u304c\u3001\u3044\u3064\u3067\u3082\u3069\u3053\u3067\u3082\u30d7\u30ed\u30b0\u30e9\u30e0\u3044\u3058\u308a\u3092\u3059\u308b\u305f\u3081\u306b\u3001\u3042\u3089\u305f\u306bVPS\u30921\u500b\u8ffd\u52a0\u3067\u501f\u308a\u3066\u3060\u3057\u3066OS\u3092FreeBSD\u306b\u3057\u3066\u3044\u305f\u3093\u3060\u3051\u3069\u3001\u4eca\u56de\u306eapr-devel\u304c\u4f7f\u3048\u308b\u72b6\u614b\u306b\u3067\u304d\u306a\u304f\u3066\u3001\u7d50\u5c40\u30ed\u30fc\u30ab\u30eb\u306eCentOS\u3067\u30c6\u30b9\u30c8\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3093\u3067\u3001\u4eca\u56de\u306e\u7d4c\u7def\u3067\u3059\u304c\u4eca\u30b5\u30fc\u30d0\u30fc\u3067\u4f7f\u3063\u3066\u3044\u308b\u81ea\u524d\u306eLoadAverage\u76e3\u8996\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092Daemon\u5316\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3063\u305f\u306e\u304c\u304d\u3063\u304b\u3051\u306a\u3093\u3060\u304c\u3001\u305b\u3063\u304b\u304ffork\u3092\u4f7f\u3046\u3093\u3060\u3063\u305f\u3089\u3001KVM\u3092\u4f7f\u3063\u3066\u8907\u6570\u306eVM\u3092\u898b\u308c\u308b\u3088\u3046\u306b\u3057\u305f\u3089\u304a\u3082\u308d\u3044\u3093\u3058\u3083\u306a\u3044\u304b\u3068\u3001\u306a\u306e\u3067\u81ea\u5b85\u30b5\u30fc\u30d0\u30fc\u306bVPS\u3092\u4f5c\u3063\u3066\u305d\u3053\u3067\u30c6\u30b9\u30c8\u3057\u3088\u3046\u3068\u3044\u3046\u4e8b\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u30ec\u30f3\u30bf\u30ebVPS\u3055\u3088\u306a\u3089\u3002<\/p>\n<p>\u982d\u3067\u306e\u69cb\u60f3\u306e\u6bb5\u968e\u3067\u30a4\u30e1\u30fc\u30b8\u901a\u308a\u306b\u52d5\u3044\u3066\u306a\u3044\u3093\u3067\u3059\u3051\u3069\u3001\u307e\u3041\u304c\u3093\u307e\u308a\u307e\u3059\u3002<br \/>\n\u30c8\u30e9\u30a4\u3059\u308b\u3082\u306e\u304c\u898b\u3064\u304b\u3063\u3066\u3001\u30d6\u30ed\u30b0\u3092\u3084\u308a\u3060\u3057\u305f\u521d\u671f\u306b\u3082\u3069\u3063\u305f\u307f\u305f\u3044\u3067\u306a\u3093\u3060\u304b\u30ef\u30af\u30c6\u30ab\u3067\u3054\u3056\u308b\u3002<\/p>\n<p>\u6614\u4f5c\u3063\u3066\u305fKVM\u6a5f\u306f\u4eca\u306fWindows\u6a5f\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u307e\u3060\u4f5c\u308a\u76f4\u3055\u306a\u3044\u3068\u3044\u304b\u3093\u3002\u3002\u3002<\/p>\n<p>\u53c2\u8003\u30b5\u30a4\u30c8<\/p>\n<p class=\"entry-title\"><a href=\"http:\/\/kurukurupapa.hatenablog.com\/entry\/20080114\/1200289172\" target=\"_blank\" rel=\"noopener noreferrer\">kurukuru-papa\u306e\u30d6\u30ed\u30b0<\/a><a class=\"entry-title-link bookmark\" href=\"http:\/\/kurukurupapa.hatenablog.com\/entry\/20080114\/1200289172\">\u3000\u3000\u30cf\u30c3\u30b7\u30e5\u30c6\u30fc\u30d6\u30eb\u3092\u4f7f\u3063\u3066\u307f\u308b<\/a><br \/>\n<a href=\"http:\/\/yoshifumi.hateblo.jp\/\">yoshifumi1975&#8217;s diary<\/a><a class=\"entry-title-link bookmark\" href=\"http:\/\/yoshifumi.hateblo.jp\/entry\/20090317\/p1\">\u3000\u3000C\u3067\u30cf\u30c3\u30b7\u30e5\u30c6\u30fc\u30d6\u30eb\u3092\u4f7f\u3046\u3068\u304d\u306e\u30e1\u30e2<\/a><\/p>\n<div class='wp_social_bookmarking_light'>        <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.vincentina.net\/?p=4079\" data-text=\"C\u3067\u30b5\u30fc\u30d0\u30fc\u76e3\u8996\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\u3000\u305d\u306e1\" data-via=\"TakekenTw\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>4\/20 \u3059\u3044\u307e\u305b\u3093\u3001\u53c2\u8003\u30b5\u30a4\u30c8\u304c\u629c\u3051\u3066\u3044\u305f\u306e\u3067\u8ffd\u8a18\u3057\u307e\u3057\u305f\u3002 \u76db\u5927\u306a\u52d8\u9055\u3044 \u4eca\u56de\u304b\u3089\u30bf\u30a4\u30c8\u30eb\u901a\u308a\u306e\u4e8b\u3092\u521d\u3081\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002\u601d\u3044\u307e\u3059\u304c\u3001\u307e\u3060\u524d\u6bb5\u968e\u306e\u3068\u3053\u308d\u306b\u3044\u307e\u3059\u3002\u69cb\u60f3\u3092\u7df4\u308a\u306a\u304c\u3089\u4e0b\u5730\u306b\u306a\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u3044\u308b\u3068\u3001 &hellip; <a href=\"https:\/\/www.vincentina.net\/?p=4079\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;C\u3067\u30b5\u30fc\u30d0\u30fc\u76e3\u8996\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\u3000\u305d\u306e1&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[106],"tags":[],"class_list":["post-4079","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/4079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4079"}],"version-history":[{"count":0,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/4079\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}