diff options
Diffstat (limited to 'crypto/stack')
-rw-r--r-- | crypto/stack/stack.c | 6 | ||||
-rw-r--r-- | crypto/stack/stack.h | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/crypto/stack/stack.c b/crypto/stack/stack.c index 7b96326156..683468264a 100644 --- a/crypto/stack/stack.c +++ b/crypto/stack/stack.c @@ -82,13 +82,17 @@ char *STACK_version="Stack part of OpenSSL 0.9.2 31-Dec-1998"; #include <errno.h> -void sk_set_cmp_func(sk,c) +int (*sk_set_cmp_func(sk,c))() STACK *sk; int (*c)(); { + int (*old)()=sk->comp; + if (sk->comp != c) sk->sorted=0; sk->comp=c; + + return old; } STACK *sk_dup(sk) diff --git a/crypto/stack/stack.h b/crypto/stack/stack.h index 615eb6ff94..6dc52db63c 100644 --- a/crypto/stack/stack.h +++ b/crypto/stack/stack.h @@ -91,7 +91,7 @@ int sk_unshift(STACK *st,char *data); char *sk_shift(STACK *st); char *sk_pop(STACK *st); void sk_zero(STACK *st); -void sk_set_cmp_func(STACK *sk, int (*c)()); +int (*sk_set_cmp_func(STACK *sk, int (*c)()))(); STACK *sk_dup(STACK *st); #else @@ -108,7 +108,7 @@ int sk_unshift(); char *sk_shift(); char *sk_pop(); void sk_zero(); -void sk_set_cmp_func(); +int (*sk_set_cmp_func())(); STACK *sk_dup(); #endif |