CFFI documentation¶ C Foreign Function Interface for Python. Interact with almost any C code from Python, based on C-like declarations that you can often copy-paste from header files or documentation.
ctypes — A foreign function library for Python¶ Source code: Lib/ctypes ctypes is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries. It can be used to wrap these libraries in pure Python. ctypes tutorial¶ Note: The code samples in this tutorial use doctest to make sure that they actually work. Since some code sample
Introduction to libiconv International text is mostly encoded in Unicode. For historical reasons, however, it is sometimes still encoded using a language or country dependent character encoding. With the advent of the internet and the frequent exchange of text across countries - even the viewing of a web page from a foreign country is a "text exchange" in this context -, conversions between these
Linux の共有ライブラリを作るとき PIC でコンパイルするのはなぜか 通常、Linux の共有ライブラリを作るときは各 .c ファイルを PIC (Position Independent Code) となるようコンパイルします。しかし、実は PIC でコンパイルしなくても共有ライブラリは作れます。それでは PIC にする意味はあるのでしょうか。 さっそく実験してみます。 int func () { printf(""); printf(""); printf(""); } PIC でコンパイルするには gcc に -fpic または -fPIC を渡します。-fpic の方が小さく高速なコードを生成する可能性がありますが、プロセッサによっては -fpic で生成できる GOT (Global Offset Table) のサイズに制限があります。一方、-fPIC はどのプロセッサで
初版作成:2003/01/11 2015年時点での参考資料追記:2015/06/29 目次 前書き 本題 後書き或いは感想 2015年時点での参考・推薦資料 前書き 2015年時点での、より正確で分かりやすい参考書籍の紹介を追記しましたので、そちらもぜひご確認ください。 LinuxやUNIXを扱っていると「共有ライブラリ(shared library)」「ライブラリ(library)」という言葉をしばしば耳に します。特に、最新版を使おうとソースコードから見よう見まねでビルド、コンパイルとやらをおそるおそる行っては見たものの 見事に失敗したときや、或いは上手く動かないときのログファイル中で現れることもあります。 プログラマーであれば、例え初めてLinuxに触ったとしても何となく語感だけでぼんやりと原因が想像できます。 しかしごく普通の ---つまりプログラミングなどに興味関心も無かった--
GNU Scientific Library Guide in Japanese Last Update: May 11, 2010 目次 GSLとは? どこにあるの? 何で今更「数値計算ライブラリ」を作るの? Install方法(Linux編) Install方法(Windows + Visual Studio編) Compile方法(Linux編) どんな機能が使えますか?(一部サンプルソース付き) これからどうなるの? GSL とは? GNU Scientific Libraryの略称です。日本語にすると「GNU科学技術計算ライブラリ」ってな感じでしょうか。基本的にはANSI Cで記述された数値計算・統計計算等の関数の集合体です。線型計算についてはBLAS(Basic Linear Algebra Suprograms)をサポートしてます。 どこにあるの? 今の所(2010-05-1
Hardware AMD R300 The R300 driver supports AMD's Radeon R300 GPU series. AMD R600 The R600 driver supports AMD's Radeon HD 2000 GPU series. It's officially supported by AMD, and is one of two Linux drivers for the hardware. More information… AMD RadeonSI The RadeonSI OpenGL and OpenCL driver supports AMD's Southern Island GPUs and later. It's officially supported by AMD, and is one of two Linux dr
前回は JSMN というのを試したけど、今度も matsuu さんのブクマから。。。 parson Lightweight json parser and reader written in C. http://kgabis.github.com/parson/ 特徴は 軽い (2ファイルだけ) 単純なAPI ドット記法による json 値のアドレッシング (C言語の構造体やOO言語のオブジェクトに似た感じ。例: "objectA.objectB.value") C89 コンパティブル テストスーツ 前回の JSMN とは違い、メモリを動的に確保するタイプ。DOM の様にルートノードから探索を始め、最終的にルートノードを指定してメモリを開放する。 今回もtwitterのタイムラインをパースしよう。 #include <assert.h> #include <string.h> #inclu
syscall って組込関数でシステムコールはできますけど、libc やその他ライブラリの関数を呼びたい、ってこともありますよね。i386 かつ dlopen な環境なら、こんな風に書けます。 use DynaLoader; use ops; sub ccall { my $r = '1111'; my $s = "\x68" . pack("L", $_[5]) . "\x68" . pack("L", $_[4]) . "\x68" . pack("L", $_[3]) . "\x68" . pack("L", $_[2]) . "\x68" . pack("L", $_[1]) . "\xb8" . pack("L", ("Dyna"."Loader")->can("dl_find_symbol")->(("Dyna"."Loader")->can("dl_load_file")->
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く