1
mirror of https://github.com/mpv-player/mpv synced 2025-03-30 22:09:20 +02:00

changed printf's to mp_msg

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5116 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2002-03-15 22:42:28 +00:00
parent 880dc95d31
commit f102cdf14f

@ -103,7 +103,7 @@ m_config_save_option(m_config_t* config, config_t* conf,char* opt, char *param)
case CONF_TYPE_FUNC : case CONF_TYPE_FUNC :
break; break;
default : default :
printf("Should never append in m_config_save_option : conf->type=%d\n",conf->type); mp_msg(MSGT_CFGPARSER,MSGL_ERR,"Should never append in m_config_save_option : conf->type=%d\n",conf->type);
} }
config->config_stack[config->cs_level] = save; config->config_stack[config->cs_level] = save;
@ -165,7 +165,7 @@ m_config_revert_option(m_config_t* config, config_save_t* save) {
break; break;
case CONF_TYPE_FUNC_PARAM : case CONF_TYPE_FUNC_PARAM :
if (iter->param.as_pointer == NULL) { if (iter->param.as_pointer == NULL) {
printf("We lost param for option %s?\n",iter->opt->name); mp_msg(MSGT_CFGPARSER,MSGL_ERR,"We lost param for option %s?\n",iter->opt->name);
return -1; return -1;
} }
if ((((cfg_func_param_t) iter->opt->p)(iter->opt, (char*)iter->param.as_pointer)) < 0) if ((((cfg_func_param_t) iter->opt->p)(iter->opt, (char*)iter->param.as_pointer)) < 0)
@ -184,7 +184,7 @@ m_config_revert_option(m_config_t* config, config_save_t* save) {
} }
break; break;
default : default :
printf("Why do we reverse this : name=%s type=%d ?\n",save->opt->name,save->opt->type); mp_msg(MSGT_CFGPARSER,MSGL_WARN,"Why do we reverse this : name=%s type=%d ?\n",save->opt->name,save->opt->type);
} }
return 1; return 1;
@ -666,7 +666,7 @@ static int config_read_option(m_config_t *config,config_t** conf_list, char *opt
break; break;
} }
case CONF_TYPE_PRINT: case CONF_TYPE_PRINT:
printf("%s", (char *) conf[i].p); mp_msg(MSGT_CFGPARSER, MSGL_INFO, "%s", (char *) conf[i].p);
exit(1); exit(1);
default: default:
mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Unknown config type specified in conf-mplayer.h!\n"); mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Unknown config type specified in conf-mplayer.h!\n");
@ -733,7 +733,7 @@ int m_config_set_option(m_config_t *config,char *opt, char *param) {
int m_config_parse_config_file(m_config_t *config, char *conffile) int m_config_parse_config_file(m_config_t *config, char *conffile)
{ {
#define PRINT_LINENUM printf("%s(%d): ", conffile, line_num) #define PRINT_LINENUM mp_msg(MSGT_CFGPARSER,MSGL_INFO,"%s(%d): ", conffile, line_num)
#define MAX_LINE_LEN 1000 #define MAX_LINE_LEN 1000
#define MAX_OPT_LEN 100 #define MAX_OPT_LEN 100
#define MAX_PARAM_LEN 100 #define MAX_PARAM_LEN 100
@ -755,10 +755,10 @@ int m_config_parse_config_file(m_config_t *config, char *conffile)
// assert(conf_list != NULL); // assert(conf_list != NULL);
#endif #endif
if (++config->recursion_depth > 1) if (++config->recursion_depth > 1)
printf("Reading config file: %s", conffile); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"Reading config file: %s", conffile);
if (config->recursion_depth > MAX_RECURSION_DEPTH) { if (config->recursion_depth > MAX_RECURSION_DEPTH) {
printf(": too deep 'include'. check your configfiles\n"); mp_msg(MSGT_CFGPARSER,MSGL_INFO,": too deep 'include'. check your configfiles\n");
ret = -1; ret = -1;
goto out; goto out;
} }
@ -769,24 +769,24 @@ int m_config_parse_config_file(m_config_t *config, char *conffile)
} }
if ((line = (char *) malloc(MAX_LINE_LEN + 1)) == NULL) { if ((line = (char *) malloc(MAX_LINE_LEN + 1)) == NULL) {
printf("\ncan't get memory for 'line': %s", strerror(errno)); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"\ncan't get memory for 'line': %s", strerror(errno));
ret = -1; ret = -1;
goto out; goto out;
} }
if ((fp = fopen(conffile, "r")) == NULL) { if ((fp = fopen(conffile, "r")) == NULL) {
if (config->recursion_depth > 1) if (config->recursion_depth > 1)
printf(": %s\n", strerror(errno)); mp_msg(MSGT_CFGPARSER,MSGL_INFO,": %s\n", strerror(errno));
free(line); free(line);
ret = 0; ret = 0;
goto out; goto out;
} }
if (config->recursion_depth > 1) if (config->recursion_depth > 1)
printf("\n"); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"\n");
while (fgets(line, MAX_LINE_LEN, fp)) { while (fgets(line, MAX_LINE_LEN, fp)) {
if (errors >= 16) { if (errors >= 16) {
printf("too many errors\n"); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"too many errors\n");
goto out; goto out;
} }
@ -809,7 +809,7 @@ int m_config_parse_config_file(m_config_t *config, char *conffile)
opt[opt_pos++] = line[line_pos++]; opt[opt_pos++] = line[line_pos++];
if (opt_pos >= MAX_OPT_LEN) { if (opt_pos >= MAX_OPT_LEN) {
PRINT_LINENUM; PRINT_LINENUM;
printf("too long option\n"); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"too long option\n");
errors++; errors++;
ret = -1; ret = -1;
goto nextline; goto nextline;
@ -817,7 +817,7 @@ int m_config_parse_config_file(m_config_t *config, char *conffile)
} }
if (opt_pos == 0) { if (opt_pos == 0) {
PRINT_LINENUM; PRINT_LINENUM;
printf("parse error\n"); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"parse error\n");
ret = -1; ret = -1;
errors++; errors++;
continue; continue;
@ -826,7 +826,7 @@ int m_config_parse_config_file(m_config_t *config, char *conffile)
#ifdef MP_DEBUG #ifdef MP_DEBUG
PRINT_LINENUM; PRINT_LINENUM;
printf("option: %s\n", opt); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"option: %s\n", opt);
#endif #endif
/* skip whitespaces */ /* skip whitespaces */
@ -836,7 +836,7 @@ int m_config_parse_config_file(m_config_t *config, char *conffile)
/* check '=' */ /* check '=' */
if (line[line_pos++] != '=') { if (line[line_pos++] != '=') {
PRINT_LINENUM; PRINT_LINENUM;
printf("option without parameter\n"); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"option without parameter\n");
ret = -1; ret = -1;
errors++; errors++;
continue; continue;
@ -854,7 +854,7 @@ int m_config_parse_config_file(m_config_t *config, char *conffile)
param[param_pos++] = line[line_pos++]; param[param_pos++] = line[line_pos++];
if (param_pos >= MAX_PARAM_LEN) { if (param_pos >= MAX_PARAM_LEN) {
PRINT_LINENUM; PRINT_LINENUM;
printf("too long parameter\n"); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"too long parameter\n");
ret = -1; ret = -1;
errors++; errors++;
goto nextline; goto nextline;
@ -867,7 +867,7 @@ int m_config_parse_config_file(m_config_t *config, char *conffile)
param[param_pos++] = line[line_pos++]; param[param_pos++] = line[line_pos++];
if (param_pos >= MAX_PARAM_LEN) { if (param_pos >= MAX_PARAM_LEN) {
PRINT_LINENUM; PRINT_LINENUM;
printf("too long parameter\n"); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"too long parameter\n");
ret = -1; ret = -1;
errors++; errors++;
goto nextline; goto nextline;
@ -879,7 +879,7 @@ int m_config_parse_config_file(m_config_t *config, char *conffile)
/* did we read a parameter? */ /* did we read a parameter? */
if (param_pos == 0) { if (param_pos == 0) {
PRINT_LINENUM; PRINT_LINENUM;
printf("option without parameter\n"); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"option without parameter\n");
ret = -1; ret = -1;
errors++; errors++;
continue; continue;
@ -887,7 +887,7 @@ int m_config_parse_config_file(m_config_t *config, char *conffile)
#ifdef MP_DEBUG #ifdef MP_DEBUG
PRINT_LINENUM; PRINT_LINENUM;
printf("parameter: %s\n", param); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"parameter: %s\n", param);
#endif #endif
/* now, check if we have some more chars on the line */ /* now, check if we have some more chars on the line */
@ -898,7 +898,7 @@ int m_config_parse_config_file(m_config_t *config, char *conffile)
/* EOL / comment */ /* EOL / comment */
if (line[line_pos] != '\0' && line[line_pos] != '#') { if (line[line_pos] != '\0' && line[line_pos] != '#') {
PRINT_LINENUM; PRINT_LINENUM;
printf("extra characters on line: %s\n", line+line_pos); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"extra characters on line: %s\n", line+line_pos);
ret = -1; ret = -1;
} }
@ -909,7 +909,7 @@ int m_config_parse_config_file(m_config_t *config, char *conffile)
case ERR_OUT_OF_RANGE: case ERR_OUT_OF_RANGE:
case ERR_FUNC_ERR: case ERR_FUNC_ERR:
PRINT_LINENUM; PRINT_LINENUM;
printf("%s\n", opt); mp_msg(MSGT_CFGPARSER,MSGL_INFO,"%s\n", opt);
ret = -1; ret = -1;
errors++; errors++;
continue; continue;