[project @ 2004-06-13 02:03:43 by unknown_lamer]
authorunknown_lamer <unknown>
Sun, 13 Jun 2004 02:03:44 +0000 (02:03 +0000)
committerunknown_lamer <unknown>
Sun, 13 Jun 2004 02:03:44 +0000 (02:03 +0000)
Wrote most of the configuration section of the manual and implemented bot:ctcp-quote in bobot-utils.scm

ChangeLog
NEWS
TODO
aclocal.m4
bobot++.info
bobot++.texinfo
configure.ac
scripts/bobot-utils.scm
source/DCCManager.C
source/Main.C

index 5d035ac..4c43ab6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2004-06-12  Clinton Ebadi  <clinton@unknownlamer.org>
+
+       * scripts/bobot-utils.scm (ctcp-quote): Implemented ctcp-quote
+
+2004-05-28  Clinton Ebadi  <clinton@unknownlamer.org>
+
+       * bobot++.texinfo (bot.conf): Finished section
+       (server syntax): New section, documents the bot.conf SERVER syntax
+       (channel syntax): New section, documentes the bot.conf CHANNEL syntax
+
+2004-05-13  Clinton Ebadi  <clinton@unknownlamer.org>
+
+       * source/Main.C (real_main): std::exit instead of exit
+
 2004-05-12  Clinton Ebadi  <clinton@unknownlamer.org>
 
        * source/DCCConnection.C (DCCConnection): Intialized `nuh' in the
diff --git a/NEWS b/NEWS
index 557ded1..c3c0c30 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@ IMPORTANT NOTES:
 ====== The News =====================================================
 =====================================================================
 
+Version 2.1.5: Manual Stuff
+- The Bot Configuration section of the manual has been completed.
+
 Version 2.1.4: DCC Support Enhancements
 - Internal Change: DCCConnection is now an abstract class
 - Internal Change: DCCChatConnection provides the functionality of
@@ -95,7 +98,7 @@ Version 2.1.0: Zug Zug
   before non-fallthrough hooks. 
 - The default config is read from ~/.bobotpp/config/default/ or
   /etc/bobotpp/default/ if the user config is not found. Put your
-  default config is either dir. You may also specify a specific config
+  default config in either dir. You may also specify a specific config
   under these dirs using the --config or -c arg to bobotpp (see
   bobotpp --help for the full list of commands you may use and how to
   use them).
diff --git a/TODO b/TODO
index 8fe2313..dd870c0 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,7 +1,18 @@
-2.2 will be released when most of these are done
+2.2:
+* Finish adding commands to Scheme for sending messages
+  (e.g. bot:send-CTCP to send a CTCP message)
+* Add util functions for doing stuff like quoting CTCP messages
+* Finish adding hooks/send hooks
+* Write Texinfo manual
+* DCC CHAT min user level
+* Configuration Database
+* Improve the help syst
+* DCC FILE support (sending and recieving)
+* XDCC file server script (requires DCC FILE support)
 
+2.4/3.0 (2.4 iff backwards compatibility is maintained, 3.0 otherwise):
 General:
-* Make String operator >> act like all other >>'s, and add getline?
+* Eliminate String class
 * Finish converting UserCommands to use Commands
 * Audit code and see what data in classes should be made private and
    have getters/setters added (e.g. logFileName in Bot--if this is
@@ -15,28 +26,19 @@ Scripting:
    - At least allow all hooks of a type with the same name field to be
      deleted at once (also all hooks with the same name). Also allow
      deleting based on the regexp
-* Finish adding commands to Scheme for sending messages
-  (e.g. bot:send-CTCP to send a CTCP message)
-* Add util functions for doing stuff like quoting CTCP messages
-* Finish adding hooks/send hooks
 
 Networking:
 * Add a networked interface to guile repl
    - This can be done as a script, but requires non-coop threads
-      support to be done easily
+     support to be done easily
    - Admins only
    - Telnet
    - Store authorized users and passwords in bot.telnet file
    - Bot master can add new telnet users
    - MUST HAVE PASSWORD
    - Maybe use SSL?
-* DCC FILE support (this can be done as a script if a few changes are
-   made to the DCC support)
-
-Documentation:
-* Work on Texinfo manual (especially scripting section)
 
-Other (post 2.2 release):
+Definitely 3.0:
 * Remove gh_* when Guile 1.8 is released
 * Make it possible to use Scheme functions in the Parser itself
 * Replace large select-loop in Bot::waitForInput with multithreaded
@@ -50,4 +52,4 @@ Other (post 2.2 release):
    - To clarify: There will be one thread for DCCs and another thread
    for the current irc server connection, each with its own select
    loop. There may also be a thread for the network repls if I
-   implement that.
\ No newline at end of file
+   implement those.
\ No newline at end of file
index a7294d9..7779651 100644 (file)
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.7.6 -*- Autoconf -*-
+# generated automatically by aclocal 1.7.9 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
 # Free Software Foundation, Inc.
@@ -435,7 +435,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
 # Call AM_AUTOMAKE_VERSION so it can be traced.
 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-        [AM_AUTOMAKE_VERSION([1.7.6])])
+        [AM_AUTOMAKE_VERSION([1.7.9])])
 
 # Helper functions for option handling.                    -*- Autoconf -*-
 
index de04f1c..ebb004f 100644 (file)
@@ -4,7 +4,7 @@ bobot++.texinfo.
    This file documents Bobot++ by Clinton Ebadi and Etienne Bernard
 (original author, no longer works on program).
 
-   Copyright 2002 Clinton Ebadi
+   Copyright 2002,2004 Clinton Ebadi
 
    Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.1 or
@@ -18,9 +18,9 @@ File: bobot++.info,  Node: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)
    This document describes Bobot++ by Clinton Ebadi and Etienne Bernard
 (original author, no longer works on program).
 
-   This document applies to version 2.1.0 of the program named Bobot++
+   This document applies to version 2.1.5 of the program named Bobot++
 
-   Copyright 2002 Clinton Ebadi
+   Copyright 2002,2004 Clinton Ebadi
 
    Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.1 or
@@ -38,6 +38,44 @@ Texts.
 * Function Index::
 * Variable Index::
 
+ --- The Detailed Node Listing ---
+
+Configuration
+
+* Configuration Files::
+* Configuration File Placement::
+
+Configuration Files
+
+* bot.conf::
+
+bot.conf
+
+* server syntax::
+* channel syntax::
+
+Using Bobot++
+
+* User Levels::
+
+Scripting
+
+* Adding New Commands::
+* Hooks::
+* Scheme User Levels::
+* Sending Messages::
+* Misc Scripting Stuff::
+
+Hooks
+
+* Creating a Hook::
+* Hook Types::
+
+Sending Messages
+
+* High Level Message Functions::
+* Low Level Message Functions::
+
 \1f
 File: bobot++.info,  Node: Introduction,  Next: Configuration,  Prev: Top,  Up: Top
 
@@ -58,26 +96,34 @@ changing in the 2.1 series, so it is not documented for now. See the
 
 * Menu:
 
-* Configuration File Syntax::
-* Configure File Placement::
+* Configuration Files::
+* Configuration File Placement::
 
 \1f
-File: bobot++.info,  Node: Configuration File Syntax,  Next: Configure File Placement,  Prev: Configuration,  Up: Configuration
+File: bobot++.info,  Node: Configuration Files,  Next: Configuration File Placement,  Prev: Configuration,  Up: Configuration
 
-Configuration File Syntax
-=========================
+Configuration Files
+===================
 
 * Menu:
 
 * bot.conf::
 
 \1f
-File: bobot++.info,  Node: bot.conf,  Prev: Configuration File Syntax,  Up: Configuration File Syntax
+File: bobot++.info,  Node: bot.conf,  Prev: Configuration Files,  Up: Configuration Files
 
 bot.conf
 --------
 
-bot.conf is the main configuration file for a Bobot++. The available
+`bot.conf' contains key value pairs separated by `='.
+
+   `<key> = <value>'
+
+   Comments are started with a `#' and cause the entire line to be
+ignored. _Note that this only works when the `#' is the first character
+of the line_.
+
+   bot.conf is the main configuration file for a Bobot++. The available
 configuration variables are listed below in the format "VARIABLE
 <default-value>: description"
 
@@ -96,11 +142,69 @@ configuration variables are listed below in the format "VARIABLE
 
    * SHITLIST <bot.shit>: Name of the file where the shitlist is stored
 
-   * LOGFILE <$LOGDIR/bot.log>:
+   * LOGFILE <$LOGDIR/bot.log>: Location of the bot logfile (set this
+     to `/dev/null' to disable logging).
+
+   * SERVER <None>: This specifies the server to connect to. Note that
+     this has a special syntax.
+
+   * CHANNEL <None>: This specifies a channel the bot will join when it
+     starts up. This also has a special syntax.
+
+
+* Menu:
+
+* server syntax::
+* channel syntax::
+
+\1f
+File: bobot++.info,  Node: server syntax,  Next: channel syntax,  Prev: bot.conf,  Up: bot.conf
+
+server syntax
+.............
+
+SERVER = SERVER_NAME [PORT [PASSWORD]]
+
+   This will make Bobot++ attempt to connect to SERVER_NAME on port
+PORT with the password PASSWORD. SERVER_NAME should be the address of
+the server. PORT and PASSWORD are optional. You may use more than one
+server line; Bobot++ will attempt to connect to the first one and, if
+it fails, will connect to the next one in the list. There is also a
+command to cause the bot to cycle servers. At the present time Bobot++
+cannot connect to more than one server at a time. This is a planned
+feature of 3.0 (which is a very long way away; the current structure of
+the program would make it very difficult to add support for connecting
+to multiple servers at a time in a usable manner).
+
+\1f
+File: bobot++.info,  Node: channel syntax,  Prev: server syntax,  Up: bot.conf
+
+channel syntax
+..............
+
+CHANNEL = NAME:INITIAL_MODES:MODES_TO_KEEP:CHANNEL_KEY
+
+   You may have any number of channel lines. When Bobot++ starts it will
+attempt to join and gain ops in every channel listed. It will join NAME
+and set the channel modes to INITIAL_MODES (e.g. "nt") if it is able to
+gain operator status. It will then maintain MODES_TO_KEEP. If the
+channel requires a key to enter simply set CHANNEL_KEY. Every argument
+except for NAME is optional.
+
+   A few example lines:
+
+   `CHANNEL = #foo:nt:nt:bar'
+
+   The bot will join `#foo' with the channel key `bar' and will then
+maintain the modes `nt'.
+
+   `CHANNEL = #bar:::'
 
