Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 24fadf2a20f50d5623f61f2cc08f95c22b5ba75c authored by Dr. Stephen Henson on 03 January 2012, 19:43:06 UTC, committed by Dr. Stephen Henson on 03 January 2012, 19:43:06 UTC
typo
1 parent 409abd2
  • Files
  • Changes
  • f6c0dd8
  • /
  • util
  • /
  • fipsas.pl
Raw File
Cook and download a directory from the Software Heritage Vault

You have requested the cooking of the directory with identifier None into a standard tar.gz archive.

Are you sure you want to continue ?

Download a directory from the Software Heritage Vault

You have requested the download of the directory with identifier None as a standard tar.gz archive.

Are you sure you want to continue ?

Cook and download a revision from the Software Heritage Vault

You have requested the cooking of the history heading to revision with identifier swh:1:rev:24fadf2a20f50d5623f61f2cc08f95c22b5ba75c into a bare git archive.

Are you sure you want to continue ?

Download a revision from the Software Heritage Vault

You have requested the download of the history heading to revision with identifier swh:1:rev:24fadf2a20f50d5623f61f2cc08f95c22b5ba75c as a bare git archive.

Are you sure you want to continue ?

Invalid Email !

The provided email is not well-formed.

Download link has expired

The requested archive is no longer available for download from the Software Heritage Vault.

Do you want to cook it again ?

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • content
revision badge
swh:1:rev:24fadf2a20f50d5623f61f2cc08f95c22b5ba75c
content badge Iframe embedding
swh:1:cnt:2734a20181535af8e8fb485243dbbf09ced4ad34
fipsas.pl

# FIPS assembly language preprocessor
# Renames all symbols in the file to
# their modified fips versions.


my @ARGS = @ARGV;

my $top = shift @ARGS;
my $target = shift @ARGS;
my $tmptarg = $target;

$tmptarg =~ s/\.[^\\\/\.]+$/.tmp/;

my $runasm = 1;

if ($ARGS[0] eq "norunasm")
	{
	$runasm = 0;
	shift @ARGS;
	}

my $enabled = 0;

$enabled = 1 if $ENV{FIPSCANISTERINTERNAL} eq "y";

if ($enabled == 0 && $runasm)
	{
	system @ARGS;
	exit $?
	}


# Open symbol rename file.
open(IN, "$top/fips/fipssyms.h") || die "Can't open fipssyms.h";

# Skip to assembler symbols
while (<IN>)
	{
	last if (/assembler/)
	}

# Store all renames.
while (<IN>)
	{
	if (/^#define\s+(\w+)\s+(\w+)\b/)
		{
		$edits{$1} = $2;
		}
	}

my ($from, $to);

#delete any temp file lying around

unlink $tmptarg;

#rename target temporarily
my $rencnt = 0;
# On windows the previous file doesn't always close straight away
# so retry the rename operation a few times if it fails.
while (!rename($target, $tmptarg))
        {
        sleep 2;
        die "Can't rename $target" if ($rencnt++ > 10);
        }

#edit target
open(IN,$tmptarg) || die "Can't open temporary file";
open(OUT, ">$target") || die "Can't open output file $target";

while (<IN>)
{
	while (($from, $to) = each %edits)
		{
		s/(\b_*)$from(\b)/$1$to$2/g;
		}
	print OUT $_;
}

close OUT;

if ($runasm)
	{
	# run assembler
	system @ARGS;

	my $rv = $?;

	# restore target
	unlink $target;
	rename $tmptarg, $target;

	die "Error executing assembler!" if $rv != 0;
	}
else
	{
	# Don't care about target
	unlink $tmptarg;
	}
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top