91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小:
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-10-13
  • 語言: 其他
  • 標簽:

資源簡介

資源截圖

代碼片段和文件信息

/*
?*?File:????dlist.c
?*?Author:??Li?XianJing?
?*?Brief:???double?list?implementation.
?*
?*?Copyright?(c)?Li?XianJing
?*
?*?Licensed?under?the?Academic?Free?License?version?2.1
?*
?*?This?program?is?free?software;?you?can?redistribute?it?and/or?modify
?*?it?under?the?terms?of?the?GNU?General?Public?License?as?published?by
?*?the?Free?Software?Foundation;?either?version?2?of?the?License?or
?*?(at?your?option)?any?later?version.
?*
?*?This?program?is?distributed?in?the?hope?that?it?will?be?useful
?*?but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
?*?MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the
?*?GNU?General?Public?License?for?more?details.
?*
?*?You?should?have?received?a?copy?of?the?GNU?General?Public?License
?*?along?with?this?program;?if?not?write?to?the?Free?Software
?*?Foundation?Inc.?59?Temple?Place?Suite?330?Boston?MA??02111-1307??USA
?*/

/*
?*?History:
?*?================================================================
?*?2008-11-09?Li?XianJing??created
?*
?*/
#include?
#include?“dlist.h“

typedef?struct?_DListNode
{
struct?_DListNode*?prev;
struct?_DListNode*?next;

void*?data;
}DListNode;

struct?_DList
{
DListNode*?first;
};

static?DListNode*?dlist_node_create(void*?data)
{
DListNode*?node?=?malloc(sizeof(DListNode));

if(node?!=?NULL)
{
node->prev?=?NULL;
node->next?=?NULL;
node->data?=?data;
}

return?node;
}

static?void?dlist_node_destroy(DListNode*?node)
{
if(node?!=?NULL)
{
node->next?=?NULL;
node->prev?=?NULL;
free(node);
}

return;
}

DList*?dlist_create(void)
{
DList*?thiz?=?malloc(sizeof(DList));

if(thiz?!=?NULL)
{
thiz->first?=?NULL;
}

return?thiz;
}

static?DListNode*?dlist_get_node(DList*?thiz?size_t?index?int?fail_return_last)
{
DListNode*?iter?=?thiz->first;

while(iter?!=?NULL?&&?iter->next?!=?NULL?&&?index?>?0)
{
iter?=?iter->next;
index--;
}

if(!fail_return_last)
{
iter?=?index?>?0???NULL?:?iter;
}

return?iter;
}

