summaryrefslogtreecommitdiffstats
path: root/libmenu/menu.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.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.c')
-rw-r--r--libmenu/menu.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/libmenu/menu.c b/libmenu/menu.c
index e0ef965e24..6113fb6dce 100644
--- a/libmenu/menu.c
+++ b/libmenu/menu.c
@@ -1,5 +1,7 @@
#include "config.h"
+#include "mp_msg.h"
+#include "help_mp.h"
#include <stdlib.h>
#include <stdio.h>
@@ -63,7 +65,7 @@ static int menu_parse_config(char* buffer) {
while(1) {
r = asx_get_element(parser,&buffer,&element,&body,&attribs);
if(r < 0) {
- printf("Syntax error at line %d\n",parser->line);
+ mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_SyntaxErrorAtLine,parser->line);
asx_parser_free(parser);
return 0;
} else if(r == 0) {
@@ -73,7 +75,7 @@ static int menu_parse_config(char* buffer) {
// Has it a name ?
name = asx_get_attrib("name",attribs);
if(!name) {
- printf("Menu definitions need a name attrib (line %d)\n",parser->line);
+ mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_MenuDefinitionsNeedANameAttrib,parser->line);
free(element);
if(body) free(body);
asx_free_attribs(attribs);
@@ -98,13 +100,13 @@ static int menu_parse_config(char* buffer) {
for(i = 0 ; attribs[2*i] ; i++) {
if(strcasecmp(attribs[2*i],"name") == 0) continue;
if(!m_struct_set(&minfo->priv_st,menu_list[mcount].cfg,attribs[2*i], attribs[2*i+1]))
- printf("Bad attrib %s=%s in menu %s at line %d\n",attribs[2*i],attribs[2*i+1],
+ mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_BadAttrib,attribs[2*i],attribs[2*i+1],
name,parser->line);
}
mcount++;
memset(&menu_list[mcount],0,sizeof(menu_def_t));
} else {
- printf("Unknown menu type %s at line %d\n",element,parser->line);
+ mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnknownMenuType,element,parser->line);
free(name);
if(body) free(body);
}
@@ -130,7 +132,7 @@ int menu_init(char* cfg_file) {
#endif
fd = open(cfg_file, O_RDONLY);
if(fd < 0) {
- printf("Can't open menu config file: %s\n",cfg_file);
+ mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_CantOpenConfigFile,cfg_file);
return 0;
}
buffer = malloc(bl);
@@ -138,7 +140,7 @@ int menu_init(char* cfg_file) {
int r;
if(bl - br < BUF_MIN) {
if(bl >= BUF_MAX) {
- printf("Menu config file is too big (> %d KB)\n",BUF_MAX/1024);
+ mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_ConfigFileIsTooBig,BUF_MAX/1024);
close(fd);
free(buffer);
return 0;
@@ -151,7 +153,7 @@ int menu_init(char* cfg_file) {
br += r;
}
if(!br) {
- printf("Menu config file is empty\n");
+ mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_ConfigFileIsEmpty);
return 0;
}
buffer[br-1] = '\0';
@@ -208,7 +210,7 @@ menu_t* menu_open(char *name) {
break;
}
if(menu_list[i].name == NULL) {
- printf("Menu %s not found\n",name);
+ mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_MenuNotFound,name);
return NULL;
}
m = calloc(1,sizeof(menu_t));
@@ -219,7 +221,7 @@ menu_t* menu_open(char *name) {
if(m->priv)
m_struct_free(m->priv_st,m->priv);
free(m);
- printf("Menu %s: init failed\n",name);
+ mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_MenuInitFailed,name);
return NULL;
}
@@ -301,7 +303,7 @@ void menu_draw_text(mp_image_t* mpi,char* txt, int x, int y) {
int font;
if(!draw_alpha) {
- printf("Unsupported outformat !!!!\n");
+ mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnsupportedOutformat);
return;
}
@@ -332,7 +334,7 @@ void menu_draw_text_full(mp_image_t* mpi,char* txt,
draw_alpha_f draw_alpha = get_draw_alpha(mpi->imgfmt);
if(!draw_alpha) {
- printf("Unsupported outformat !!!!\n");
+ mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnsupportedOutformat);
return;
}