Changeset 2851705c32f14a69dcf115859481f0e4267d9ac2

Show
Ignore:
Timestamp:
08/17/05 16:39:07 (3 years ago)
Author:
Christophe Massiot <massiot@videolan.org>
git-committer:
Christophe Massiot <massiot@videolan.org> 1124289547 +0000
git-parent:

[606657480ad9bf46664eea80f2a8e49aabc02d37]

git-author:
Christophe Massiot <massiot@videolan.org> 1124289547 +0000
Message:
  • Makefile.am: New file version.c, generated at each 'make' command.
  • toolbox: New --update-version switch, which builds the version.c file
    from current date, user/hostname/domainname, compiler version and
    svn changeset.
  • src/libvlc.c: Exported API to access data from version.c.
  • modules/control/http.c: New variables vlc_compile_time, vlc_compile_by,
    vlc_compile_host, vlc_compile_domain, vlc_compiler and vlc_changeset.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Makefile.am

    r5b85463 r2851705  
    4949    stamp-api \ 
    5050    src/misc/modules_builtin.h \ 
     51    src/misc/version.c \ 
    5152    $(NULL) 
    5253 
     
    131132    srcdir=$(srcdir) $(srcdir)/toolbox --update-includes 
    132133    touch $@ 
     134 
     135src/misc/version.c: FORCE 
     136    srcdir=$(srcdir) $(srcdir)/toolbox --update-version 
    133137 
    134138# These dependencies are mandatory 
     
    413417    src/misc/vlm.c \ 
    414418    src/misc/xml.c \ 
     419    src/misc/version.c \ 
    415420    src/extras/libc.c \ 
    416421    src/control/core.c \ 
  • include/vlc/vlc.h

    rfe087a3 r2851705  
    153153 * Exported libvlc API 
    154154 *****************************************************************************/ 
    155  
     155#if !defined( __VLC__ ) 
     156/* Otherwise they are declared and exported in vlc_common.h */ 
    156157/** 
    157158 * Retrieve libvlc version 
     
    160161 */ 
    161162char const * VLC_Version ( void ); 
     163 
     164/** 
     165 * Retrieve libvlc compile time 
     166 * 
     167 * \return a string containing the libvlc compile time 
     168 */ 
     169char const * VLC_CompileTime ( void ); 
     170 
     171/** 
     172 * Retrieve the username of the libvlc builder 
     173 * 
     174 * \return a string containing the username of the libvlc builder 
     175 */ 
     176char const * VLC_CompileBy ( void ); 
     177 
     178/** 
     179 * Retrieve the host of the libvlc builder 
     180 * 
     181 * \return a string containing the host of the libvlc builder 
     182 */ 
     183char const * VLC_CompileHost ( void ); 
     184 
     185/** 
     186 * Retrieve the domain name of the host of the libvlc builder 
     187 * 
     188 * \return a string containing the domain name of the host of the libvlc builder 
     189 */ 
     190char const * VLC_CompileDomain ( void ); 
     191 
     192/** 
     193 * Retrieve libvlc compiler version 
     194 * 
     195 * \return a string containing the libvlc compiler version 
     196 */ 
     197char const * VLC_Compiler ( void ); 
     198 
     199/** 
     200 * Retrieve libvlc changeset 
     201 * 
     202 * \return a string containing the libvlc subversion changeset 
     203 */ 
     204char const * VLC_Changeset ( void ); 
    162205 
    163206/** 
     
    168211 */ 
    169212char const * VLC_Error ( int i_err ); 
     213 
     214#endif /* __VLC__ */ 
    170215 
    171216/** 
  • include/vlc_common.h

    r26e6004 r2851705  
    10881088 
    10891089/***************************************************************************** 
     1090 * libvlc features 
     1091 *****************************************************************************/ 
     1092VLC_EXPORT( const char *, VLC_Version, ( void ) ); 
     1093VLC_EXPORT( const char *, VLC_CompileTime, ( void ) ); 
     1094VLC_EXPORT( const char *, VLC_CompileBy, ( void ) ); 
     1095VLC_EXPORT( const char *, VLC_CompileHost, ( void ) ); 
     1096VLC_EXPORT( const char *, VLC_CompileDomain, ( void ) ); 
     1097VLC_EXPORT( const char *, VLC_Compiler, ( void ) ); 
     1098VLC_EXPORT( const char *, VLC_Changeset, ( void ) ); 
     1099VLC_EXPORT( const char *, VLC_Error, ( int ) ); 
     1100 
     1101/***************************************************************************** 
    10901102 * Additional vlc stuff 
    10911103 *****************************************************************************/ 
  • include/vlc_symbols.h

    r28caec4 r2851705  
    409409    void (*__osd_MenuActivate_inner) (vlc_object_t *); 
    410410    void (*__osd_Volume_inner) (vlc_object_t *); 
     411    const char * (*VLC_Compiler_inner) (void); 
     412    const char * (*VLC_Error_inner) (int); 
     413    const char * (*VLC_Changeset_inner) (void); 
     414    const char * (*VLC_CompileBy_inner) (void); 
     415    const char * (*VLC_CompileDomain_inner) (void); 
     416    const char * (*VLC_CompileHost_inner) (void); 
     417    const char * (*VLC_Version_inner) (void); 
     418    const char * (*VLC_CompileTime_inner) (void); 
    411419}; 
    412420# if defined (__PLUGIN__) 
     
    799807#  define __osd_MenuActivate (p_symbols)->__osd_MenuActivate_inner 
    800808#  define __osd_Volume (p_symbols)->__osd_Volume_inner 
     809#  define VLC_Compiler (p_symbols)->VLC_Compiler_inner 
     810#  define VLC_Error (p_symbols)->VLC_Error_inner 
     811#  define VLC_Changeset (p_symbols)->VLC_Changeset_inner 
     812#  define VLC_CompileBy (p_symbols)->VLC_CompileBy_inner 
     813#  define VLC_CompileDomain (p_symbols)->VLC_CompileDomain_inner 
     814#  define VLC_CompileHost (p_symbols)->VLC_CompileHost_inner 
     815#  define VLC_Version (p_symbols)->VLC_Version_inner 
     816#  define VLC_CompileTime (p_symbols)->VLC_CompileTime_inner 
    801817# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__) 
    802818/****************************************************************** 
     
    11921208    ((p_symbols)->__osd_MenuActivate_inner) = __osd_MenuActivate; \ 
    11931209    ((p_symbols)->__osd_Volume_inner) = __osd_Volume; \ 
     1210    ((p_symbols)->VLC_Compiler_inner) = VLC_Compiler; \ 
     1211    ((p_symbols)->VLC_Error_inner) = VLC_Error; \ 
     1212    ((p_symbols)->VLC_Changeset_inner) = VLC_Changeset; \ 
     1213    ((p_symbols)->VLC_CompileBy_inner) = VLC_CompileBy; \ 
     1214    ((p_symbols)->VLC_CompileDomain_inner) = VLC_CompileDomain; \ 
     1215    ((p_symbols)->VLC_CompileHost_inner) = VLC_CompileHost; \ 
     1216    ((p_symbols)->VLC_Version_inner) = VLC_Version; \ 
     1217    ((p_symbols)->VLC_CompileTime_inner) = VLC_CompileTime; \ 
    11941218    (p_symbols)->net_ConvertIPv4_deprecated = NULL; \ 
    11951219    (p_symbols)->vlc_fix_readdir_charset_deprecated = NULL; \ 
  • modules/control/http.c

    r6066574 r2851705  
    30443044 
    30453045        p_args->vars = mvar_New( "variables", "" ); 
    3046         mvar_AppendNewVar( p_args->vars, "url_param", i_request > 0 ? "1" : "0" ); 
     3046        mvar_AppendNewVar( p_args->vars, "url_param", 
     3047                           i_request > 0 ? "1" : "0" ); 
    30473048        mvar_AppendNewVar( p_args->vars, "url_value", p_request ); 
    3048         mvar_AppendNewVar( p_args->vars, "version",   VERSION_MESSAGE ); 
     3049        mvar_AppendNewVar( p_args->vars, "version", VLC_Version() ); 
    30493050        mvar_AppendNewVar( p_args->vars, "copyright", COPYRIGHT_MESSAGE ); 
     3051        mvar_AppendNewVar( p_args->vars, "vlc_compile_time", 
     3052                           VLC_CompileTime() ); 
     3053        mvar_AppendNewVar( p_args->vars, "vlc_compile_by", VLC_CompileBy() ); 
     3054        mvar_AppendNewVar( p_args->vars, "vlc_compile_host", 
     3055                           VLC_CompileHost() ); 
     3056        mvar_AppendNewVar( p_args->vars, "vlc_compile_domain", 
     3057                           VLC_CompileDomain() ); 
     3058        mvar_AppendNewVar( p_args->vars, "vlc_compiler", VLC_Compiler() ); 
     3059        mvar_AppendNewVar( p_args->vars, "vlc_changeset", VLC_Changeset() ); 
    30503060        mvar_AppendNewVar( p_args->vars, "stream_position", position ); 
    30513061        mvar_AppendNewVar( p_args->vars, "stream_time", time ); 
  • src/libvlc.c

    ra3eb885 r2851705  
    138138    return VERSION_MESSAGE; 
    139139} 
     140 
     141/***************************************************************************** 
     142 * VLC_CompileTime, VLC_CompileBy, VLC_CompileHost, VLC_CompileDomain, 
     143 * VLC_Compiler, VLC_Changeset 
     144 *****************************************************************************/ 
     145#define DECLARE_VLC_VERSION( func, var )                                    \ 
     146extern const char psz_vlc_##var [];                                         \ 
     147char const * VLC_##func ( void )                                            \ 
     148{                                                                           \ 
     149    return psz_vlc_##var ;                                                  \ 
     150} 
     151 
     152DECLARE_VLC_VERSION( CompileTime, compile_time ); 
     153DECLARE_VLC_VERSION( CompileBy, compile_by ); 
     154DECLARE_VLC_VERSION( CompileHost, compile_host ); 
     155DECLARE_VLC_VERSION( CompileDomain, compile_domain ); 
     156DECLARE_VLC_VERSION( Compiler, compiler ); 
     157DECLARE_VLC_VERSION( Changeset, changeset ); 
    140158 
    141159/***************************************************************************** 
     
    23612379#endif 
    23622380 
    2363     fprintf( stdout, VERSION_MESSAGE "\n" ); 
     2381    fprintf( stdout, _("VLC version %s\n"), VLC_Version() ); 
     2382    fprintf( stdout, _("Compiled on %s by %s@%s.%s\n"), VLC_CompileTime(), 
     2383             VLC_CompileBy(), VLC_CompileHost(), VLC_CompileDomain() ); 
     2384    fprintf( stdout, _("Compiler: %s\n"), VLC_Compiler() ); 
     2385    if( *VLC_Changeset() ) 
     2386        fprintf( stdout, _("Based upon svn changeset [%s]\n"), 
     2387                 VLC_Changeset() ); 
    23642388    fprintf( stdout, 
    23652389      _("This program comes with NO WARRANTY, to the extent permitted by " 
  • toolbox

    rc8c6021 r2851705  
    2929  --update-po             update translation files 
    3030  --update-includes       generate various include files 
     31  --update-version        generate src/misc/version.c 
    3132  --update-glade          generate and fix Glade code 
    3233  --update-glade2         generate and fix Glade 2 code 
     
    7172  --update-includes) 
    7273    action=includes 
     74    ;; 
     75  --update-version) 
     76    action=version 
    7377    ;; 
    7478  --update-flexml) 
     
    427431 
    428432## 
     433##  Create version file 
     434## 
     435if test "${action}" = "version" 
     436then 
     437  if test -z "${srcdir}"; then 
     438    srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`" 
     439  fi 
     440  if test -z "${builddir}"; then 
     441    builddir="`sed -ne 's/^top_builddir *= *//p' < Makefile`" 
     442  fi 
     443  if test -z "${CC}"; then 
     444    CC="`sed -ne 's/^CC *= *//p' < Makefile`" 
     445  fi 
     446 
     447  VLC_COMPILE_TIME=`LC_ALL=C LANG=C date` 
     448  VLC_COMPILE_BY=`whoami` 
     449  VLC_COMPILE_HOST=`hostname` 
     450  if which dnsdomainname 2>&1 >/dev/null; then 
     451    VLC_COMPILE_DOMAIN=`dnsdomainname` 
     452  elif which domainname 2>&1 >/dev/null; then 
     453    VLC_COMPILE_DOMAIN=`domainname` 
     454  else 
     455    VLC_COMPILE_DOMAIN=unknown 
     456  fi 
     457  VLC_COMPILER=`$CC -v 2>&1 | tail -n 1` 
     458  if which svnversion 2>&1 >/dev/null; then 
     459    VLC_CHANGESET=`svnversion $srcdir` 
     460  else 
     461    VLC_CHANGESET='' 
     462  fi 
     463 
     464  cat >| src/misc/version.c << EOF 
     465const char psz_vlc_compile_time[] = "${VLC_COMPILE_TIME}"; 
     466const char psz_vlc_compile_by[] = "${VLC_COMPILE_BY}"; 
     467const char psz_vlc_compile_host[] = "${VLC_COMPILE_HOST}"; 
     468const char psz_vlc_compile_domain[] = "${VLC_COMPILE_DOMAIN}"; 
     469const char psz_vlc_compiler[] = "${VLC_COMPILER}"; 
     470const char psz_vlc_changeset[] = "${VLC_CHANGESET}"; 
     471EOF 
     472fi 
     473 
     474## 
    429475##  Fix glade-generated files 
    430476##