From e2714122bf99a23977a7b34071f18be1e654a3d3 Mon Sep 17 00:00:00 2001 From: CMonkey <42.codemonkey@gmail.com> Date: Sat, 1 Jun 2013 23:41:34 +0800 Subject: [PATCH] Site updated at 2013-06-01 15:41:34 UTC --- about/index.html | 8 +- atom.xml | 70 +++- blog/2011/07/20/Jekyll/index.html | 8 +- blog/2011/07/20/workers-sadness/index.html | 8 +- .../07/21/solaris-vbox4.10-error/index.html | 8 +- blog/2011/07/23/lucifer-effect/index.html | 8 +- blog/2011/07/24/ruby-index-pack/index.html | 8 +- blog/2011/07/25/onkind-sound/index.html | 8 +- blog/2011/07/31/elegy-723/index.html | 8 +- .../2011/08/01/form-feynman-to-723/index.html | 8 +- blog/2011/08/01/horse/index.html | 8 +- .../08/01/there-is-unspeakable/index.html | 8 +- blog/2011/08/03/lsof/index.html | 8 +- .../index.html | 8 +- blog/2011/08/05/seven-weapons/index.html | 8 +- .../08/11/norwegian-youth-slip/index.html | 8 +- blog/2011/08/13/blue-wizard-phd/index.html | 8 +- .../08/13/blue-wizard-programmer/index.html | 8 +- blog/2011/08/28/storm/index.html | 8 +- blog/2011/09/03/faster-horses/index.html | 8 +- blog/2011/09/17/wait/index.html | 8 +- blog/2011/09/18/evil-child/index.html | 8 +- blog/2011/09/23/man-manpath/index.html | 8 +- blog/2011/09/23/sex-slaves-2/index.html | 8 +- blog/2011/09/23/sex-slaves/index.html | 8 +- blog/2011/09/26/anonymous/index.html | 8 +- .../index.html | 8 +- blog/2011/09/26/successors/index.html | 8 +- .../scavare-pits-sostegno-schiavo/index.html | 8 +- .../09/28/sesso-schiavi-disturbato/index.html | 8 +- .../10/01/complie-tmux-on-solaris/index.html | 8 +- .../index.html | 8 +- .../10/07/clina-grande-carestia/index.html | 8 +- .../commemorare-rivoluzione-secolo/index.html | 8 +- blog/2011/10/13/nb/index.html | 8 +- blog/2011/10/29/archlinux-error/index.html | 8 +- blog/2011/10/31/apple-jobs/index.html | 8 +- blog/2011/11/04/superstition/index.html | 8 +- blog/2011/11/17/lunchfree/index.html | 8 +- blog/2011/11/30/poem/index.html | 8 +- blog/2011/12/01/poem/index.html | 8 +- blog/2011/12/02/friendly-feelings/index.html | 8 +- blog/2011/12/10/to-salute-free/index.html | 8 +- blog/2011/12/11/everlasting-regret/index.html | 8 +- blog/2011/12/12/imagemagick/index.html | 8 +- .../12/20/solaris-disk-install/index.html | 8 +- blog/2011/12/25/view-room/index.html | 8 +- .../2012/01/18/package-query-error/index.html | 8 +- .../08/charles-john-huffam-dickens/index.html | 8 +- .../02/12/archlinux-gvim-zh-input/index.html | 8 +- blog/2012/02/12/be-time/index.html | 8 +- blog/2012/02/14/neighbor/index.html | 8 +- blog/2012/02/14/squander/index.html | 8 +- .../02/14/stephen-william-hawking/index.html | 8 +- blog/2012/02/15/education/index.html | 8 +- blog/2012/02/15/git-svn/index.html | 8 +- blog/2012/02/18/rvm-install/index.html | 8 +- .../02/24/awesome-monitor-settings/index.html | 8 +- blog/2012/03/09/jdk-remote-debug/index.html | 8 +- blog/2012/03/15/ciminal-law/index.html | 8 +- .../03/24/archlinux-install-pandoc/index.html | 8 +- blog/2012/03/31/scrot/index.html | 8 +- blog/2012/04/01/tig/index.html | 8 +- blog/2012/04/08/update-goagent/index.html | 8 +- blog/2012/04/24/demoittions/index.html | 8 +- blog/2012/05/04/escape/index.html | 8 +- blog/2012/05/19/ate/index.html | 8 +- .../31/how-china-flouts-lts-laws/index.html | 8 +- blog/2012/06/01/14553930/index.html | 8 +- blog/2012/06/07/linux-kill/index.html | 8 +- blog/2012/06/10/firefox-cash/index.html | 8 +- blog/2012/06/10/nerdcommenter/index.html | 8 +- blog/2012/06/16/children/index.html | 8 +- blog/2012/06/20/memSQL/index.html | 8 +- blog/2012/07/04/mingyun/index.html | 8 +- blog/2012/07/11/demote/index.html | 8 +- blog/2012/08/21/jp/index.html | 8 +- .../index.html | 8 +- .../08/22/testing-octopress-img/index.html | 8 +- blog/2012/08/25/car/index.html | 8 +- blog/2012/09/08/tian-shi-ai-mei-li/index.html | 8 +- blog/2012/09/10/huawei/index.html | 8 +- .../complex-systems-equals-fault/index.html | 8 +- blog/2012/10/17/tsung-report/index.html | 8 +- blog/2012/10/22/consumption/index.html | 8 +- blog/2012/10/23/vim-quickfix/index.html | 8 +- blog/2012/10/25/tsung-test-website/index.html | 8 +- blog/2012/10/25/vim-line/index.html | 8 +- .../26/the-year-of-the-stray-dog/index.html | 8 +- blog/2012/10/27/programmer/index.html | 8 +- blog/2012/11/23/schemer/index.html | 8 +- .../2012/11/24/yu-dan-de-xiu-chang/index.html | 8 +- blog/2012/11/29/xin-you-meng-hu/index.html | 8 +- blog/2013/01/25/garbage-collection/index.html | 8 +- blog/2013/01/25/light/index.html | 8 +- blog/2013/01/28/clever-fool/index.html | 8 +- blog/2013/02/06/kernel-sysrq/index.html | 8 +- blog/2013/02/28/0-2-baby/index.html | 8 +- blog/2013/03/14/cat/index.html | 8 +- blog/2013/04/29/call-slash-cc/index.html | 8 +- blog/2013/04/29/fact/index.html | 8 +- blog/2013/04/29/the-croods/index.html | 8 +- blog/2013/04/30/i-love-you/index.html | 8 +- blog/2013/06/01/racket-on-ffi/index.html | 321 ++++++++++++++++++ blog/2013/06/01/slideshow-and-ffi/index.html | 10 +- blog/archives/index.html | 24 +- blog/page/10/index.html | 113 +++--- blog/page/11/index.html | 61 +++- blog/page/2/index.html | 108 +++--- blog/page/3/index.html | 109 +++--- blog/page/4/index.html | 119 +++---- blog/page/5/index.html | 119 ++++--- blog/page/6/index.html | 144 +++----- blog/page/7/index.html | 162 +++++---- blog/page/8/index.html | 116 ++++--- blog/page/9/index.html | 97 +++--- index.html | 148 ++++---- sitemap.xml | 8 +- 118 files changed, 1510 insertions(+), 1035 deletions(-) create mode 100644 blog/2013/06/01/racket-on-ffi/index.html diff --git a/about/index.html b/about/index.html index 998383e74..ea529ac6b 100644 --- a/about/index.html +++ b/about/index.html @@ -161,6 +161,10 @@

