summaryrefslogtreecommitdiffstats
path: root/apps/filetypes.h
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-03-29 06:16:00 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-03-29 06:16:00 +0000
commit21165a3f3db3c777f8522b14f16e570107b0405b (patch)
treea3e2766c1424ded8a2de37ba28f0a709ee3d4ded /apps/filetypes.h
parentd71b531c25ad0e02f4124e6e8cb851f59e4bbc65 (diff)
downloadrockbox-21165a3f3db3c777f8522b14f16e570107b0405b.tar.gz
rockbox-21165a3f3db3c777f8522b14f16e570107b0405b.tar.bz2
rockbox-21165a3f3db3c777f8522b14f16e570107b0405b.zip
Recode filetypes.c to remove its need for a static string buffer.
Functional changes: - filetypes.c handles the open with menu now instead of onplay.c - automatic plugin registration no longer works (did anyone know about you could do this?) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12959 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/filetypes.h')
-rw-r--r--apps/filetypes.h40
1 files changed, 16 insertions, 24 deletions
diff --git a/apps/filetypes.h b/apps/filetypes.h
index 7416c93b00..d2556c1d95 100644
--- a/apps/filetypes.h
+++ b/apps/filetypes.h
@@ -22,32 +22,24 @@
#include <stdbool.h>
#include <tree.h>
#include <menu.h>
-
-int filetype_get_attr(const char*);
-#ifdef HAVE_LCD_BITMAP
-const unsigned char* filetype_get_icon(int);
-#else
-int filetype_get_icon(int);
-#endif
-char* filetype_get_plugin(const struct entry*);
+/* init the filetypes structs.
+ uses audio buffer for storage, so call early in init... */
void filetype_init(void);
-bool filetype_supported(int);
-int filetype_load_menu(struct menu_item*, int);
-int filetype_load_plugin(const char*, char*);
-struct file_type {
-#ifdef HAVE_LCD_BITMAP
- const unsigned char* icon; /* the icon which shall be used for it, NULL if unknown */
-#else
- int icon; /* the icon which shall be used for it, -1 if unknown */
-#endif
- char* plugin; /* Which plugin to use, NULL if unknown */
- bool no_extension;
-};
+/* Return the attribute (TREE_ATTR_*) of the file */
+int filetype_get_attr(const char* file);
+ICON filetype_get_icon(int attr);
+/* return the plugin filename associated with the file */
+char* filetype_get_plugin(const struct entry* file);
+
+/* returns true if the attr is supported */
+bool filetype_supported(int attr);
+
+/* List avialable viewers */
+int filetype_list_viewers(const char* current_file);
+
+/* start a plugin with file as the argument (called from onplay.c) */
+int filetype_load_plugin(const char* plugin, char* file);
-struct ext_type {
- char* extension; /* extension for which the file type is recognized */
- struct file_type* type;
-};
#endif