example format int format const char format_string const char format_s

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* @example format ("%a - %t (%A)") */
int
format (const char *format_string)
{
const char *p = format_string;
while ((p = strchr (p, '%')) != NULL)
{
if (*(++p) != 0)
{
switch (*p)
{
case 'A': /* Album */
break;
case 'a': /* artist */
break;
case 't': /* title */
break;
case 'C': /* cdnum */
break;
}
}
}
return 0;
}