annotate src/audlegacy/tuple_formatter.h @ 4862:7ec3621a9f9b

We only need the results of the stat once, do not bother with a variable at all. From code analysis, unique ID uYRsrf.
author Tony Vroon <chainsaw@gentoo.org>
date Sun, 19 Apr 2009 23:26:48 +0100
parents 7bf7f83a217e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3283
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
1 /*
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
2 * Audacious
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
3 * Copyright (c) 2007 William Pitcock
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
4 *
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
7 * the Free Software Foundation; under version 3 of the License.
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
8 *
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
12 * GNU General Public License for more details.
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
13 *
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses>.
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
16 *
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
17 * The Audacious team does not consider modular code linking to
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
18 * Audacious or using our public API to be a derived work.
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
19 */
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
20
4557
2eee464379dc Clean up header multiple inclusion guards (e.g. #ifndef FOO_H/#define FOO_H)
Matti Hamalainen <ccr@tnsp.org>
parents: 3349
diff changeset
21 #ifndef AUDACIOUS_TUPLE_FORMATTER_H
2eee464379dc Clean up header multiple inclusion guards (e.g. #ifndef FOO_H/#define FOO_H)
Matti Hamalainen <ccr@tnsp.org>
parents: 3349
diff changeset
22 #define AUDACIOUS_TUPLE_FORMATTER_H
3283
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
23
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
24 #include <glib.h>
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
25 #include <mowgli.h>
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
26
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
27 #include "tuple.h"
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
28
4653
5f80f9d0e7ee Use G_{BEGIN,END}_DECLS
Matti Hamalainen <ccr@tnsp.org>
parents: 4557
diff changeset
29 G_BEGIN_DECLS
5f80f9d0e7ee Use G_{BEGIN,END}_DECLS
Matti Hamalainen <ccr@tnsp.org>
parents: 4557
diff changeset
30
3283
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
31 gchar *tuple_formatter_process_string(Tuple *tuple, const gchar *string);
3349
01a241d35146 add tuple_formatter_make_title_string(). it is a wrapper function to tuple_formatter_process_construct() to make title string. it falls back to the file name if the formatted string is blank or unavailable.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3292
diff changeset
32 gchar *tuple_formatter_make_title_string(Tuple *tuple, const gchar *string);
3283
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
33 void tuple_formatter_register_expression(const gchar *keyword,
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
34 gboolean (*func)(Tuple *tuple, const gchar *argument));
3292
a97fb19a0148 Add support for functions.
William Pitcock <nenolod@atheme-project.org>
parents: 3283
diff changeset
35 void tuple_formatter_register_function(const gchar *keyword,
a97fb19a0148 Add support for functions.
William Pitcock <nenolod@atheme-project.org>
parents: 3283
diff changeset
36 gchar *(*func)(Tuple *tuple, gchar **argument));
3283
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
37 gchar *tuple_formatter_process_expr(Tuple *tuple, const gchar *expression,
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
38 const gchar *argument);
3292
a97fb19a0148 Add support for functions.
William Pitcock <nenolod@atheme-project.org>
parents: 3283
diff changeset
39 gchar *tuple_formatter_process_function(Tuple *tuple, const gchar *expression,
a97fb19a0148 Add support for functions.
William Pitcock <nenolod@atheme-project.org>
parents: 3283
diff changeset
40 const gchar *argument);
3283
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
41 gchar *tuple_formatter_process_construct(Tuple *tuple, const gchar *string);
6062ef95818b Add first revision parser code. May or may not work, not hooked up, so I can't test it yet. ;)
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
42
4653
5f80f9d0e7ee Use G_{BEGIN,END}_DECLS
Matti Hamalainen <ccr@tnsp.org>
parents: 4557
diff changeset
43 G_END_DECLS
5f80f9d0e7ee Use G_{BEGIN,END}_DECLS
Matti Hamalainen <ccr@tnsp.org>
parents: 4557
diff changeset
44
4557
2eee464379dc Clean up header multiple inclusion guards (e.g. #ifndef FOO_H/#define FOO_H)
Matti Hamalainen <ccr@tnsp.org>
parents: 3349
diff changeset
45 #endif /* AUDACIOUS_TUPLE_FORMATTER_H */