summaryrefslogtreecommitdiffstats
path: root/libmenu/menu_filesel.c
diff options
context:
space:
mode:
authorreynaldo <reynaldo@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-03-30 06:40:58 +0000
committerreynaldo <reynaldo@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-03-30 06:40:58 +0000
commitbf25812a43c2e3ca244cc1698a7e006391ce34b8 (patch)
tree5d5f792df73067fc4e2d5ff9295fea966c3baf80 /libmenu/menu_filesel.c
parent9c301c3e16546f00e9230abfbe36a45793bd9389 (diff)
downloadmpv-bf25812a43c2e3ca244cc1698a7e006391ce34b8.tar.bz2
mpv-bf25812a43c2e3ca244cc1698a7e006391ce34b8.tar.xz
Part1 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17995 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmenu/menu_filesel.c')
-rw-r--r--libmenu/menu_filesel.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libmenu/menu_filesel.c b/libmenu/menu_filesel.c
index 9148dc2c8d..b4b3b98783 100644
--- a/libmenu/menu_filesel.c
+++ b/libmenu/menu_filesel.c
@@ -12,6 +12,8 @@
#include "config.h"
+#include "mp_msg.h"
+#include "help_mp.h"
#include "m_struct.h"
#include "m_option.h"
@@ -142,7 +144,7 @@ static int open_dir(menu_t* menu,char* args) {
mpriv->p.title = replace_path(mpriv->title,mpriv->dir);
if ((dirp = opendir (mpriv->dir)) == NULL){
- printf("opendir error: %s", strerror(errno));
+ mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_OpendirError, strerror(errno));
return 0;
}
@@ -155,7 +157,7 @@ static int open_dir(menu_t* menu,char* args) {
if(n%20 == 0){ // Get some more mem
if((tp = (char **) realloc(namelist, (n+20) * sizeof (char *)))
== NULL) {
- printf("realloc error: %s", strerror(errno));
+ mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReallocError, strerror(errno));
n--;
goto bailout;
}
@@ -164,7 +166,7 @@ static int open_dir(menu_t* menu,char* args) {
namelist[n] = (char *) malloc(strlen(dp->d_name) + 2);
if(namelist[n] == NULL){
- printf("malloc error: %s", strerror(errno));
+ mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_MallocError, strerror(errno));
n--;
goto bailout;
}
@@ -182,7 +184,7 @@ bailout:
qsort(namelist, n, sizeof(char *), (kill_warn)compare);
if (n < 0) {
- printf("readdir error: %s\n",strerror(errno));
+ mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReaddirError,strerror(errno));
return 0;
}
while(n--) {
@@ -193,7 +195,7 @@ bailout:
e->d = 1;
menu_list_add_entry(menu,e);
}else{
- printf("malloc error: %s", strerror(errno));
+ mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_MallocError, strerror(errno));
}
free(namelist[n]);
}
@@ -237,7 +239,7 @@ static void read_cmd(menu_t* menu,int cmd) {
}
menu_list_uninit(menu,free_entry);
if(!open_dir(menu,p)) {
- printf("Can't open directory %s\n",p);
+ mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_CantOpenDirectory,p);
menu->cl = 1;
}
free(p);