Added SILC HTTP Server API
[runtime.git] / lib / silchttp / silchttpserver.h
index 3abea82db49bd2bd1dcb73184f1595cc3f0dd7af..a966794f282c370497d7a2f8a83e285e696755a5 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2006 Pekka Riikonen
+  Copyright (C) 2006 - 2008 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
 
 */
 
-/****h* silchttp/SILC HTTP Server Interface
+/****h* silchttp/HTTP Server Interface
  *
  * DESCRIPTION
  *
  * Very simple HTTP server interface.  This HTTP server supports basic HTTP
  * features.  All pages on the server are dynamically created by the caller
  * of this interface.  The server does not support plugins, modules, cgi-bin,
- * server-side includes or any other special features.
+ * server-side includes or any other special features.  Naturally, the caller
+ * of this interface may itself implement such features.
  *
  ***/
 
 #ifndef SILCHTTPSERVER_H
 #define SILCHTTPSERVER_H
 
-/****s* silchttp/SilcHTTPServer/SilcHttpServer
+/****s* silchttp/SilcHttpServer
  *
  * NAME
  *
@@ -45,7 +46,7 @@
  ***/
 typedef struct SilcHttpServerStruct *SilcHttpServer;
 
-/****s* silchttp/SilcHTTPServer/SilcHttpConnection
+/****s* silchttp/SilcHttpConnection
  *
  * NAME
  *
@@ -61,7 +62,7 @@ typedef struct SilcHttpServerStruct *SilcHttpServer;
  ***/
 typedef struct SilcHttpConnectionStruct *SilcHttpConnection;
 
-/****f* silchttp/SilcHTTPServer/SilcHttpServerCallback
+/****f* silchttp/SilcHttpServerCallback
  *
  * SYNOPSIS
  *
@@ -74,7 +75,7 @@ typedef struct SilcHttpConnectionStruct *SilcHttpConnection;
  *
  * DESCRIPTION
  *
- *    The HTTP request callback, that is called everytime a new HTTP request
+ *    The HTTP request callback that is called everytime a new HTTP request
  *    comes from a HTTP client.  The `uri' is the requested URI (web page),
  *    and the `method' is the HTTP request method (GET, POST, etc.).  The
  *    `data' is non-NULL only if the `method' is POST, and it includes the
@@ -96,7 +97,7 @@ typedef void (*SilcHttpServerCallback)(SilcHttpServer httpd,
                                       SilcBuffer data,
                                       void *context);
 
-/****f* silchttp/SilcHTTPServer/silc_http_server_alloc
+/****f* silchttp/silc_http_server_alloc
  *
  * SYNOPSIS
  *
@@ -111,6 +112,8 @@ typedef void (*SilcHttpServerCallback)(SilcHttpServer httpd,
  *    `port'.  The `callback' with `context' will be called everytime a new
  *    HTTP request comes to the server from a HTTP client.  In that callback
  *    the caller must then reply with the requested Web page or with error.
+ *    If the `schedule' is NULL this will call silc_schedule_get_global to
+ *    try to get global scheduler.
  *
  ***/
 SilcHttpServer silc_http_server_alloc(const char *ip, SilcUInt16 port,
@@ -118,7 +121,7 @@ SilcHttpServer silc_http_server_alloc(const char *ip, SilcUInt16 port,
                                      SilcHttpServerCallback callback,
                                      void *context);
 
-/****f* silchttp/SilcHTTPServer/silc_http_server_free
+/****f* silchttp/silc_http_server_free
  *
  * SYNOPSIS
  *
@@ -131,7 +134,7 @@ SilcHttpServer silc_http_server_alloc(const char *ip, SilcUInt16 port,
  ***/
 void silc_http_server_free(SilcHttpServer httpd);
 
-/****f* silchttp/SilcHTTPServer/silc_http_server_send
+/****f* silchttp/silc_http_server_send
  *
  * SYNOPSIS
  *
@@ -150,7 +153,7 @@ SilcBool silc_http_server_send(SilcHttpServer httpd,
                               SilcHttpConnection conn,
                               SilcBuffer data);
 
-/****f* silchttp/SilcHTTPServer/silc_http_server_send_error
+/****f* silchttp/silc_http_server_send_error
  *
  * SYNOPSIS
  *
@@ -181,7 +184,7 @@ SilcBool silc_http_server_send_error(SilcHttpServer httpd,
                                     const char *error,
                                     const char *error_message);
 
-/****f* silchttp/SilcHTTPServer/silc_http_server_get_header
+/****f* silchttp/silc_http_server_get_header
  *
  * SYNOPSIS
  *
@@ -200,7 +203,7 @@ const char *silc_http_server_get_header(SilcHttpServer httpd,
                                        SilcHttpConnection conn,
                                        const char *field);
 
-/****f* silchttp/SilcHTTPServer/silc_http_server_add_header
+/****f* silchttp/silc_http_server_add_header
  *
  * SYNOPSIS
  *
@@ -218,6 +221,7 @@ const char *silc_http_server_get_header(SilcHttpServer httpd,
  * EXAMPLE
  *
  *    silc_http_server_add_header(httpd, conn, "Content-Type", "image/jpeg");
+ *    silc_http_server_send(httpd, conn, image_data);
  *
  ***/
 SilcBool silc_http_server_add_header(SilcHttpServer httpd,