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
d04effdc
Commit
d04effdc
authored
May 10, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decode_URI: improve documentation, add a return value
parent
33e389f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
include/vlc_url.h
include/vlc_url.h
+1
-1
src/text/strings.c
src/text/strings.c
+17
-7
No files found.
include/vlc_url.h
View file @
d04effdc
...
...
@@ -48,7 +48,7 @@ struct vlc_url_t
VLC_EXPORT
(
char
*
,
unescape_URI_duplicate
,
(
const
char
*
psz
)
);
VLC_EXPORT
(
void
,
unescape_URI
,
(
char
*
psz
)
);
VLC_EXPORT
(
char
*
,
decode_URI_duplicate
,
(
const
char
*
psz
)
);
VLC_EXPORT
(
void
,
decode_URI
,
(
char
*
psz
)
);
VLC_EXPORT
(
char
*
,
decode_URI
,
(
char
*
psz
)
);
VLC_EXPORT
(
char
*
,
encode_URI_component
,
(
const
char
*
psz
)
);
/*****************************************************************************
...
...
src/text/strings.c
View file @
d04effdc
...
...
@@ -130,7 +130,7 @@ void unescape_URI( char *psz )
}
/**
* Decode encoded URI
string
* Decode encoded URI
component. See also decode_URI().
* \return decoded duplicated string
*/
char
*
decode_URI_duplicate
(
const
char
*
psz
)
...
...
@@ -141,14 +141,23 @@ char *decode_URI_duplicate( const char *psz )
}
/**
* Decode encoded URI string in place
* \return nothing
* Decode an encoded URI component in place.
* <b>This function does NOT decode entire URIs.</b>
* It decodes components (e.g. host name, directory, file name).
* Decoded URIs do not exist in the real world (see RFC3986 §2.4).
* Complete URIs are always "encoded" (or they are syntaxically invalid).
*
* Note that URI encoding is different from Javascript escaping. Especially,
* white spaces and Unicode non-ASCII code points are encoded differently.
*
* \return psz on success, NULL if it was not properly encoded
*/
void
decode_URI
(
char
*
psz
)
char
*
decode_URI
(
char
*
psz
)
{
unsigned
char
*
in
=
(
unsigned
char
*
)
psz
,
*
out
=
in
,
c
;
if
(
psz
==
NULL
)
return
;
return
NULL
;
while
(
(
c
=
*
in
++
)
!=
'\0'
)
{
...
...
@@ -160,14 +169,14 @@ void decode_URI( char *psz )
if
(
(
(
hex
[
0
]
=
*
in
++
)
==
0
)
||
(
(
hex
[
1
]
=
*
in
++
)
==
0
)
)
return
;
return
NULL
;
hex
[
2
]
=
'\0'
;
*
out
++
=
(
unsigned
char
)
strtoul
(
hex
,
NULL
,
0x10
);
break
;
}
case
'+'
:
case
'+'
:
/* This is HTTP forms, not URI decoding... */
*
out
++
=
' '
;
break
;
...
...
@@ -182,6 +191,7 @@ void decode_URI( char *psz )
}
*
out
=
'\0'
;
EnsureUTF8
(
psz
);
return
psz
;
}
static
inline
bool
isurisafe
(
int
c
)
...
...
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