Comments

Recent Posts

diff --git a/atom.xml b/atom.xml index 889032d53..cda7279e8 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@ <![CDATA[]]> - 2013-06-01T22:56:34+08:00 + 2013-06-01T23:41:18+08:00 http://cmonkey.github.com/ @@ -13,6 +13,60 @@ Octopress + + <![CDATA[Racket on ffi]]> + + 2013-06-01T23:28:00+08:00 + http://cmonkey.github.com/blog/2013/06/01/racket-on-ffi + link:The Racke tForeign-Function Interface

+ +
// mylib1.c
+#include <stdio.h>
+#include <stdlib.h>
+
+
+// Square an integer
+int isquare (int i){
+    return i * i;
+}
+
+ +

command 中执行:

+ +
gcc --shared -o mylib1.so mylib1.c
+
+ +

mylib.rkt

+ +
#lang racket
+
+(require ffi/unsafe
+ffi/unsafe/define)
+
+(define-ffi-definer mylib-define (ffi-lib "mylib1"))
+(mylib-define isquare (_fun _int -> _int))
+
+(isquare 5)
+
+ +

mylib1.rkt

+ +
#lang racket
+(require ffi/unsafe)
+
+(define mylib (ffi-lib "mylib1.so"))
+
+
+(define isquare
+(get-ffi-obj "isquare"
+        mylib 
+        (_fun _int -> _int)))
+
+(isquare 1000)
+
+]]>
+
+ <![CDATA[slideshow and ffi]]> @@ -1092,20 +1146,6 @@ $代表一行的结尾处 -]]> - - - - <![CDATA[陈志武:金融危机之下,美国消费方式会改变吗]]> - - 2012-10-22T09:23:00+08:00 - http://cmonkey.github.com/blog/2012/10/22/consumption - link: 陈志武:金融危机之下,美国消费方式会改变吗

- -

你家乡的人好像没有什么基本生存和简单精神空间之外的世界,他们清早起来去为生存而生产,忙碌一天下来,吃过饭,到晚上很早又睡觉,他们自己这一代如此,到了下一代还是重复着如此,生存就是为了能多工作一天,多工作一天就是为了简单地多生存一天,每天这样重复,每代这样重复。

- - - ]]>
diff --git a/blog/2011/07/20/Jekyll/index.html b/blog/2011/07/20/Jekyll/index.html index 9c1a298f3..07ff1ba43 100644 --- a/blog/2011/07/20/Jekyll/index.html +++ b/blog/2011/07/20/Jekyll/index.html @@ -205,6 +205,10 @@

Comments

Recent Posts

diff --git a/blog/2011/07/20/workers-sadness/index.html b/blog/2011/07/20/workers-sadness/index.html index 0f776b705..6b366550b 100644 --- a/blog/2011/07/20/workers-sadness/index.html +++ b/blog/2011/07/20/workers-sadness/index.html @@ -200,6 +200,10 @@

Comments

Recent Posts

diff --git a/blog/2011/07/21/solaris-vbox4.10-error/index.html b/blog/2011/07/21/solaris-vbox4.10-error/index.html index 358d523f7..96c51b605 100644 --- a/blog/2011/07/21/solaris-vbox4.10-error/index.html +++ b/blog/2011/07/21/solaris-vbox4.10-error/index.html @@ -179,6 +179,10 @@

Comments

Recent Posts

diff --git a/blog/2011/07/23/lucifer-effect/index.html b/blog/2011/07/23/lucifer-effect/index.html index 96c17e8ba..bf642e8f7 100644 --- a/blog/2011/07/23/lucifer-effect/index.html +++ b/blog/2011/07/23/lucifer-effect/index.html @@ -294,6 +294,10 @@

Comments

Recent Posts

diff --git a/blog/2011/07/24/ruby-index-pack/index.html b/blog/2011/07/24/ruby-index-pack/index.html index fb65ebf5f..bec8795ae 100644 --- a/blog/2011/07/24/ruby-index-pack/index.html +++ b/blog/2011/07/24/ruby-index-pack/index.html @@ -174,6 +174,10 @@

Comments

Recent Posts

diff --git a/blog/2011/07/25/onkind-sound/index.html b/blog/2011/07/25/onkind-sound/index.html index e4f4f56dc..22982b5f0 100644 --- a/blog/2011/07/25/onkind-sound/index.html +++ b/blog/2011/07/25/onkind-sound/index.html @@ -204,6 +204,10 @@

Comments

Recent Posts

diff --git a/blog/2011/07/31/elegy-723/index.html b/blog/2011/07/31/elegy-723/index.html index 44ea4af8d..1e1b14e19 100644 --- a/blog/2011/07/31/elegy-723/index.html +++ b/blog/2011/07/31/elegy-723/index.html @@ -192,6 +192,10 @@

Comments

Recent Posts

diff --git a/blog/2011/08/01/form-feynman-to-723/index.html b/blog/2011/08/01/form-feynman-to-723/index.html index 8b55ba643..c4b90aae6 100644 --- a/blog/2011/08/01/form-feynman-to-723/index.html +++ b/blog/2011/08/01/form-feynman-to-723/index.html @@ -234,6 +234,10 @@