DListRet?dlist_insert(DList*?thiz?size_t?index?void*?data)
{
DListNode*?node?=?NULL;
DListNode*?cursor?=?NULL;

if((node?=?dlist_node_create(data))?==?NULL)
{
return?DLIST_RET_OOM;?
}

if(thiz->first?==?NULL)
{
thiz->first?=?node;

return?DLIST_RET_OK;
}

cursor?=?dlist_get_node(thiz?index?1);

if(index? {
if(thiz->first?==?cursor)
{
thiz->first?=?node;
}
else
{
cursor->prev->next?=?node;
node->prev?=?cursor->prev;
}
node->next?=?cursor;
cursor->prev?=?node;
}
else
{
cursor->next?=?node;
node->prev?=?cursor;
}

return?DLIST_RET_OK;
}

DListRet?dlist_prepend(DList*?thiz?void*?data)
{
return?dlist_insert(thiz?0?data);
}

DListRet?dlist_append(DList*?thiz?void*?data)
{
return?dlist_insert(thiz?-1?data);
}

DListRet?dlist_delete(DList*?thiz?size_t?index)
{
DListNode*?cursor?=?dlist_get_node(thiz?index?0);

if(cursor?!=?NULL)
{
if(cursor?==?thiz->first)
{
thiz->first?=

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????????62??2010-05-05?11:27??系統程序員成長計劃-源碼\spexamples\.svn\all-wcprops

?????文件????????278??2010-05-05?11:27??系統程序員成長計劃-源碼\spexamples\.svn\entries

?????文件?????????64??2010-04-29?15:33??系統程序員成長計劃-源碼\spexamples\1\.svn\all-wcprops

?????文件????????214??2010-04-29?15:33??系統程序員成長計劃-源碼\spexamples\1\.svn\entries

?????文件?????????66??2010-04-29?15:33??系統程序員成長計劃-源碼\spexamples\1\4\.svn\all-wcprops

?????文件????????213??2010-04-29?15:33??系統程序員成長計劃-源碼\spexamples\1\4\.svn\entries

?????文件????????469??2010-04-29?15:33??系統程序員成長計劃-源碼\spexamples\1\4\embrace_change\.svn\all-wcprops

?????文件????????789??2010-04-29?15:33??系統程序員成長計劃-源碼\spexamples\1\4\embrace_change\.svn\entries

?????文件???????4307??2010-04-21?21:39??系統程序員成長計劃-源碼\spexamples\1\4\embrace_change\.svn\text-base\dlist.c.svn-base

?????文件???????1942??2010-04-18?17:30??系統程序員成長計劃-源碼\spexamples\1\4\embrace_change\.svn\text-base\dlist.h.svn-base

?????文件???????1561??2010-04-18?17:30??系統程序員成長計劃-源碼\spexamples\1\4\embrace_change\.svn\text-base\main.c.svn-base

?????文件?????????55??2010-04-18?17:30??系統程序員成長計劃-源碼\spexamples\1\4\embrace_change\.svn\text-base\Makefile.svn-base

?????文件???????4307??2010-04-21?21:38??系統程序員成長計劃-源碼\spexamples\1\4\embrace_change\dlist.c

?????文件???????1942??2010-04-18?17:30??系統程序員成長計劃-源碼\spexamples\1\4\embrace_change\dlist.h

?????文件???????1561??2010-04-18?17:30??系統程序員成長計劃-源碼\spexamples\1\4\embrace_change\main.c

?????文件?????????55??2010-04-18?17:30??系統程序員成長計劃-源碼\spexamples\1\4\embrace_change\Makefile

?????文件?????????66??2010-04-29?15:33??系統程序員成長計劃-源碼\spexamples\1\5\.svn\all-wcprops

?????文件????????202??2010-04-29?15:33??系統程序員成長計劃-源碼\spexamples\1\5\.svn\entries

?????文件????????414??2010-04-29?15:33??系統程序員成長計劃-源碼\spexamples\1\5\dry\.svn\all-wcprops

?????文件????????778??2010-04-29?15:33??系統程序員成長計劃-源碼\spexamples\1\5\dry\.svn\entries

?????文件???????4593??2010-04-21?21:39??系統程序員成長計劃-源碼\spexamples\1\5\dry\.svn\text-base\dlist.c.svn-base

?????文件???????2097??2010-04-18?17:30??系統程序員成長計劃-源碼\spexamples\1\5\dry\.svn\text-base\dlist.h.svn-base

?????文件???????1042??2010-04-18?17:32??系統程序員成長計劃-源碼\spexamples\1\5\dry\.svn\text-base\main.c.svn-base

?????文件?????????56??2010-04-18?17:30??系統程序員成長計劃-源碼\spexamples\1\5\dry\.svn\text-base\Makefile.svn-base

?????文件???????4593??2010-04-21?21:39??系統程序員成長計劃-源碼\spexamples\1\5\dry\dlist.c

?????文件???????2097??2010-04-18?17:30??系統程序員成長計劃-源碼\spexamples\1\5\dry\dlist.h

?????文件???????1042??2010-04-18?17:31??系統程序員成長計劃-源碼\spexamples\1\5\dry\main.c

?????文件?????????56??2010-04-18?17:30??系統程序員成長計劃-源碼\spexamples\1\5\dry\Makefile

?????文件?????????66??2010-04-29?15:33??系統程序員成長計劃-源碼\spexamples\1\6\.svn\all-wcprops

?????文件????????209??2010-04-29?15:33??系統程序員成長計劃-源碼\spexamples\1\6\.svn\entries

............此處省略1392個文件信息

評論

共有 條評論