diff -r 000000000000 -r 6474c204b198 security/nss/lib/ckfw/ckapi.perl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/security/nss/lib/ckfw/ckapi.perl Wed Dec 31 06:09:35 2014 +0100
@@ -0,0 +1,434 @@
+#!perl
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+$copyright = '/* THIS IS A GENERATED FILE */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+';
+
+$count = -1;
+$i = 0;
+
+open(INPUT, "<$ARGV[0]") || die "Can't open $ARGV[0]: $!";
+
+while() {
+ s/^((?:[^"#]+|"[^"]*")*)(\s*#.*$)/$1/;
+ next if (/^\s*$/);
+
+# print;
+
+ /^([\S]+)\s+([^"][\S]*|"[^"]*")/;
+ $name = $1;
+ $value = $2;
+
+ if( ($name =~ "FUNCTION") && !($name =~ "CK_FUNCTION") ) {
+ $count++;
+ $x[$count]{name} = $value;
+ $i = 0;
+ } else {
+ if( $count < 0 ) {
+ $value =~ s/"//g;
+ $g{$name} = $value;
+ } else {
+ $x[$count]{args}[$i]{type} = $name;
+ $x[$count]{args}[$i]{name} = $value;
+ $i++;
+ $x[$count]{nargs} = $i; # rewritten each time, oh well
+ }
+ }
+}
+
+close INPUT;
+
+# dodump();
+doprint();
+
+sub dodump {
+ for( $j = 0; $j <= $count; $j++ ) {
+ print "CK_RV CK_ENTRY $x[$j]{name}\n";
+ for( $i = 0; $i < $x[$j]{nargs}; $i++ ) {
+ print " $x[$j]{args}[$i]{type} $x[$j]{args}[$i]{name}";
+ if( $i == ($x[$j]{nargs} - 1) ) {
+ print "\n";
+ } else {
+ print ",\n";
+ }
+ }
+ }
+}
+
+sub doprint {
+open(PROTOTYPE, ">nssckg.h") || die "Can't open nssckg.h: $!";
+open(TYPEDEF, ">nssckft.h") || die "Can't open nssckft.h: $!";
+open(EPV, ">nssckepv.h") || die "Can't open nssckepv.h: $!";
+open(API, ">nssck.api") || die "Can't open nssck.api: $!";
+
+select PROTOTYPE;
+
+print $copyright;
+print <