+ size_t len;
+ UINT16 *ports;
+ len = array_length(a, sizeof(UINT16));
+ if (len--) {
+ ports = (UINT16*) array_start(a);
+ printf("%u", (unsigned int) *ports);
+ while (len--) {
+ ports++;
+ printf(", %u", (unsigned int) *ports);
+ }
+ }
+ putc('\n', stdout);
+}
+
+
+static void
+ports_parse(array *a, int Line, char *Arg)
+{
+ char *ptr;
+ int port;
+ UINT16 port16;
+
+ array_trunc(a);
+
+ /* Ports on that the server should listen. More port numbers
+ * must be separated by "," */
+ ptr = strtok( Arg, "," );
+ while (ptr) {
+ ngt_TrimStr( ptr );
+ port = atol( ptr );
+ if (port > 0 && port < 0xFFFF) {
+ port16 = (UINT16) port;
+ if (!array_catb(a, (char*)&port16, sizeof port16))
+ Config_Error(LOG_ERR, "%s, line %d Could not add port number %ld: %s",
+ NGIRCd_ConfFile, Line, port, strerror(errno));
+ } else {
+ Config_Error( LOG_ERR, "%s, line %d (section \"Global\"): Illegal port number %ld!",
+ NGIRCd_ConfFile, Line, port );
+ }
+
+ ptr = strtok( NULL, "," );
+ }
+}
+
+
+GLOBAL void
+Conf_Init( void )
+{
+ Set_Defaults( true );