Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
300b9f27
Commit
300b9f27
authored
Nov 21, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Save config file as
UTF-8
, starting with Byte-Order-Mark.
- Leverage fputc().
parent
b01009b8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
src/misc/configuration.c
src/misc/configuration.c
+12
-12
No files found.
src/misc/configuration.c
View file @
300b9f27
...
@@ -1154,7 +1154,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
...
@@ -1154,7 +1154,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
return
-
1
;
return
-
1
;
}
}
fprintf
(
file
,
"###
\n
### "
COPYRIGHT_MESSAGE
"
\n
###
\n\n
"
fprintf
(
file
,
"
\xEF\xBB\xBF
###
\n
### "
COPYRIGHT_MESSAGE
"
\n
###
\n\n
"
"###
\n
### lines begining with a '#' character are comments
\n
###
\n\n
"
);
"###
\n
### lines begining with a '#' character are comments
\n
###
\n\n
"
);
/* Look for the selected module, if NULL then save everything */
/* Look for the selected module, if NULL then save everything */
...
@@ -1175,7 +1175,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
...
@@ -1175,7 +1175,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
fprintf
(
file
,
"[%s]"
,
p_parser
->
psz_object_name
);
fprintf
(
file
,
"[%s]"
,
p_parser
->
psz_object_name
);
if
(
p_parser
->
psz_longname
)
if
(
p_parser
->
psz_longname
)
utf8_
fprintf
(
file
,
" # %s
\n\n
"
,
p_parser
->
psz_longname
);
fprintf
(
file
,
" # %s
\n\n
"
,
p_parser
->
psz_longname
);
else
else
fprintf
(
file
,
"
\n\n
"
);
fprintf
(
file
,
"
\n\n
"
);
...
@@ -1186,7 +1186,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
...
@@ -1186,7 +1186,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
char
*
psz_key
;
char
*
psz_key
;
int
i_value
=
p_item
->
i_value
;
int
i_value
=
p_item
->
i_value
;
float
f_value
=
p_item
->
f_value
;
float
f_value
=
p_item
->
f_value
;
char
*
psz_value
=
p_item
->
psz_value
;
c
onst
c
har
*
psz_value
=
p_item
->
psz_value
;
if
(
p_item
->
i_type
&
CONFIG_HINT
)
if
(
p_item
->
i_type
&
CONFIG_HINT
)
/* ignore hints */
/* ignore hints */
...
@@ -1215,11 +1215,11 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
...
@@ -1215,11 +1215,11 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
case
CONFIG_ITEM_BOOL
:
case
CONFIG_ITEM_BOOL
:
case
CONFIG_ITEM_INTEGER
:
case
CONFIG_ITEM_INTEGER
:
if
(
p_item
->
psz_text
)
if
(
p_item
->
psz_text
)
utf8_
fprintf
(
file
,
"# %s (%s)
\n
"
,
p_item
->
psz_text
,
fprintf
(
file
,
"# %s (%s)
\n
"
,
p_item
->
psz_text
,
(
p_item
->
i_type
==
CONFIG_ITEM_BOOL
)
?
(
p_item
->
i_type
==
CONFIG_ITEM_BOOL
)
?
_
(
"boolean"
)
:
_
(
"integer"
)
);
_
(
"boolean"
)
:
_
(
"integer"
)
);
if
(
i_value
==
p_item
->
i_value_orig
)
if
(
i_value
==
p_item
->
i_value_orig
)
fp
rintf
(
file
,
"#"
);
fp
utc
(
'#'
,
file
);
fprintf
(
file
,
"%s=%i
\n
"
,
p_item
->
psz_name
,
i_value
);
fprintf
(
file
,
"%s=%i
\n
"
,
p_item
->
psz_name
,
i_value
);
p_item
->
i_value_saved
=
i_value
;
p_item
->
i_value_saved
=
i_value
;
...
@@ -1227,10 +1227,10 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
...
@@ -1227,10 +1227,10 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
case
CONFIG_ITEM_KEY
:
case
CONFIG_ITEM_KEY
:
if
(
p_item
->
psz_text
)
if
(
p_item
->
psz_text
)
utf8_
fprintf
(
file
,
"# %s (%s)
\n
"
,
p_item
->
psz_text
,
fprintf
(
file
,
"# %s (%s)
\n
"
,
p_item
->
psz_text
,
_
(
"key"
)
);
_
(
"key"
)
);
if
(
i_value
==
p_item
->
i_value_orig
)
if
(
i_value
==
p_item
->
i_value_orig
)
fp
rintf
(
file
,
"#"
);
fp
utc
(
'#'
,
file
);
psz_key
=
ConfigKeyToString
(
i_value
);
psz_key
=
ConfigKeyToString
(
i_value
);
fprintf
(
file
,
"%s=%s
\n
"
,
p_item
->
psz_name
,
fprintf
(
file
,
"%s=%s
\n
"
,
p_item
->
psz_name
,
psz_key
?
psz_key
:
""
);
psz_key
?
psz_key
:
""
);
...
@@ -1241,10 +1241,10 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
...
@@ -1241,10 +1241,10 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
case
CONFIG_ITEM_FLOAT
:
case
CONFIG_ITEM_FLOAT
:
if
(
p_item
->
psz_text
)
if
(
p_item
->
psz_text
)
utf8_
fprintf
(
file
,
"# %s (%s)
\n
"
,
p_item
->
psz_text
,
fprintf
(
file
,
"# %s (%s)
\n
"
,
p_item
->
psz_text
,
_
(
"float"
)
);
_
(
"float"
)
);
if
(
f_value
==
p_item
->
f_value_orig
)
if
(
f_value
==
p_item
->
f_value_orig
)
fp
rintf
(
file
,
"#"
);
fp
utc
(
'#'
,
file
);
fprintf
(
file
,
"%s=%f
\n
"
,
p_item
->
psz_name
,
(
double
)
f_value
);
fprintf
(
file
,
"%s=%f
\n
"
,
p_item
->
psz_name
,
(
double
)
f_value
);
p_item
->
f_value_saved
=
f_value
;
p_item
->
f_value_saved
=
f_value
;
...
@@ -1252,12 +1252,12 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
...
@@ -1252,12 +1252,12 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
default:
default:
if
(
p_item
->
psz_text
)
if
(
p_item
->
psz_text
)
utf8_
fprintf
(
file
,
"# %s (%s)
\n
"
,
p_item
->
psz_text
,
fprintf
(
file
,
"# %s (%s)
\n
"
,
p_item
->
psz_text
,
_
(
"string"
)
);
_
(
"string"
)
);
if
(
(
!
psz_value
&&
!
p_item
->
psz_value_orig
)
||
if
(
(
!
psz_value
&&
!
p_item
->
psz_value_orig
)
||
(
psz_value
&&
p_item
->
psz_value_orig
&&
(
psz_value
&&
p_item
->
psz_value_orig
&&
!
strcmp
(
psz_value
,
p_item
->
psz_value_orig
))
)
!
strcmp
(
psz_value
,
p_item
->
psz_value_orig
))
)
fp
rintf
(
file
,
"#"
);
fp
utc
(
'#'
,
file
);
fprintf
(
file
,
"%s=%s
\n
"
,
p_item
->
psz_name
,
fprintf
(
file
,
"%s=%s
\n
"
,
p_item
->
psz_name
,
psz_value
?
psz_value
:
""
);
psz_value
?
psz_value
:
""
);
...
@@ -1272,7 +1272,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
...
@@ -1272,7 +1272,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
}
}
}
}
fp
rintf
(
file
,
"
\n
"
);
fp
utc
(
'\n'
,
file
);
}
}
vlc_list_release
(
p_list
);
vlc_list_release
(
p_list
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment