You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by pi...@apache.org on 2001/04/25 19:04:21 UTC

cvs commit: jakarta-tomcat-4.0/connectors/include wa_main.h wa.h wa_request.h wa_general.h

pier        01/04/25 10:04:21

  Modified:    connectors/include wa.h wa_request.h
  Added:       connectors/include wa_main.h
  Removed:     connectors/include wa_general.h
  Log:
  Renamed wa_general to wa_main.
  Updated function prototypes.
  
  Revision  Changes    Path
  1.3       +2 -2      jakarta-tomcat-4.0/connectors/include/wa.h
  
  Index: wa.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/connectors/include/wa.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- wa.h	2001/04/24 16:30:24	1.2
  +++ wa.h	2001/04/25 17:04:15	1.3
  @@ -57,7 +57,7 @@
   
   /**
    * @author  Pier Fumagalli <ma...@eng.sun.com>
  - * @version $Id: wa.h,v 1.2 2001/04/24 16:30:24 pier Exp $
  + * @version $Id: wa.h,v 1.3 2001/04/25 17:04:15 pier Exp $
    */
   #ifndef _WA_H_
   #define _WA_H_
  @@ -68,7 +68,7 @@
   #include <string.h>
   
   /* APR Library includes */
  -#include <apr_general.h>
  +#include <apr_main.h>
   #include <apr_pools.h>
   #include <apr_strings.h>
   #include <apr_tables.h>
  
  
  
  1.3       +17 -5     jakarta-tomcat-4.0/connectors/include/wa_request.h
  
  Index: wa_request.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/connectors/include/wa_request.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- wa_request.h	2001/04/24 16:30:25	1.2
  +++ wa_request.h	2001/04/25 17:04:17	1.3
  @@ -58,7 +58,7 @@
   /**
    * @package Request
    * @author  Pier Fumagalli <ma...@eng.sun.com>
  - * @version $Id: wa_request.h,v 1.2 2001/04/24 16:30:25 pier Exp $
  + * @version $Id: wa_request.h,v 1.3 2001/04/25 17:04:17 pier Exp $
    */
   #ifndef _WA_REQUEST_H_
   #define _WA_REQUEST_H_
  @@ -161,7 +161,7 @@
    * @param d The web-server specific data for this request.
    * @return An error message on faliure or <b>NULL</b>.
    */
  -const char *wa_request_alloc(wa_request **r, void *d);
  +const char *WA_AllocRequest(wa_request **r, void *d);
   
   /**
    * Clean up and free the memory used by a request structure.
  @@ -169,14 +169,26 @@
    * @param r The request structure to destroy.
    * @return An error message on faliure or <b>NULL</b>.
    */
  -const char *wa_request_free(wa_request *r);
  +const char *WA_FreeRequest(wa_request *r);
   
   /**
    * Invoke a request in a web application.
  - * <br>
  + *
  + * @param r The WebApp Library request structure.
  + * @param a The application to which this request needs to be forwarded.
  + * @return The HTTP result code of this operation.
  + */
  +int WA_InvokeRequest(wa_request *r, wa_application *a);
  +
  +/**
  + * Report the set up of a list of web applications to the client thru an
  + * HTTP request.
  + *
    * @param r The WebApp Library request structure.
  + * @param a A <b>NULL</b> terminated list of applications for which a
  + *          description should be generated.
    * @return The HTTP result code of this operation.
    */
  -int wa_request_invoke(wa_request *r, wa_application *a);
  +int WA_InfoRequest(wa_request *r, wa_application **a);
   
   #endif /* ifndef _WA_REQUEST_H_ */
  
  
  
  1.1                  jakarta-tomcat-4.0/connectors/include/wa_main.h
  
  Index: wa_main.h
  ===================================================================
  /* ========================================================================= *
   *                                                                           *
   *                 The Apache Software License,  Version 1.1                 *
   *                                                                           *
   *          Copyright (c) 1999-2001 The Apache Software Foundation.          *
   *                           All rights reserved.                            *
   *                                                                           *
   * ========================================================================= *
   *                                                                           *
   * Redistribution and use in source and binary forms,  with or without modi- *
   * fication, are permitted provided that the following conditions are met:   *
   *                                                                           *
   * 1. Redistributions of source code  must retain the above copyright notice *
   *    notice, this list of conditions and the following disclaimer.          *
   *                                                                           *
   * 2. Redistributions  in binary  form  must  reproduce the  above copyright *
   *    notice,  this list of conditions  and the following  disclaimer in the *
   *    documentation and/or other materials provided with the distribution.   *
   *                                                                           *
   * 3. The end-user documentation  included with the redistribution,  if any, *
   *    must include the following acknowlegement:                             *
   *                                                                           *
   *       "This product includes  software developed  by the Apache  Software *
   *        Foundation <http://www.apache.org/>."                              *
   *                                                                           *
   *    Alternately, this acknowlegement may appear in the software itself, if *
   *    and wherever such third-party acknowlegements normally appear.         *
   *                                                                           *
   * 4. The names  "The  Jakarta  Project",  "WebApp",  and  "Apache  Software *
   *    Foundation"  must not be used  to endorse or promote  products derived *
   *    from this  software without  prior  written  permission.  For  written *
   *    permission, please contact <ap...@apache.org>.                        *
   *                                                                           *
   * 5. Products derived from this software may not be called "Apache" nor may *
   *    "Apache" appear in their names without prior written permission of the *
   *    Apache Software Foundation.                                            *
   *                                                                           *
   * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES *
   * INCLUDING, BUT NOT LIMITED TO,  THE IMPLIED WARRANTIES OF MERCHANTABILITY *
   * AND FITNESS FOR  A PARTICULAR PURPOSE  ARE DISCLAIMED.  IN NO EVENT SHALL *
   * THE APACHE  SOFTWARE  FOUNDATION OR  ITS CONTRIBUTORS  BE LIABLE  FOR ANY *
   * DIRECT,  INDIRECT,   INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR  CONSEQUENTIAL *
   * DAMAGES (INCLUDING,  BUT NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE GOODS *
   * OR SERVICES;  LOSS OF USE,  DATA,  OR PROFITS;  OR BUSINESS INTERRUPTION) *
   * HOWEVER CAUSED AND  ON ANY  THEORY  OF  LIABILITY,  WHETHER IN  CONTRACT, *
   * STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *
   * ANY  WAY  OUT OF  THE  USE OF  THIS  SOFTWARE,  EVEN  IF  ADVISED  OF THE *
   * POSSIBILITY OF SUCH DAMAGE.                                               *
   *                                                                           *
   * ========================================================================= *
   *                                                                           *
   * This software  consists of voluntary  contributions made  by many indivi- *
   * duals on behalf of the  Apache Software Foundation.  For more information *
   * on the Apache Software Foundation, please see <http://www.apache.org/>.   *
   *                                                                           *
   * ========================================================================= */
  
  /**
   * @package Main
   * @author  Pier Fumagalli <ma...@eng.sun.com>
   * @version $Id: wa_main.h,v 1.1 2001/04/25 17:04:17 pier Exp $
   */
  #ifndef _WA_MAIN_H_
  #define _WA_MAIN_H_
  
  /**
   * The WebApp Library connection structure.
   * <br>
   * This structure holds all required data required by a connection provider
   * to connect to a web-application container and to handle HTTP requests.
   */
  struct wa_connection {
  	/** The APR memory pool where this connections is allocated. */
  	apr_pool_t *pool;
  	/** The connection provider. */
  	void *prov;
  	/** The provider-specific configuration member for this connection. */
  	void *conf;
  };
  
  /**
   * The WebApp Library application structure.
   * <br>
   * This structure holds all informations associated with an application.
   * Applications are not grouped in virtual hosts inside the library as in
   * specific cases (like when load balancing is in use), multiple applications
   * can share the same root URL path, or (like when applications are shared),
   * a single web application can be shared across multiple virtual host.
   */
  struct wa_application {
  	/** The APR memory pool where this application is allocated. */
  	apr_pool_t *pool;
  	/** The application connection. */
  	wa_connection *conn;
  	/** The provider-specific configuration member for this application. */
  	void *conf;
  	/** The application name. */
  	char *name;
  	/** The application root URL path. */
  	char *rpth;
  	/** The local expanded application path (if any). */
  	char *lpth;
  };
  
  /**
   * Initialize the WebApp Library.
   * This function must be called <b>before</b> any other calls to any other
   * function to set up the APR and WebApp Library internals. If any other
   * function is called before this function has been invoked will result in
   * impredictable results.
   *
   * @param w The Web Server structure used for callbacks.
   * @return <b>NULL</b> on success or an error message on faliure.
   */
  const char *WA_Init(wa_webserver *w);
  
  /**
   * Clean up the WebApp Library.
   * This function releases all memory and resouces used by the WebApp library
   * and must be called before the underlying web server process exits. Any call
   * to any other WebApp Library function after this function has been invoked
   * will result in impredictable results.
   *
   * @return <b>NULL</b> on success or an error message on faliure.
   */
  const char *WA_Destroy(void);
  
  /**
   * Allocate and set up a <code>wa_connection</code> member.
   *
   * @param c Where the pointer to where the <code>wa_connection</code> member
   *          must be stored.
   * @param p The connection provider name.
   * @param a The connection argument from a configuration file.
   * @return <b>NULL</b> on success or an error message on faliure.
   */
  const char *WA_Connect(wa_connection **c, const char *p, const char *a);
  
  /**
   * Allocate, set up and deploy a <code>wa_application</code> member.
   *
   * @param a Where the pointer to where the <code>wa_application</code> member
   *          must be stored.
   * @param c The <code>wa_connection</code> where the application is deployed.
   * @param n The application name. This parameter will be passed to the
   *          application container as its unique selection key within its
   *          array of deployable applications (for example the .war file name).
   * @param p The root URL path of the web application to deploy.
   * @return <b>NULL</b> on success or an error message on faliure.
   */
  const char *WA_Deploy(wa_application **a, wa_connection *c, const char *n,
                        const char *p);
  
  /**
   * Attempt to match an URL against a web application.
   * This function will return <b>TRUE</b> only if the root URL path of the
   * application matches the beginning of the specified URL.
   *
   * @param u The request URL to be matched against the web application.
   * @param a The application against which the URL must be matched.
   * @return <b>TRUE</b> if the URL can be handled by the web application without
   *         raising a &quot;404 Not Found&quot; error, <b>FALSE</b> otherwise.
   */
  boolean WA_Match(const char *u, wa_application *a);
  
  /**
   * The <code>wa_webserver</code> structure used for all callbacks while
   * processing an HTTP request.
   */
  extern wa_webserver *WA_WebServer;
  
  /**
   * The APR memory pool used by the WebApp Library.
   */
  extern apr_pool_t *WA_Pool;
  
  #endif /* ifndef _WA_MAIN_H_ */