mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-10 21:55:11 +01:00
Removed
This commit is contained in:
parent
06992b8f2c
commit
218fba704c
59
Src/slist.c
59
Src/slist.c
@ -1,59 +0,0 @@
|
|||||||
#include "slist.h"
|
|
||||||
|
|
||||||
/**********************************************************************************************************/
|
|
||||||
S_List *S_CreateList(int Sorted)
|
|
||||||
{
|
|
||||||
S_List *List;
|
|
||||||
|
|
||||||
List = (S_List*)malloc(sizeof(S_List));
|
|
||||||
if (!List)
|
|
||||||
return NULL;
|
|
||||||
List->Elements = 0;
|
|
||||||
List->List = NULL;
|
|
||||||
List->Sorted = Sorted;
|
|
||||||
return List;
|
|
||||||
|
|
||||||
}
|
|
||||||
/**********************************************************************************************************/
|
|
||||||
int S_AddToList(S_List* List, char *String)
|
|
||||||
{
|
|
||||||
char **NewList;
|
|
||||||
|
|
||||||
List->Elements++;
|
|
||||||
NewList = (char**)realloc(List->List, (size_t)(List->Elements * sizeof(char *)));
|
|
||||||
if (!NewList)
|
|
||||||
{
|
|
||||||
List->Elements--;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
List->List = NewList;
|
|
||||||
List->List[List->Elements - 1] = (char *)malloc((size_t)(strlen(String) + 1));
|
|
||||||
if (!List->List[List->Elements - 1])
|
|
||||||
{
|
|
||||||
List->Elements--;
|
|
||||||
List = (S_List*)realloc(List->List, (size_t)(List->Elements * sizeof(char *)));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
strcpy(List->List[List->Elements - 1], String);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
/**********************************************************************************************************/
|
|
||||||
void S_DestroyList(S_List* List)
|
|
||||||
{
|
|
||||||
int nCount;
|
|
||||||
|
|
||||||
if (List)
|
|
||||||
{
|
|
||||||
for (nCount = 0; nCount < (int)List->Elements; nCount ++)
|
|
||||||
{
|
|
||||||
if (List)
|
|
||||||
free(List->List[nCount]);
|
|
||||||
}
|
|
||||||
if (List->List)
|
|
||||||
free(List->List);
|
|
||||||
free(List);
|
|
||||||
List = NULL;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
22
Src/slist.h
22
Src/slist.h
@ -1,22 +0,0 @@
|
|||||||
#ifndef __slist_h
|
|
||||||
#define __slist_h
|
|
||||||
|
|
||||||
struct _S_LIST
|
|
||||||
{
|
|
||||||
int Elements;
|
|
||||||
char **List;
|
|
||||||
int Sorted;
|
|
||||||
};
|
|
||||||
typedef struct _S_LIST S_List;
|
|
||||||
|
|
||||||
#define S_SORTED 1
|
|
||||||
#define S_UNSORTED 0
|
|
||||||
|
|
||||||
|
|
||||||
/************************************************************/
|
|
||||||
extern S_List* S_CreateList(int Sorted);
|
|
||||||
extern int S_AddToList(S_List *List, char *String);
|
|
||||||
extern void S_DestroyList(S_List *List);
|
|
||||||
/************************************************************/
|
|
||||||
|
|
||||||
#endif /* __slist_h */
|
|
Loading…
Reference in New Issue
Block a user