Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/openssl/lib/libcrypto move the generator...



details:   https://anonhg.NetBSD.org/src/rev/814307b5ef98
branches:  trunk
changeset: 374587:814307b5ef98
user:      christos <christos%NetBSD.org@localhost>
date:      Sat May 06 17:21:51 2023 +0000

description:
move the generator script here.

diffstat:

 crypto/external/bsd/openssl/lib/libcrypto/Makefile |    4 +-
 crypto/external/bsd/openssl/lib/libcrypto/gen      |  231 +++++++++++++++++++++
 2 files changed, 233 insertions(+), 2 deletions(-)

diffs (253 lines):

diff -r 3b6546932224 -r 814307b5ef98 crypto/external/bsd/openssl/lib/libcrypto/Makefile
--- a/crypto/external/bsd/openssl/lib/libcrypto/Makefile        Sat May 06 17:07:22 2023 +0000
+++ b/crypto/external/bsd/openssl/lib/libcrypto/Makefile        Sat May 06 17:21:51 2023 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.23 2023/05/06 17:07:22 christos Exp $
+#      $NetBSD: Makefile,v 1.24 2023/05/06 17:21:51 christos Exp $
 
 # RCSid:
 #      Id: Makefile,v 1.33 1998/11/11 11:53:53 sjg Exp
@@ -295,7 +295,7 @@ x509v3.h
 .for i in ${GENH}
 $i: $i.in
        ${_MKTARGET_CREATE}
-       ${.CURDIR}/../../gen ${.ALLSRC} > ${.TARGET}
+       ${.CURDIR}/gen ${.ALLSRC} > ${.TARGET}
 .endfor
 
 .include <bsd.lib.mk>
