hholzgra                Wed Apr 25 14:02:46 2001 EDT

  Added files:                 
    /php4/ext/rtfm      .cvsignore Makefile.in config.m4 php_rtfm.h rtfm.c 
  Log:
  guess what ... :)
  
  

Index: php4/ext/rtfm/.cvsignore
+++ php4/ext/rtfm/.cvsignore
deps
Makefile
*.lo
*.la
libs
libs.mk

Index: php4/ext/rtfm/Makefile.in
+++ php4/ext/rtfm/Makefile.in
# $Id: Makefile.in,v 1.1 2001/04/25 21:02:46 hholzgra Exp $

LTLIBRARY_NAME        = librtfm.la
LTLIBRARY_SOURCES     = rtfm.c
LTLIBRARY_SHARED_NAME = rtfm.la
LTLIBRARY_SHARED_LIBADD  = $(RTFM_SHARED_LIBADD)

include $(top_srcdir)/build/dynlib.mk

Index: php4/ext/rtfm/config.m4
+++ php4/ext/rtfm/config.m4
dnl $Id: config.m4,v 1.1 2001/04/25 21:02:46 hholzgra Exp $
PHP_ARG_ENABLE(rtfm, whether to enable rtfm support,
    [  --disable-rtfm           Enable rtfm support],yes)

if test "$PHP_RTFM" != "no"; then
  PHP_EXTENSION(rtfm, $ext_shared)
fi

Index: php4/ext/rtfm/php_rtfm.h
+++ php4/ext/rtfm/php_rtfm.h
/*
   +----------------------------------------------------------------------+
   | PHP version 4.0                                                      |
   +----------------------------------------------------------------------+
   | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group             |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.02 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_02.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          |
   | [EMAIL PROTECTED] so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Authors: Hartmut Holzgraefe <[EMAIL PROTECTED]>                         |
   |          Peter Petermann    <[EMAIL PROTECTED]>                   |
   +----------------------------------------------------------------------+
 */

#ifndef PHP_RTFM_H
#define PHP_RTFM_H

extern zend_module_entry rtfm_module_entry;
#define phpext_rtfm_ptr &rtfm_module_entry

#ifdef PHP_WIN32
#define PHP_RTFM_API __declspec(dllexport)
#else
#define PHP_RTFM_API
#endif

PHP_MINIT_FUNCTION(rtfm);
PHP_MSHUTDOWN_FUNCTION(rtfm);
PHP_MINFO_FUNCTION(rtfm);

PHP_FUNCTION(rtfm);

ZEND_BEGIN_MODULE_GLOBALS(rtfm)
        char *manual_url;
        char *faq_url;
ZEND_END_MODULE_GLOBALS(rtfm)

#ifdef ZTS
#define RTFMG(v) (rtfm_globals->v)
#define RTFMLS_FETCH() zend_rtfm_globals *rtfm_globals = ts_resource(rtfm_globals_id)
#else
#define RTFMG(v) (rtfm_globals.v)
#define RTFMLS_FETCH()
#endif

#endif  /* PHP_RTFM_H */


/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * End:
 */

Index: php4/ext/rtfm/rtfm.c
+++ php4/ext/rtfm/rtfm.c
/*
   +----------------------------------------------------------------------+
   | PHP version 4.0                                                      |
   +----------------------------------------------------------------------+
   | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group             |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.02 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_02.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          |
   | [EMAIL PROTECTED] so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Authors: Hartmut Holzgraefe <[EMAIL PROTECTED]>                         |
   |          Peter Petermann    <[EMAIL PROTECTED]>                      |
   +----------------------------------------------------------------------+
 */

#include "php.h"
#include "php_ini.h"
#include "php_rtfm.h"

ZEND_DECLARE_MODULE_GLOBALS(rtfm)

function_entry rtfm_functions[] = {
        PHP_FE(rtfm,    NULL)
        {NULL, NULL, NULL}      /* Must be the last line in rtfm_functions[] */
};

zend_module_entry rtfm_module_entry = {
        "rtfm",
        rtfm_functions,
        PHP_MINIT(rtfm),
        PHP_MSHUTDOWN(rtfm),
        NULL,
        NULL,
        PHP_MINFO(rtfm),
        STANDARD_MODULE_PROPERTIES
};

#ifdef COMPILE_DL_RTFM
ZEND_GET_MODULE(rtfm)
#endif

PHP_INI_BEGIN()
         STD_PHP_INI_ENTRY("rtfm.manual_url", "http://php.net/manual/";, PHP_INI_ALL, 
OnUpdateString, manual_url, zend_rtfm_globals,     rtfm_globals)
         STD_PHP_INI_ENTRY("rtfm.faq_url"   , "http://php.net/faq/";,    PHP_INI_ALL, 
OnUpdateString, faq_url   , zend_rtfm_globals,     rtfm_globals)
PHP_INI_END()

PHP_MINIT_FUNCTION(rtfm)
{
        REGISTER_INI_ENTRIES();
        return SUCCESS;
}

PHP_MSHUTDOWN_FUNCTION(rtfm)
{
        UNREGISTER_INI_ENTRIES();
        return SUCCESS;
}


PHP_MINFO_FUNCTION(rtfm)
{
        php_info_print_table_start();
        php_info_print_table_header(2, "rtfm support", "enabled");
        php_info_print_table_end();

        DISPLAY_INI_ENTRIES();
}

/* {{{ proto void rtfm(void )
    */
PHP_FUNCTION(rtfm)
{
        RTFMLS_FETCH();
        php_printf("Read the <a href='%s'>FAQ</a> or <a 
href='%s'>Manual</a>!\n",RTFMG(faq_url),RTFMG(manual_url));
}
/* }}} */



/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * End:
 */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to