Skip to content

Commit

Permalink
Rename str_format_meta() to strfinput()
Browse files Browse the repository at this point in the history
Not the best naming convention known to mankind, but still better than
starting with "str".
  • Loading branch information
Rémi Denis-Courmont committed May 17, 2016
1 parent 274f62f commit 70d808b
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 11 deletions.
10 changes: 8 additions & 2 deletions include/vlc_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,18 @@ VLC_API char * vlc_b64_decode( const char *psz_src );
* @return an allocated string (must be free()'d), or NULL on memory error.
*/
VLC_API char *vlc_strftime( const char * );
VLC_API char * str_format_meta( input_thread_t *, const char * );

/**
* Formats input meta-data.
*
* Formats input and input item meta-informations into a heap-allocated string.
*/
VLC_API char *vlc_strfinput( input_thread_t *, const char * );

static inline char *str_format( input_thread_t *input, const char *fmt )
{
char *s1 = vlc_strftime( fmt );
char *s2 = str_format_meta( input, s1 );
char *s2 = vlc_strfinput( input, s1 );
free( s1 );
return s2;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/gui/macosx/CoreInteraction.m
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ - (NSString*)nameOfCurrentPlaylistItem
NSString *o_name = @"";
char *format = var_InheritString(getIntf(), "input-title-format");
if (format) {
char *formated = str_format_meta(p_input, format);
char *formated = vlc_strfinput(p_input, format);
free(format);
o_name = toNSStr(formated);
free(formated);
Expand Down
2 changes: 1 addition & 1 deletion modules/gui/macosx/MainWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ - (void)updateName
if (!config_GetPsz(getIntf(), "video-title")) {
char *format = var_InheritString(getIntf(), "input-title-format");
if (format) {
char *formated = str_format_meta(p_input, format);
char *formated = vlc_strfinput(p_input, format);
free(format);
aString = toNSStr(formated);
free(formated);
Expand Down
4 changes: 2 additions & 2 deletions modules/gui/qt/input_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include <vlc_keys.h> /* ACTION_ID */
#include <vlc_url.h> /* vlc_uri_decode */
#include <vlc_strings.h> /* str_format_meta */
#include <vlc_strings.h> /* vlc_strfinput */
#include <vlc_aout.h> /* audio_output_t */

#include <QApplication>
Expand Down Expand Up @@ -520,7 +520,7 @@ void InputManager::UpdateName()
char *formatted = NULL;
if (format != NULL)
{
formatted = str_format_meta( p_input, format );
formatted = vlc_strfinput( p_input, format );
free( format );
if( formatted != NULL )
{
Expand Down
2 changes: 1 addition & 1 deletion modules/gui/skins2/src/vlcproc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ void VlcProc::update_current_input()
char *psz_name = NULL;
if( psz_fmt != NULL )
{
psz_name = str_format_meta( pInput, psz_fmt );
psz_name = vlc_strfinput( pInput, psz_fmt );
free( psz_fmt );
}

Expand Down
2 changes: 1 addition & 1 deletion src/check_symbols
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cat libvlccore.sym | grep -v \
-e '^net_' -e '^httpd_' \
-e '^config_' -e '^module_' -e '^var_' \
-e '^date_' -e '^sdp_' -e '^plane_' \
-e '^us_' -e '^utf8_' -e '^xml_' -e '^str_format_' -e '^GetLang_' \
-e '^us_' -e '^utf8_' -e '^xml_' -e '^GetLang_' \
-e '^m\(date\|sleep\|wait\)$' -e '^[A-Z][a-z]*Charset$' -e 'MD5$' \
-e '^NTPtime64$' -e '^secstotimestr$' \
&& exit 1
Expand Down
2 changes: 1 addition & 1 deletion src/libvlccore.sym
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ stream_UrlNew
stream_vaControl
stream_ReadDir
stream_FilterDefaultReadDir
str_format_meta
vlc_strfinput
vlc_strftime
subpicture_Delete
subpicture_New
Expand Down
4 changes: 2 additions & 2 deletions src/text/strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <limits.h>
#include <math.h>

/* Needed by str_format_meta */
/* Needed by vlc_strfinput */
#include <vlc_input.h>
#include <vlc_meta.h>
#include <vlc_aout.h>
Expand Down Expand Up @@ -524,7 +524,7 @@ static int write_meta(FILE *stream, input_item_t *item, vlc_meta_type_t type)
return ret;
}

char *str_format_meta(input_thread_t *input, const char *s)
char *vlc_strfinput(input_thread_t *input, const char *s)
{
char *str;
size_t len;
Expand Down

0 comments on commit 70d808b

Please sign in to comment.