1
/* gtktiemu - a TI89/92/92+ emulator
2
* (c) Copyright 2000-2001, Romain Lievin and Thomas Corvazier
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
Specific linked lists: should be replaced with glib
27
int getSize(struct intlist* list)
32
return (getSize(list->next)+1);
35
void addEnd(struct intlist** list,int val)
43
if ((*list)->next) addEnd(&(*list)->next,val);
46
l=(struct intlist*)malloc(sizeof(struct intlist));
54
void add2End(struct intlist** list,int val,int val2)
62
if ((*list)->next) add2End(&(*list)->next,val,val2);
65
l=(struct intlist*)malloc(sizeof(struct intlist));
74
void addAt(struct intlist** list,int i,int val)
79
*list=(struct intlist*)malloc(sizeof(struct intlist));
85
addAt(&(*list)->next,i-1,val);
88
l=(struct intlist*)malloc(sizeof(struct intlist));
95
void add2At(struct intlist** list,int i,int val,int val2)
100
*list=(struct intlist*)malloc(sizeof(struct intlist));
107
add2At(&(*list)->next,i-1,val,val2);
110
l=(struct intlist*)malloc(sizeof(struct intlist));
118
void delList(struct intlist** list)
121
delList(&(*list)->next);
126
void delAt(struct intlist** list,int i)
130
delAt(&(*list)->next,i-1);
133
struct intlist* temp = (*list)->next;
139
void delEnd(struct intlist** list)
143
delEnd(&(*list)->next);