elks-enhanced
public
Read
Owner: themaster
Branch: master
Commits: 6893
Updated: 2026-04-19 00:15
Git CLI clone URL
git clone https://www.xt-emporium.com/git/elks-enhanced.git
Fullscreen desktop URL
Code
Commits
History
Branches
Bug Reports
Discussions
Compare
Settings
elks-enhanced
/
elkscmd
/
unused
/
nano-X
/
engine
/
list.c
File editor
#include <stdio.h> #include <stdlib.h> #include "list.h" /* * linked list routines * * 1/28/98 g haerr * Copyright (c) 1999 Greg Haerr <greg@censoft.com> */ void * ItemAlloc(unsigned int size) { return (void *)calloc(size, 1); } /* insert at tail of list*/ void ListAdd(PLISTHEAD pHead,PLIST pItem) { if( pHead->tail) { pItem->prev = pHead->tail; pHead->tail->next = pItem; } else pItem->prev = NULL; pItem->next = NULL; pHead->tail = pItem; if( !pHead->head) pHead->head = pItem; } /* insert at head of list*/ void ListInsert(PLISTHEAD pHead,PLIST pItem) { if( pHead->head) { pItem->next = pHead->head; pHead->head->prev = pItem; } else pItem->next = NULL; pItem->prev = NULL; pHead->head = pItem; if( !pHead->head) pHead->head = pItem; } void ListRemove(PLISTHEAD pHead,PLIST pItem) { if( pItem->next) pItem->next->prev = pItem->prev; if( pItem->prev) pItem->prev->next = pItem->next; if( pHead->head == pItem) pHead->head = pItem->next; if( pHead->tail == pItem) pHead->tail = pItem->prev; pItem->next = pItem->prev = NULL; }
Commit message
This repository is read-only for this account.
Repository snapshot
Current branch
master
Visibility
public
Your access
Read
Remote
Configured
File activity
View file history