+/**
+ * Adds a comparator to a comparator network. The code tries to add the
+ * comparator to the last stage, i.e. the stage closest to the outputs. If this
+ * is not possible, because one line is used by another comparator, a new stage
+ * is created and appended to the sorting network.
+ *
+ * \param n Pointer to the comparator netork.
+ * \param c Pointer to a comparator to add. The given comparator is copied. It
+ * is the caller's responsibility to free c.
+ * \return Zero on success, non-zero on failure.
+ */
+int sn_network_comparator_add (sn_network_t *n, const sn_comparator_t *c);
+
+/**
+ * Returns the number of comparators contained in the comparator network. This
+ * will traverse all comparators in all stages, resulting in a running time of
+ * \f$ \mathcal{O}(n) \f$.
+ *
+ * \param n Comparator network to work with.
+ * \return The number of comparators contained in the network or less than zero
+ * on error (\c n is \c NULL).
+ */
+int sn_network_get_comparator_num (const sn_network_t *n);
+
+/**
+ * Applies a comparator network to an array of integers. This is implemented by
+ * calling sn_stage_sort() with every stage of the network.
+ *
+ * \param n Pointer to the comparator netork.
+ * \param[in,out] values Pointer to integer values to sort. The number of
+ * integer values pointed to must be at least the number of inputs of the
+ * comparator network. Otherwise, segmentation faults or memory corruption
+ * will occur.
+ * \return Zero on success, non-zero on failure.
+ * \see sn_stage_sort
+ */