add: chains = fw_malloc(sizeof(ipt_chainlabel) * chaincount); i = 0; chain = iptc_first_chain(handle); while (chain) { strcpy(chains + i*sizeof(ipt_chainlabel), chain); i++; chain = iptc_next_chain(handle); }  for (i = 0; i < chaincount; i++) { if (!builtinstoo && iptc_builtin(chains + i*sizeof(ipt_chainlabel), *handle)) continue; ret &= fn(chains + i*sizeof(ipt_chainlabel), verbose, handle); }  free(chains);
context: for_each_chain(int (*fn)(const ipt_chainlabel, int, iptc_handle_t *),	       int verbose, iptc_handle_t *handle){        int ret = 1;	const char *chain = NULL;	while ((chain = iptc_next_chain(chain, handle))) {	        ret &= fn(chain, verbose, handle);        }        return ret;}