diff cinst/nss-secitemlist.c @ 242:809eaca3898c

Added helper functions to handle lists of NSS SECItems.
author Sascha Wilde <wilde@intevation.de>
date Fri, 28 Mar 2014 18:37:59 +0100
parents
children 6ccaf25219fd
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cinst/nss-secitemlist.c	Fri Mar 28 18:37:59 2014 +0100
@@ -0,0 +1,28 @@
+#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/