#!/bin/sh global out := $1 shift global in := @Argv for i in [$in] { eval $CPP $LINUXINCLUDE -dD -imacros $i -x c /dev/null } | \ awk '$1 == "#define" && $2 ~ /__HYPERVISOR_[a-z][a-z_0-9]*/ { v[$3] = $2 } END { print "/* auto-generated by scripts/xen-hypercall.sh */" for (i in v) if (!(v[i] in v)) print "HYPERCALL("substr(v[i], 14)")"}' | sort -u >$out (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:out) op:Equal rhs:{(DQ ($ VSub_Number "$1"))} spids:[3])] spids: [3] ) (C {(shift)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:in) op:Equal rhs:{(DQ ($ VSub_At "$@"))} spids:[10])] spids: [10] ) (Pipeline children: [ (ForEach iter_name: i iter_words: [{($ VSub_Name "$in")}] do_arg_iter: False body: (DoGroup children: [ (C {(eval)} {($ VSub_Name "$CPP")} {($ VSub_Name "$LINUXINCLUDE")} {(-dD)} {(-imacros)} {(DQ ($ VSub_Name "$i"))} {(-x)} {(c)} {(/dev/null)} ) ] spids: [25 48] ) spids: [21 23] ) (C {(awk)} { (SQ <"$1 == \"#define\" && $2 ~ /__HYPERVISOR_[a-z][a-z_0-9]*/ { v[$3] = $2 }\n"> <"\tEND { print \"/* auto-generated by scripts/xen-hypercall.sh */\"\n"> <"\t\tfor (i in v) if (!(v[i] in v))\n"> <"\t\t\tprint \"HYPERCALL(\"substr(v[i], 14)\")\"}"> ) } ) (SimpleCommand words: [{(sort)} {(-u)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{($ VSub_Name "$out")} spids:[68])] ) ] negated: False ) ] )