+   The bot will join `#bar' and will not set any modes nor will it
+attempt to maintain any modes.
 
 \1f
-File: bobot++.info,  Node: Configure File Placement,  Prev: Configuration File Syntax,  Up: Configuration
+File: bobot++.info,  Node: Configuration File Placement,  Prev: Configuration Files,  Up: Configuration
 
 Configuration File Placement
 ============================
@@ -108,7 +212,7 @@ Configuration File Placement
 Bobot++ will look in `/etc/bobotpp/default/' for its default config if
 none is specified on the command line. Put the configuration files you
 want to be loaded by default in this directory. If you are not root or
-you want to have your own personal configration, put it in
+you want to have your own personal configuration, put it in
 `~/.bobotpp/config/default/'.
 
 \1f
@@ -549,26 +653,28 @@ Variable Index
 
 \1f
 Tag Table:
-Node: Top\7f517
-Node: Introduction\7f1246
-Node: Configuration\7f1434
-Node: Configuration File Syntax\7f1817
-Node: bot.conf\7f2024
-Node: Configure File Placement\7f2856
-Node: Using the Bot\7f3327
-Node: User Levels\7f3498
-Node: Scripting\7f4499
-Node: Adding New Commands\7f5404
-Node: Hooks\7f6668
-Node: Creating a Hook\7f7639
-Node: Hook Types\7f8775
-Node: Scheme User Levels\7f12246
-Node: Sending Messages\7f13372
-Node: High Level Message Functions\7f13980
-Node: Low Level Message Functions\7f14191
-Node: Misc Scripting Stuff\7f14941
-Node: Concept Index\7f15357
-Node: Function Index\7f15539
-Node: Variable Index\7f15800
+Node: Top\7f522
+Node: Introduction\7f1722
+Node: Configuration\7f1910
+Node: Configuration Files\7f2291
+Node: bot.conf\7f2484
+Node: server syntax\7f3889
+Node: channel syntax\7f4737
+Node: Configuration File Placement\7f5564
+Node: Using the Bot\7f6034
+Node: User Levels\7f6205
+Node: Scripting\7f7206
+Node: Adding New Commands\7f8111
+Node: Hooks\7f9375
+Node: Creating a Hook\7f10346
+Node: Hook Types\7f11482
+Node: Scheme User Levels\7f14953
+Node: Sending Messages\7f16079
+Node: High Level Message Functions\7f16687
+Node: Low Level Message Functions\7f16898
+Node: Misc Scripting Stuff\7f17648
+Node: Concept Index\7f18064
+Node: Function Index\7f18246
+Node: Variable Index\7f18507
 \1f
 End Tag Table
index 96c130c..d61bd50 100644 (file)
@@ -9,7 +9,7 @@
 This file documents Bobot++ by Clinton Ebadi and Etienne Bernard
 (original author, no longer works on program).
 
-Copyright 2002 Clinton Ebadi
+Copyright 2002,2004 Clinton Ebadi
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.1 or
@@ -25,7 +25,7 @@ Texts.
 
 @page
 @vskip O plus 1filll
-Copyright @copyright{} 2002 Clinton Ebadi
+Copyright @copyright{} 2002,2004 Clinton Ebadi
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.1 or
@@ -42,10 +42,10 @@ Texts.
 This document describes Bobot++ by Clinton Ebadi and Etienne Bernard
 (original author, no longer works on program).
 
-This document applies to version 2.1.0 of the program named
+This document applies to version 2.1.5 of the program named
 Bobot++
 
-Copyright 2002 Clinton Ebadi
+Copyright 2002,2004 Clinton Ebadi
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.1 or
@@ -62,6 +62,47 @@ Texts.
 * Concept Index::               
 * Function Index::              
 * Variable Index::              
+
+@detailmenu
+ --- The Detailed Node Listing ---
+
+Configuration
+
+* Configuration Files::         
+* Configuration File Placement::  
+
+Configuration Files
+
+* bot.conf::                    
+
+bot.conf
+
+* server syntax::               
+* channel syntax::              
+
+Using Bobot++
+
+* User Levels::                 
+
+Scripting
+
+* Adding New Commands::         
+* Hooks::                       
+* Scheme User Levels::          
+* Sending Messages::            
+* Misc Scripting Stuff::        
+
+Hooks
+
+* Creating a Hook::             
+* Hook Types::                  
+
+Sending Messages
+
+* High Level Message Functions::  
+* Low Level Message Functions::  
+
+@end detailmenu
 @end menu
 
 @node Introduction, Configuration, Top, Top
@@ -78,20 +119,28 @@ changing in the 2.1 series, so it is not documented for now. See the
 @file{examples} directory for an example configuration. 
 
 @menu
-* Configuration File Syntax::   
-* Configure File Placement::    
+* Configuration Files::         
+* Configuration File Placement::  
 @end menu
 
-@node Configuration File Syntax, Configure File Placement, Configuration, Configuration
-@section Configuration File Syntax
+@node Configuration Files, Configuration File Placement, Configuration, Configuration
+@section Configuration Files
 
 @menu
 * bot.conf::                    
 @end menu
 
-@node bot.conf,  , Configuration File Syntax, Configuration File Syntax
+@node bot.conf,  , Configuration Files, Configuration Files
 @subsection bot.conf
 
+@file{bot.conf} contains key value pairs separated by @code{=}. 
+
+@code{<key> = <value>}
+
+Comments are started with a @code{#} and cause the entire line to be
+ignored. @emph{Note that this only works when the @code{#} is the first
+character of the line}.
+
 bot.conf is the main configuration file for a Bobot++. The available
 configuration variables are listed below in the format ``@var{variable}
 <default-value>: description''
@@ -109,17 +158,70 @@ the bot (@var{realname} is an alias for @var{ircname})
 stored
 @item @var{shitlist} <bot.shit>: Name of the file where the shitlist is
 stored
-@item @var{logfile} <$LOGDIR/bot.log>:
+@item @var{logfile} <$LOGDIR/bot.log>: Location of the bot logfile
+(set this to @file{/dev/null} to disable logging).
+@item @var{server} <None>: This specifies the server to connect
+to. Note that this has a special syntax.
+@item @var{channel} <None>: This specifies a channel the bot will join
+when it starts up. This also has a special syntax.
 
 @end itemize
 
-@node Configure File Placement,  , Configuration File Syntax, Configuration
+@menu
+* server syntax::               
+* channel syntax::              
+@end menu
+
+@node server syntax, channel syntax, bot.conf, bot.conf
+@subsubsection server syntax
+
+@var{server} = @var{server_name} [@var{port} [@var{password}]]
+
+This will make Bobot++ attempt to connect to @var{server_name} on port
+@var{port} with the password @var{password}. @var{server_name} should
+be the address of the server. @var{port} and @var{password} are
+optional. You may use more than one server line; Bobot++ will attempt
+to connect to the first one and, if it fails, will connect to the next
+one in the list. There is also a command to cause the bot to cycle
+servers. At the present time Bobot++ cannot connect to more than one
+server at a time. This is a planned feature of 3.0 (which is a very
+long way away; the current structure of the program would make it very
+difficult to add support for connecting to multiple servers at a time
+in a usable manner).
+
+@node  channel syntax,  , server syntax, bot.conf
+@subsubsection channel syntax
+
+@var{channel} =
+@var{name}:@var{initial_modes}:@var{modes_to_keep}:@var{channel_key}
+
+You may have any number of channel lines. When Bobot++ starts it will
+attempt to join and gain ops in every channel listed. It will join
+@var{name} and set the channel modes to @var{initial_modes}
+(e.g. ``nt'') if it is able to gain operator status. It will then
+maintain @var{modes_to_keep}. If the channel requires a key to enter
+simply set @var{channel_key}. Every argument except for @var{name} is
+optional. 
+
+A few example lines:
+
+@code{@var{channel} = #foo:nt:nt:bar}
+
+The bot will join @code{#foo} with the channel key @code{bar} and will
+then maintain the modes @code{nt}.
+
+@code{@var{channel} = #bar:::}
+
+The bot will join @code{#bar} and will not set any modes nor will it
+attempt to maintain any modes.
+
+@node Configuration File Placement,  , Configuration Files, Configuration
 @section Configuration File Placement
 
 Bobot++ will look in @file{/etc/bobotpp/default/} for its default
 config if none is specified on the command line. Put the configuration
 files you want to be loaded by default in this directory. If you are
-not root or you want to have your own personal configration, put it in
+not root or you want to have your own personal configuration, put it in
 @file{~/.bobotpp/config/default/}. 
 
 @node Using the Bot, Scripting, Configuration, Top
index add45f6..12b3d88 100644 (file)
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PRERQ(2.50)
 dnl AC_INIT(source/Makefile.in)
-AC_INIT([Bobot++], [2.1.4CVS], [clinton@unknownlamer.org], [bobotpp])
+AC_INIT([Bobot++], [2.1.5CVS], [clinton@unknownlamer.org], [bobotpp])
 AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER(config.h)
 
index a3323dc..16f3996 100644 (file)
@@ -9,13 +9,15 @@
 (module-use! (resolve-module '(guile-user) #f)
             the-bot-module)
 
+(use-modules (srfi srfi-13))
+
 (define-public %bot:loadpath (list
                              (string-append (getenv "HOME")
                                             "/.bobotpp/scripts/")
                              bot:sys-scripts-dir))
 (define-public %bot:load-extensions %load-extensions)
 
-;;; bot-log: Write as many messages as you want to the log.  If the
+;;; bot:log: Write as many messages as you want to the log.  If the
 ;;; arg is a thunk it will be executed and it's output will be
 ;;; written to the log
 (define-public (bot:log . messages)
@@ -24,7 +26,7 @@
      (if (thunk? x)
        (display (x) (bot-logport))
        (display x (bot-logport))))
-   messages )
+   messages)
   (bot:flushport))
 
 (define-public (bot:load file)
 
 ;;; Message sending utils
 
-;;; returns the CTCP quoted message
+;;; Returns the CTCP quoted message
+;;; Input _MUST NOT_ contain the trailing \r\n
+;;; (it is added by the message sending code)
 (define-public (ctcp-quote message)
-  message) ; FIXME: fill me in
+  ;; TODO: Not very efficient, it may be worth reimplementing
+  (let ((ls (string->list message)))
+     (string-concatenate
+      (map (lambda (chr) ; CTCP level quoting
+            (case (char->integer chr)
+              ((#o134) (string (integer->char #o134) (integer->char #o134)))
+              ((#o01)  (string (integer->char #o134) #\a)) ; X-DELIM
+              (else (string chr))))
+          (string->list
+           (string-concatenate
+            (map (lambda (chr) ; Low-level
+                   (let ((m-quote (integer->char #o20)))
+                     (case chr
+                       ((m-quote)  (string m-quote m-quote))
+                       ((#\nul)    (string m-quote #\0))
+                       ((#\nl)     (string m-quote #\n))
+                       ((#\cr)     (string m-quote #\r))
+                       (else       (string chr)))))
+                 ls)))))))
+        
+  
 
 ;;; DEPRECATED FUNCTION NAMES
 ;;; These are provided for backwards compatibility
-;;; and will be removed in the 2.3 dev tree
+;;; and will be removed in the 3.0 release
 
 (define-public bot-load bot:load)
 (define-public bot-action bot:action)
index 3ea012b..8f51521 100644 (file)
@@ -22,7 +22,6 @@ DCCManager::addConnection (DCCConnection *cnx)
 {
   DCCPerson *person = new DCCPerson (cnx);
   String temp = person->getAddress ();
-  cnx->get_bot()->logLine (temp);
   if (dcc_map[temp])
     delete dcc_map[temp];
   dcc_map[person->getAddress ()] = person;
index bb51b54..9bc36f0 100644 (file)
@@ -175,7 +175,7 @@ static void real_main(void* DONOTUSE, int argc, char **argv)
       break;
     default:
       print_short_help (argv[0]); 
-      exit(1);
+      std::exit(1);
     }
 
   DIR * temp;
@@ -241,7 +241,8 @@ static void real_main(void* DONOTUSE, int argc, char **argv)
 
 } // static functions and data
 
-int main(int argc, char **argv) {
+int main(int argc, char **argv) 
+{
 #ifdef USESCRIPTS
   scm_boot_guile (argc, argv, real_main, 0);
 #else