change head list name.

This commit is contained in:
m1k1o 2021-04-12 19:30:19 +02:00
parent 285d4b630b
commit 1307236f86

View File

@ -6,30 +6,25 @@ static char *NAME = ":0.0";
static int REGISTERED = 0; static int REGISTERED = 0;
static int DIRTY = 0; static int DIRTY = 0;
xkeys_t *head = NULL; xkeys_t *xKeysHead = NULL;
void insertItem(KeySym keysym, KeyCode keycode) { void insertItem(KeySym keysym, KeyCode keycode) {
xkeys_t *temp_node = (xkeys_t *) malloc(sizeof(xkeys_t)); xkeys_t *temp_node = (xkeys_t *) malloc(sizeof(xkeys_t));
temp_node->keysym = keysym; temp_node->keysym = keysym;
temp_node->keycode = keycode; temp_node->keycode = keycode;
temp_node->next = NULL; temp_node->next = xKeysHead;
xKeysHead = temp_node;
// For the 1st element
if (head) {
temp_node->next = head;
}
head = temp_node;
} }
void deleteItem(KeySym keysym) { void deleteItem(KeySym keysym) {
xkeys_t *myNode = head, *previous = NULL; xkeys_t *myNode = xKeysHead, *previous = NULL;
int i = 0; int i = 0;
while (myNode) { while (myNode) {
if (myNode->keysym == keysym) { if (myNode->keysym == keysym) {
if (!previous) if (!previous)
head = myNode->next; xKeysHead = myNode->next;
else else
previous->next = myNode->next; previous->next = myNode->next;
@ -48,7 +43,7 @@ void deleteItem(KeySym keysym) {
} }
xkeys_t *searchItemNode(KeySym keysym) { xkeys_t *searchItemNode(KeySym keysym) {
xkeys_t *searchNode = head; xkeys_t *searchNode = xKeysHead;
int i = 0; int i = 0;
while (searchNode) { while (searchNode) {