libarray-refelem-perl-1.00.orig/0000755000076500007650000000000010415507704015642 5ustar smurfsmurflibarray-refelem-perl-1.00.orig/.git/0000755000076500007650000000000010415507602016500 5ustar smurfsmurflibarray-refelem-perl-1.00.orig/.git/refs/0000755000076500007650000000000010415507602017437 5ustar smurfsmurflibarray-refelem-perl-1.00.orig/.git/refs/heads/0000755000076500007650000000000010415507602020523 5ustar smurfsmurflibarray-refelem-perl-1.00.orig/.git/refs/tags/0000755000076500007650000000000010415507602020375 5ustar smurfsmurflibarray-refelem-perl-1.00.orig/.git/description0000644000076500007650000000007210415507602020745 0ustar smurfsmurfUnnamed repository; edit this file to name it for gitweb. libarray-refelem-perl-1.00.orig/.git/hooks/0000755000076500007650000000000010415507602017623 5ustar smurfsmurflibarray-refelem-perl-1.00.orig/.git/hooks/applypatch-msg0000644000076500007650000000067110415507602022503 0ustar smurfsmurf#!/bin/sh # # An example hook script to check the commit log message taken by # applypatch from an e-mail message. # # The hook should exit with non-zero status after issuing an # appropriate message if it wants to stop the commit. The hook is # allowed to edit the commit message file. # # To enable this hook, make this file executable. . git-sh-setup test -x "$GIT_DIR/hooks/commit-msg" && exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} : libarray-refelem-perl-1.00.orig/.git/hooks/post-update0000644000076500007650000000031710415507602022014 0ustar smurfsmurf#!/bin/sh # # An example hook script to prepare a packed repository for use over # dumb transports. # # To enable this hook, make this file executable by "chmod +x post-update". exec git-update-server-info libarray-refelem-perl-1.00.orig/.git/hooks/update0000644000076500007650000000501310415507602021027 0ustar smurfsmurf#!/bin/sh # # An example hook script to mail out commit update information. # It also blocks tags that aren't annotated. # Called by git-receive-pack with arguments: refname sha1-old sha1-new # # To enable this hook: # (1) change the recipient e-mail address # (2) make this file executable by "chmod +x update". # project=$(cat $GIT_DIR/description) recipients="commit-list@somewhere.com commit-list@somewhereelse.com" ref_type=$(git cat-file -t "$3") # Only allow annotated tags in a shared repo # Remove this code to treat dumb tags the same as everything else case "$1","$ref_type" in refs/tags/*,commit) echo "*** Un-annotated tags are not allowed in this repo" >&2 echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." exit 1;; refs/tags/*,tag) echo "### Pushing version '${1##refs/tags/}' to the masses" >&2 # recipients="release-announce@somwehere.com announce@somewhereelse.com" ;; esac # set this to 'cat' to get a very detailed listing. # short only kicks in when an annotated tag is added short='git shortlog' # see 'date --help' for info on how to write this # The default is a human-readable iso8601-like format with minute # precision ('2006-01-25 15:58 +0100' for example) date_format="%F %R %z" (if expr "$2" : '0*$' >/dev/null then # new ref case "$1" in refs/tags/*) # a pushed and annotated tag (usually) means a new version tag="${1##refs/tags/}" if [ "$ref_type" = tag ]; then eval $(git cat-file tag $3 | \ sed -n '4s/tagger \([^>]*>\)[^0-9]*\([0-9]*\).*/tagger="\1" ts="\2"/p') date=$(date --date="1970-01-01 00:00:00 $ts seconds" +"$date_format") echo "Tag '$tag' created by $tagger at $date" git cat-file tag $3 | sed -n '5,$p' echo fi prev=$(git describe "$3^" | sed 's/-g.*//') # the first tag in a repo will yield no $prev if [ -z "$prev" ]; then echo "Changes since the dawn of time:" git rev-list --pretty $3 | $short else echo "Changes since $prev:" git rev-list --pretty $prev..$3 | $short echo --- git diff $prev..$3 | diffstat -p1 echo --- fi ;; refs/heads/*) branch="${1##refs/heads/}" echo "New branch '$branch' available with the following commits:" git-rev-list --pretty "$3" $(git-rev-parse --not --all) ;; esac else base=$(git-merge-base "$2" "$3") case "$base" in "$2") git diff "$3" "^$base" | diffstat -p1 echo echo "New commits:" ;; *) echo "Rebased ref, commits from common ancestor:" ;; esac git-rev-list --pretty "$3" "^$base" fi) | mail -s "$project: Changes to '${1##refs/heads/}'" $recipients exit 0 libarray-refelem-perl-1.00.orig/.git/hooks/pre-applypatch0000644000076500007650000000060410415507602022477 0ustar smurfsmurf#!/bin/sh # # An example hook script to verify what is about to be committed # by applypatch from an e-mail message. # # The hook should exit with non-zero status after issuing an # appropriate message if it wants to stop the commit. # # To enable this hook, make this file executable. . git-sh-setup test -x "$GIT_DIR/hooks/pre-commit" && exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} : libarray-refelem-perl-1.00.orig/.git/hooks/commit-msg0000644000076500007650000000102010415507602021613 0ustar smurfsmurf#!/bin/sh # # An example hook script to check the commit log message. # Called by git-commit with one argument, the name of the file # that has the commit message. The hook should exit with non-zero # status after issuing an appropriate message if it wants to stop the # commit. The hook is allowed to edit the commit message file. # # To enable this hook, make this file executable. # This example catches duplicate Signed-off-by lines. test "" = "$(grep '^Signed-off-by: ' "$1" | sort | uniq -c | sed -e '/^[ ]*1 /d')" libarray-refelem-perl-1.00.orig/.git/hooks/post-commit0000644000076500007650000000023010415507602022014 0ustar smurfsmurf#!/bin/sh # # An example hook script that is called after a successful # commit is made. # # To enable this hook, make this file executable. : Nothing libarray-refelem-perl-1.00.orig/.git/hooks/pre-commit0000644000076500007650000000312010415507602021616 0ustar smurfsmurf#!/bin/sh # # An example hook script to verify what is about to be committed. # Called by git-commit with no arguments. The hook should # exit with non-zero status after issuing an appropriate message if # it wants to stop the commit. # # To enable this hook, make this file executable. # This is slightly modified from Andrew Morton's Perfect Patch. # Lines you introduce should not have trailing whitespace. # Also check for an indentation that has SP before a TAB. if git-rev-parse --verify HEAD 2>/dev/null then git-diff-index -p -M --cached HEAD else # NEEDSWORK: we should produce a diff with an empty tree here # if we want to do the same verification for the initial import. : fi | perl -e ' my $found_bad = 0; my $filename; my $reported_filename = ""; my $lineno; sub bad_line { my ($why, $line) = @_; if (!$found_bad) { print STDERR "*\n"; print STDERR "* You have some suspicious patch lines:\n"; print STDERR "*\n"; $found_bad = 1; } if ($reported_filename ne $filename) { print STDERR "* In $filename\n"; $reported_filename = $filename; } print STDERR "* $why (line $lineno)\n"; print STDERR "$filename:$lineno:$line\n"; } while (<>) { if (m|^diff --git a/(.*) b/\1$|) { $filename = $1; next; } if (/^@@ -\S+ \+(\d+)/) { $lineno = $1 - 1; next; } if (/^ /) { $lineno++; next; } if (s/^\+//) { $lineno++; chomp; if (/\s$/) { bad_line("trailing whitespace", $_); } if (/^\s* /) { bad_line("indent SP followed by a TAB", $_); } } } exit($found_bad); ' libarray-refelem-perl-1.00.orig/.git/hooks/pre-rebase0000644000076500007650000001024610415507602021576 0ustar smurfsmurf#!/bin/sh # # Copyright (c) 2006 Junio C Hamano # publish=next basebranch="$1" if test "$#" = 2 then topic="refs/heads/$2" else topic=`git symbolic-ref HEAD` fi case "$basebranch,$topic" in master,refs/heads/??/*) ;; *) exit 0 ;# we do not interrupt others. ;; esac # Now we are dealing with a topic branch being rebased # on top of master. Is it OK to rebase it? # Is topic fully merged to master? not_in_master=`git-rev-list --pretty=oneline ^master "$topic"` if test -z "$not_in_master" then echo >&2 "$topic is fully merged to master; better remove it." exit 1 ;# we could allow it, but there is no point. fi # Is topic ever merged to next? If so you should not be rebasing it. only_next_1=`git-rev-list ^master "^$topic" ${publish} | sort` only_next_2=`git-rev-list ^master ${publish} | sort` if test "$only_next_1" = "$only_next_2" then not_in_topic=`git-rev-list "^$topic" master` if test -z "$not_in_topic" then echo >&2 "$topic is already up-to-date with master" exit 1 ;# we could allow it, but there is no point. else exit 0 fi else not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"` perl -e ' my $topic = $ARGV[0]; my $msg = "* $topic has commits already merged to public branch:\n"; my (%not_in_next) = map { /^([0-9a-f]+) /; ($1 => 1); } split(/\n/, $ARGV[1]); for my $elem (map { /^([0-9a-f]+) (.*)$/; [$1 => $2]; } split(/\n/, $ARGV[2])) { if (!exists $not_in_next{$elem->[0]}) { if ($msg) { print STDERR $msg; undef $msg; } print STDERR " $elem->[1]\n"; } } ' "$topic" "$not_in_next" "$not_in_master" exit 1 fi exit 0 ################################################################ This sample hook safeguards topic branches that have been published from being rewound. The workflow assumed here is: * Once a topic branch forks from "master", "master" is never merged into it again (either directly or indirectly). * Once a topic branch is fully cooked and merged into "master", it is deleted. If you need to build on top of it to correct earlier mistakes, a new topic branch is created by forking at the tip of the "master". This is not strictly necessary, but it makes it easier to keep your history simple. * Whenever you need to test or publish your changes to topic branches, merge them into "next" branch. The script, being an example, hardcodes the publish branch name to be "next", but it is trivial to make it configurable via $GIT_DIR/config mechanism. With this workflow, you would want to know: (1) ... if a topic branch has ever been merged to "next". Young topic branches can have stupid mistakes you would rather clean up before publishing, and things that have not been merged into other branches can be easily rebased without affecting other people. But once it is published, you would not want to rewind it. (2) ... if a topic branch has been fully merged to "master". Then you can delete it. More importantly, you should not build on top of it -- other people may already want to change things related to the topic as patches against your "master", so if you need further changes, it is better to fork the topic (perhaps with the same name) afresh from the tip of "master". Let's look at this example: o---o---o---o---o---o---o---o---o---o "next" / / / / / a---a---b A / / / / / / / / c---c---c---c B / / / / \ / / / / b---b C \ / / / / / \ / ---o---o---o---o---o---o---o---o---o---o---o "master" A, B and C are topic branches. * A has one fix since it was merged up to "next". * B has finished. It has been fully merged up to "master" and "next", and is ready to be deleted. * C has not merged to "next" at all. We would want to allow C to be rebased, refuse A, and encourage B to be deleted. To compute (1): git-rev-list ^master ^topic next git-rev-list ^master next if these match, topic has not merged in next at all. To compute (2): git-rev-list master..topic if this is empty, it is fully merged to "master". libarray-refelem-perl-1.00.orig/.git/info/0000755000076500007650000000000010415507602017433 5ustar smurfsmurflibarray-refelem-perl-1.00.orig/.git/info/exclude0000644000076500007650000000036010415507602021006 0ustar smurfsmurf# git-ls-files --others --exclude-from=.git/info/exclude # Lines that start with '#' are comments. # For a project mostly in C, the following would be a good set of # exclude patterns (uncomment them if you want to use them): # *.[oa] # *~ libarray-refelem-perl-1.00.orig/.git/branches/0000755000076500007650000000000010415507602020265 5ustar smurfsmurflibarray-refelem-perl-1.00.orig/.git/remotes/0000755000076500007650000000000010415507602020156 5ustar smurfsmurflibarray-refelem-perl-1.00.orig/.git/objects/0000755000076500007650000000000010415507602020131 5ustar smurfsmurflibarray-refelem-perl-1.00.orig/.git/objects/pack/0000755000076500007650000000000010415507602021047 5ustar smurfsmurflibarray-refelem-perl-1.00.orig/.git/objects/info/0000755000076500007650000000000010415507602021064 5ustar smurfsmurflibarray-refelem-perl-1.00.orig/.git/HEAD0000644000076500007650000000002710415507602017123 0ustar smurfsmurfref: refs/heads/master libarray-refelem-perl-1.00.orig/.git/config0000644000076500007650000000006510415507602017671 0ustar smurfsmurf[core] repositoryformatversion = 0 filemode = true libarray-refelem-perl-1.00.orig/Changes0000644000076500007650000000070607770272366017155 0ustar smurfsmurf2003-12-18 Gisle Aas Release 1.00 Documentation fixes by Paul Croome . 2000-01-13 Gisle Aas Release 0.02 Do reference counting for av_store/hv_store the right way. Previously we could trigger a core dump if the thing to be stored only was kept alive by a reference at the same location in the array. 2000-01-10 Gisle Aas Release 0.01 libarray-refelem-perl-1.00.orig/Makefile.PL0000644000076500007650000000025607036040520017610 0ustar smurfsmurfuse ExtUtils::MakeMaker; WriteMakefile( NAME => 'Array::RefElem', VERSION_FROM => 'RefElem.pm', dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, ); libarray-refelem-perl-1.00.orig/MANIFEST0000644000076500007650000000010607036076500016770 0ustar smurfsmurfChanges MANIFEST Makefile.PL README RefElem.pm RefElem.xs t/refelem.t libarray-refelem-perl-1.00.orig/README0000644000076500007650000000044107036076470016527 0ustar smurfsmurfArray::RefElem This module give direct access to the internal perl routines that let you store reference to things in arrays and hashes. Copyright 2000 Gisle Aas This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. libarray-refelem-perl-1.00.orig/RefElem.pm0000644000076500007650000000243407770272313017527 0ustar smurfsmurfpackage Array::RefElem; use strict; use vars qw(@ISA @EXPORT_OK $VERSION); require Exporter; require DynaLoader; @ISA = qw(Exporter DynaLoader); @EXPORT_OK = qw(av_store av_push hv_store); $VERSION = '1.00'; Array::RefElem->bootstrap($VERSION); 1; __END__ =head1 NAME Array::RefElem - Set up array elements as aliases =head1 SYNOPSIS use Array::RefElem qw(av_store av_push hv_store); av_store(@a, 1, $a); av_push(@a, $a); hv_store(%h, $key, $a); =head1 DESCRIPTION This module gives direct access to some of the internal Perl routines that let you store things in arrays and hashes. The following functions are available: =over =item av_store(@array, $index, $value) Stores $value in @array at the specified $index. After executing this call, $array[$index] and $value denote the same thing. =item av_push(@array, $value) Pushes $value onto the @array. After executing this call, $array[-1] and $value denote the same thing. =item hv_store(%hash, $key, $value); Stores $value in the %hash with the given $key. After executing this call, $hash{$key} and $value denote the same thing. =back =head1 SEE ALSO L =head1 COPYRIGHT Copyright 2000 Gisle Aas. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut libarray-refelem-perl-1.00.orig/RefElem.xs0000644000076500007650000000217607037443574017555 0ustar smurfsmurf#ifdef __cplusplus extern "C" { #endif #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #ifdef __cplusplus } #endif MODULE = Array::RefElem PACKAGE = Array::RefElem void av_store(avref, key, val) SV* avref I32 key SV* val PROTOTYPE: \@$$ PREINIT: AV* av; CODE: if (!SvROK(avref) || SvTYPE(SvRV(avref)) != SVt_PVAV) croak("First argument to av_store() must be an array reference"); av = (AV*)SvRV(avref); SvREFCNT_inc(val); if (!av_store(av, key, val)) SvREFCNT_dec(val); void av_push(avref, val) SV* avref SV* val PROTOTYPE: \@$ PREINIT: AV* av; CODE: if (!SvROK(avref) || SvTYPE(SvRV(avref)) != SVt_PVAV) croak("First argument to av_push() must be an array reference"); av = (AV*)SvRV(avref); SvREFCNT_inc(val); av_push(av, val); void hv_store(hvref, key, val) SV* hvref SV* key SV* val PROTOTYPE: \%$$ PREINIT: HV* hv; CODE: if (!SvROK(hvref) || SvTYPE(SvRV(hvref)) != SVt_PVHV) croak("First argument to hv_store() must be a hash reference"); hv = (HV*)SvRV(hvref); SvREFCNT_inc(val); if (!hv_store_ent(hv, key, val, 0)) SvREFCNT_dec(val); libarray-refelem-perl-1.00.orig/t/0000755000076500007650000000000007770272502016112 5ustar smurfsmurflibarray-refelem-perl-1.00.orig/t/refelem.t0000644000076500007650000000121407037444042017710 0ustar smurfsmurfprint "1..5\n"; use strict; use Array::RefElem qw(av_store av_push hv_store); my $a = "a"; my @a = (1, 2, 3, 4); av_store(@a, 1, $a); av_push(@a, $a); print "not " unless "@a" eq "1 a 3 4 a"; print "ok 1\n"; $a = 2; print "not " unless "@a" eq "1 2 3 4 2"; print "ok 2\n"; $a[1] = "z"; print "not " unless $a[4] eq "z"; print "ok 3\n"; my %h; hv_store(%h, "foo", $a); $h{foo} = "bar"; print "not " unless $a eq "bar"; print "ok 4\n"; $a[2] = [3]; av_store(@a, 2, $a[2][0]); print "not " unless $a[2] == 3; print "ok 5\n"; if (shift) { require Devel::Peek; Devel::Peek::Dump($a); Devel::Peek::Dump(\@a); Devel::Peek::Dump(\%h); }