Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 36230 invoked from network); 24 Oct 2005 05:25:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Oct 2005 05:25:46 -0000 Received: (qmail 87996 invoked by uid 500); 24 Oct 2005 05:25:45 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 87925 invoked by uid 500); 24 Oct 2005 05:25:44 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 87914 invoked by uid 500); 24 Oct 2005 05:25:44 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 87910 invoked by uid 99); 24 Oct 2005 05:25:44 -0000 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 23 Oct 2005 22:25:44 -0700 Received: (qmail 36159 invoked by uid 65534); 24 Oct 2005 05:25:23 -0000 Message-ID: <20051024052523.36158.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r327974 - in /webservices/axis2/trunk/c: include/axis2_om_stax_builder.h modules/xml/om/src/axis2_om_stax_builder.c Date: Mon, 24 Oct 2005 05:25:22 -0000 To: axis2-cvs@ws.apache.org From: samisa@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: samisa Date: Sun Oct 23 22:25:11 2005 New Revision: 327974 URL: http://svn.apache.org/viewcvs?rev=327974&view=rev Log: Improved the doc comments. Also dropped unused methods. Modified: webservices/axis2/trunk/c/include/axis2_om_stax_builder.h webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c Modified: webservices/axis2/trunk/c/include/axis2_om_stax_builder.h URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_stax_builder.h?rev=327974&r1=327973&r2=327974&view=diff ============================================================================== --- webservices/axis2/trunk/c/include/axis2_om_stax_builder.h (original) +++ webservices/axis2/trunk/c/include/axis2_om_stax_builder.h Sun Oct 23 22:25:11 2005 @@ -26,51 +26,98 @@ #include #include -struct axis2_om_stax_builder; -struct axis2_om_stax_builder_ops; - -typedef struct axis2_om_stax_builder_ops +#ifdef __cplusplus +extern "C" { - -/** - * move parser forward and reacts to events - */ - - axis2_om_node_t *(*axis2_om_stax_builder_ops_next) (axis2_environment_t * - environment, - struct axis2_om_stax_builder - * builder); - - axis2_status_t (*axis2_om_stax_builder_ops_discard_current_element) - (axis2_environment_t * environment, - struct axis2_om_stax_builder * builder); +#endif -} axis2_om_stax_builder_ops_t; - -typedef struct axis2_om_stax_builder -{ - axis2_om_stax_builder_ops_t *ops; - void *parser; - axis2_om_node_t *lastnode; - axis2_om_document_t *document; - axis2_bool_t done; - axis2_bool_t parser_accessed; - axis2_bool_t cache; -} axis2_om_stax_builder_t; + struct axis2_om_stax_builder; + struct axis2_om_stax_builder_ops; /** - * create an stax_om_builder - * @param parser This is the XMLStreamReader of xmlparser - * [ Guththila ] + * @defgroup axis2_om_stax_builder OM Stax Builder + * @ingroup axis2_om + * @{ */ -axis2_om_stax_builder_t *axis2_om_stax_builder_create (axis2_environment_t * - environment, - void *parser); + /** + * @brief OM stax builder operations struct + * Encapsulator struct for operations of axis2_om_stax_builder + */ + typedef struct axis2_om_stax_builder_ops + { + /** + * Builds the next node from stream. Moves pull parser forward and reacts to events. + * @param environment Environment. MUST NOT be NULL, if NULL behaviour is undefined. + * @param builder pointer to stax builder struct to be used + * @return a pointer to the next node, or NULL if there are no more nodes. + * On erros sets the error and returns NULL. + */ + AXIS2_DECLARE_DATA axis2_om_node_t * + (AXIS2_CALL *axis2_om_stax_builder_ops_next) (axis2_environment_t * + environment, + struct axis2_om_stax_builder * + builder); + + /** + * Discards the element that is being built currently. + * @param environment Environment. MUST NOT be NULL, if NULL behaviour is undefined. + * @param builder pointer to stax builder struct to be used + * @return satus of the operation. AXIS2_SUCCESS on success else AXIS2_FAILURE. + */ + AXIS2_DECLARE_DATA axis2_status_t (AXIS2_CALL *axis2_om_stax_builder_ops_discard_current_element) + (axis2_environment_t * environment, + struct axis2_om_stax_builder * builder); + + + } axis2_om_stax_builder_ops_t; + + /** + * \brief OM stax builder struct + * Bulds OM document using a pull parser interface + */ + typedef struct axis2_om_stax_builder + { + /** operations struct */ + axis2_om_stax_builder_ops_t *ops; + /** pull parser instance used by the builder */ + void *parser; + /** last node the builder found */ + axis2_om_node_t *lastnode; + /** document associated with the builder */ + axis2_om_document_t *document; + /** done building the document? */ + axis2_bool_t done; + /** parser was accessed? */ + axis2_bool_t parser_accessed; + /** caching enabled? */ + axis2_bool_t cache; + } axis2_om_stax_builder_t; + + /** + * creates an stax builder + * @param environment Environment. MUST NOT be NULL, if NULL behaviour is undefined. + * @param parser pull parser to be used by the builder. Parser should implement the + * Guththila interface. If NULL, default xml parser + * (guththila pull parser) will be created with stdin as the input stream. + * @return a pointer to the newly created builder struct. + */ + AXIS2_DECLARE( axis2_om_stax_builder_t *) axis2_om_stax_builder_create (axis2_environment_t + * environment, + void *parser); +/** builds next node */ #define axis2_om_stax_builder_next(environment, builder) ((builder)->ops->axis2_om_stax_builder_ops_next(environment, builder)) +/** discards current node */ #define axis2_om_stax_builder_discard_current_element(environment, builder) ((builder)->ops->axis2_om_stax_builder_ops_discard_current_element(environment, builder)) +/** @} */ + + +#ifdef __cplusplus +} +#endif + -#endif /* AXIS2_OM_STAX_BUILDER_H */ +#endif /* AXIS2_OM_STAX_BUILDER_H */ Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c?rev=327974&r1=327973&r2=327974&view=diff ============================================================================== --- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c (original) +++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c Sun Oct 23 22:25:11 2005 @@ -32,32 +32,6 @@ axis2_om_stax_builder_t * builder); -static int -isnot_whitespace (axis2_char_t s[]) -{ - - int n = 0; - - for (n = strlen (s) - 1; n >= 0; n--) - if (s[n] != ' ' && s[n] != '\t' && s[n] != '\n') - break; - if (n == -1) - n = 0; - - return n; -} - -static int -trim (axis2_char_t s[]) -{ - int n; - for (n = strlen (s) - 1; n >= 0; n--) - if (s[n] != ' ' && s[n] != '\t' && s[n] != '\n') - break; - s[n + 1] = '\0'; - return n; -} - axis2_om_stax_builder_t * axis2_om_stax_builder_create (axis2_environment_t * environment, void *parser) { @@ -510,6 +484,8 @@ axis2_om_stax_builder_create_om_text (environment, builder); break; case GUTHTHILA_COMMENT: + break; + default: break; } }