Clean code by adding function instead macros for seq parsing AND allow multi mousebinds sequence: \[](;;)(;;)(;;)

This commit is contained in:
Martin Duquesnoy
2012-01-11 16:18:21 +01:00
parent 5cdb0ac77c
commit f46cbaf501
5 changed files with 87 additions and 87 deletions

View File

@@ -121,6 +121,23 @@ spawn(const char *format, ...)
return pid;
}
int
parse_args(char *str, char delim, char end, int narg, char *args[])
{
int i = 0;
for(args[0] = str; *str && *str != end && i < narg; ++str)
if(*str == delim)
{
*str = '\0';
args[++i] = ++str;
}
*str = '\0';
return i;
}
void
uicb_spawn(Uicb cmd)
{