Any C structure can be stored in a hash table using uthash. Just add a UT_hash_handle to the structure and choose one or more fields in your structure to act as the key. Then use these macros to store, retrieve or delete items from the hash table. #include "uthash.h" struct my_struct { int id; /* we'll use this field as the key */ char name[10]; UT_hash_handle hh; /* makes this structure hashable
Java のように豊富なライブラリを標準で提供している開発言語を使い慣れてしまうと、ふと C に戻った時に「リストとかハッシュテーブルがないから、再実装するか...いやそれともライブラリを探してきた方がいいか...。」と嘆くこともしばしば。 そこで以前 C/C++ 言語で使用できるハッシュテーブルについて調べたものを簡単にまとめておく。 glibc 言わずと知れた GNU の標準 C ライブラリ。search.h というヘッダがあり、その中にハッシュテーブルを管理できる API が提供されている。 STL (Standard Template Library) C++ の標準テンプレートライブラリ。hash_map がハッシュテーブルを提供するクラス。 GLib gtk+ のために設計・実装された低レベルライブラリ。GHashTable がハッシュテーブルを提供する構造体。 Eet EFL
hashtable: hashtable.c hashtable.h hashtable_private.h hashtable iterator: hashtable_itr.c hashtable_itr.h support files: tester.c Makefile utility files: hashtable_utility.h hashtable_utility.c email: deduce from: firstname.lastname @ cl.cam.ac.uk Christopher Clark Source code for a hash table data structure in C This code is made available under the terms of the new BSD license. If you use this
Cmockery tests are compiled into stand-alone executables and linked with the Cmockery library, the standard C library, and the module being tested. Any symbols external to the module being tested should be mocked - replaced with functions that return values determined by the test - within the test application. Even though significant differences may exist between the target execution environment o
The most recent version of this package can be found in the source tree for the Boehm-Demers-Weiser garbage collector (bdwgc) on Sourceforge. It should be possible to just extract the libatomic_ops source tree and build it independently. The versions on this site are no longer being updated. Future versions will be identified by bdwgc version numbers. That transition is currently (2008-06-01) inc
以前このサイトとブログに,何度かアラインメントに関する記事を書きました (サイト内関連ページ参照). そのせいか「アラインメント」で検索して来てくれる人が多いので, 過去の記事に加筆修正してこのページを新たに作成しました. 加筆した点は次のとおりです. アラインメントとメモリアクセス回数の関係をわかりやすくするため, (ほんの少し) 図を導入しました. 「データがアラインされていないとメモリアクセス回数が増える」 と言葉で説明しているサイトは多いのですが, 図で示しているところはまだ見たことありません. アラインされていないアドレスにデータを書き込む場合, 読み出しの場合以上にメモリアクセス回数がかかる可能性があることを追記しました. 以前は「複合データ型 (配列,構造体,共用体) のアラインメント」はほとんど自明のことだと思っていたので軽く流していましたが, 意外なことにこれを解説してい
_ FSF announces release of gNewSense 1.0 うむ。 gNewSense。 _ 自由な静的解析ツール しばらく前にGNUの連中に訊いていて、 紹介されたページ達。 splint sparse Free software tools for formal verification of computer programs 後、最近発表されたばかりのプロジェクトですが、 The GlobalGCC project launches なんて記事がありました。 まあ、微妙に関係ありそうかなあ。 ちなみに、GlobalGCCの連絡先になっているArnaudは友達だったりします。 もう二年ぐらい顔を合わせてないですけど。 要するにですね、 KlocworkとかCoverityの代替が欲しいんですね。 現状を見る限り、フリーソフトウェアでは到底太刀打ちできてない、と言
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く