Blame ms/uplink-common.pl

Packit c4476c
#! /usr/bin/env perl
Packit c4476c
# Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
#
Packit c4476c
# Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
# this file except in compliance with the License.  You can obtain a copy
Packit c4476c
# in the file LICENSE in the source distribution or at
Packit c4476c
# https://www.openssl.org/source/license.html
Packit c4476c
Packit c4476c
# pull APPLINK_MAX value from applink.c...
Packit c4476c
$applink_c=$0;
Packit c4476c
$applink_c=~s|[^/\\]+$||g;
Packit c4476c
$applink_c.="applink.c";
Packit c4476c
open(INPUT,$applink_c) || die "can't open $applink_c: $!";
Packit c4476c
@max=grep {/APPLINK_MAX\s+(\d+)/} <INPUT>;
Packit c4476c
close(INPUT);
Packit c4476c
($#max==0) or die "can't find APPLINK_MAX in $applink_c";
Packit c4476c
Packit c4476c
$max[0]=~/APPLINK_MAX\s+(\d+)/;
Packit c4476c
$N=$1;	# number of entries in OPENSSL_UplinkTable not including
Packit c4476c
	# OPENSSL_UplinkTable[0], which contains this value...
Packit c4476c
Packit c4476c
1;
Packit c4476c
Packit c4476c
# Idea is to fill the OPENSSL_UplinkTable with pointers to stubs
Packit c4476c
# which invoke 'void OPENSSL_Uplink (ULONG_PTR *table,int index)';
Packit c4476c
# and then dereference themselves. Latter shall result in endless
Packit c4476c
# loop *unless* OPENSSL_Uplink does not replace 'table[index]' with
Packit c4476c
# something else, e.g. as 'table[index]=unimplemented;'...