/* +----------------------------------------------------------------------+ | PHP version 4.0 | +----------------------------------------------------------------------+ | Copyright (c) 1997, 1998, 1999 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 2.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available at through the world-wide-web at | | http://www.php.net/license/2_0.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Uwe Steinmann | +----------------------------------------------------------------------+ */ /* $Id$ */ #if COMPILE_DL #include "dl/phpdl.h" #endif #include #if !(WIN32|WINNT) #include "php_config.h" #endif #include "php.h" #include "ext/standard/head.h" #if HYPERWAVE #include "hw.h" #if APACHE # ifndef DEBUG # undef palloc # endif #endif hw_module php3_hw_module; function_entry hw_functions[] = { PHP_FE(hw_connect, NULL) PHP_FE(hw_pconnect, NULL) PHP_FE(hw_close, NULL) PHP_FE(hw_root, NULL) PHP_FE(hw_info, NULL) PHP_FE(hw_connection_info, NULL) PHP_FE(hw_error, NULL) PHP_FE(hw_errormsg, NULL) PHP_FE(hw_getparentsobj, NULL) PHP_FE(hw_getparents, NULL) PHP_FE(hw_children, NULL) PHP_FE(hw_childrenobj, NULL) PHP_FE(hw_getchildcoll, NULL) PHP_FE(hw_getchildcollobj, NULL) PHP_FE(hw_getobject, NULL) PHP_FE(hw_getandlock, NULL) PHP_FE(hw_unlock, NULL) PHP_FE(hw_gettext, NULL) PHP_FE(hw_edittext, NULL) PHP_FE(hw_getcgi, NULL) PHP_FE(hw_getremote, NULL) PHP_FE(hw_getremotechildren, NULL) PHP_FE(hw_pipedocument, NULL) PHP_FE(hw_pipecgi, NULL) PHP_FE(hw_insertdocument, NULL) PHP_FE(hw_mv, NULL) PHP_FE(hw_cp, NULL) PHP_FE(hw_deleteobject, NULL) PHP_FE(hw_changeobject, NULL) PHP_FE(hw_docbyanchor, NULL) PHP_FE(hw_docbyanchorobj, NULL) PHP_FE(hw_getobjectbyquery, NULL) PHP_FE(hw_getobjectbyqueryobj, NULL) PHP_FE(hw_getobjectbyquerycoll, NULL) PHP_FE(hw_getobjectbyquerycollobj, NULL) PHP_FE(hw_getchilddoccoll, NULL) PHP_FE(hw_getchilddoccollobj, NULL) PHP_FE(hw_getanchors, NULL) PHP_FE(hw_getanchorsobj, NULL) PHP_FE(hw_getusername, NULL) PHP_FE(hw_setlinkroot, NULL) PHP_FE(hw_identify, NULL) PHP_FE(hw_free_document, NULL) PHP_FE(hw_new_document, NULL) PHP_FE(hw_output_document, NULL) PHP_FE(hw_outputdocument, NULL) PHP_FE(hw_document_size, NULL) PHP_FE(hw_documentsize, NULL) PHP_FE(hw_document_attributes, NULL) PHP_FE(hw_documentattributes, NULL) PHP_FE(hw_document_bodytag, NULL) PHP_FE(hw_documentbodytag, NULL) PHP_FE(hw_document_content, NULL) PHP_FE(hw_objrec2array, NULL) PHP_FE(hw_array2objrec, NULL) PHP_FE(hw_incollections, NULL) PHP_FE(hw_inscoll, NULL) PHP_FE(hw_insertobject, NULL) PHP_FE(hw_insdoc, NULL) PHP_FE(hw_getsrcbydestobj, NULL) PHP_FE(hw_getrellink, NULL) PHP_FE(hw_who, NULL) PHP_FE(hw_stat, NULL) PHP_FE(hw_dummy, NULL) {NULL, NULL, NULL} }; php3_module_entry hw_module_entry = { "HyperWave", hw_functions, PHP_MINIT(hw), NULL, NULL, NULL, PHP_MINFO(hw), 0, 0, 0, NULL }; void print_msg(hg_msg *msg, char *str, int txt); #if COMPILE_DL DLEXPORT php3_module_entry *get_module(void) { return &hw_module_entry; } #endif void _close_hw_link(hw_connection *conn) { if(conn->hostname) free(conn->hostname); if(conn->username) free(conn->username); close(conn->socket); free(conn); php3_hw_module.num_links--; } void _close_hw_plink(hw_connection *conn) { if(conn->hostname) free(conn->hostname); if(conn->username) free(conn->username); close(conn->socket); free(conn); php3_hw_module.num_links--; php3_hw_module.num_persistent--; } void _free_hw_document(hw_document *doc) { if(doc->data) free(doc->data); if(doc->attributes) free(doc->attributes); if(doc->bodytag) free(doc->bodytag); free(doc); } /* creates an array in return value and frees all memory * Also adds as an assoc. array at the end of the return array with * statistics. */ int make_return_objrec(pval **return_value, char **objrecs, int count) { pval stat_arr; int i; int hidden, collhead, fullcollhead, total; int collheadnr, fullcollheadnr; if (array_init(*return_value) == FAILURE) { /* Ups, failed! Let's at least free the memory */ for(i=0; i