Comments

Recent Posts

diff --git a/blog/2011/08/01/horse/index.html b/blog/2011/08/01/horse/index.html index 88c14bd79..fb94a1622 100644 --- a/blog/2011/08/01/horse/index.html +++ b/blog/2011/08/01/horse/index.html @@ -180,6 +180,10 @@

Comments

Recent Posts

diff --git a/blog/2011/08/01/there-is-unspeakable/index.html b/blog/2011/08/01/there-is-unspeakable/index.html index 14c560169..2c5a09651 100644 --- a/blog/2011/08/01/there-is-unspeakable/index.html +++ b/blog/2011/08/01/there-is-unspeakable/index.html @@ -169,6 +169,10 @@

Comments

Recent Posts

diff --git a/blog/2011/08/03/lsof/index.html b/blog/2011/08/03/lsof/index.html index e3d4d6ccf..dae06c927 100644 --- a/blog/2011/08/03/lsof/index.html +++ b/blog/2011/08/03/lsof/index.html @@ -425,6 +425,10 @@

Comments

Recent Posts

diff --git a/blog/2011/08/03/three-body-series-climax-over-and-over-eternal-life/index.html b/blog/2011/08/03/three-body-series-climax-over-and-over-eternal-life/index.html index ccd9da0f7..673c4ad26 100644 --- a/blog/2011/08/03/three-body-series-climax-over-and-over-eternal-life/index.html +++ b/blog/2011/08/03/three-body-series-climax-over-and-over-eternal-life/index.html @@ -224,6 +224,10 @@

Comments

Recent Posts

diff --git a/blog/2011/08/05/seven-weapons/index.html b/blog/2011/08/05/seven-weapons/index.html index 585e9a699..62c886011 100644 --- a/blog/2011/08/05/seven-weapons/index.html +++ b/blog/2011/08/05/seven-weapons/index.html @@ -180,6 +180,10 @@

Comments

Recent Posts

diff --git a/blog/2011/08/11/norwegian-youth-slip/index.html b/blog/2011/08/11/norwegian-youth-slip/index.html index 725b25f57..2ca3449a4 100644 --- a/blog/2011/08/11/norwegian-youth-slip/index.html +++ b/blog/2011/08/11/norwegian-youth-slip/index.html @@ -201,6 +201,10 @@

Comments

Recent Posts

diff --git a/blog/2011/08/13/blue-wizard-phd/index.html b/blog/2011/08/13/blue-wizard-phd/index.html index 9db24d582..c7be4c89f 100644 --- a/blog/2011/08/13/blue-wizard-phd/index.html +++ b/blog/2011/08/13/blue-wizard-phd/index.html @@ -167,6 +167,10 @@

Comments

Recent Posts

diff --git a/blog/2011/08/13/blue-wizard-programmer/index.html b/blog/2011/08/13/blue-wizard-programmer/index.html index aae94b32d..27ee61606 100644 --- a/blog/2011/08/13/blue-wizard-programmer/index.html +++ b/blog/2011/08/13/blue-wizard-programmer/index.html @@ -171,6 +171,10 @@

Comments

Recent Posts

diff --git a/blog/2011/08/28/storm/index.html b/blog/2011/08/28/storm/index.html index 9dd7601fc..ed86abd08 100644 --- a/blog/2011/08/28/storm/index.html +++ b/blog/2011/08/28/storm/index.html @@ -169,6 +169,10 @@

Comments

Recent Posts

diff --git a/blog/2011/09/03/faster-horses/index.html b/blog/2011/09/03/faster-horses/index.html index 14d7448f5..9acd01040 100644 --- a/blog/2011/09/03/faster-horses/index.html +++ b/blog/2011/09/03/faster-horses/index.html @@ -169,6 +169,10 @@

Comments

Recent Posts

diff --git a/blog/2011/09/17/wait/index.html b/blog/2011/09/17/wait/index.html index 051141459..0eb7d9ea6 100644 --- a/blog/2011/09/17/wait/index.html +++ b/blog/2011/09/17/wait/index.html @@ -169,6 +169,10 @@

Comments

Recent Posts

diff --git a/blog/2011/09/18/evil-child/index.html b/blog/2011/09/18/evil-child/index.html index c55e943f0..2fed7a11b 100644 --- a/blog/2011/09/18/evil-child/index.html +++ b/blog/2011/09/18/evil-child/index.html @@ -169,6 +169,10 @@

Comments

Recent Posts

diff --git a/blog/2011/09/23/man-manpath/index.html b/blog/2011/09/23/man-manpath/index.html index d9bb501d5..da7df4f82 100644 --- a/blog/2011/09/23/man-manpath/index.html +++ b/blog/2011/09/23/man-manpath/index.html @@ -194,6 +194,10 @@

Comments

Recent Posts

diff --git a/blog/2011/09/23/sex-slaves-2/index.html b/blog/2011/09/23/sex-slaves-2/index.html index 634de9255..8e12bd0a5 100644 --- a/blog/2011/09/23/sex-slaves-2/index.html +++ b/blog/2011/09/23/sex-slaves-2/index.html @@ -169,6 +169,10 @@

Comments

Recent Posts

diff --git a/blog/2011/09/23/sex-slaves/index.html b/blog/2011/09/23/sex-slaves/index.html index c27082117..36d78ea52 100644 --- a/blog/2011/09/23/sex-slaves/index.html +++ b/blog/2011/09/23/sex-slaves/index.html @@ -208,6 +208,10 @@

Comments

Recent Posts

diff --git a/blog/2011/09/26/anonymous/index.html b/blog/2011/09/26/anonymous/index.html index b38da1713..8d3d61e76 100644 --- a/blog/2011/09/26/anonymous/index.html +++ b/blog/2011/09/26/anonymous/index.html @@ -166,6 +166,10 @@

Comments

Recent Posts

diff --git a/blog/2011/09/26/sesso-schiavi-etica-riflessione/index.html b/blog/2011/09/26/sesso-schiavi-etica-riflessione/index.html index 39f163936..1b55ae645 100644 --- a/blog/2011/09/26/sesso-schiavi-etica-riflessione/index.html +++ b/blog/2011/09/26/sesso-schiavi-etica-riflessione/index.html @@ -196,6 +196,10 @@

Comments

Recent Posts

