X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=m4%2Fpsi%2Fpsi_type.m4;h=a55e6affcb2741b5dd5955d6ea37c218cb7eb146;hp=b5fe39f20978daaf7958e0a33f1c80760dd3af9b;hb=3ef8c66ab1300801bcdb15b43f9f28e77b6487b6;hpb=991b10eeadb51b0b3309f140391ecf0b4c1e1859 diff --git a/m4/psi/psi_type.m4 b/m4/psi/psi_type.m4 index b5fe39f..a55e6af 100644 --- a/m4/psi/psi_type.m4 +++ b/m4/psi/psi_type.m4 @@ -149,6 +149,10 @@ dnl PSI_VAR_TYPE(decl arg) dnl Extracts the type of a decl arg, e.g. dnl unsigned char* buf[16] -> unsigned char*. AC_DEFUN(PSI_VAR_TYPE, [m4_bregexp([$1], [^\(const \)?\(.*\) \([*]*\)[^ ]+$], [\2\3])]) +dnl PSI_VAR_TYPE_RETURN(decl arg) +dnl Extracts the type of a decl arg usable for return types, e.g. dnl unsigned char* buf[16] -> unsigned char**. +AC_DEFUN(PSI_VAR_TYPE_RETURN, [PSI_VAR_TYPE(m4_bpatsubst([$1], [\([^ ]+\) *@<:@[0-9]+@:>@], [* \1]))]) + dnl PSI_VAR_NAME(decl arg) dnl Extracts the var name of a decl arg, e.g. unsigned char* buf[16] -> buf. AC_DEFUN(PSI_VAR_NAME, [m4_bregexp(m4_bregexp([$1], [\([^ ]+\)$], [\1]), [\w+], [\&])])