+ZEBRA_RES rpn_get_top_approx_limit(ZebraHandle zh, Z_RPNStructure *zs,
+ zint *approx_limit)
+{
+ ZEBRA_RES res = ZEBRA_OK;
+ if (zs->which == Z_RPNStructure_complex)
+ {
+ if (res == ZEBRA_OK)
+ res = rpn_get_top_approx_limit(zh, zs->u.complex->s1,
+ approx_limit);
+ if (res == ZEBRA_OK)
+ res = rpn_get_top_approx_limit(zh, zs->u.complex->s2,
+ approx_limit);
+ }
+ else if (zs->which == Z_RPNStructure_simple)
+ {
+ if (zs->u.simple->which == Z_Operand_APT)
+ {
+ Z_AttributesPlusTerm *zapt = zs->u.simple->u.attributesPlusTerm;
+ AttrType global_hits_limit_attr;
+ int l;
+
+ attr_init_APT(&global_hits_limit_attr, zapt, 12);
+
+ l = attr_find(&global_hits_limit_attr, NULL);
+ if (l != -1)
+ *approx_limit = l;
+ }
+ }
+ return res;
+}
+