1 Star 0 Fork 4

calvinlin/vcc

forked from rain/vcc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
klist.c 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
3swordman 提交于 2022-04-08 09:12 +08:00 . vcc: change the implementation of ban
/* vcc/klist.c
*
* This file is part of vcc.
*
* vcc 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 3 of the License, or
* (at your option) any later version.
*
* vcc 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 vcc. If not, see <https://www.gnu.org/licenses/>
*/
#include <sys/types.h>
#include <stddef.h>
#include <klist.h>
void klist_init(struct klist_node *head) {
head->next = head;
head->prev = head;
head->usrname = NULL;
return;
}
void klist_add(struct klist_node *head, struct klist_node *new) {
/* head->prev: the last. */
new->prev = head->prev;
new->next = head;
/* head->prev->next: (was) the head */
head->prev->next = new;
head->prev = new;
return;
}
void klist_del(struct klist_node *head, struct klist_node *will_del) {
(void) head;
will_del->prev->next = will_del->next;
will_del->next->prev = will_del->prev;
return;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/calvin-lin/vcc.git
[email protected]:calvin-lin/vcc.git
calvin-lin
vcc
vcc
master

搜索帮助