X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/80e2389990082500d76eb566d4946be3e786c3ef..d8f41ccd20de16f8ebe2ccc84d47bf1cb2b26bbb:/libsecurity_cdsa_utilities/lib/generator.pl diff --git a/libsecurity_cdsa_utilities/lib/generator.pl b/libsecurity_cdsa_utilities/lib/generator.pl deleted file mode 100644 index 1b3fd9ad..00000000 --- a/libsecurity_cdsa_utilities/lib/generator.pl +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/perl -# -# generator.pl - derive various and sundry C++ code from the CDSA header files -# -# Usage: -# perl generator.pl input-directory output-directory -# -# Perry The Cynic, Fall 1999. -# -$ERR_H="cssmerr.h"; -$APPLE_ERR_H="cssmapple.h"; - -$SOURCEDIR=$ARGV[0]; # directory with cdsa headers -$TARGETDIR=$ARGV[1]; # where to put the output file -@INPUTFILES=@ARGV[2 .. 9999]; # list of input files - -$TABLES="$TARGETDIR/errorcodes.gen"; # error name tables - -$tabs = "\t\t\t"; # argument indentation (noncritical) -$warning = "This file was automatically generated. Do not edit on penalty of futility!"; - - -# -# Parse CSSM error header and build table of all named codes -# -open(ERR, "$SOURCEDIR/$ERR_H") or die "Cannot open $ERR_H: $^E"; -open(APPLE_ERR, "$SOURCEDIR/$APPLE_ERR_H") or die "Cannot open $APPLE_ERR_H: $^E"; -$/=undef; # big gulp mode -$errors = . ; -close(ERR); close(APPLE_ERR); - -@fullErrors = $errors =~ /^\s+CSSMERR_([A-Z_]+)/gm; -@convertibles = $errors =~ /^\s+CSSM_ERRCODE_([A-Z_]+)\s*=\s*([0-9xXA-Fa-f]+)/gm; - -while ($name = shift @convertibles) { - $value = shift @convertibles or die; - $convErrors[hex $value] = $name; -}; - - -# -# Read Keychain-level headers for more error codes (errSecBlahBlah) -# -open(ERR, "cat " . join(" ", @INPUTFILES) . "|") or die "Cannot open error header files"; -$/=undef; # still gulping -$_ = ; -@kcerrors = /err((?:Sec|Authorization)\w+)\s*=\s*-?\d+/gm; -close(ERR); - - -# -# Now we will generate the error name tables. -# -open(OUT, ">$TABLES") or die "Cannot write $TABLES: $^E"; -select OUT; - -print <