From 76ee719f8c9ba52a21d8cdd92cc7a8689f322a2e Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sat, 9 Feb 2002 15:21:17 +0000 Subject: [PATCH] updates. --- .cvsignore | 19 ++ CHANGES | 7 + lib/LIBINDEX | 14 +- lib/silcclient/DIRECTORY | 3 +- lib/silcclient/Makefile.am | 2 +- .../{README => silcclient_using.html} | 201 ++++++++++++------ lib/silcutil/silchashtable.h | 6 +- scripts/silcdoc/gen_detail.php | 6 +- scripts/silcdoc/gen_html_detail.php | 39 ++++ scripts/silcdoc/index.php | 4 +- scripts/silcdoc/silcdoc | 35 ++- util/robodoc/Source/generator.c | 8 +- 12 files changed, 254 insertions(+), 90 deletions(-) create mode 100644 .cvsignore rename lib/silcclient/{README => silcclient_using.html} (69%) create mode 100644 scripts/silcdoc/gen_html_detail.php diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 00000000..204db8f3 --- /dev/null +++ b/.cvsignore @@ -0,0 +1,19 @@ +Makefile +Makefile.in +Makefile.am +Makefile.defines.in +Makefile.defines_int.in +config.cache +config.guess +config.h +config.h.in +config.log +config.status +config.sub +configure +configure.in +libtool +libtool-shared +ltconfig +stamp-h +stamp-h.in diff --git a/CHANGES b/CHANGES index ccde2997..aac22727 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,13 @@ Sat Feb 9 14:54:33 EET 2002 Pekka Riikonen * Allow zero length channel messages inside the Channel Message Payload. Affected file lib/silccore/silcchannel.c. + * Fixed scripts/silcdoc/silcdoc to support all kinds of filenames + as header filenames. + + * Removed lib/silcclient/README and created HTML file + lib/silcclient/silcclient_using.html, which is now included + as part of Toolkit documentation. + Thu Feb 7 10:12:25 CET 2002 Pekka Riikonen * Fixed CUMODE_CHANGE notify handling to change the mode of diff --git a/lib/LIBINDEX b/lib/LIBINDEX index 565a0c5c..ba2219d1 100644 --- a/lib/LIBINDEX +++ b/lib/LIBINDEX @@ -5,11 +5,19 @@ SILC Toolkit Reference Manual
-Copyright (C) GNU GPL 2001 The SILC Project
-Version: 0.7.1
+Copyright (C) 2001 - 2002 The SILC Project
+Version: @VERSION@
Updated: @DATE@

Note that this document is still under work and does not -include yet all references for SILC Toolkit interfaces. +include yet all references for SILC Toolkit interfaces.

@BODY@ + +

+Resource Links +