diff --git a/blog/2011/09/26/successors/index.html b/blog/2011/09/26/successors/index.html index 193a55e9d..ecf6e689a 100644 --- a/blog/2011/09/26/successors/index.html +++ b/blog/2011/09/26/successors/index.html @@ -166,6 +166,10 @@

Comments

Recent Posts

diff --git a/blog/2011/09/27/scavare-pits-sostegno-schiavo/index.html b/blog/2011/09/27/scavare-pits-sostegno-schiavo/index.html index a60451daf..242b06d8d 100644 --- a/blog/2011/09/27/scavare-pits-sostegno-schiavo/index.html +++ b/blog/2011/09/27/scavare-pits-sostegno-schiavo/index.html @@ -242,6 +242,10 @@

Comments

Recent Posts

diff --git a/blog/2011/09/28/sesso-schiavi-disturbato/index.html b/blog/2011/09/28/sesso-schiavi-disturbato/index.html index 3c5bfff73..7aee84df9 100644 --- a/blog/2011/09/28/sesso-schiavi-disturbato/index.html +++ b/blog/2011/09/28/sesso-schiavi-disturbato/index.html @@ -206,6 +206,10 @@

Comments

Recent Posts

diff --git a/blog/2011/10/01/complie-tmux-on-solaris/index.html b/blog/2011/10/01/complie-tmux-on-solaris/index.html index 2c415031a..2e09a14ed 100644 --- a/blog/2011/10/01/complie-tmux-on-solaris/index.html +++ b/blog/2011/10/01/complie-tmux-on-solaris/index.html @@ -226,6 +226,10 @@

Comments

Recent Posts

diff --git a/blog/2011/10/05/Installing-Locale-in-Solaris-10/index.html b/blog/2011/10/05/Installing-Locale-in-Solaris-10/index.html index 19ecf124b..f22496f06 100644 --- a/blog/2011/10/05/Installing-Locale-in-Solaris-10/index.html +++ b/blog/2011/10/05/Installing-Locale-in-Solaris-10/index.html @@ -294,6 +294,10 @@

Comments

Recent Posts

diff --git a/blog/2011/10/07/clina-grande-carestia/index.html b/blog/2011/10/07/clina-grande-carestia/index.html index df82e8327..5f7c8e661 100644 --- a/blog/2011/10/07/clina-grande-carestia/index.html +++ b/blog/2011/10/07/clina-grande-carestia/index.html @@ -218,6 +218,10 @@

Comments

Recent Posts

diff --git a/blog/2011/10/10/commemorare-rivoluzione-secolo/index.html b/blog/2011/10/10/commemorare-rivoluzione-secolo/index.html index d09ff90b7..d1399dd49 100644 --- a/blog/2011/10/10/commemorare-rivoluzione-secolo/index.html +++ b/blog/2011/10/10/commemorare-rivoluzione-secolo/index.html @@ -166,6 +166,10 @@

纪念辛亥革命百年

Recent Posts

diff --git a/blog/2011/10/13/nb/index.html b/blog/2011/10/13/nb/index.html index 41ad51880..3e50db87f 100644 --- a/blog/2011/10/13/nb/index.html +++ b/blog/2011/10/13/nb/index.html @@ -270,6 +270,10 @@

Comments

Recent Posts

diff --git a/blog/2011/10/29/archlinux-error/index.html b/blog/2011/10/29/archlinux-error/index.html index f1c6e9c95..05b40436a 100644 --- a/blog/2011/10/29/archlinux-error/index.html +++ b/blog/2011/10/29/archlinux-error/index.html @@ -179,6 +179,10 @@

Comments

Recent Posts

diff --git a/blog/2011/10/31/apple-jobs/index.html b/blog/2011/10/31/apple-jobs/index.html index f576a5e8e..364ae5d95 100644 --- a/blog/2011/10/31/apple-jobs/index.html +++ b/blog/2011/10/31/apple-jobs/index.html @@ -196,6 +196,10 @@

Comments

Recent Posts

diff --git a/blog/2011/11/04/superstition/index.html b/blog/2011/11/04/superstition/index.html index f0f60e2ea..925c2df39 100644 --- a/blog/2011/11/04/superstition/index.html +++ b/blog/2011/11/04/superstition/index.html @@ -290,6 +290,10 @@

Comments

Recent Posts

diff --git a/blog/2011/11/17/lunchfree/index.html b/blog/2011/11/17/lunchfree/index.html index fdfc62206..ed8e369ba 100644 --- a/blog/2011/11/17/lunchfree/index.html +++ b/blog/2011/11/17/lunchfree/index.html @@ -210,6 +210,10 @@

Comments

Recent Posts

diff --git a/blog/2011/11/30/poem/index.html b/blog/2011/11/30/poem/index.html index 05c372f3f..6c2d39fc6 100644 --- a/blog/2011/11/30/poem/index.html +++ b/blog/2011/11/30/poem/index.html @@ -183,6 +183,10 @@

Comments

Recent Posts

diff --git a/blog/2011/12/01/poem/index.html b/blog/2011/12/01/poem/index.html index fd3bca626..548c31963 100644 --- a/blog/2011/12/01/poem/index.html +++ b/blog/2011/12/01/poem/index.html @@ -170,6 +170,10 @@

Comments

Recent Posts

diff --git a/blog/2011/12/02/friendly-feelings/index.html b/blog/2011/12/02/friendly-feelings/index.html index 5472aef80..cda816273 100644 --- a/blog/2011/12/02/friendly-feelings/index.html +++ b/blog/2011/12/02/friendly-feelings/index.html @@ -166,6 +166,10 @@

Comments

Recent Posts

diff --git a/blog/2011/12/10/to-salute-free/index.html b/blog/2011/12/10/to-salute-free/index.html index de93a8905..b7aea829e 100644 --- a/blog/2011/12/10/to-salute-free/index.html +++ b/blog/2011/12/10/to-salute-free/index.html @@ -381,6 +381,10 @@

Comments

Recent Posts

diff --git a/blog/2011/12/11/everlasting-regret/index.html b/blog/2011/12/11/everlasting-regret/index.html index 7de36eabd..863d9b974 100644 --- a/blog/2011/12/11/everlasting-regret/index.html +++ b/blog/2011/12/11/everlasting-regret/index.html @@ -207,6 +207,10 @@

Comments

Recent Posts

