| 1 |
/* vi: set ft=c : */ |
| 2 |
|
| 3 |
#include "xps_internals.h" |
| 4 |
|
| 5 |
/* Some experimental extension flags. Not (currently) part of core perl API |
| 6 |
*/ |
| 7 |
enum { |
| 8 |
PARSE_SUBSIGNATURE_NAMED_PARAMS = (1<<0), |
| 9 |
/* Permits ( :$foo, :$bar, :$splot = "default" ) named params |
| 10 |
* They are accumulated into a slurpy hash then extracted afterwards |
| 11 |
* As with positional params, any param without a defaulting expression is |
| 12 |
* required; an error is thrown if the caller did not provide it |
| 13 |
*/ |
| 14 |
|
| 15 |
PARSE_SUBSIGNATURE_PARAM_ATTRIBUTES = (1<<1), |
| 16 |
/* Permits ( $param :Attribute(Value) ) attributes on params |
| 17 |
* These must be registered by calling register_subsignature_attribute() |
| 18 |
*/ |
| 19 |
|
| 20 |
PARSE_SUBSIGNATURE_REFALIAS = (1<<2), |
| 21 |
/* Permits ( \$scalar, \@array, \%hash ) refalias parameters |
| 22 |
*/ |
| 23 |
}; |
| 24 |
|
| 25 |
#define boot_parse_subsignature_ex() XPS_boot_parse_subsignature_ex(aTHX) |
| 26 |
void XPS_boot_parse_subsignature_ex(pTHX); |
| 27 |
|
| 28 |
#define signature_add_param(ctx, details) XPS_signature_add_param(aTHX_ ctx, details) |
| 29 |
void XPS_signature_add_param(pTHX_ struct XSParseSublikeContext *ctx, struct XPSSignatureParamDetails *details); |
| 30 |
|
| 31 |
#define signature_query(ctx, q) XPS_signature_query(aTHX_ ctx, q) |
| 32 |
IV XPS_signature_query(pTHX_ struct XSParseSublikeContext *ctx, int q); |
| 33 |
|
| 34 |
#define parse_subsignature_ex(flags, ctx, hd, nhooks) XPS_parse_subsignature_ex(aTHX_ flags, ctx, hd, nhooks) |
| 35 |
OP *XPS_parse_subsignature_ex(pTHX_ int flags, |
| 36 |
struct XPSContextWithPointer *ctx, |
| 37 |
struct HooksAndData hooksanddata[], |
| 38 |
size_t nhooks); |
| 39 |
|
| 40 |
#define register_subsignature_attribute(name, funcs, funcdata) XPS_register_subsignature_attribute(aTHX_ name, funcs, funcdata) |
| 41 |
void XPS_register_subsignature_attribute(pTHX_ const char *name, const struct XPSSignatureAttributeFuncs *funcs, void *funcdata); |