Legofit
infers population history from nucleotide site patterns.
Data Structures | Functions
ptrlst.c File Reference
#include "ptrlst.h"
#include "misc.h"
#include <stdio.h>
#include <stdlib.h>

Data Structures

struct  PtrLst
 
struct  PtrLstEl
 A linked list of pointers. More...
 

Functions

static PtrLstElPtrLstEl_push (PtrLstEl *next, void *ptr)
 Push pointer onto list.
 
static PtrLstElPtrLstEl_pop (PtrLstEl *head, void **ptr)
 Returns NULL if list is empty, so this list cannot be used to store NULL pointers.
 
static void PtrLstEl_free (PtrLstEl *e)
 Destroy a linked list of PtrLstEl objects.
 
PtrLstPtrLst_new (void)
 Allocate a structure to hold a linked list.
 
void PtrLst_free (PtrLst *self)
 
int PtrLst_push (PtrLst *self, void *ptr)
 
void * PtrLst_pop (PtrLst *self)
 Remove next pointer from list and return it. More...
 
long unsigned PtrLst_length (PtrLst *self)
 
void PtrLst_rewind (PtrLst *self)
 
void * PtrLst_next (PtrLst *self)
 
void PtrLst_move (PtrLst *to, PtrLst *from)
 
void PtrLst_append (PtrLst *to, PtrLst *from)
 

Function Documentation

◆ PtrLst_pop()

void * PtrLst_pop ( PtrLst self)

Remove next pointer from list and return it.

Return NULL if list is empty.

References PtrLstEl_pop().