+#ifndef SILC_SYMBIAN
+ char *string;
+ int len;
+ if ((strchr(debug_string, '(') && strchr(debug_string, ')')) ||
+ strchr(debug_string, '$'))
+ string = silc_strdup(debug_string);
+ else
+ string = silc_string_regexify(debug_string);
+ len = strlen(string);
+ if (len >= sizeof(silclog.debug_string))
+ len = sizeof(silclog.debug_string) - 1;
+ memset(silclog.debug_string, 0, sizeof(silclog.debug_string));
+ strncpy(silclog.debug_string, string, len);
+ silc_free(string);
+#endif /* !SILC_SYMBIAN */
+}
+
+/* Set timestamp */
+
+void silc_log_timestamp(SilcBool enable)
+{
+#ifndef SILC_SYMBIAN
+ silclog.timestamp = enable;
+#endif /* !SILC_SYMBIAN */
+}
+
+/* Set flushdelay */
+
+void silc_log_flushdelay(SilcUInt32 flushdelay)
+{
+#ifndef SILC_SYMBIAN
+ silclog.flushdelay = flushdelay;
+#endif /* !SILC_SYMBIAN */
+}
+
+/* Set quick logging */
+
+void silc_log_quick(SilcBool enable)
+{
+#ifndef SILC_SYMBIAN
+ silclog.quick = enable;
+#endif /* !SILC_SYMBIAN */
+}
+
+/* Set debugging */
+
+void silc_log_debug(SilcBool enable)
+{
+#ifndef SILC_SYMBIAN
+ silclog.debug = enable;
+#endif /* !SILC_SYMBIAN */
+}
+
+/* Set debug hexdump */
+
+void silc_log_debug_hexdump(SilcBool enable)
+{
+#ifndef SILC_SYMBIAN
+ silclog.debug_hexdump = enable;
+#endif /* !SILC_SYMBIAN */
+}
+
+/* Outputs the debug message to stderr. */
+
+void silc_log_output_debug(char *file, const char *function,
+ int line, char *string)
+{
+ SilcTimeStruct curtime;
+
+#ifndef SILC_SYMBIAN
+ if (!silclog.debug)
+ goto end;
+
+ if (!silc_string_regex_match(silclog.debug_string, file) &&
+ !silc_string_regex_match(silclog.debug_string, function))
+ goto end;
+
+ if (silclog.debug_cb) {
+ if ((*silclog.debug_cb)(file, (char *)function, line, string,
+ silclog.debug_context))
+ goto end;
+ }
+#endif /* !SILC_SYMBIAN */
+
+ silc_time_value(0, &curtime);
+
+#ifdef SILC_WIN32
+ if (strrchr(function, '\\'))
+ fprintf(stderr, "%s:%d: %s\n", strrchr(function, '\\') + 1, line, string);