+
  • SILC Project Website
    +
  • SILC Protocol Documentation
    +
  • SILC White Paper
    +
  • SILC FAQ
    diff --git a/lib/silcclient/DIRECTORY b/lib/silcclient/DIRECTORY index f4ac2554..e80ba7ca 100644 --- a/lib/silcclient/DIRECTORY +++ b/lib/silcclient/DIRECTORY @@ -1,7 +1,8 @@ SILC Client Library

    diff --git a/lib/silcclient/Makefile.am b/lib/silcclient/Makefile.am index 5dafa974..ccacb703 100644 --- a/lib/silcclient/Makefile.am +++ b/lib/silcclient/Makefile.am @@ -42,6 +42,6 @@ include_HEADERS= \ silcapi.h endif -EXTRA_DIST = *.h client_ops_example.c +EXTRA_DIST = *.h client_ops_example.c *.html include $(top_srcdir)/Makefile.defines.in diff --git a/lib/silcclient/README b/lib/silcclient/silcclient_using.html similarity index 69% rename from lib/silcclient/README rename to lib/silcclient/silcclient_using.html index 2b578a7e..1ffa65b7 100644 --- a/lib/silcclient/README +++ b/lib/silcclient/silcclient_using.html @@ -1,11 +1,11 @@ +
    +Using SILC Client Library - SILC Client Library Manual +
     
     
    +1.0 Introduction - Version 0.7.4 - -1.0 Introduction - -SILC Client library is a full featured SILC Client protocolimplementation. +
     
    +SILC Client library is a full featured SILC Client protocol implementation. The library has been designed to be complete SILC client without actual user interface. The library provides the API for the appliation which it can use to implement generally whatever user interface it wants. The @@ -13,6 +13,7 @@ SILC Client Library recides in the lib/silcclient/ directory. It uses common and core compomnent of SILC protocol from the lib/silccore, SKE from lib/silcske and general utility routines from lib/silcutil. +
     
    The `silcapi.h' file defines the function prototypes that application must implement in order to be able to create the user interface with the library. The idea is that the application can implement whatever user @@ -25,37 +26,50 @@ the application can call. The interface includes for example functions for sending channel and private messages, client and channel retrieval and other utility functions. +
     
     
    +1.0.1 Including Library Headers -1.0.1 Including Library Headers - +
     
    Your application must include the following includes in your sources to get access all SILC Client Library routines: -#include "silcincludes.h" +
     
    + +#include "silcincludes.h"
    #include "clientlibincludes.h" +
    +
     
    If you are compiling with C++ compiler then you need to include the headers as follows: -extern "C" { -#include "silcincludes.h" -#include "clientlibincludes.h" +
     
    + +extern "C" {
    +#include "silcincludes.h"
    +#include "clientlibincludes.h"
    } +
    -1.1 Creating Client +
     
     
    +1.1 Creating Client +
     
    The client is context or entity based, so several client entitites can be created in the application if needed. However, it should be noted that they are completely independent from each other and can be seen as different applications. Usually only one client entity is needed per application. +
     
    The client object is SilcClient which is usually allocated in following manner: - SilcClient client = silc_client_alloc(&ops, context, version); +
     
    +  SilcClient client = silc_client_alloc(&ops, params, context, version); +
     
    `ops' is the static structure of client operations that library will call. `context' can be some application specific context that will be saved into the SilcClient object. It is up to the caller to free this context. @@ -63,75 +77,95 @@ SilcClient is always passed to the application thus the application specific context can be retrieved from the SilcClient object. See `client.h' file for detailed definition of SilcClient object. +
     
    `ops' can be defined for example as follows: -SilcClientOperations ops = { - silc_say, - silc_channel_message, - silc_private_message, - silc_notify, - silc_command, - silc_command_reply, - silc_connect, - silc_disconnect, - silc_get_auth_method, - silc_verify_public_key, - silc_ask_passphrase, - silc_failure, - silc_key_agreement, -}; - +
     
    + +SilcClientOperations ops = {
    +   silc_say,
    +   silc_channel_message,
    +   silc_private_message,
    +   silc_notify,
    +   silc_command,
    +   silc_command_reply,
    +   silc_connect,
    +   silc_disconnect,
    +   silc_get_auth_method,
    +   silc_verify_public_key,
    +   silc_ask_passphrase,
    +   silc_failure,
    +   silc_key_agreement,
    +};
    +
    + +
     
    Please see the `client_ops_example.c' source file in lib/silcclient/ directory for predefined structure and stub functions for your -convenince. It is provided for programmers so that they can copy +convenience. It is provided for programmers so that they can copy it and use it directly in their application. -1.2 Initializing the Client +
     
     
    +1.2 Initializing the Client +
     
    The client must be initialized before running. However, there are also some other tasks that must be done before initializing the client. The following pointers must be set by the application before calling the initializing function: - client->username - client->hostname - client->realname - client->pkcs - client->public_key - client->private_key - +
     
    + +  client->username
    +  client->hostname
    +  client->realname
    +  client->pkcs
    +  client->public_key
    +  client->private_key +
    + +
     
    You may also set client->nickname if you want. If it is set then the library will change the nickname to that one after the client is connected to the server. If not set, then server will initially give the nickname which is same as the username. +
     
    After setting the pointers one must call: - silc_client_init(client); +
     
    +  silc_client_init(client); +
     
    which then initializes the client library for the `client'. If the pointers mentioned above are not initialized the silc_client_init will fail. The application should check the return value of the silc_client_init function. -1.3 Running the Client +
     
     
    +1.3 Running the Client +
     
    The client is run by calling silc_client_run. The function will call the scheduler from utility library that will be run until the program is ended. When silc_client_run returns the application is ended. Thus, to run the client, call: - silc_client_run(client); +
     
    +  silc_client_run(client); +
     
    Usually application may do some other initializations before calling this function. For example before calling this function application should initialize the user interface. -1.3.1 Running the Client in GUI application +
     
     
    +1.3.1 Running the Client in GUI application +
     
    Many GUI applications has their own main loop or event loop, which they would like to use or are forced to use by the underlaying system. If you are developing for example GUI application on Unix system, and you are @@ -142,6 +176,7 @@ client library once, and returns immediately. During that running it can process incoming data and send outgoing data, but it is guaranteed that it will not block the calling process. +
     
    It is suggested that you would call this function as many times in a second as possible to provide smooth action for the client library. You can use an timeout task, or an idle task provided by your GUI library to @@ -152,48 +187,64 @@ there is GTK-- GUI example in silcer/ directory. That example calls the silc_client_run_one every 50 milliseconds, and it should be sufficient for smooth working. +
     
    For Win32 the silc_client_run can be used instead of using the Windows's own event loop. However, if you would like to use the silc_client_run_one also on Win32 systems it is possible. -1.3.1.1 Running Client in GTK-- +
     
     
    +1.3.1.1 Running Client in GTK-- +
     
    Here is a short example how to run the SILC Client libary under the Gnome/GTK--'s main loop: -gint YourClass::silc_scheduler() -{ - // Run the SILC client once, and return immediately. This function - // is called every 50 milliseconds by the Gnome main loop, to process - // SILC stuff. This function will read data, and write data to network, - // etc. Makes the client library tick! :) - silc_client_run_one(silc_client); - return 1; -} - +
     
    + +gint YourClass::silc_scheduler()
    +{
    +   // Run the SILC client once, and return immediately. This function
    +   // is called every 50 milliseconds by the Gnome main loop, to process
    +   // SILC stuff. This function will read data, and write data to network,
    +   // etc. Makes the client library tick! :)
    +   silc_client_run_one(silc_client);
    +   return 1;
    +}
    +
    + +
     
    then, during initialization of the SILC Client call: - // Setup SILC scheduler as timeout task. This will handle the SILC - // client library every 50 milliseconds. It will actually make the - // SILC client work on background. - Gnome::Main::timeout.connect(slot(this, &YourClass::silc_scheduler), 50); +
     
    + +// Setup SILC scheduler as timeout task. This will handle the SILC
    +// client library every 50 milliseconds. It will actually make the
    +// SILC client work on background.
    +Gnome::Main::timeout.connect(slot(this, &YourClass::silc_scheduler), 50);
    +
    +
     
    This will call the function silc_scheduler every 50 millisecconds, which on the otherhand will call silc_client_run_one, which will make the SILC Client library work on the background of the GUI application. -1.4 Creating Connection to Server +
     
     
    +1.4 Creating Connection to Server +
     
    Connection to remote SILC server is done by calling: - silc_client_connect_to_server(client, port, hostname, context); +
     
    +  silc_client_connect_to_server(client, port, hostname, context); +
     
    The function will create the connection asynchronously to the server, ie. the function will return before the actual connection is created. After the connection is created the client->ops->connect operation is called. +
     
    Generally speaking the connections are associated with windows' on the screen. IRC is usually implemented this way, however it is not the necessary way to associate the client's connections. SilcClientConnection @@ -205,8 +256,10 @@ thus perhaps associate the connection with what ever object in application (window or something else). -1.4.1 Using Own Connecting +
     
     
    +1.4.1 Using Own Connecting +
     
    Application might not want to use silc_client_connect_to_server function if it wants to perform its own connecting for some reason. In this case application must call function silc_client_start_key_exchange after it @@ -214,29 +267,40 @@ has created the connection by itself. This function starts the key exhange protocol between the client and server and the library takes care of everything after that. +
     
    After connection has been created application must call: - SilcClientConnection conn; +
     
    + +  SilcClientConnection conn; - /* Add new connection to client */ - conn = silc_client_add_connection(client, hostname, port, context); +
     
    +  /* Add new connection to client */
    +  conn = silc_client_add_connection(client, hostname, port, context); - /* Start key exchange and let the library handle everything - after this point on. */ - silc_client_start_key_exchange(client, conn, sock); +
     
    +  /* Start key exchange and let the library handle everything
    +   after this point on. */
    +  silc_client_start_key_exchange(client, conn, sock); +
    +
     
    NOTE: These calls are performed only and only if application did not call silc_client_connect_to_server function, but performed the connecting process manually. -1.5 Example Client +
     
     
    +1.5 Example Client +
     
    This section includes an example SILC client implementation in pseudo-like C code. It creates and initializes the client and sets up an imaginary user interface. The user will use the user interface then to create the connections. The SilcClientOperations are expected to be implemented. +
     
    +
     #include "silcincludes.h"
     #include "silcapi.h"
     
    @@ -303,3 +367,4 @@ int main()
     	/* Client is ended */
     	return 0;
     }
    +
    diff --git a/lib/silcutil/silchashtable.h b/lib/silcutil/silchashtable.h index c7eeed3e..9c4c823c 100644 --- a/lib/silcutil/silchashtable.h +++ b/lib/silcutil/silchashtable.h @@ -341,7 +341,7 @@ bool silc_hash_table_find(SilcHashTable ht, void *key, * * NOTES * - * The hash table will not be rehashed during the traversing of the list, + * The hash table will not be rehashed during the traversing of the table, * even if the table was marked as auto rehashable. The caller also must * not call silc_hash_table_rehash while traversing the table. * @@ -363,7 +363,7 @@ void silc_hash_table_find_foreach(SilcHashTable ht, void *key, * * NOTES * - * The hash table will not be rehashed during the traversing of the list, + * The hash table will not be rehashed during the traversing of the table, * even if the table was marked as auto rehashable. The caller also must * not call silc_hash_table_rehash while traversing the table. * @@ -618,7 +618,7 @@ bool silc_hash_table_find_ext(SilcHashTable ht, void *key, * * NOTES * - * The hash table will not be rehashed during the traversing of the list, + * The hash table will not be rehashed during the traversing of the table, * even if the table was marked as auto rehashable. The caller also must * not call silc_hash_table_rehash while traversing the table. * diff --git a/scripts/silcdoc/gen_detail.php b/scripts/silcdoc/gen_detail.php index 1ab755bf..7b3d1298 100644 --- a/scripts/silcdoc/gen_detail.php +++ b/scripts/silcdoc/gen_detail.php @@ -35,7 +35,7 @@ require "$page"; - +
    @@ -43,9 +43,9 @@ width="99%" align=center> diff --git a/scripts/silcdoc/gen_html_detail.php b/scripts/silcdoc/gen_html_detail.php new file mode 100644 index 00000000..999fcb16 --- /dev/null +++ b/scripts/silcdoc/gen_html_detail.php @@ -0,0 +1,39 @@ + + + Copyright (C) 2001 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + This is the detailed page generator. This generates the actual data + that is shown plus index at the right side. + +*/ +?> + +
    + + + + +
    + + + + + +
    +
    diff --git a/scripts/silcdoc/index.php b/scripts/silcdoc/index.php index 0ad58fa5..49a3862d 100644 --- a/scripts/silcdoc/index.php +++ b/scripts/silcdoc/index.php @@ -27,8 +27,8 @@
    -
    - +
    +
    $DST/index.html + sed -e "/@VERSION@/s//$version/" -e "/@DATE@/s//$curdate/" -e "/@BODY@/ r $DST/index.html.tmp" -e s/@BODY@//g $index >$DST/index.html sh gen.sh $DST gen_toc.php $DST/index.html $DST/index.html sh gen.sh $DST index.php $DST/index.html $DST/index.html rm -rf $DST/index.html.tmp rm -rf /tmp/silcdoc.html + rm -rf /tmp/silcdoc_html.html fi diff --git a/util/robodoc/Source/generator.c b/util/robodoc/Source/generator.c index c9dcd8de..6c12fa26 100644 --- a/util/robodoc/Source/generator.c +++ b/util/robodoc/Source/generator.c @@ -64,7 +64,7 @@ RB_Generate_Documentation ( if (output_mode == HTML) { - sprintf(fname, "%s_%s.html", doc_base, cur_header->function_name); + sprintf(fname, "%s__%s.html", doc_base, cur_header->function_name); dest_doc = fopen(fname, "w"); if (!dest_doc) { @@ -272,7 +272,7 @@ RB_Generate_Doc_Start ( #endif /* Generate quick index file, for fast referencing */ - sprintf(iname, "%s_index.tmpl", doc_base); + sprintf(iname, "%s__index.tmpl", doc_base); index = fopen(iname, "w"); if (!index) { @@ -286,7 +286,7 @@ RB_Generate_Doc_Start ( { char fname[256]; - sprintf(fname, "%s_%s.html", RB_FilePart(doc_base), + sprintf(fname, "%s__%s.html", RB_FilePart(doc_base), cur_header->function_name); if (cur_header->name && cur_header->function_name) @@ -1284,7 +1284,7 @@ RB_Generate_Item_Body (FILE * dest_doc, char *dest_name, fprintf (dest_doc, "%s", label_name, label_name); #endif - fprintf (dest_doc, "%s", + fprintf (dest_doc, "%s", RB_FilePart(doc_base), label_name, label_name); } -- 2.24.0