NetworkManager/vpn-daemons/pptp/properties/util_lists.c
Antony Mee 93b722d574 * Generalised properties dialog for other possible PPPd uses
* Abstracted somewhat - may be a useful base of other configuration
      dialogs as it now simply needs the glade file and a few declarations.
  * Added a dial-up option though the backend doesn't yet support that.
  * Added many PPPD options including those for compression and encryption


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1804 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-06-06 19:57:05 +00:00

42 lines
830 B
C

#include <glib.h>
#include <string.h>
#define NMVPNUI_UTIL_LISTS_C
#include "util_lists.h"
GSList *
list_from_string (const char *string)
{
char **entries;
char **parts;
char **entry;
char **part;
int i;
GSList *list=NULL;
if (string==NULL) return list;
entries = g_strsplit(string,";",0);
for (entry=entries; *entry; entry++)
{
parts = g_strsplit(*entry,"=",2);
part=parts;
if ((!(*part)) || (strlen(*part)==0)) {
g_strfreev(parts);
continue;
}
list = g_slist_append (list,g_strdup(*part));
*part++;
if ((!(*part)) || (strlen(*part)==0) || (strcmp("''",*part)==0)) {
list = g_slist_append (list,g_strdup(""));
} else {
list = g_slist_append (list,g_strdup(*part));
}
g_strfreev(parts);
}
g_strfreev(entries);
return list;
}