- Fixed bug #24402 (Compile failure with gettext 0.12.x)

This commit is contained in:
foobar 2003-09-24 02:07:04 +00:00
parent 431e5cf5b8
commit 258d5838bb
2 changed files with 36 additions and 40 deletions

View file

@ -18,42 +18,41 @@
/* $Id$ */ /* $Id$ */
#include <stdio.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include "php.h" #include "php.h"
#include "php_gettext.h"
#if HAVE_LIBINTL #if HAVE_LIBINTL
#include <stdio.h>
#include <libintl.h> #include <libintl.h>
#include "ext/standard/info.h" #include "ext/standard/info.h"
#include "php_gettext.h"
/* {{{ php_gettext_functions[] /* {{{ php_gettext_functions[]
*/ */
function_entry php_gettext_functions[] = { function_entry php_gettext_functions[] = {
PHP_FE(textdomain, NULL) PHP_NAMED_FE(textdomain, zif_textdomain, NULL)
PHP_FE(gettext, NULL) PHP_NAMED_FE(gettext, zif_gettext, NULL)
PHP_FALIAS(_, gettext, NULL) /* Alias for gettext() */
PHP_FE(dgettext, NULL) PHP_NAMED_FE(_, zif_gettext, NULL)
PHP_FE(dcgettext, NULL) PHP_NAMED_FE(dgettext, zif_dgettext, NULL)
PHP_FE(bindtextdomain, NULL) PHP_NAMED_FE(dcgettext, zif_dcgettext, NULL)
PHP_NAMED_FE(bindtextdomain, zif_bindtextdomain, NULL)
#if HAVE_NGETTEXT #if HAVE_NGETTEXT
PHP_FE(ngettext, NULL) PHP_NAMED_FE(ngettext, zif_ngettext, NULL)
#endif #endif
#if HAVE_DNGETTEXT #if HAVE_DNGETTEXT
PHP_FE(dngettext, NULL) PHP_NAMED_FE(dngettext, zif_dngettext, NULL)
#endif #endif
#if HAVE_DCNGETTEXT #if HAVE_DCNGETTEXT
PHP_FE(dcngettext, NULL) PHP_NAMED_FE(dcngettext, zif_dcngettext, NULL)
#endif #endif
#if HAVE_BIND_TEXTDOMAIN_CODESET #if HAVE_BIND_TEXTDOMAIN_CODESET
PHP_FE(bind_textdomain_codeset, NULL) PHP_NAMED_FE(bind_textdomain_codeset, zif_bind_textdomain_codeset, NULL)
#endif #endif
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };
/* }}} */ /* }}} */
@ -66,7 +65,7 @@ zend_module_entry php_gettext_module_entry = {
NULL, NULL,
NULL, NULL,
NULL, NULL,
PHP_MINFO(gettext), PHP_MINFO(php_gettext),
NO_VERSION_YET, NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
@ -75,7 +74,7 @@ zend_module_entry php_gettext_module_entry = {
ZEND_GET_MODULE(php_gettext) ZEND_GET_MODULE(php_gettext)
#endif #endif
PHP_MINFO_FUNCTION(gettext) PHP_MINFO_FUNCTION(php_gettext)
{ {
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_row(2, "GetText Support", "enabled"); php_info_print_table_row(2, "GetText Support", "enabled");
@ -84,7 +83,7 @@ PHP_MINFO_FUNCTION(gettext)
/* {{{ proto string textdomain(string domain) /* {{{ proto string textdomain(string domain)
Set the textdomain to "domain". Returns the current domain */ Set the textdomain to "domain". Returns the current domain */
PHP_FUNCTION(textdomain) PHP_NAMED_FUNCTION(zif_textdomain)
{ {
zval **domain; zval **domain;
char *domain_name, *retval; char *domain_name, *retval;
@ -110,7 +109,7 @@ PHP_FUNCTION(textdomain)
/* {{{ proto string gettext(string msgid) /* {{{ proto string gettext(string msgid)
Return the translation of msgid for the current domain, or msgid unaltered if a translation does not exist */ Return the translation of msgid for the current domain, or msgid unaltered if a translation does not exist */
PHP_FUNCTION(gettext) PHP_NAMED_FUNCTION(zif_gettext)
{ {
zval **msgid; zval **msgid;
char *msgstr; char *msgstr;
@ -128,7 +127,7 @@ PHP_FUNCTION(gettext)
/* {{{ proto string dgettext(string domain_name, string msgid) /* {{{ proto string dgettext(string domain_name, string msgid)
Return the translation of msgid for domain_name, or msgid unaltered if a translation does not exist */ Return the translation of msgid for domain_name, or msgid unaltered if a translation does not exist */
PHP_FUNCTION(dgettext) PHP_NAMED_FUNCTION(zif_dgettext)
{ {
zval **domain_name, **msgid; zval **domain_name, **msgid;
char *msgstr; char *msgstr;
@ -147,7 +146,7 @@ PHP_FUNCTION(dgettext)
/* {{{ proto string dcgettext(string domain_name, string msgid, long category) /* {{{ proto string dcgettext(string domain_name, string msgid, long category)
Return the translation of msgid for domain_name and category, or msgid unaltered if a translation does not exist */ Return the translation of msgid for domain_name and category, or msgid unaltered if a translation does not exist */
PHP_FUNCTION(dcgettext) PHP_NAMED_FUNCTION(zif_dcgettext)
{ {
zval **domain_name, **msgid, **category; zval **domain_name, **msgid, **category;
char *msgstr; char *msgstr;
@ -167,7 +166,7 @@ PHP_FUNCTION(dcgettext)
/* {{{ proto string bindtextdomain(string domain_name, string dir) /* {{{ proto string bindtextdomain(string domain_name, string dir)
Bind to the text domain domain_name, looking for translations in dir. Returns the current domain */ Bind to the text domain domain_name, looking for translations in dir. Returns the current domain */
PHP_FUNCTION(bindtextdomain) PHP_NAMED_FUNCTION(zif_bindtextdomain)
{ {
zval **domain_name, **dir; zval **domain_name, **dir;
char *retval, dir_name[MAXPATHLEN]; char *retval, dir_name[MAXPATHLEN];
@ -198,7 +197,7 @@ PHP_FUNCTION(bindtextdomain)
#if HAVE_NGETTEXT #if HAVE_NGETTEXT
/* {{{ proto string ngettext(string MSGID1, string MSGID2, int N) /* {{{ proto string ngettext(string MSGID1, string MSGID2, int N)
Plural version of gettext() */ Plural version of gettext() */
PHP_FUNCTION(ngettext) PHP_NAMED_FUNCTION(zif_ngettext)
{ {
zval **msgid1, **msgid2, **count; zval **msgid1, **msgid2, **count;
char *msgstr; char *msgstr;
@ -224,7 +223,7 @@ PHP_FUNCTION(ngettext)
#if HAVE_DNGETTEXT #if HAVE_DNGETTEXT
/* {{{ proto string dngettext (string domain, string msgid1, string msgid2, int count) /* {{{ proto string dngettext (string domain, string msgid1, string msgid2, int count)
Plural version of dgettext() */ Plural version of dgettext() */
PHP_FUNCTION(dngettext) PHP_NAMED_FUNCTION(zif_dngettext)
{ {
zval **domain, **msgid1, **msgid2, **count; zval **domain, **msgid1, **msgid2, **count;
@ -252,7 +251,7 @@ PHP_FUNCTION(dngettext)
#if HAVE_DCNGETTEXT #if HAVE_DCNGETTEXT
/* {{{ proto string dcngettext (string domain, string msgid1, string msgid2, int n, int category) /* {{{ proto string dcngettext (string domain, string msgid1, string msgid2, int n, int category)
Plural version of dcgettext() */ Plural version of dcgettext() */
PHP_FUNCTION(dcngettext) PHP_NAMED_FUNCTION(zif_dcngettext)
{ {
zval **domain, **msgid1, **msgid2, **count, **category; zval **domain, **msgid1, **msgid2, **count, **category;
@ -283,7 +282,7 @@ PHP_FUNCTION(dcngettext)
/* {{{ proto string bind_textdomain_codeset (string domain, string codeset) /* {{{ proto string bind_textdomain_codeset (string domain, string codeset)
Specify the character encoding in which the messages from the DOMAIN message catalog will be returned. */ Specify the character encoding in which the messages from the DOMAIN message catalog will be returned. */
PHP_FUNCTION(bind_textdomain_codeset) PHP_NAMED_FUNCTION(zif_bind_textdomain_codeset)
{ {
zval **domain, **codeset; zval **domain, **codeset;
char *retval; char *retval;

View file

@ -22,31 +22,28 @@
#define PHP_GETTEXT_H #define PHP_GETTEXT_H
#if HAVE_LIBINTL #if HAVE_LIBINTL
#ifndef INIT_FUNC_ARGS
#include "zend_modules.h"
#endif
extern zend_module_entry php_gettext_module_entry; extern zend_module_entry php_gettext_module_entry;
#define gettext_module_ptr &php_gettext_module_entry #define gettext_module_ptr &php_gettext_module_entry
PHP_MINFO_FUNCTION(gettext); PHP_MINFO_FUNCTION(php_gettext);
PHP_FUNCTION(textdomain); PHP_NAMED_FUNCTION(zif_textdomain);
PHP_FUNCTION(gettext); PHP_NAMED_FUNCTION(zif_gettext);
PHP_FUNCTION(dgettext); PHP_NAMED_FUNCTION(zif_dgettext);
PHP_FUNCTION(dcgettext); PHP_NAMED_FUNCTION(zif_dcgettext);
PHP_FUNCTION(bindtextdomain); PHP_NAMED_FUNCTION(zif_bindtextdomain);
#if HAVE_NGETTEXT #if HAVE_NGETTEXT
PHP_FUNCTION(ngettext); PHP_NAMED_FUNCTION(zif_ngettext);
#endif #endif
#if HAVE_DNGETTEXT #if HAVE_DNGETTEXT
PHP_FUNCTION(dngettext); PHP_NAMED_FUNCTION(zif_dngettext);
#endif #endif
#if HAVE_DCNGETTEXT #if HAVE_DCNGETTEXT
PHP_FUNCTION(dcngettext); PHP_NAMED_FUNCTION(zif_dcngettext);
#endif #endif
#if HAVE_BIND_TEXTDOMAIN_CODESET #if HAVE_BIND_TEXTDOMAIN_CODESET
PHP_FUNCTION(bind_textdomain_codeset); PHP_NAMED_FUNCTION(zif_bind_textdomain_codeset);
#endif #endif
#else #else