diff --git a/blog/2011/12/12/imagemagick/index.html b/blog/2011/12/12/imagemagick/index.html index 1fcc4c76d..2242a70d7 100644 --- a/blog/2011/12/12/imagemagick/index.html +++ b/blog/2011/12/12/imagemagick/index.html @@ -344,6 +344,10 @@

Comments

Recent Posts

diff --git a/blog/2011/12/20/solaris-disk-install/index.html b/blog/2011/12/20/solaris-disk-install/index.html index a3812b115..602da25ed 100644 --- a/blog/2011/12/20/solaris-disk-install/index.html +++ b/blog/2011/12/20/solaris-disk-install/index.html @@ -221,6 +221,10 @@

Comments

Recent Posts

diff --git a/blog/2011/12/25/view-room/index.html b/blog/2011/12/25/view-room/index.html index 5a0e31e4b..ead13ea96 100644 --- a/blog/2011/12/25/view-room/index.html +++ b/blog/2011/12/25/view-room/index.html @@ -187,6 +187,10 @@

Comments

Recent Posts

diff --git a/blog/2012/01/18/package-query-error/index.html b/blog/2012/01/18/package-query-error/index.html index ad5322f49..86e5f61d7 100644 --- a/blog/2012/01/18/package-query-error/index.html +++ b/blog/2012/01/18/package-query-error/index.html @@ -231,6 +231,10 @@

Comments

Recent Posts

diff --git a/blog/2012/02/08/charles-john-huffam-dickens/index.html b/blog/2012/02/08/charles-john-huffam-dickens/index.html index 8ac540048..23ba4c5e6 100644 --- a/blog/2012/02/08/charles-john-huffam-dickens/index.html +++ b/blog/2012/02/08/charles-john-huffam-dickens/index.html @@ -168,6 +168,10 @@

Comments

Recent Posts

diff --git a/blog/2012/02/12/archlinux-gvim-zh-input/index.html b/blog/2012/02/12/archlinux-gvim-zh-input/index.html index dff9db1dd..c3eb4dfc8 100644 --- a/blog/2012/02/12/archlinux-gvim-zh-input/index.html +++ b/blog/2012/02/12/archlinux-gvim-zh-input/index.html @@ -190,6 +190,10 @@

Comments

Recent Posts

diff --git a/blog/2012/02/12/be-time/index.html b/blog/2012/02/12/be-time/index.html index 1215e321c..171ca5d68 100644 --- a/blog/2012/02/12/be-time/index.html +++ b/blog/2012/02/12/be-time/index.html @@ -190,6 +190,10 @@

Comments

Recent Posts

diff --git a/blog/2012/02/14/neighbor/index.html b/blog/2012/02/14/neighbor/index.html index 478d55331..2a1c27509 100644 --- a/blog/2012/02/14/neighbor/index.html +++ b/blog/2012/02/14/neighbor/index.html @@ -177,6 +177,10 @@

Comments

Recent Posts

diff --git a/blog/2012/02/14/squander/index.html b/blog/2012/02/14/squander/index.html index 9e7f498b9..e280afc7f 100644 --- a/blog/2012/02/14/squander/index.html +++ b/blog/2012/02/14/squander/index.html @@ -201,6 +201,10 @@

Comments

Recent Posts

diff --git a/blog/2012/02/14/stephen-william-hawking/index.html b/blog/2012/02/14/stephen-william-hawking/index.html index db18be9bb..ee12c6e37 100644 --- a/blog/2012/02/14/stephen-william-hawking/index.html +++ b/blog/2012/02/14/stephen-william-hawking/index.html @@ -223,6 +223,10 @@

Comments

Recent Posts

diff --git a/blog/2012/02/15/education/index.html b/blog/2012/02/15/education/index.html index 502f61a6f..81cc06611 100644 --- a/blog/2012/02/15/education/index.html +++ b/blog/2012/02/15/education/index.html @@ -183,6 +183,10 @@

Comments

Recent Posts

diff --git a/blog/2012/02/15/git-svn/index.html b/blog/2012/02/15/git-svn/index.html index 4552d1662..1c14ca2b7 100644 --- a/blog/2012/02/15/git-svn/index.html +++ b/blog/2012/02/15/git-svn/index.html @@ -221,6 +221,10 @@

Comments

Recent Posts

diff --git a/blog/2012/02/18/rvm-install/index.html b/blog/2012/02/18/rvm-install/index.html index e104b1a59..f8adff01c 100644 --- a/blog/2012/02/18/rvm-install/index.html +++ b/blog/2012/02/18/rvm-install/index.html @@ -214,6 +214,10 @@

Comments

Recent Posts

diff --git a/blog/2012/02/24/awesome-monitor-settings/index.html b/blog/2012/02/24/awesome-monitor-settings/index.html index 5b1d26246..dee6f5132 100644 --- a/blog/2012/02/24/awesome-monitor-settings/index.html +++ b/blog/2012/02/24/awesome-monitor-settings/index.html @@ -250,6 +250,10 @@

Comments

Recent Posts

diff --git a/blog/2012/03/09/jdk-remote-debug/index.html b/blog/2012/03/09/jdk-remote-debug/index.html index f38edc2aa..455a4b5a2 100644 --- a/blog/2012/03/09/jdk-remote-debug/index.html +++ b/blog/2012/03/09/jdk-remote-debug/index.html @@ -208,6 +208,10 @@

Comments

Recent Posts

diff --git a/blog/2012/03/15/ciminal-law/index.html b/blog/2012/03/15/ciminal-law/index.html index f13cc6d33..99b274098 100644 --- a/blog/2012/03/15/ciminal-law/index.html +++ b/blog/2012/03/15/ciminal-law/index.html @@ -175,6 +175,10 @@

Comments

Recent Posts

diff --git a/blog/2012/03/24/archlinux-install-pandoc/index.html b/blog/2012/03/24/archlinux-install-pandoc/index.html index e6b48e5d0..6b7cea260 100644 --- a/blog/2012/03/24/archlinux-install-pandoc/index.html +++ b/blog/2012/03/24/archlinux-install-pandoc/index.html @@ -188,6 +188,10 @@

Comments

Recent Posts

diff --git a/blog/2012/03/31/scrot/index.html b/blog/2012/03/31/scrot/index.html index dbbc6bbee..3ff182ddb 100644 --- a/blog/2012/03/31/scrot/index.html +++ b/blog/2012/03/31/scrot/index.html @@ -209,6 +209,10 @@

