NARGS

AcronymDefinition
NARGSNorth American Rock Garden Society
Copyright 1988-2018 AcronymFinder.com, All rights reserved.
References in periodicals archive ?
typedef union {int i; double d; void *p; } type; typedef enum { INTEGER, DOUBLE, POINTER } type_t; /* Types we expect to marshal */ extern void *alloc(); void cspec mk_marshal(type_t *types, int nargs) { int i; type *vspec m = local(type *); /* Spec of pointer to result vector */ void cspec s = `{ m = (type *)alloc(nargs * sizeof(type)); }; for (i = 0; i < nargs; i++) { /* Add code to marshal each param */ switch(types[i]) { case INTEGER: s = `{ @s; m[$i].i = param($i, int); }; break; case DOUBLE: s = `{ @s; m[$i].d = param($i, double); }; break; case POINTER: s = `{ @s; m[$i].p = param($i, void *); }; break; } } /* Return code spec to marshal parameters and return result vector */ return `{ @s; return m; }; } Dynamic generation of unmarshaling code is equally useful.
typedef int (*fptr)(); /* Type of the function we will be calling */ void cspec mk_unmarshal(type_t *types, int nargs) { int i; fptr vspec fp = param(fptr, 0); /* Arg 0: the function to invoke */ type *vspec m = param(type *, 1); /* Arg 1: the vector to unmarshal */ void cspec args = push_init(); /* Initialize the dynamic argument list */ for (i = 0; i < nargs; i++) { /* Build up the dynamic argument list */ switch(types[i]) { case INTEGER: push(args, `m[$i].i); break; case DOUBLE: push(args, `m[$i].d); break; case POINTER: push(args, `m[$i].p); break; } } /* Return code spec to call the given function with unmarshaled args */ return `{ fp(args); }; } 4.3 Dynamic Inlining
find_alpha := proc() if nargs = 2 # Procedure requires two input then values.