Skip to content

ademkaya/BasicList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic List

This is a basic list implementation written in C language.

Usage :

ListStr_Typedef listsContainer = { 0 };
/* list to be used */
List_Typedef* listSTR = NULL;

int main()
{
        /* Create List container and initialze some lists  */
            InitListContainer(&listsContainer);
            listSTR         = listsContainer.InitList(0);
        /* Add string into list                            */
            listsContainer.Add(listSTR, "TESTING 12345\0", 14);
            listsContainer.Add(listSTR, "TESTING 1234\0" , 13);
            listsContainer.Add(listSTR, "TESTING 123\0"  , 12);
            listsContainer.Add(listSTR, "TESTING\0"      , 8 );  
            
        /* reach the items in the list*/    
            printf("%s", (char*)listSTR->ListPtrArr[3]->ListPtr);
            
        /* Remove data from index                          */
            listsContainer.Remove(listSTR, 0);
        /* Clear all added data from the List    */
            listsContainer.Clear(listSTR);
        /* Destroy the list                  */
            listsContainer.Destroy(&listSTR);

        return 0;
}

Releases

No releases published

Packages

No packages published

Languages