Commit a8d1e07d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove vlc_symbols - refs #297.

Maintaining an API with this was pretty much impossible. 
parent 7171c2bd
......@@ -21,7 +21,6 @@ EXTRA_DIST = \
README.MacOSX.rtf \
bootstrap \
toolbox \
vlc-api.pl \
vlc-config.in.in \
vlc.fedora.spec \
vlc.mandriva.spec \
......@@ -1029,7 +1028,7 @@ update-po:
echo "" ; \
echo "# main sources" ; \
find include src -name '*.[chm]' -o -name '*.[ch]pp' \
| grep -v '\(vlc_symbols\|misc/modules_\|src/misc/revision.c\|modules/builtin.h\)' \
| grep -v '\(misc/modules_\|src/misc/revision.c\|modules/builtin.h\)' \
| sort ; \
echo "" ; \
echo "# modules" ; \
......@@ -1058,7 +1057,7 @@ stamp-builtin: FORCE
###############################################################################
# Enforce Mac OS X deployment target environment variable
###############################################################################
macosx-sdk: Makefile.in $(HEADERS_include) vlc-config vlc-api.pl
macosx-sdk: Makefile.in $(HEADERS_include) vlc-config
export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET)
###############################################################################
......
......@@ -1016,7 +1016,6 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw )
VLC_INTERNAL( void, vlc_seekdir, ( void *, long ) );
VLC_INTERNAL( long, vlc_telldir, ( void * ) );
#else
struct dirent; /* forward declaration for vlc_symbols.h */
# if !defined(__PLUGIN__)
# define vlc_opendir NULL
# define vlc_readdir NULL
......@@ -1222,12 +1221,6 @@ VLC_EXPORT( const char *, VLC_Changeset, ( void ) );
/*****************************************************************************
* Additional vlc stuff
*****************************************************************************/
#ifndef HAVE_SHARED_LIBVLC
# ifdef HAVE_DIRENT_H
# include <dirent.h> /* for DIR typedef in vlc_symbols.h */
# endif
# include "vlc_symbols.h"
#endif
#include "vlc_os_specific.h"
#include "vlc_messages.h"
#include "vlc_variables.h"
......
This diff is collapsed.
#!/usr/bin/perl
#*****************************************************************************
#* vlc-api.pl: VLC API maintenance script
#*****************************************************************************
#* Copyright (C) 2005 the VideoLAN team
#* $Id$
#*
#* Authors: Rémi Denis-Courmont <rem # videolan.org>
#*
#* This program is free software; you can redistribute it and/or modify
#* it under the terms of the GNU General Public License as published by
#* the Free Software Foundation; either version 2 of the License, or
#* (at your option) any later version.
#*
#* This program is distributed in the hope that it will be useful,
#* but WITHOUT ANY WARRANTY; without even the implied warranty of
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#* GNU General Public License for more details.
#*
#* You should have received a copy of the GNU General Public License
#* along with this program; if not, write to the Free Software
#* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
#*****************************************************************************/
use IO::Handle;
use strict;
my $srcdir = $ENV{'top_srcdir'};
#
# Reads to-be exported APIs
#
my %new_APIs;
my $new_sym = IO::Handle->new();
while (<STDIN>)
{
if (/VLC_EXPORT\(\s*(\w.*\S)\s*,\s*(\w*)\s*,\s*\(\s*(\w.*\S)\s*\)\s*\)[^)]*$/)
{
$new_APIs{$2} = [ ( $1, $3 ) ];
}
}
#
# Write header's header
#
open $new_sym, '> vlc_symbols.h.new' or die "vlc_symbols.h.new: $!\n";
print { $new_sym }
"/*\n".
" * This file is automatically generated. DO NOT EDIT!\n".
" * You can force an update with \"make stamp-api\".\n".
" */\n".
"\n".
"#ifndef __VLC_SYMBOLS_H\n".
"# define __VLC_SYMBOLS_H\n".
"\n".
"# ifdef HAVE_SHARED_LIBVLC\n".
"# error You are not supposed to include this file!\n".
"# endif\n".
"/*\n".
" * This is the big VLC API structure for plugins :\n".
" * Changing its layout breaks plugin's binary compatibility,\n".
" * so DO NOT DO THAT.\n".
" * In case of conflict with SVN, add your uncommited APIs\n".
" * at the *end* of the structure so they don't mess the other's\n".
" * offset in the structure.\n".
" */\n".
"struct module_symbols_t\n".
"{\n";
my $changes = 0;
#
# Compares new APIs with currently exported APIs
#
my @API;
my @deprecated_API;
my $parse = 0;
my $oldfd = IO::Handle->new();
open $oldfd, "< $srcdir/include/vlc_symbols.h";
while (<$oldfd>)
{
if (/^struct module_symbols_t/)
{
$parse = 1;
}
elsif ($parse == 0)
{
}
elsif (/^ void \*(\w*)_deprecated;$/)
{
if (defined $new_APIs{$1})
{
print "[info] $1 was RESTORED!\n";
print { $new_sym }
" ".$new_APIs{$1}[0]." (*$1_inner) (".$new_APIs{$1}[1].");\n";
delete $new_APIs{$1};
push (@API, $1);
$changes++;
}
else
{
print { $new_sym } $_;
push (@deprecated_API, $1);
}
}
elsif (/^\s*(\w.*\S)\s*\(\*\s*(\w*)_inner\)\s*\(\s*(\w.*\S)\s*\)\s*;\s*$/)
{
if (!defined $new_APIs{$2})
{
print "[warn] $2 was REMOVED!\n";
print { $new_sym } " void *$2_deprecated;\n";
push (@deprecated_API, $2);
$changes++;
}
elsif (($new_APIs{$2}[0] ne $1)
|| ($new_APIs{$2}[1] ne $3))
{
print
"[warn] $2 was CHANGED!\n".
" Old argument(s) : \"$3\"\n".
" New argument(s) : \"".$new_APIs{$2}[1]."\"\n".
" Old return type : \"$1\"\n".
" New return type : \"".$new_APIs{$2}[0]."\"\n";
print { $new_sym }
" ".$new_APIs{$2}[0]." (*$2_inner) (".$new_APIs{$2}[1].");\n";
delete $new_APIs{$2};
push (@API, $2);
$changes++;
}
else
{
print { $new_sym } " $1 (*$2_inner) ($3);\n";
push (@API, $2);
delete $new_APIs{$2};
}
}
}
close $oldfd;
#
# Adds brand-new APIs
#
foreach (keys %new_APIs)
{
print "[info] $_ was ADDED!\n";
print { $new_sym }
" ".$new_APIs{$_}[0]." (*${_}_inner) (".$new_APIs{$_}[1].");\n";
push (@API, $_);
$changes++;
}
#
# Writes #defines
#
print { $new_sym }
"};\n".
"# if defined (__PLUGIN__)\n";
foreach (@API)
{
print { $new_sym } "# define $_ (p_symbols)->${_}_inner\n";
}
print { $new_sym }
"# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)\n".
"/******************************************************************\n".
" * STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.\n".
" ******************************************************************/\n".
"# define STORE_SYMBOLS( p_symbols ) \\\n";
foreach (@API)
{
print { $new_sym } " ((p_symbols)->${_}_inner) = $_; \\\n";
}
foreach (@deprecated_API)
{
print { $new_sym } " (p_symbols)->${_}_deprecated = NULL; \\\n";
}
print { $new_sym }
"\n".
"# endif /* __PLUGIN__ */\n".
"#endif /* __VLC_SYMBOLS_H */\n";
close $new_sym;
#
# Replace headers if needed
#
if ($changes != 0)
{
rename 'vlc_symbols.h.new', "$srcdir/include/vlc_symbols.h";
print "$changes API(s) changed.\n";
}
else
{
unlink 'vlc_symbols.h.new';
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment