/* Saves the union ipt_matchinfo in parsable form to stdout. */ static void tos_save(const void *ip, const struct xt_entry_match *match) { const struct ipt_tos_info *info = (const struct ipt_tos_info *)match->data; if (info->invert) printf("! "); printf("--tos "); print_tos(info->tos, 0); }
/* Prints out the targinfo. */ static void print(const void *ip, const struct xt_entry_target *target, int numeric) { const struct ipt_tos_target_info *tosinfo = (const struct ipt_tos_target_info *)target->data; printf("TOS set "); print_tos(tosinfo->tos, numeric); }
/* Prints out the matchinfo. */ static void tos_print(const void *ip, const struct xt_entry_match *match, int numeric) { const struct ipt_tos_info *info = (const struct ipt_tos_info *)match->data; printf("TOS match "); if (info->invert) printf("!"); print_tos(info->tos, numeric); }
int argout(int dtype, int dval, int optype) { char *s; if (dtype&AGT_VAR) dtype=AGT_VAR; if ((optype&3)==1) /* variable */ dtype=AGT_VAR; if (optype&2) {/* NOUN or OBJECT */ if (dtype>=64 && dtype!=AGT_NUM) dbgprintf("ILL:"); if (optype==2) print_special_obj(0); /* NOUN */ else print_special_obj(1); /* OBJECT */ return 0; } if (!interp_arg) dbgprintf("%d",dval); else { if (dtype<64) { if (dval==-1) print_special_obj(2); /* NAME */ else { s=getname(dval); if (dtype&(AGT_ITEM|AGT_CREAT|AGT_SELF|AGT_WORN)) dbgprintf("<%d:%s>",dval,s); else dbgprintf("{%d:%s}",dval,s); rfree(s); } } else if ( (dtype&AGT_VAR)!=0) { if (dval==-1) print_tos(); else printval("Var",dval,dbgvarptr); } else switch(dtype) { case AGT_TIME: dbgprintf("%2d:%2d",dval/100,dval%100);break; case AGT_NUM: /* Numeric */ dbgprintf("%d",dval);break; case AGT_FLAG: /* Flag */ printval("Flg",dval,dbgflagptr);break; case AGT_ROOMFLAG: /* Roomflag */ dbgprintf("RoomFlag%d",dval);break; case AGT_QUEST: /* Question */ if (dval<=MaxQuestion && dval>=1 && question!=NULL) { dbgprintf("\nQ%d:%s\n",dval,question[dval-1]); dbgprintf("[A:%s]",answer[dval-1]); } else if (quest_ptr!=NULL) { dbgprintf("\nQ%d: ",dval); print_msg(quest_ptr[dval-1]); dbgprintf("[A:"); print_msg(ans_ptr[dval-1]); } break; case AGT_MSG: /* Message */ if (dval>last_message || dval<1 || msg_ptr==NULL) dbgprintf("ILLEGAL MESSAGE"); else { dbgprintf("(Msg%d)",dval); if (!dbg_nomsg) print_msg(msg_ptr[dval-1]); } break; case AGT_ERR: /* Message */ if (dval>NUM_ERR || dval<1 || err_ptr==NULL) dbgprintf("ILLEGAL MESSAGE"); else { dbgprintf("(Std%d)",dval); if (!dbg_nomsg) print_msg(err_ptr[dval-1]); } break; case AGT_STR: /* String */ if (dval-1>=MAX_USTR || userstr==NULL) dbgprintf("ILLEGAL STRING"); else dbgprintf("\nStr%d:%s",dval,userstr[dval]); break; case AGT_CNT: /* Counter */ printval("Cnt",dval,dbgcntptr);break; case AGT_DIR: /* Direction */ if (dval>=1 && dval<=13) dbgprintf("%s",exitname[dval-1]); else dbgprintf("ILL_DIR(%d)",dval); break; case AGT_SUB: /* Subroutine */ dbgprintf("Subroutine %d",dval);break; case AGT_PIC: /* Picture */ case AGT_PIX: dbgprintf("Picture #%d",dval);break; case AGT_FONT: /* Font */ dbgprintf("Font #%d",dval);break; case AGT_SONG: /* Song */ dbgprintf("Song #%d",dval);break; case AGT_OBJFLAG: dbgprintf("ObjFlag%d",dval);break; case AGT_OBJPROP: dbgprintf("ObjProp%d",dval);break; case AGT_ATTR: if (dval<0 || dval>=NUM_ATTR) dbgprintf("UnkownAttr%d",dval); else dbgprintf("%s",attrlist[dval].name); break; case AGT_PROP: if (dval<0 || dval>=NUM_PROP) dbgprintf("UnknownProp%d",dval); else dbgprintf("%s",proplist[dval].name); break; case AGT_EXIT: if (dval>=exitmsg_base) argout(AGT_MSG,dval-exitmsg_base,0); else argout(AGT_ROOM,dval,0); break; default: dbgprintf("?+%d",dval); } } return 1; }