diff -r 3b6546932224 -r 814307b5ef98 crypto/external/bsd/openssl/lib/libcrypto/gen
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/crypto/external/bsd/openssl/lib/libcrypto/gen     Sat May 06 17:21:51 2023 +0000
@@ -0,0 +1,231 @@
+#!/bin/sh
+
+awk '
+/- join\(/ {
+       printf(" * WARNING: do not edit!\n");
+       i = index(FILENAME, "/src/crypto/external");
+       s = substr(FILENAME, i);
+       printf(" * Generated by Makefile from /usr%s\n", s);
+       next;
+}
+/use OpenSSL/ {
+       next;
+}
+/^{-/ {
+       next;
+}
+/^-}/ {
+       next;
+}
+/generate_stack_string_macros\(/ {
+V="SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_STRING, char, char)\n"
+V=V"#define sk_OPENSSL_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_STRING_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_STRING_value(sk, idx) ((char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_STRING_sk_type(sk), (idx)))\n"
+V=V"#define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new(ossl_check_OPENSSL_STRING_compfunc_type(cmp)))\n"
+V=V"#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_null())\n"
+V=V"#define sk_OPENSSL_STRING_new_reserve(cmp, n) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_STRING_compfunc_type(cmp), (n)))\n"
+V=V"#define sk_OPENSSL_STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_STRING_sk_type(sk), (n))\n"
+V=V"#define sk_OPENSSL_STRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_STRING_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_STRING_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_STRING_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_STRING_delete(sk, i) ((char *)OPENSSL_sk_delete(ossl_check_OPENSSL_STRING_sk_type(sk), (i)))\n"
+V=V"#define sk_OPENSSL_STRING_delete_ptr(sk, ptr) ((char *)OPENSSL_sk_delete_ptr(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr)))\n"
+V=V"#define sk_OPENSSL_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))\n"
+V=V"#define sk_OPENSSL_STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))\n"
+V=V"#define sk_OPENSSL_STRING_pop(sk) ((char *)OPENSSL_sk_pop(ossl_check_OPENSSL_STRING_sk_type(sk)))\n"
+V=V"#define sk_OPENSSL_STRING_shift(sk) ((char *)OPENSSL_sk_shift(ossl_check_OPENSSL_STRING_sk_type(sk)))\n"
+V=V"#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk),ossl_check_OPENSSL_STRING_freefunc_type(freefunc))\n"
+V=V"#define sk_OPENSSL_STRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr), (idx))\n"
+V=V"#define sk_OPENSSL_STRING_set(sk, idx, ptr) ((char *)OPENSSL_sk_set(ossl_check_OPENSSL_STRING_sk_type(sk), (idx), ossl_check_OPENSSL_STRING_type(ptr)))\n"
+V=V"#define sk_OPENSSL_STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))\n"
+V=V"#define sk_OPENSSL_STRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))\n"
+V=V"#define sk_OPENSSL_STRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr), pnum)\n"
+V=V"#define sk_OPENSSL_STRING_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_STRING_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_STRING_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_STRING_dup(sk) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_STRING_sk_type(sk)))\n"
+V=V"#define sk_OPENSSL_STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_OPENSSL_STRING_sk_type(sk), 
ossl_check_OPENSSL_STRING_copyfunc_type(copyfunc), ossl_check_OPENSSL_STRING_freefunc_type(freefunc)))\n"
+V=V"#define sk_OPENSSL_STRING_set_cmp_func(sk, cmp) ((sk_OPENSSL_STRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_compfunc_type(cmp)))\n"
+       
+       printf("%s", V);
+       next;
+}
+/generate_stack_string_macros/ {
+       next;
+}
+/generate_stack_const_string_macros\(/ {
+
+V="SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_CSTRING, const char, char)\n"
+V=V"#define sk_OPENSSL_CSTRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_CSTRING_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_CSTRING_value(sk, idx) ((const char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), (idx)))\n"
+V=V"#define sk_OPENSSL_CSTRING_new(cmp) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new(ossl_check_OPENSSL_CSTRING_compfunc_type(cmp)))\n"
+V=V"#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())\n"
+V=V"#define sk_OPENSSL_CSTRING_new_reserve(cmp, n) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_CSTRING_compfunc_type(cmp), (n)))\n"
+V=V"#define sk_OPENSSL_CSTRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_CSTRING_sk_type(sk), (n))\n"
+V=V"#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_CSTRING_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_CSTRING_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_CSTRING_delete(sk, i) ((const char *)OPENSSL_sk_delete(ossl_check_OPENSSL_CSTRING_sk_type(sk), (i)))\n"
+V=V"#define sk_OPENSSL_CSTRING_delete_ptr(sk, ptr) ((const char *)OPENSSL_sk_delete_ptr(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr)))\n"
+V=V"#define sk_OPENSSL_CSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))\n"
+V=V"#define sk_OPENSSL_CSTRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))\n"
+V=V"#define sk_OPENSSL_CSTRING_pop(sk) ((const char *)OPENSSL_sk_pop(ossl_check_OPENSSL_CSTRING_sk_type(sk)))\n"
+V=V"#define sk_OPENSSL_CSTRING_shift(sk) ((const char *)OPENSSL_sk_shift(ossl_check_OPENSSL_CSTRING_sk_type(sk)))\n"
+V=V"#define sk_OPENSSL_CSTRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_CSTRING_sk_type(sk),ossl_check_OPENSSL_CSTRING_freefunc_type(freefunc))\n"
+V=V"#define sk_OPENSSL_CSTRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr), (idx))\n"
+V=V"#define sk_OPENSSL_CSTRING_set(sk, idx, ptr) ((const char *)OPENSSL_sk_set(ossl_check_OPENSSL_CSTRING_sk_type(sk), (idx), ossl_check_OPENSSL_CSTRING_type(ptr)))\n"
+V=V"#define sk_OPENSSL_CSTRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))\n"
+V=V"#define sk_OPENSSL_CSTRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))\n"
+V=V"#define sk_OPENSSL_CSTRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr), pnum)\n"
+V=V"#define sk_OPENSSL_CSTRING_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_CSTRING_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_CSTRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_CSTRING_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_CSTRING_dup(sk) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_CSTRING_sk_type(sk)))\n"
+V=V"#define sk_OPENSSL_CSTRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_deep_copy(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), 
ossl_check_OPENSSL_CSTRING_copyfunc_type(copyfunc), ossl_check_OPENSSL_CSTRING_freefunc_type(freefunc)))\n"
+V=V"#define sk_OPENSSL_CSTRING_set_cmp_func(sk, cmp) ((sk_OPENSSL_CSTRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_compfunc_type(cmp)))\n"
+       printf("%s", V);
+       next;
+}
+/generate_stack_const_string_macros/ {
+       next;
+}
+/generate_stack_block_macros\(/ {
+       i = index($0, "\"");
+       s = substr($0, i + 1);
+       i = index(s, "\"");
+       s = substr(s, 1, i - 1);
+
+V="SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_BLOCK, void, void)\n"
+V=V"#define sk_OPENSSL_BLOCK_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_BLOCK_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_BLOCK_value(sk, idx) ((void *)OPENSSL_sk_value(ossl_check_const_OPENSSL_BLOCK_sk_type(sk), (idx)))\n"
+V=V"#define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new(ossl_check_OPENSSL_BLOCK_compfunc_type(cmp)))\n"
+V=V"#define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new_null())\n"
+V=V"#define sk_OPENSSL_BLOCK_new_reserve(cmp, n) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_BLOCK_compfunc_type(cmp), (n)))\n"
+V=V"#define sk_OPENSSL_BLOCK_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_BLOCK_sk_type(sk), (n))\n"
+V=V"#define sk_OPENSSL_BLOCK_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_BLOCK_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_BLOCK_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_BLOCK_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_BLOCK_delete(sk, i) ((void *)OPENSSL_sk_delete(ossl_check_OPENSSL_BLOCK_sk_type(sk), (i)))\n"
+V=V"#define sk_OPENSSL_BLOCK_delete_ptr(sk, ptr) ((void *)OPENSSL_sk_delete_ptr(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr)))\n"
+V=V"#define sk_OPENSSL_BLOCK_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))\n"
+V=V"#define sk_OPENSSL_BLOCK_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))\n"
+V=V"#define sk_OPENSSL_BLOCK_pop(sk) ((void *)OPENSSL_sk_pop(ossl_check_OPENSSL_BLOCK_sk_type(sk)))\n"
+V=V"#define sk_OPENSSL_BLOCK_shift(sk) ((void *)OPENSSL_sk_shift(ossl_check_OPENSSL_BLOCK_sk_type(sk)))\n"
+V=V"#define sk_OPENSSL_BLOCK_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_BLOCK_sk_type(sk),ossl_check_OPENSSL_BLOCK_freefunc_type(freefunc))\n"
+V=V"#define sk_OPENSSL_BLOCK_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr), (idx))\n"
+V=V"#define sk_OPENSSL_BLOCK_set(sk, idx, ptr) ((void *)OPENSSL_sk_set(ossl_check_OPENSSL_BLOCK_sk_type(sk), (idx), ossl_check_OPENSSL_BLOCK_type(ptr)))\n"
+V=V"#define sk_OPENSSL_BLOCK_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))\n"
+V=V"#define sk_OPENSSL_BLOCK_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))\n"
+V=V"#define sk_OPENSSL_BLOCK_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr), pnum)\n"
+V=V"#define sk_OPENSSL_BLOCK_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_BLOCK_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_BLOCK_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_BLOCK_sk_type(sk))\n"
+V=V"#define sk_OPENSSL_BLOCK_dup(sk) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_BLOCK_sk_type(sk)))\n"
+V=V"#define sk_OPENSSL_BLOCK_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_deep_copy(ossl_check_const_OPENSSL_BLOCK_sk_type(sk), 
ossl_check_OPENSSL_BLOCK_copyfunc_type(copyfunc), ossl_check_OPENSSL_BLOCK_freefunc_type(freefunc)))\n"
+V=V"#define sk_OPENSSL_BLOCK_set_cmp_func(sk, cmp) ((sk_OPENSSL_BLOCK_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_compfunc_type(cmp)))\n"
+
+       gsub("@", s, V);
+       printf("%s\n", V);
+       next;
+}
+/generate_stack_block_macros/ {
+       next;
+}
+/generate_const_stack_macros\(/ {
+       i = index($0, "\"");
+       s = substr($0, i + 1);
+       i = index(s, "\"");
+       s = substr(s, 1, i - 1);
+
+V="SKM_DEFINE_STACK_OF_INTERNAL(SSL_CIPHER, const SSL_CIPHER, SSL_CIPHER)\n"
+V=V"#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))\n"
+V=V"#define sk_SSL_CIPHER_value(sk, idx) ((const SSL_CIPHER *)OPENSSL_sk_value(ossl_check_const_SSL_CIPHER_sk_type(sk), (idx)))\n"
+V=V"#define sk_SSL_CIPHER_new(cmp) ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_new(ossl_check_SSL_CIPHER_compfunc_type(cmp)))\n"
+V=V"#define sk_SSL_CIPHER_new_null() ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_new_null())\n"
+V=V"#define sk_SSL_CIPHER_new_reserve(cmp, n) ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_new_reserve(ossl_check_SSL_CIPHER_compfunc_type(cmp), (n)))\n"
+V=V"#define sk_SSL_CIPHER_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SSL_CIPHER_sk_type(sk), (n))\n"
+V=V"#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))\n"
+V=V"#define sk_SSL_CIPHER_zero(sk) OPENSSL_sk_zero(ossl_check_SSL_CIPHER_sk_type(sk))\n"
+V=V"#define sk_SSL_CIPHER_delete(sk, i) ((const SSL_CIPHER *)OPENSSL_sk_delete(ossl_check_SSL_CIPHER_sk_type(sk), (i)))\n"
+V=V"#define sk_SSL_CIPHER_delete_ptr(sk, ptr) ((const SSL_CIPHER *)OPENSSL_sk_delete_ptr(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr)))\n"
+V=V"#define sk_SSL_CIPHER_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))\n"
+V=V"#define sk_SSL_CIPHER_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))\n"
+V=V"#define sk_SSL_CIPHER_pop(sk) ((const SSL_CIPHER *)OPENSSL_sk_pop(ossl_check_SSL_CIPHER_sk_type(sk)))\n"
+V=V"#define sk_SSL_CIPHER_shift(sk) ((const SSL_CIPHER *)OPENSSL_sk_shift(ossl_check_SSL_CIPHER_sk_type(sk)))\n"
+V=V"#define sk_SSL_CIPHER_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SSL_CIPHER_sk_type(sk),ossl_check_SSL_CIPHER_freefunc_type(freefunc))\n"
+V=V"#define sk_SSL_CIPHER_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr), (idx))\n"
+V=V"#define sk_SSL_CIPHER_set(sk, idx, ptr) ((const SSL_CIPHER *)OPENSSL_sk_set(ossl_check_SSL_CIPHER_sk_type(sk), (idx), ossl_check_SSL_CIPHER_type(ptr)))\n"
+V=V"#define sk_SSL_CIPHER_find(sk, ptr) OPENSSL_sk_find(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))\n"
+V=V"#define sk_SSL_CIPHER_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))\n"
+V=V"#define sk_SSL_CIPHER_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr), pnum)\n"
+V=V"#define sk_SSL_CIPHER_sort(sk) OPENSSL_sk_sort(ossl_check_SSL_CIPHER_sk_type(sk))\n"
+V=V"#define sk_SSL_CIPHER_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SSL_CIPHER_sk_type(sk))\n"
+V=V"#define sk_SSL_CIPHER_dup(sk) ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_dup(ossl_check_const_SSL_CIPHER_sk_type(sk)))\n"
+V=V"#define sk_SSL_CIPHER_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_deep_copy(ossl_check_const_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_copyfunc_type(copyfunc), 
ossl_check_SSL_CIPHER_freefunc_type(freefunc)))\n"
+V=V"#define sk_SSL_CIPHER_set_cmp_func(sk, cmp) ((sk_SSL_CIPHER_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_compfunc_type(cmp)))\n"
+
+       gsub("@", s, V);
+       printf("%s\n", V);
+       next;
+}
+/generate_lhash_macros\(/ {
+       i = index($0, "\"");
+       s = substr($0, i + 1);
+       i = index(s, "\"");
+       s = substr(s, 1, i - 1);
+
+V="DEFINE_LHASH_OF_INTERNAL(@);\n"
+V=V"#define lh_@_new(hfn, cmp) ((LHASH_OF(@) *)OPENSSL_LH_new(ossl_check_@_lh_hashfunc_type(hfn), ossl_check_@_lh_compfunc_type(cmp)))\n"
+V=V"#define lh_@_free(lh) OPENSSL_LH_free(ossl_check_@_lh_type(lh))\n"
+V=V"#define lh_@_flush(lh) OPENSSL_LH_flush(ossl_check_@_lh_type(lh))\n"
+V=V"#define lh_@_insert(lh, ptr) ((@ *)OPENSSL_LH_insert(ossl_check_@_lh_type(lh), ossl_check_@_lh_plain_type(ptr)))\n"
+V=V"#define lh_@_delete(lh, ptr) ((@ *)OPENSSL_LH_delete(ossl_check_@_lh_type(lh), ossl_check_const_@_lh_plain_type(ptr)))\n"
+V=V"#define lh_@_retrieve(lh, ptr) ((@ *)OPENSSL_LH_retrieve(ossl_check_@_lh_type(lh), ossl_check_const_@_lh_plain_type(ptr)))\n"
+V=V"#define lh_@_error(lh) OPENSSL_LH_error(ossl_check_@_lh_type(lh))\n"
+V=V"#define lh_@_num_items(lh) OPENSSL_LH_num_items(ossl_check_@_lh_type(lh))\n"
+V=V"#define lh_@_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_@_lh_type(lh), out)\n"
+V=V"#define lh_@_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_@_lh_type(lh), out)\n"
+V=V"#define lh_@_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_@_lh_type(lh), out)\n"
+V=V"#define lh_@_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_@_lh_type(lh))\n"
+V=V"#define lh_@_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_@_lh_type(lh), dl)\n"
+V=V"#define lh_@_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_@_lh_type(lh), ossl_check_@_lh_doallfunc_type(dfn))\n"
+       gsub("@", s, V);
+       printf("%s\n", V);
+       next;
+}
+
+/generate_stack_macros\(/ {
+       i = index($0, "\"");
+       s = substr($0, i + 1);
+       i = index(s, "\"");
+       s = substr(s, 1, i - 1);
+
+V="SKM_DEFINE_STACK_OF_INTERNAL(@, @, @)\n"
+V=V"#define sk_@_num(sk) OPENSSL_sk_num(ossl_check_const_@_sk_type(sk))\n"
+V=V"#define sk_@_value(sk, idx) ((@ *)OPENSSL_sk_value(ossl_check_const_@_sk_type(sk), (idx)))\n"
+V=V"#define sk_@_new(cmp) ((STACK_OF(@) *)OPENSSL_sk_new(ossl_check_@_compfunc_type(cmp)))\n"
+V=V"#define sk_@_new_null() ((STACK_OF(@) *)OPENSSL_sk_new_null())\n"
+V=V"#define sk_@_new_reserve(cmp, n) ((STACK_OF(@) *)OPENSSL_sk_new_reserve(ossl_check_@_compfunc_type(cmp), (n)))\n"
+V=V"#define sk_@_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_@_sk_type(sk), (n))\n"
+V=V"#define sk_@_free(sk) OPENSSL_sk_free(ossl_check_@_sk_type(sk))\n"
+V=V"#define sk_@_zero(sk) OPENSSL_sk_zero(ossl_check_@_sk_type(sk))\n"
+V=V"#define sk_@_delete(sk, i) ((@ *)OPENSSL_sk_delete(ossl_check_@_sk_type(sk), (i)))\n"
+V=V"#define sk_@_delete_ptr(sk, ptr) ((@ *)OPENSSL_sk_delete_ptr(ossl_check_@_sk_type(sk), ossl_check_@_type(ptr)))\n"
+V=V"#define sk_@_push(sk, ptr) OPENSSL_sk_push(ossl_check_@_sk_type(sk), ossl_check_@_type(ptr))\n"
+V=V"#define sk_@_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_@_sk_type(sk), ossl_check_@_type(ptr))\n"
+V=V"#define sk_@_pop(sk) ((@ *)OPENSSL_sk_pop(ossl_check_@_sk_type(sk)))\n"
+V=V"#define sk_@_shift(sk) ((@ *)OPENSSL_sk_shift(ossl_check_@_sk_type(sk)))\n"
+V=V"#define sk_@_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_@_sk_type(sk),ossl_check_@_freefunc_type(freefunc))\n"
+V=V"#define sk_@_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_@_sk_type(sk), ossl_check_@_type(ptr), (idx))\n"
+V=V"#define sk_@_set(sk, idx, ptr) ((@ *)OPENSSL_sk_set(ossl_check_@_sk_type(sk), (idx), ossl_check_@_type(ptr)))\n"
+V=V"#define sk_@_find(sk, ptr) OPENSSL_sk_find(ossl_check_@_sk_type(sk), ossl_check_@_type(ptr))\n"
+V=V"#define sk_@_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_@_sk_type(sk), ossl_check_@_type(ptr))\n"
+V=V"#define sk_@_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_@_sk_type(sk), ossl_check_@_type(ptr), pnum)\n"
+V=V"#define sk_@_sort(sk) OPENSSL_sk_sort(ossl_check_@_sk_type(sk))\n"
+V=V"#define sk_@_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_@_sk_type(sk))\n"
+V=V"#define sk_@_dup(sk) ((STACK_OF(@) *)OPENSSL_sk_dup(ossl_check_const_@_sk_type(sk)))\n"
+V=V"#define sk_@_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(@) *)OPENSSL_sk_deep_copy(ossl_check_const_@_sk_type(sk), ossl_check_@_copyfunc_type(copyfunc), ossl_check_@_freefunc_type(freefunc)))\n"
+V=V"#define sk_@_set_cmp_func(sk, cmp) ((sk_@_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_@_sk_type(sk), ossl_check_@_compfunc_type(cmp)))\n"
+
+       gsub("@", s, V);
+       printf("%s\n", V);
+       next;
+}
+{
+       print $0;
+}
+' "$1"



Home | Main Index | Thread Index | Old Index