{
int stages_num;
sn_stage_t **tmp;
+ int i;
if ((n == NULL) || (other == NULL))
return (EINVAL);
memcpy (n->stages + n->stages_num, other->stages,
sizeof (*other->stages) * other->stages_num);
+ for (i = n->stages_num; i < stages_num; i++)
+ SN_STAGE_DEPTH(n->stages[i]) = i;
+
n->stages_num = stages_num;
free (other->stages);
return (num);
} /* }}} int sn_network_get_comparator_num */
-int sn_network_show (sn_network_t *n) /* {{{ */
+int sn_network_show_fh (sn_network_t *n, FILE *fh) /* {{{ */
{
int i;
for (i = 0; i < n->stages_num; i++)
- sn_stage_show (n->stages[i]);
+ sn_stage_show_fh (n->stages[i], fh);
return (0);
+} /* }}} int sn_network_show_fh */
+
+int sn_network_show (sn_network_t *n) /* {{{ */
+{
+ return (sn_network_show_fh (n, stdout));
} /* }}} int sn_network_show */
int sn_network_invert (sn_network_t *n) /* {{{ */