英語版
このページの英語版を見る

dmd.backend.dlist

C リンクリスト型とのインターフェイス".
リストは、ポインタや整数の単一リンクリストを扱う関数の完全なパッケージである。 ポインタや整数のリストを扱う関数の完全なパッケージである。

特徴

  1. memパッケージを使う。
  2. ループバック・テストがある。
  3. リスト内の各項目は複数の前任者を持つことができる。 異なるリストが共通の末尾を「共有」できる。

Authors:

ソース backend/dlist.d

nothrow @nogc @safe list_t list_next(list_t list);
Returns:
リストの次のエントリへのポインタ。
nothrow @nogc @trusted inout(void)* list_ptr(inout list_t list);
Returns:
リストエントリからの ptr。
nothrow @nogc @safe int list_data(list_t list);
Returns:
整数項目をリスト項目から取り出す。
nothrow @nogc @safe void list_prependdata(list_t* plist, int d);
整数アイテムをリストにプリペンドする。
nothrow @nogc @trusted void list_free(list_t* plist, list_free_fp freeptr);
リストを解放する。
Parameters:
list_t* plist 解放するリストへのポインタ
list_free_fp freeptr データ・ポインタの解放関数へのポインタ。 (ない場合はFPNULLを使用)

出力 *plistがNULLである

nothrow @nogc @trusted void* list_subtract(list_t* plist, void* ptr);
plistが指すリストからptrを削除する。

出力 *plistは新しいリストの先頭に更新される。

Returns:
plistがNULLの場合はNULL そうでなければ ptr
nothrow @nogc @safe void* list_pop(list_t* plist);
plistが指すリストの最初の要素を削除する。
Returns:
最初の要素、*plist が NULL ならば NULL
nothrow @nogc @trusted list_t list_append(list_t* plist, void* ptr);
ptrを*plistに追加する。
Returns:
作成されたリスト項目へのポインタ。 メモリ不足の場合はnull
nothrow @nogc @trusted list_t list_prepend(list_t* plist, void* ptr);
ptrを*plistにプリペンドする。
Returns:
作成されたリスト項目へのポインタ(リストの開始点でもある)。 メモリ不足の場合はnull
nothrow @nogc @safe int list_nitems(list_t list);
リスト内の項目数をカウントアップして返す。
Returns:

リストの項目数

nothrow @nogc @safe list_t list_nth(list_t list, int n);
Returns:
リストの n 番目の項目。
nothrow @nogc @safe int list_equal(list_t list1, list_t list2);
2つのリストを比較する。
Returns:
同じptrであれば1を返し、そうでなければ0を返す。
nothrow @nogc @trusted list_t list_inlist(list_t list, void* ptr);
リスト内のptrを検索する。
Returns:
見つかればそのリストエントリを返し、そうでなければnullを返す。
nothrow @nogc @trusted void list_apply(list_t* plist, void function(void*) nothrow @nogc fp);
リストの各メンバーに関数fpを適用する。
nothrow @nogc @safe list_t list_reverse(list_t l);
リストをその場で反転する。
struct ListRange;
リストの範囲。