Comments

Recent Posts

diff --git a/blog/2012/04/01/tig/index.html b/blog/2012/04/01/tig/index.html index 3af82c135..b498e3e03 100644 --- a/blog/2012/04/01/tig/index.html +++ b/blog/2012/04/01/tig/index.html @@ -183,6 +183,10 @@

Comments

Recent Posts

diff --git a/blog/2012/04/08/update-goagent/index.html b/blog/2012/04/08/update-goagent/index.html index dbf50ec89..d93ad589c 100644 --- a/blog/2012/04/08/update-goagent/index.html +++ b/blog/2012/04/08/update-goagent/index.html @@ -189,6 +189,10 @@

Comments

Recent Posts

diff --git a/blog/2012/04/24/demoittions/index.html b/blog/2012/04/24/demoittions/index.html index 5597b27ce..0f9300132 100644 --- a/blog/2012/04/24/demoittions/index.html +++ b/blog/2012/04/24/demoittions/index.html @@ -193,6 +193,10 @@

Comments

Recent Posts

diff --git a/blog/2012/05/04/escape/index.html b/blog/2012/05/04/escape/index.html index b03a37a2d..f77ff75ce 100644 --- a/blog/2012/05/04/escape/index.html +++ b/blog/2012/05/04/escape/index.html @@ -221,6 +221,10 @@

Comments

Recent Posts

diff --git a/blog/2012/05/19/ate/index.html b/blog/2012/05/19/ate/index.html index b43437fdb..3857a58d5 100644 --- a/blog/2012/05/19/ate/index.html +++ b/blog/2012/05/19/ate/index.html @@ -191,6 +191,10 @@

Comments

Recent Posts

diff --git a/blog/2012/05/31/how-china-flouts-lts-laws/index.html b/blog/2012/05/31/how-china-flouts-lts-laws/index.html index 0411fc4c1..8d84a082f 100644 --- a/blog/2012/05/31/how-china-flouts-lts-laws/index.html +++ b/blog/2012/05/31/how-china-flouts-lts-laws/index.html @@ -201,6 +201,10 @@

Comments

Recent Posts

diff --git a/blog/2012/06/01/14553930/index.html b/blog/2012/06/01/14553930/index.html index 1699391cb..0cfeb7adf 100644 --- a/blog/2012/06/01/14553930/index.html +++ b/blog/2012/06/01/14553930/index.html @@ -257,6 +257,10 @@

Comments

Recent Posts

diff --git a/blog/2012/06/07/linux-kill/index.html b/blog/2012/06/07/linux-kill/index.html index fc18da994..7ea8ebf60 100644 --- a/blog/2012/06/07/linux-kill/index.html +++ b/blog/2012/06/07/linux-kill/index.html @@ -353,6 +353,10 @@

Comments

Recent Posts

diff --git a/blog/2012/06/10/firefox-cash/index.html b/blog/2012/06/10/firefox-cash/index.html index 5616187b5..b4be57dde 100644 --- a/blog/2012/06/10/firefox-cash/index.html +++ b/blog/2012/06/10/firefox-cash/index.html @@ -199,6 +199,10 @@

Comments

Recent Posts

diff --git a/blog/2012/06/10/nerdcommenter/index.html b/blog/2012/06/10/nerdcommenter/index.html index 1a324c27d..79b6624e9 100644 --- a/blog/2012/06/10/nerdcommenter/index.html +++ b/blog/2012/06/10/nerdcommenter/index.html @@ -186,6 +186,10 @@

Comments

Recent Posts

diff --git a/blog/2012/06/16/children/index.html b/blog/2012/06/16/children/index.html index 03edfbdc7..d0c915622 100644 --- a/blog/2012/06/16/children/index.html +++ b/blog/2012/06/16/children/index.html @@ -303,6 +303,10 @@

Comments

Recent Posts

diff --git a/blog/2012/06/20/memSQL/index.html b/blog/2012/06/20/memSQL/index.html index a0fc87230..4fd1fa0eb 100644 --- a/blog/2012/06/20/memSQL/index.html +++ b/blog/2012/06/20/memSQL/index.html @@ -198,6 +198,10 @@

Comments

Recent Posts

diff --git a/blog/2012/07/04/mingyun/index.html b/blog/2012/07/04/mingyun/index.html index fd48543bb..61ddc93e4 100644 --- a/blog/2012/07/04/mingyun/index.html +++ b/blog/2012/07/04/mingyun/index.html @@ -195,6 +195,10 @@

Comments

Recent Posts

diff --git a/blog/2012/07/11/demote/index.html b/blog/2012/07/11/demote/index.html index 9d943b6a7..5f083ebd0 100644 --- a/blog/2012/07/11/demote/index.html +++ b/blog/2012/07/11/demote/index.html @@ -223,6 +223,10 @@

Comments

Recent Posts

diff --git a/blog/2012/08/21/jp/index.html b/blog/2012/08/21/jp/index.html index 2ce548370..335b369c8 100644 --- a/blog/2012/08/21/jp/index.html +++ b/blog/2012/08/21/jp/index.html @@ -169,6 +169,10 @@

Comments

Recent Posts

diff --git a/blog/2012/08/22/holiday-is-better-than-chemotherapy/index.html b/blog/2012/08/22/holiday-is-better-than-chemotherapy/index.html index fc839c882..12077bf8b 100644 --- a/blog/2012/08/22/holiday-is-better-than-chemotherapy/index.html +++ b/blog/2012/08/22/holiday-is-better-than-chemotherapy/index.html @@ -251,6 +251,10 @@

Comments

Recent Posts

diff --git a/blog/2012/08/22/testing-octopress-img/index.html b/blog/2012/08/22/testing-octopress-img/index.html index 602340be8..203818f99 100644 --- a/blog/2012/08/22/testing-octopress-img/index.html +++ b/blog/2012/08/22/testing-octopress-img/index.html @@ -169,6 +169,10 @@

Comments

Recent Posts

diff --git a/blog/2012/08/25/car/index.html b/blog/2012/08/25/car/index.html index 40b269f01..96e28d17e 100644 --- a/blog/2012/08/25/car/index.html +++ b/blog/2012/08/25/car/index.html @@ -449,6 +449,10 @@

Comments

Recent Posts

