r14650 - gnucash/branches/swigify/src/engine - Add a SCM to GSList* helper.

Chris Shoemaker chris at cvs.gnucash.org
Sat Aug 12 21:58:38 EDT 2006


Author: chris
Date: 2006-08-12 21:58:37 -0400 (Sat, 12 Aug 2006)
New Revision: 14650
Trac: http://svn.gnucash.org/trac/changeset/14650

Modified:
   gnucash/branches/swigify/src/engine/glib-helpers.c
   gnucash/branches/swigify/src/engine/glib-helpers.h
Log:
   Add a SCM to GSList* helper.


Modified: gnucash/branches/swigify/src/engine/glib-helpers.c
===================================================================
--- gnucash/branches/swigify/src/engine/glib-helpers.c	2006-08-13 01:54:38 UTC (rev 14649)
+++ gnucash/branches/swigify/src/engine/glib-helpers.c	2006-08-13 01:58:37 UTC (rev 14650)
@@ -143,9 +143,9 @@
 
 /********************************************************************
  * gnc_scm_to_glist_string
- * i.e. (glist-of (<gw:mchars> calee-owned) callee-owned)
+ * i.e. (glist-of (<gw:mchars> callee-owned) callee-owned)
  * or equivalently
- * i.e. (glist-of (<gw:gchars> calee-owned) callee-owned)
+ * i.e. (glist-of (<gw:gchars> callee-owned) callee-owned)
  ********************************************************************/
 
 GList *
@@ -164,6 +164,22 @@
   return g_list_reverse (glist);
 }
 
+GSList *
+gnc_scm_to_gslist_string(SCM list)
+{
+  GSList *gslist = NULL;
+
+  while (!SCM_NULLP (list))
+  {
+    const gchar * str = SCM_STRING_CHARS (SCM_CAR(list));
+    if (str)
+      gslist = g_slist_prepend (gslist, g_strdup (str));
+    list = SCM_CDR (list);
+  }
+
+  return g_slist_reverse (gslist);
+}
+
 /********************************************************************
  * gnc_glist_string_p
  ********************************************************************/

Modified: gnucash/branches/swigify/src/engine/glib-helpers.h
===================================================================
--- gnucash/branches/swigify/src/engine/glib-helpers.h	2006-08-13 01:54:38 UTC (rev 14649)
+++ gnucash/branches/swigify/src/engine/glib-helpers.h	2006-08-13 01:58:37 UTC (rev 14650)
@@ -37,6 +37,8 @@
 GList * gnc_scm_to_glist_string(SCM list);
 int     gnc_glist_string_p(SCM list);
 
+GSList * gnc_scm_to_gslist_string(SCM list);
 
 
+
 #endif



More information about the gnucash-changes mailing list