From 069bd35b3cc58e0deeae02d3a7811d29c1ccea3f Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sun, 30 Jun 2024 07:37:49 +0200 Subject: T6527: remove legacy Perl library components --- perl_dmod/Cstore/.gitignore | 5 - perl_dmod/Cstore/Changes | 6 - perl_dmod/Cstore/Cstore.xs | 343 ----------------------------------------- perl_dmod/Cstore/MANIFEST | 7 - perl_dmod/Cstore/Makefile.PL | 88 ----------- perl_dmod/Cstore/README | 33 ---- perl_dmod/Cstore/lib/Cstore.pm | 96 ------------ perl_dmod/Cstore/t/Cstore.t | 15 -- perl_dmod/Cstore/typemap | 83 ---------- 9 files changed, 676 deletions(-) delete mode 100644 perl_dmod/Cstore/.gitignore delete mode 100644 perl_dmod/Cstore/Changes delete mode 100644 perl_dmod/Cstore/Cstore.xs delete mode 100644 perl_dmod/Cstore/MANIFEST delete mode 100644 perl_dmod/Cstore/Makefile.PL delete mode 100644 perl_dmod/Cstore/README delete mode 100644 perl_dmod/Cstore/lib/Cstore.pm delete mode 100644 perl_dmod/Cstore/t/Cstore.t delete mode 100644 perl_dmod/Cstore/typemap (limited to 'perl_dmod/Cstore') 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 . - */ - -#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 -#include -#include - -#include - -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 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 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 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 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 ret_strvec; - THIS->cfgPathGetDeletedChildNodes(arg_cpath, ret_strvec); -OUTPUT: - RETVAL - - -STRVEC * -Cstore::cfgPathGetDeletedValues(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - vector ret_strvec; - THIS->cfgPathGetDeletedValues(arg_cpath, ret_strvec); -OUTPUT: - RETVAL - - -STRSTRMAP * -Cstore::cfgPathGetChildNodesStatus(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - MapT ret_strstrmap; - THIS->cfgPathGetChildNodesStatus(arg_cpath, ret_strstrmap); -OUTPUT: - RETVAL - - -STRVEC * -Cstore::cfgPathGetValuesDA(CPATH *pref, bool active_cfg) -PREINIT: - Cpath arg_cpath; -CODE: - vector 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 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 ret_strstrmap; - THIS->cfgPathGetChildNodesStatusDA(arg_cpath, ret_strstrmap); -OUTPUT: - RETVAL - - -STRVEC * -Cstore::tmplGetChildNodes(CPATH *pref) -PREINIT: - Cpath arg_cpath; -CODE: - vector 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 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 . - -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 ') : ()), - # 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 . - - 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 . - -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. Eeng@vyatta.comE - -=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 . - -=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 . - -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::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))); - } - } - -- cgit v1.2.3