Added __SILC_HAVE_PTHREAD, __SILC_HAVE_SIM, __SILC_HAVE_LIBIDN,
authorPekka Riikonen <priikone@silcnet.org>
Thu, 31 Mar 2005 08:18:09 +0000 (08:18 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 31 Mar 2005 08:18:09 +0000 (08:18 +0000)
and __SILC_ENABLE_DEBUG for third-party software.

CHANGES
TODO
apps/silcd/command.c
configure.in.pre
includes/silcincludes.h.in

diff --git a/CHANGES b/CHANGES
index 12b4392e09cbd2ba50e9323cb6813daf6935d23f..15befc32498650fd2fb664317dea83c55e383e6b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,10 @@ Thu Mar 31 08:52:06 EEST 2005  Pekka Riikonen <priikone@silcnet.org>
          server names in client library.  Affected files in
          lib/silcclient/.
 
+       * Added __SILC_HAVE_PTHREAD, __SILC_HAVE_SIM, __SILC_HAVE_LIBIDN,
+         and __SILC_ENABLE_DEBUG to include/silcclient.h for third-party
+         software to check how Toolkit has been compiled.
+
 Wed Mar 30 22:16:35 EEST 2005  Pekka Riikonen <priikone@silcnet.org>
 
        * Added silc_utf8_str[n]casecmp into lib/silcutil/silcutf8.[ch].
diff --git a/TODO b/TODO
index 38b510488a9cdd4d7035b6df8f5da70c478c6c9f..32f3a9b8f55ff459e228e485ddfa355e4b02b3ab 100644 (file)
--- a/TODO
+++ b/TODO
@@ -43,18 +43,6 @@ TODO for SILC Server 1.0
 TODO/bugs In SILC Libraries
 ===========================
 
- o Stringprep checks to the Client Library.
-
- o Add following defines in silcincludes.h and silcclient.h for 
-   third-party software:
-
-       __SILC_LIBSILC_HAVE_PTHREAD
-       __SILC_LIBSILC_HAVE_SIM
-        __SILC_LIBSILC_ENABLE_DEBUG
-       __SILC_LIBSILCCLIENT_HAVE_PTHREAD
-       __SILC_LIBSILCCLIENT_HAVE_SIM
-        __SILC_LIBSILCCLIENT_ENABLE_DEBUG
-
  o Test cases for all payload encoding and decoding routins in lib/silccore/
 
  o Test cases for math library routines in lib/silcmath/
index b16e413706da11e50b4d804054366c90ddbe6b7a..621ce1459b1f2054f8473741386763ace7a2f7d4 100644 (file)
@@ -994,6 +994,13 @@ SILC_SERVER_CMD_FUNC(topic)
       goto out;
     }
 
+    if (!silc_utf8_valid(tmp, strlen(tmp))) {
+      silc_server_command_send_status_reply(cmd, SILC_COMMAND_TOPIC,
+                                           SILC_STATUS_ERR_NOT_ENOUGH_PARAMS,
+                                           0);
+      goto out;
+    }
+
     /* See whether the client is on channel and has rights to change topic */
     if (!silc_server_client_on_channel(client, channel, &chl)) {
       tmp = silc_argument_get_arg_type(cmd->args, 1, &tmp_len);
index c7a3c1c8a78817cb1cf716b4623fee267f479436..2b11a15b41acb6577eaf151c1671be1499e1920a 100644 (file)
@@ -3,12 +3,11 @@
 #
 #  Author: Pekka Riikonen <priikone@silcnet.org>
 #
-#  Copyright (C) 2000 - 2004 Pekka Riikonen
+#  Copyright (C) 2000 - 2005 Pekka Riikonen
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
+#  the Free Software Foundation; version 2 of the License.
 #
 #  This program is distributed in the hope that it will be useful,
 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -187,9 +186,11 @@ AC_CHECK_HEADERS(dlfcn.h,
       ])
    ])
 
+__SILC_HAVE_SIM=""
 AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue)
 if test x$sim_support = xtrue; then
   AC_MSG_RESULT(Enabled SIM support.)
+  __SILC_HAVE_SIM="#define __SILC_HAVE_SIM 1"
 else
   AC_MSG_RESULT(No SIM support found.)
 fi
@@ -276,6 +277,7 @@ fi
 #
 AC_MSG_CHECKING(whether to enable debugging)
 summary_debug="no"
+__SILC_ENABLE_DEBUG=""
 AC_ARG_ENABLE(debug,
   [  --enable-debug          enable debugging],
   [
@@ -284,6 +286,7 @@ AC_ARG_ENABLE(debug,
         AC_MSG_RESULT(yes)
         AC_DEFINE(SILC_DEBUG)
        summary_debug="yes"
+        __SILC_ENABLE_DEBUG="#define __SILC_ENABLE_DEBUG 1"
         ;;
       *)
         AC_MSG_RESULT(no)
@@ -838,6 +841,10 @@ if test x$check_libidn = xtrue; then
     done
 fi
 
+__SILC_HAVE_LIBIDN=""
+if test x$has_libidn = xtrue; then
+  __SILC_HAVE_LIBIDN="#define __SILC_HAVE_LIBIDN 1"
+fi
 
 # iconv support
 #
@@ -1112,6 +1119,7 @@ else
   has_threads=false
 fi
 
+__SILC_HAVE_PTHREAD=""
 AM_CONDITIONAL(SILC_THREADS, test x$has_threads = xtrue)
 if test x$has_threads = xtrue; then
   CFLAGS="$CFLAGS -D_REENTRANT"
@@ -1142,6 +1150,7 @@ if test x$has_threads = xtrue; then
   AC_CHECK_FUNC(pthread_create)
   AC_DEFINE(SILC_HAVE_PTHREAD)
   AC_DEFINE(SILC_THREADS)
+  __SILC_HAVE_PTHREAD="#define __SILC_HAVE_PTHEAD 1"
 fi
 
 # Native WIN32 compilation under cygwin
@@ -1262,6 +1271,11 @@ AM_CONDITIONAL(SILC_LIBTOOLFIX, test x$libtoolfix = xtrue)
 # Included configure scripts
 AD_INCLUDE_CONFIGURE
 
+AC_SUBST(__SILC_HAVE_PTHREAD)
+AC_SUBST(__SILC_HAVE_SIM)
+AC_SUBST(__SILC_HAVE_LIBIDN)
+AC_SUBST(__SILC_ENABLE_DEBUG)
+
 #
 # Makefile outputs
 #
index 9f61030078f160213a8c2c8c6ac234881978ba60..3bc14ca536415a02c4b915a087a7be80aad2d1ef 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2003 Pekka Riikonen
+  Copyright (C) 1997 - 2005 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -71,6 +71,12 @@ extern "C" {
 #define SILC_SIZEOF_CHAR @SILC_SIZEOF_CHAR@
 #define SILC_SIZEOF_VOID_P @SILC_SIZEOF_VOID_P@
 
+/* Compilation time defines, for third-party software */
+@__SILC_HAVE_PTHREAD@
+@__SILC_HAVE_SIM@
+@__SILC_HAVE_LIBIDN@
+@__SILC_ENABLE_DEBUG@
+
 #if defined(HAVE_SILCDEFS_H)
 /* Automatically generated configuration header */
 #include "silcdefs.h"