+// #define MTRACE
+#ifdef MTRACE
+#include <mcheck.h>
+#endif
+
+static struct conf_config *sc_stop_config = 0;
+
+void child_handler(void *data)
+{
+ struct conf_config *config = (struct conf_config *) data;
+
+ config_process_events(config);
+
+ config_destroy(config);
+}
+
+static void show_version(void)
+{
+ char yaz_version_str[80];
+ printf("Pazpar2 " PACKAGE_VERSION
+#ifdef PAZPAR2_VERSION_SHA1
+ " "
+ PAZPAR2_VERSION_SHA1
+#endif
+"\n");
+
+ yaz_version(yaz_version_str, 0);
+
+ printf("Configuration:");
+#if YAZ_HAVE_ICU
+ printf(" icu:enabled");
+#else
+ printf(" icu:disabled");
+#endif
+ printf(" yaz:%s", yaz_version_str);
+ printf("\n");
+ exit(0);
+}
+
+#ifdef WIN32
+static int tcpip_init (void)
+{
+ WORD requested;
+ WSADATA wd;
+
+ requested = MAKEWORD(1, 1);
+ if (WSAStartup(requested, &wd))
+ return 0;
+ return 1;
+}
+#endif
+
+
+static int sc_main(
+ yaz_sc_t s,
+ int argc, char **argv)