diff options
author | Christian Breunig <christian@breunig.cc> | 2024-06-30 07:37:49 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-06-30 07:39:10 +0200 |
commit | 069bd35b3cc58e0deeae02d3a7811d29c1ccea3f (patch) | |
tree | e9697cbe7ef50908ce96a0a57e76f7d7b7bcaeb2 /perl_dmod | |
parent | 6f435de5a5ee165d24a11a28c5aa10b735bace03 (diff) | |
download | vyatta-cfg-069bd35b3cc58e0deeae02d3a7811d29c1ccea3f.tar.gz vyatta-cfg-069bd35b3cc58e0deeae02d3a7811d29c1ccea3f.zip |
T6527: remove legacy Perl library components
Diffstat (limited to 'perl_dmod')
-rw-r--r-- | perl_dmod/.gitignore | 2 | ||||
-rw-r--r-- | perl_dmod/Cstore/.gitignore | 5 | ||||
-rw-r--r-- | perl_dmod/Cstore/Changes | 6 | ||||
-rw-r--r-- | perl_dmod/Cstore/Cstore.xs | 343 | ||||
-rw-r--r-- | perl_dmod/Cstore/MANIFEST | 7 | ||||
-rw-r--r-- | perl_dmod/Cstore/Makefile.PL | 88 | ||||
-rw-r--r-- | perl_dmod/Cstore/README | 33 | ||||
-rw-r--r-- | perl_dmod/Cstore/lib/Cstore.pm | 96 | ||||
-rw-r--r-- | perl_dmod/Cstore/t/Cstore.t | 15 | ||||
-rw-r--r-- | perl_dmod/Cstore/typemap | 83 | ||||
-rw-r--r-- | perl_dmod/Makefile.am | 25 |
11 files changed, 0 insertions, 703 deletions
diff --git a/perl_dmod/.gitignore b/perl_dmod/.gitignore deleted file mode 100644 index b336cc7..0000000 --- a/perl_dmod/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/perl_dmod/Cstore/.gitignore b/perl_dmod/Cstore/.gitignore deleted file mode 100644 index 7082d2a..0000000 --- a/perl_dmod/Cstore/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/Makefile -/Cstore.bs -/Cstore.cpp -/blib -/pm_to_blib diff --git a/perl_dmod/Cstore/Changes b/perl_dmod/Cstore/Changes deleted file mode 100644 index 15e5188..0000000 --- a/perl_dmod/Cstore/Changes +++ /dev/null @@ -1,6 +0,0 @@ -Revision history for Perl extension Cstore. - -0.01 Tue Jun 15 12:03:35 2010 - - original version; created by h2xs 1.23 with options - -c --skip-ppport -n Cstore - diff --git a/perl_dmod/Cstore/Cstore.xs b/perl_dmod/Cstore/Cstore.xs deleted file mode 100644 index 3c9a9ad..0000000 --- a/perl_dmod/Cstore/Cstore.xs +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Copyright (C) 2010 Vyatta, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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, see <http://www.gnu.org/licenses/>. - */ - -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -/* these macros are defined in perl headers but conflict with C++ headers */ -#undef do_open -#undef do_close - -#include <cstring> -#include <vector> -#include <string> - -#include <cstore/cstore.hpp> - -using namespace cstore; - -typedef SV STRVEC; -typedef SV CPATH; -typedef SV STRSTRMAP; - -MODULE = Cstore PACKAGE = Cstore - - -Cstore * -Cstore::new() -CODE: - RETVAL = Cstore::createCstore(false); -OUTPUT: - RETVAL - - -bool -Cstore::cfgPathExists(CPATH *pref, bool active_cfg) -PREINIT: - Cpath arg_cpath; -CODE: - RETVAL = THIS->cfgPathExists(arg_cpath, active_cfg); -OUTPUT: - RETVAL - - -bool -Cstore::cfgPathDefault(CPATH *pref, bool active_cfg) -PREINIT: - Cpath arg_cpath; -CODE: - RETVAL = THIS->cfgPathDefault(arg_cpath, active_cfg); -OUTPUT: - RETVAL - - -STRVEC * -Cstore::cfgPathGetChildNodes(CPATH *pref, bool active_cfg) -PREINIT: - Cpath arg_cpath; -CODE: - vector<string> ret_strvec; - THIS->cfgPathGetChildNodes(arg_cpath, ret_strvec, active_cfg); -OUTPUT: - RETVAL - - -SV * -Cstore::cfgPathGetValue(CPATH *pref, bool active_cfg) -PREINIT: - Cpath arg_cpath; -CODE: - string value; - if (THIS->cfgPathGetValue(arg_cpath, value, active_cfg)) { - RETVAL = newSVpv(value.c_str(), 0); - } else { - XSRETURN_UNDEF; - } -OUTPUT: - RETVAL - - -STRVEC * -Cstore::cfgPathGetValues(CPATH *pref, bool active_cfg) -PREINIT: - Cpath arg_cpath; -CODE: - vector<string> ret_strvec; - THIS->cfgPathGetValues(arg_cpath, ret_strvec, active_cfg); -OUTPUT: - RETVAL - - -bool -Cstore::cfgPathEffective(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - RETVAL = THIS->cfgPathEffective(arg_cpath); -OUTPUT: - RETVAL - - -STRVEC * -Cstore::cfgPathGetEffectiveChildNodes(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - vector<string> ret_strvec; - THIS->cfgPathGetEffectiveChildNodes(arg_cpath, ret_strvec); -OUTPUT: - RETVAL - - -SV * -Cstore::cfgPathGetEffectiveValue(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - string value; - if (THIS->cfgPathGetEffectiveValue(arg_cpath, value)) { - RETVAL = newSVpv(value.c_str(), 0); - } else { - XSRETURN_UNDEF; - } -OUTPUT: - RETVAL - - -STRVEC * -Cstore::cfgPathGetEffectiveValues(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - vector<string> ret_strvec; - THIS->cfgPathGetEffectiveValues(arg_cpath, ret_strvec); -OUTPUT: - RETVAL - - -bool -Cstore::cfgPathDeleted(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - RETVAL = THIS->cfgPathDeleted(arg_cpath); -OUTPUT: - RETVAL - - -bool -Cstore::cfgPathAdded(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - RETVAL = THIS->cfgPathAdded(arg_cpath); -OUTPUT: - RETVAL - - -bool -Cstore::cfgPathChanged(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - RETVAL = THIS->cfgPathChanged(arg_cpath); -OUTPUT: - RETVAL - - -STRVEC * -Cstore::cfgPathGetDeletedChildNodes(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - vector<string> ret_strvec; - THIS->cfgPathGetDeletedChildNodes(arg_cpath, ret_strvec); -OUTPUT: - RETVAL - - -STRVEC * -Cstore::cfgPathGetDeletedValues(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - vector<string> ret_strvec; - THIS->cfgPathGetDeletedValues(arg_cpath, ret_strvec); -OUTPUT: - RETVAL - - -STRSTRMAP * -Cstore::cfgPathGetChildNodesStatus(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - MapT<string, string> ret_strstrmap; - THIS->cfgPathGetChildNodesStatus(arg_cpath, ret_strstrmap); -OUTPUT: - RETVAL - - -STRVEC * -Cstore::cfgPathGetValuesDA(CPATH *pref, bool active_cfg) -PREINIT: - Cpath arg_cpath; -CODE: - vector<string> ret_strvec; - THIS->cfgPathGetValuesDA(arg_cpath, ret_strvec, active_cfg); -OUTPUT: - RETVAL - - -SV * -Cstore::cfgPathGetValueDA(CPATH *pref, bool active_cfg) -PREINIT: - Cpath arg_cpath; -CODE: - string value; - if (THIS->cfgPathGetValueDA(arg_cpath, value, active_cfg)) { - RETVAL = newSVpv(value.c_str(), 0); - } else { - XSRETURN_UNDEF; - } -OUTPUT: - RETVAL - - -STRVEC * -Cstore::cfgPathGetChildNodesDA(CPATH *pref, bool active_cfg) -PREINIT: - Cpath arg_cpath; -CODE: - vector<string> ret_strvec; - THIS->cfgPathGetChildNodesDA(arg_cpath, ret_strvec, active_cfg); -OUTPUT: - RETVAL - - -bool -Cstore::cfgPathDeactivated(CPATH *pref, bool active_cfg) -PREINIT: - Cpath arg_cpath; -CODE: - RETVAL = THIS->cfgPathDeactivated(arg_cpath, active_cfg); -OUTPUT: - RETVAL - - -STRSTRMAP * -Cstore::cfgPathGetChildNodesStatusDA(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - MapT<string, string> ret_strstrmap; - THIS->cfgPathGetChildNodesStatusDA(arg_cpath, ret_strstrmap); -OUTPUT: - RETVAL - - -STRVEC * -Cstore::tmplGetChildNodes(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - vector<string> ret_strvec; - THIS->tmplGetChildNodes(arg_cpath, ret_strvec); -OUTPUT: - RETVAL - - -bool -Cstore::validateTmplPath(CPATH *pref, bool validate_vals) -PREINIT: - Cpath arg_cpath; -CODE: - RETVAL = THIS->validateTmplPath(arg_cpath, validate_vals); -OUTPUT: - RETVAL - - -STRSTRMAP * -Cstore::getParsedTmpl(CPATH *pref, bool allow_val) -PREINIT: - Cpath arg_cpath; -CODE: - MapT<string, string> ret_strstrmap; - if (!THIS->getParsedTmpl(arg_cpath, ret_strstrmap, allow_val)) { - XSRETURN_UNDEF; - } -OUTPUT: - RETVAL - - -SV * -Cstore::cfgPathGetComment(CPATH *pref, bool active_cfg) -PREINIT: - Cpath arg_cpath; -CODE: - string comment; - if (THIS->cfgPathGetComment(arg_cpath, comment, active_cfg)) { - RETVAL = newSVpv(comment.c_str(), 0); - } else { - XSRETURN_UNDEF; - } -OUTPUT: - RETVAL - - -bool -Cstore::sessionChanged() -CODE: - RETVAL = THIS->sessionChanged(); -OUTPUT: - RETVAL - - -bool -Cstore::loadFile(char *filename) -CODE: - RETVAL = THIS->loadFile(filename); -OUTPUT: - RETVAL - - -bool -Cstore::inSession() -CODE: - RETVAL = THIS->inSession(); -OUTPUT: - RETVAL diff --git a/perl_dmod/Cstore/MANIFEST b/perl_dmod/Cstore/MANIFEST deleted file mode 100644 index 3f4f007..0000000 --- a/perl_dmod/Cstore/MANIFEST +++ /dev/null @@ -1,7 +0,0 @@ -Changes -Makefile.PL -MANIFEST -README -Cstore.xs -t/Cstore.t -lib/Cstore.pm diff --git a/perl_dmod/Cstore/Makefile.PL b/perl_dmod/Cstore/Makefile.PL deleted file mode 100644 index d3968f7..0000000 --- a/perl_dmod/Cstore/Makefile.PL +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright (C) 2010 Vyatta, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# -# 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, see <http://www.gnu.org/licenses/>. - -package MY; - -use 5.010000; -use ExtUtils::MakeMaker; - -my $PMOD_DIR = '$(SITEPREFIX)/share/perl5'; - -sub constants{ - my $self = shift; - my $orig_txt = $self->SUPER::constants(@_); - $orig_txt =~ s#= \$\(SITEPREFIX\)/(lib|share)/.*#= $PMOD_DIR#g; - return $orig_txt; -} - -sub c_o { - my $self = shift; - my $orig_txt = $self->SUPER::c_o(@_); - $orig_txt =~ s/\.c(\s)/.cpp$1/g; - return $orig_txt; -} - -sub xs_c { - my $self = shift; - my $orig_txt = $self->SUPER::xs_c(@_); - $orig_txt =~ s/\.c(\s)/.cpp$1/g; - return $orig_txt; -} - -sub xs_o { - my $self = shift; - my $orig_txt = $self->SUPER::xs_o(@_); - $orig_txt =~ s/\.c(\s)/.cpp$1/g; - return $orig_txt; -} - -sub install { - my $self = shift; - my $orig_txt = $self->SUPER::install(@_); - $orig_txt =~ s/pure_install doc_install/pure_install/g; - $orig_txt =~ s/\$\(INST_MAN3DIR\) .*/undef undef/g; - return $orig_txt; -} - -sub clean { - my $self = shift; - my $orig_txt = $self->SUPER::clean(@_); - $orig_txt =~ s/Cstore\.c\s/Cstore.cpp /g; - return $orig_txt; -} - -sub dynamic_lib { - my $self = shift; - my $orig_txt = $self->SUPER::dynamic_lib(@_); - $orig_txt =~ s/(\s)LD_RUN_PATH=\S+\s+/$1/g; - return $orig_txt; -} - -WriteMakefile( - NAME => 'Cstore', - VERSION_FROM => 'lib/Cstore.pm', - PREREQ_PM => {}, - ($] >= 5.005 ? - (ABSTRACT_FROM => 'lib/Cstore.pm', - AUTHOR => 'Vyatta <eng@vyatta.com>') : ()), - # note: MM will convert LIBS to absolute path in Makefile. - # => regenerate Makefile every time - LIBS => ['-L../../src/.libs -lvyatta-cfg'], - DEFINE => '', - INC => '-I../../src', - CC => 'g++', - PREFIX => '/opt/vyatta', - INSTALLDIRS => 'site', -); - diff --git a/perl_dmod/Cstore/README b/perl_dmod/Cstore/README deleted file mode 100644 index 84870fc..0000000 --- a/perl_dmod/Cstore/README +++ /dev/null @@ -1,33 +0,0 @@ -Cstore version 0.01 -========================== - -This module provides Perl bindings to the Vyatta Cstore library. - - -INSTALLATION - -This module is installed as part of the vyatta-cfg package. - - -DEPENDENCIES - -This module requires the Vyatta Cstore library. - - -COPYRIGHT AND LICENCE - -Copyright (C) 2010 Vyatta, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License version 2 as -published by the Free Software Foundation. - -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, see <http://www.gnu.org/licenses/>. - - diff --git a/perl_dmod/Cstore/lib/Cstore.pm b/perl_dmod/Cstore/lib/Cstore.pm deleted file mode 100644 index 7cf2169..0000000 --- a/perl_dmod/Cstore/lib/Cstore.pm +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright (C) 2010 Vyatta, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# -# 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, see <http://www.gnu.org/licenses/>. - -package Cstore; - -use 5.010000; -use strict; -use warnings; - -require Exporter; -use AutoLoader qw(AUTOLOAD); - -our @ISA = qw(Exporter); - -# Items to export into callers namespace by default. Note: do not export -# names by default without a very good reason. Use EXPORT_OK instead. -# Do not simply export all your public functions/methods/constants. - -# This allows declaration use Cstore ':all'; -# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK -# will save memory. -our %EXPORT_TAGS = ( 'all' => [ qw( - -) ] ); - -our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); - -our @EXPORT = qw( - -); - -our $VERSION = '0.01'; - -require XSLoader; -XSLoader::load('Cstore', $VERSION); - -# Preloaded methods go here. - -# Autoload methods go after =cut, and are processed by the autosplit program. - -1; -__END__ -=head1 NAME - -Cstore - Perl binding for the Vyatta Cstore library - -=head1 SYNOPSIS - - use Cstore; - my $cstore = new Cstore; - -=head1 DESCRIPTION - -This module provides the Perl binding for the Vyatta Cstore library. - -=head2 EXPORT - -None by default. - -=head1 SEE ALSO - -For more information on the Cstore library, see the documentation and -source code for the main library. - -=head1 AUTHOR - -Vyatta, Inc. E<lt>eng@vyatta.comE<gt> - -=head1 COPYRIGHT AND LICENSE - -Copyright (C) 2010 Vyatta, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License version 2 as -published by the Free Software Foundation. - -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, see <http://www.gnu.org/licenses/>. - -=cut diff --git a/perl_dmod/Cstore/t/Cstore.t b/perl_dmod/Cstore/t/Cstore.t deleted file mode 100644 index 51d23ac..0000000 --- a/perl_dmod/Cstore/t/Cstore.t +++ /dev/null @@ -1,15 +0,0 @@ -# Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl Cstore.t' - -######################### - -# change 'tests => 1' to 'tests => last_test_to_print'; - -use Test::More tests => 1; -BEGIN { use_ok('Cstore') }; - -######################### - -# Insert your test code below, the Test::More module is use()ed here so read -# its man page ( perldoc Test::More ) for help writing this test script. - diff --git a/perl_dmod/Cstore/typemap b/perl_dmod/Cstore/typemap deleted file mode 100644 index 8d6d178..0000000 --- a/perl_dmod/Cstore/typemap +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (C) 2010 Vyatta, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# -# 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, see <http://www.gnu.org/licenses/>. - -Cstore * O_CPPOBJ -STRVEC * T_STRVEC_REF -CPATH * T_CPATH_REF -STRSTRMAP * T_STRSTRMAP_REF - - -############################################################ -OUTPUT -O_CPPOBJ - sv_setref_pv($arg, CLASS, (void *) $var); - -T_STRVEC_REF - AV *results; - results = (AV *) sv_2mortal((SV *) newAV()); - for (unsigned int i = 0; i < ret_strvec.size(); i++) { - av_push(results, newSVpv(ret_strvec[i].c_str(), 0)); - } - $arg = newRV((SV *) results); - -T_STRSTRMAP_REF - HV *href = (HV *) sv_2mortal((SV *) newHV()); - MapT<string, string>::iterator it = ret_strstrmap.begin(); - for (; it != ret_strstrmap.end(); ++it) { - const char *key = (*it).first.c_str(); - const char *val = (*it).second.c_str(); - hv_store(href, key, strlen(key), newSVpv(val, 0), 0); - } - $arg = newRV((SV *) href); - - -############################################################ -INPUT -O_CPPOBJ - if (sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG)) { - $var = ($type) SvIV((SV *) SvRV($arg)); - } else { - warn(\"${Package}::$func_name(): $var is not a blessed SV reference\"); - XSRETURN_UNDEF; - } - -T_STRVEC_REF - { - int i = 0; - I32 num = 0; - if (!SvROK($arg) || SvTYPE(SvRV($arg)) != SVt_PVAV) { - XSRETURN_UNDEF; - } - num = av_len((AV *) SvRV($arg)); - /* if input array is empty, vector will be empty as well. */ - for (i = 0; i <= num; i++) { - string str = SvPV_nolen(*av_fetch((AV *) SvRV($arg), i, 0)); - arg_strvec.push_back(str); - } - } - -T_CPATH_REF - { - int i = 0; - I32 num = 0; - if (!SvROK($arg) || SvTYPE(SvRV($arg)) != SVt_PVAV) { - XSRETURN_UNDEF; - } - num = av_len((AV *) SvRV($arg)); - /* if input array is empty, path will be empty as well. */ - for (i = 0; i <= num; i++) { - arg_cpath.push(SvPV_nolen(*av_fetch((AV *) SvRV($arg), i, 0))); - } - } - diff --git a/perl_dmod/Makefile.am b/perl_dmod/Makefile.am deleted file mode 100644 index 6c12b35..0000000 --- a/perl_dmod/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -PERL_MODS = Cstore - -# nop for all-local. make install will do a build anyway, so don't repeat -# the build here. -all-local: ; - -install-exec-local: - for pm in $(PERL_MODS); do \ - (cd $$pm; \ - perl Makefile.PL; \ - $(MAKE) $(AM_MAKEFLAGS) install); \ - done - -clean-local: - for pm in $(PERL_MODS); do \ - (cd $$pm; \ - perl Makefile.PL; \ - $(MAKE) $(AM_MAKEFLAGS) realclean); \ - done - -# nops -check-local: ; -install-data-local: ; -uninstall-local: ; - |