diff --git a/blog/2012/09/08/tian-shi-ai-mei-li/index.html b/blog/2012/09/08/tian-shi-ai-mei-li/index.html index cc373f112..77a662735 100644 --- a/blog/2012/09/08/tian-shi-ai-mei-li/index.html +++ b/blog/2012/09/08/tian-shi-ai-mei-li/index.html @@ -167,6 +167,10 @@

Comments

Recent Posts

diff --git a/blog/2012/09/10/huawei/index.html b/blog/2012/09/10/huawei/index.html index f7cde2ef0..5f5593d12 100644 --- a/blog/2012/09/10/huawei/index.html +++ b/blog/2012/09/10/huawei/index.html @@ -286,6 +286,10 @@

Comments

Recent Posts

diff --git a/blog/2012/09/17/complex-systems-equals-fault/index.html b/blog/2012/09/17/complex-systems-equals-fault/index.html index 1e1b559d3..e1f62c455 100644 --- a/blog/2012/09/17/complex-systems-equals-fault/index.html +++ b/blog/2012/09/17/complex-systems-equals-fault/index.html @@ -241,6 +241,10 @@

Comments

Recent Posts

diff --git a/blog/2012/10/17/tsung-report/index.html b/blog/2012/10/17/tsung-report/index.html index b1a8c8f30..196d5f556 100644 --- a/blog/2012/10/17/tsung-report/index.html +++ b/blog/2012/10/17/tsung-report/index.html @@ -185,6 +185,10 @@

Comments

Recent Posts

diff --git a/blog/2012/10/22/consumption/index.html b/blog/2012/10/22/consumption/index.html index e4f9f5856..e6972c2da 100644 --- a/blog/2012/10/22/consumption/index.html +++ b/blog/2012/10/22/consumption/index.html @@ -171,6 +171,10 @@

Comments

Recent Posts

diff --git a/blog/2012/10/23/vim-quickfix/index.html b/blog/2012/10/23/vim-quickfix/index.html index d326758e5..7e769024f 100644 --- a/blog/2012/10/23/vim-quickfix/index.html +++ b/blog/2012/10/23/vim-quickfix/index.html @@ -177,6 +177,10 @@

Comments

Recent Posts

diff --git a/blog/2012/10/25/tsung-test-website/index.html b/blog/2012/10/25/tsung-test-website/index.html index c0d5a3a79..49d0b5dc7 100644 --- a/blog/2012/10/25/tsung-test-website/index.html +++ b/blog/2012/10/25/tsung-test-website/index.html @@ -212,6 +212,10 @@

Comments

Recent Posts

diff --git a/blog/2012/10/25/vim-line/index.html b/blog/2012/10/25/vim-line/index.html index 1bf25529d..5e35da999 100644 --- a/blog/2012/10/25/vim-line/index.html +++ b/blog/2012/10/25/vim-line/index.html @@ -187,6 +187,10 @@

Comments

Recent Posts

diff --git a/blog/2012/10/26/the-year-of-the-stray-dog/index.html b/blog/2012/10/26/the-year-of-the-stray-dog/index.html index 80f6e99b5..5fd9732a5 100644 --- a/blog/2012/10/26/the-year-of-the-stray-dog/index.html +++ b/blog/2012/10/26/the-year-of-the-stray-dog/index.html @@ -231,6 +231,10 @@

Comments

Recent Posts

diff --git a/blog/2012/10/27/programmer/index.html b/blog/2012/10/27/programmer/index.html index 6540d3567..d61917465 100644 --- a/blog/2012/10/27/programmer/index.html +++ b/blog/2012/10/27/programmer/index.html @@ -218,6 +218,10 @@

Comments

Recent Posts

diff --git a/blog/2012/11/23/schemer/index.html b/blog/2012/11/23/schemer/index.html index 95998a623..098d3c4ed 100644 --- a/blog/2012/11/23/schemer/index.html +++ b/blog/2012/11/23/schemer/index.html @@ -207,6 +207,10 @@

Comments

Recent Posts

diff --git a/blog/2012/11/24/yu-dan-de-xiu-chang/index.html b/blog/2012/11/24/yu-dan-de-xiu-chang/index.html index 4e12edca0..d2f6e0b85 100644 --- a/blog/2012/11/24/yu-dan-de-xiu-chang/index.html +++ b/blog/2012/11/24/yu-dan-de-xiu-chang/index.html @@ -209,6 +209,10 @@

Comments

Recent Posts

diff --git a/blog/2012/11/29/xin-you-meng-hu/index.html b/blog/2012/11/29/xin-you-meng-hu/index.html index 727cbe69b..0b49a04b9 100644 --- a/blog/2012/11/29/xin-you-meng-hu/index.html +++ b/blog/2012/11/29/xin-you-meng-hu/index.html @@ -167,6 +167,10 @@

Comments

Recent Posts

diff --git a/blog/2013/01/25/garbage-collection/index.html b/blog/2013/01/25/garbage-collection/index.html index 5791da9e4..dd5cbf270 100644 --- a/blog/2013/01/25/garbage-collection/index.html +++ b/blog/2013/01/25/garbage-collection/index.html @@ -230,6 +230,10 @@

Comments

Recent Posts

diff --git a/blog/2013/01/25/light/index.html b/blog/2013/01/25/light/index.html index a92358e0c..5466ff5ff 100644 --- a/blog/2013/01/25/light/index.html +++ b/blog/2013/01/25/light/index.html @@ -194,6 +194,10 @@

Comments

Recent Posts

diff --git a/blog/2013/01/28/clever-fool/index.html b/blog/2013/01/28/clever-fool/index.html index 377ee4b11..6a6e39b2b 100644 --- a/blog/2013/01/28/clever-fool/index.html +++ b/blog/2013/01/28/clever-fool/index.html @@ -207,6 +207,10 @@

Comments

Recent Posts

diff --git a/blog/2013/02/06/kernel-sysrq/index.html b/blog/2013/02/06/kernel-sysrq/index.html index 5402cc860..874349d6f 100644 --- a/blog/2013/02/06/kernel-sysrq/index.html +++ b/blog/2013/02/06/kernel-sysrq/index.html @@ -188,6 +188,10 @@

Comments

Recent Posts

diff --git a/blog/2013/02/28/0-2-baby/index.html b/blog/2013/02/28/0-2-baby/index.html index ec4626b1c..4f211f437 100644 --- a/blog/2013/02/28/0-2-baby/index.html +++ b/blog/2013/02/28/0-2-baby/index.html @@ -192,6 +192,10 @@

Comments

Recent Posts

diff --git a/blog/2013/03/14/cat/index.html b/blog/2013/03/14/cat/index.html index 0655da792..ace945d05 100644 --- a/blog/2013/03/14/cat/index.html +++ b/blog/2013/03/14/cat/index.html @@ -184,6 +184,10 @@

Comments

Recent Posts

diff --git a/blog/2013/04/29/call-slash-cc/index.html b/blog/2013/04/29/call-slash-cc/index.html index 12b2c3ef6..1c7009180 100644 --- a/blog/2013/04/29/call-slash-cc/index.html +++ b/blog/2013/04/29/call-slash-cc/index.html @@ -196,6 +196,10 @@

Comments

Recent Posts

diff --git a/blog/2013/04/29/fact/index.html b/blog/2013/04/29/fact/index.html index e953d81ee..4acc13f53 100644 --- a/blog/2013/04/29/fact/index.html +++ b/blog/2013/04/29/fact/index.html @@ -204,6 +204,10 @@

Comments

Recent Posts

diff --git a/blog/2013/04/29/the-croods/index.html b/blog/2013/04/29/the-croods/index.html index 074ccd8d1..64c8840c6 100644 --- a/blog/2013/04/29/the-croods/index.html +++ b/blog/2013/04/29/the-croods/index.html @@ -177,6 +177,10 @@

Comments

Recent Posts

diff --git a/blog/2013/04/30/i-love-you/index.html b/blog/2013/04/30/i-love-you/index.html index 4945f2166..c10a33fc9 100644 --- a/blog/2013/04/30/i-love-you/index.html +++ b/blog/2013/04/30/i-love-you/index.html @@ -517,6 +517,10 @@

Comments

Recent Posts

diff --git a/blog/2013/06/01/racket-on-ffi/index.html b/blog/2013/06/01/racket-on-ffi/index.html new file mode 100644 index 000000000..35f3d2891 --- /dev/null +++ b/blog/2013/06/01/racket-on-ffi/index.html @@ -0,0 +1,321 @@ + + + + + + + + Racket on ffi - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ +

芝兰生于深谷,不以无人而不芳;君子修道立德,不为困穷而改节。

+ +
+ +
+ +
+
+
+
+ +
+ +

Racket on Ffi

+ + +

+ + + + + + + + + + + + + + +

+ +
+ + +

link:The Racke tForeign-Function Interface

+ +
// mylib1.c
+#include <stdio.h>
+#include <stdlib.h>
+
+
+// Square an integer
+int isquare (int i){
+    return i * i;
+}
+
+ +

command 中执行:

+ +
gcc --shared -o mylib1.so mylib1.c
+
+ +

mylib.rkt

+ +
#lang racket
+
+(require ffi/unsafe
+ffi/unsafe/define)
+
+(define-ffi-definer mylib-define (ffi-lib "mylib1"))
+(mylib-define isquare (_fun _int -> _int))
+
+(isquare 5)
+
+ +

mylib1.rkt

+ +
#lang racket
+(require ffi/unsafe)
+
+(define mylib (ffi-lib "mylib1.so"))
+
+
+(define isquare
+(get-ffi-obj "isquare"
+        mylib 
+        (_fun _int -> _int)))
+
+(isquare 1000)
+
+
+ + +
+

+ + + + + + + + + + + + + + + + + + + + + +

+ + + + +

+ + « slideshow and ffi + + +

+
+
+ +
+

Comments

+
+
+
+ +
+ + + + +
+
+ + + + + + + + + + + + + + + + + + + diff --git a/blog/2013/06/01/slideshow-and-ffi/index.html b/blog/2013/06/01/slideshow-and-ffi/index.html index a18d9c102..12d7ec876 100644 --- a/blog/2013/06/01/slideshow-and-ffi/index.html +++ b/blog/2013/06/01/slideshow-and-ffi/index.html @@ -166,6 +166,8 @@

Slideshow and Ffi

« I love you + Racket on ffi » +

@@ -184,6 +186,10 @@

Comments

Recent Posts

diff --git a/blog/archives/index.html b/blog/archives/index.html index f41ca1ae5..be8c437bc 100644 --- a/blog/archives/index.html +++ b/blog/archives/index.html @@ -9,13 +9,13 @@ - +Apr …"> @@ -96,6 +96,16 @@

Blog Archive

2013

+
+ +

Racket on ffi

+ + + +
+ + +

slideshow and ffi

@@ -1133,6 +1143,10 @@

使用jekyll在github上搭建个人Blog<

Recent Posts

diff --git a/blog/page/10/index.html b/blog/page/10/index.html index cf990c5ca..58fb73ebd 100644 --- a/blog/page/10/index.html +++ b/blog/page/10/index.html @@ -9,8 +9,14 @@ - + @@ -80,6 +86,52 @@

芝兰生于深谷,不以无人而不芳;君子修道立德,不为困穷 +
+ +
+ +

中国父母著名的七种武器

+ + +

+ + + + + + + + + + + + + + +

+ +
+ + +

RT @laoyang945: 转: +“要听话”用来杀自由,“要孝顺”用来杀独立, +“就你跟大家不一样”用来杀个性, +“别整天琢磨那没用的”用来杀想象力, +“少管闲事”用来杀公德心, +“养你这孩子有什么用”用来杀自尊, +“我不许你跟他/她在一起”用来杀爱情 +——这就是中国父母著名的“七种武器”

+ + + + + + +
+ +
@@ -516,55 +568,6 @@

-
- - -
- -
- -

VirtualBox 4.1 for Solaris Hosts Error Log

- - -

- - - - - - - - - - - - - - -

- -
- - -
Jul 21 12:27:56 home-solaris vboxdrv:
-[ID 694835 kern.notice] NOTICE: kthread_t::t_preempt at 42
-
-Jul 21 12:27:56 home-solaris vboxdrv:
-[ID 694835 kern.notice] NOTICE: cpu_t::cpu_runrun at 232
-
-Jul 21 12:27:56 home-solaris vboxdrv:
-[ID 694835 kern.notice] NOTICE: cpu_t::cpu_kprunrun at 233
-
- -
- - - - - -