Konstantin Dmitriev wrote:
> Hello!
> 
> After thinking about file format I have one more idea:
> It would be nice to have a  support for several input formats.
> For example the convert type could have a parameter - "Format" - with
> a dropdown list, where user can choose the import format.
> 
> So the Convert type will have following parameters:
> * Filename
> * Format
> 
> We can have only one format for now - "Default" (the one submitted by
> Carlos), but later we can add CSV and personally I would like to have
> a support for direct import of Papagayo's *.pgo files. ^__^
> 
> K.

Hi!

The program might be able to deduce the filetype by its extension
(csv, json, etc).  I think the artist/animator shouldn't have to
tell Synfig what kind of file they're giving it.  ^^

I attached a basic CSV parser.

-Charlie

/*!	\file csv.c
**	\copyright Public domain, WTFPL, or CC-0.
**	A comma-separated values (CSV) parser.
*/

/*!	\fn int csv(char *s, char **values, int maxvalues)
**	\brief Extracts comma-separated values into an array.
**	\param s a string of comma-separated values.
**	\param values the array where they will be stored.
**	\param maxvalues the maximum number of values.
**	\return the number of values extracted.
*/
int
csv(char *s, char **values, int maxvalues)
{
	int i;

	if (*s == '\0')
		return 0;

	i = 0;
	while (i < maxvalues) {
		values[i++] = s;

		while (*s != '\0' && *s != ',')
			s++;

		if (*s == '\0')
			break;

		*s = '\0';
		s++;
	}

	return i;
}

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees_APR
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to