view cinst/nss-secitemlist.c @ 251:c596568fa45b

Add utf16 conversion functions for Windows. This also includes a null pointer checking free.
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 01 Apr 2014 10:48:35 +0000
parents 809eaca3898c
children 6ccaf25219fd
line wrap: on
line source
#include "nss-secitemlist.h"

void
seciteml_push (seciteml_t **list, SECItem *item)
{
  seciteml_t *newlelt;
  SECItem *newitem;
  newlelt = (seciteml_t *)xmalloc( sizeof(seciteml_t) );
  newitem = (SECItem *)xmalloc( sizeof(SECItem) );
  memcpy(newitem, item, sizeof(SECItem));
  newlelt->item = newitem;
  newlelt->next = *list;
  *list = newlelt;
}

SECItem *seciteml_pop (seciteml_t **list)
{
  seciteml_t *oldlelt;
  SECItem *item = NULL;
  
  if (*list != NULL)
    {
      oldlelt = *list;
      item = oldlelt->item;
      *list = oldlelt->next;
    }
  return(item);
}

http://wald.intevation.org/projects/trustbridge/