path: root/apps/filetypes.h
diff options
authorJonathan Gordon <>2007-03-29 06:16:00 +0000
committerJonathan Gordon <>2007-03-29 06:16:00 +0000
commit21165a3f3db3c777f8522b14f16e570107b0405b (patch)
treea3e2766c1424ded8a2de37ba28f0a709ee3d4ded /apps/filetypes.h
parentd71b531c25ad0e02f4124e6e8cb851f59e4bbc65 (diff)
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:// a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/filetypes.h')
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*);
-const unsigned char* filetype_get_icon(int);
-int filetype_get_icon(int);
-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 {
- const unsigned char* icon; /* the icon which shall be used for it, NULL if unknown */
- int icon; /* the icon which shall be used for it, -1 if unknown */
- 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;