]> git.sesse.net Git - vlc/blobdiff - include/vlc_common.h
Support for pgettext
[vlc] / include / vlc_common.h
index e5fdd7f1d7ce7087858824197375a8db8e47b539..869bfc4945223fa15cd5eb9a1416461b07070eb7 100644 (file)
@@ -731,10 +731,6 @@ static inline uint64_t ntoh64 (uint64_t ll)
 #define VLC_UNUSED(x) (void)(x)
 
 /* Stuff defined in src/extras/libc.c */
-VLC_EXPORT( size_t, vlc_strlcpy, ( char *, const char *, size_t ) );
-VLC_EXPORT( long long, vlc_strtoll, ( const char *nptr, char **endptr, int base ) LIBVLC_USED );
-
-VLC_EXPORT( char *, vlc_strcasestr, ( const char *s1, const char *s2 ) LIBVLC_USED );
 
 #if defined(WIN32) || defined(UNDER_CE)
 /* win32, cl and icl support */
@@ -783,14 +779,6 @@ VLC_EXPORT( char *, vlc_strcasestr, ( const char *s1, const char *s2 ) LIBVLC_US
 
 #   ifndef alloca
 #       define alloca _alloca
-#   endif
-
-    /* These two are not defined in mingw32 (bug?) */
-#   ifndef snprintf
-#       define snprintf _snprintf
-#   endif
-#   ifndef vsnprintf
-#       define vsnprintf _vsnprintf
 #   endif
 
 #   include <tchar.h>
@@ -798,10 +786,6 @@ VLC_EXPORT( char *, vlc_strcasestr, ( const char *s1, const char *s2 ) LIBVLC_US
 
 VLC_EXPORT( bool, vlc_ureduce, ( unsigned *, unsigned *, uint64_t, uint64_t, uint64_t ) );
 
-/* vlc_wraptext (defined in src/extras/libc.c) */
-#define wraptext vlc_wraptext
-VLC_EXPORT( char *, vlc_wraptext, ( const char *, int ) LIBVLC_USED );
-
 /* iconv wrappers (defined in src/extras/libc.c) */
 typedef void *vlc_iconv_t;
 VLC_EXPORT( vlc_iconv_t, vlc_iconv_open, ( const char *, const char * ) LIBVLC_USED );
@@ -843,6 +827,12 @@ VLC_EXPORT( void *, vlc_memset, ( void *, int, size_t ) );
  *****************************************************************************/
 VLC_EXPORT( char *, vlc_gettext, ( const char *msgid ) LIBVLC_USED );
 
+static inline const char *vlc_pgettext( const char *ctx, const char *id )
+{
+    const char *tr = vlc_gettext( id );
+    return (tr == ctx) ? id : tr;
+}
+
 /*****************************************************************************
  * libvlc features
  *****************************************************************************/