Skip to content

Commit

Permalink
@cleaned up extension namespace (Stig)
Browse files Browse the repository at this point in the history
Cleaned up extension namespace, and changed ext/standard into one single
extension.
  • Loading branch information
stigsb committed Mar 6, 2000
1 parent 031808c commit 99e0b36
Show file tree
Hide file tree
Showing 44 changed files with 351 additions and 583 deletions.
3 changes: 3 additions & 0 deletions Makefile.in
Expand Up @@ -51,4 +51,7 @@ configuration-parser.h configuration-parser.c: configuration-parser.y
configuration-scanner.c: configuration-scanner.l
$(LEX) -Pcfg -o$@ -i $<

internal_functions.c: internal_functions.c.in config.status
CONFIG_FILES= CONFIG_HEADERS= ./config.status

.NOEXPORT:
30 changes: 7 additions & 23 deletions ext/ereg/ereg.c
Expand Up @@ -24,31 +24,15 @@
#include "php_string.h"
#include "reg.h"

unsigned char third_argument_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };

function_entry reg_functions[] = {
PHP_FE(ereg, third_argument_force_ref)
PHP_FE(ereg_replace, NULL)
PHP_FE(eregi, third_argument_force_ref)
PHP_FE(eregi_replace, NULL)
PHP_FE(split, NULL)
PHP_FALIAS(join, implode, NULL)
PHP_FE(sql_regcase, NULL)
{NULL, NULL, NULL}
};


static PHP_MINIT_FUNCTION(regex);
static PHP_MSHUTDOWN_FUNCTION(regex);
static PHP_MINFO_FUNCTION(regex);

#if 0
zend_module_entry regexp_module_entry = {
"Regular Expressions",
reg_functions,
PHP_MINIT(regex), PHP_MSHUTDOWN(regex),
NULL, NULL, PHP_MINFO(regex),
STANDARD_MODULE_PROPERTIES
};
#endif

#ifdef ZTS
int reg_globals_id;
Expand Down Expand Up @@ -101,7 +85,7 @@ static void php_reg_init_globals(php_reg_globals *reg_globals)
zend_hash_init(&reg_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1);
}

static PHP_MINIT_FUNCTION(regex)
PHP_MINIT_FUNCTION(regex)
{
#ifdef ZTS
reg_globals_id = ts_allocate_id(sizeof(php_reg_globals), (ts_allocate_ctor) php_reg_init_globals, NULL);
Expand All @@ -112,20 +96,20 @@ static PHP_MINIT_FUNCTION(regex)
return SUCCESS;
}

static PHP_MSHUTDOWN_FUNCTION(regex)
PHP_MSHUTDOWN_FUNCTION(regex)
{
REGLS_FETCH();

zend_hash_destroy(&REG(ht_rc));
return SUCCESS;
}

static PHP_MINFO_FUNCTION(regex)
PHP_MINFO_FUNCTION(regex)
{
#if HSREGEX
PUTS("Bundled regex library enabled\n");
PUTS("Bundled regex library enabled<br>\n");
#else
PUTS("System regex library enabled\n");
PUTS("System regex library enabled<br>\n");
#endif
}

Expand Down
9 changes: 4 additions & 5 deletions ext/ereg/php_ereg.h
Expand Up @@ -33,9 +33,6 @@
#ifndef _REG_H
#define _REG_H

extern zend_module_entry regexp_module_entry;
#define regexp_module_ptr &regexp_module_entry

char *php_reg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended);

PHP_FUNCTION(ereg);
Expand All @@ -49,6 +46,10 @@ typedef struct {
HashTable ht_rc;
} php_reg_globals;

PHP_MINIT_FUNCTION(regex);
PHP_MSHUTDOWN_FUNCTION(regex);
PHP_MINFO_FUNCTION(regex);


#ifdef ZTS
#define REGLS_D php_reg_globals *reg_globals
Expand All @@ -66,6 +67,4 @@ typedef struct {
#define REGLS_FETCH()
#endif

#define phpext_regex_ptr regexp_module_ptr

#endif /* _REG_H */
60 changes: 2 additions & 58 deletions ext/standard/array.c
Expand Up @@ -14,6 +14,8 @@
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
| Rasmus Lerdorf <rasmus@php.net> |
| Andrei Zmievski <andrei@ispi.net> |
+----------------------------------------------------------------------+
*/

Expand Down Expand Up @@ -52,64 +54,6 @@ php_array_globals array_globals;
#define SORT_DESC -1
#define SORT_ASC 1

function_entry array_functions[] = {
PHP_FE(ksort, first_arg_force_ref)
PHP_FE(krsort, first_arg_force_ref)
PHP_FE(asort, first_arg_force_ref)
PHP_FE(arsort, first_arg_force_ref)
PHP_FE(sort, first_arg_force_ref)
PHP_FE(rsort, first_arg_force_ref)
PHP_FE(usort, first_arg_force_ref)
PHP_FE(uasort, first_arg_force_ref)
PHP_FE(uksort, first_arg_force_ref)
PHP_FE(shuffle, first_arg_force_ref)
PHP_FE(array_walk, first_arg_force_ref)
PHP_FE(count, first_arg_allow_ref)
PHP_FE(end, first_arg_force_ref)
PHP_FE(prev, first_arg_force_ref)
PHP_FE(next, first_arg_force_ref)
PHP_FE(reset, first_arg_force_ref)
PHP_FE(current, first_arg_force_ref)
PHP_FE(key, first_arg_force_ref)
PHP_FE(min, NULL)
PHP_FE(max, NULL)
PHP_FE(in_array, NULL)
PHP_FE(extract, NULL)
PHP_FE(compact, NULL)
PHP_FE(range, NULL)
PHP_FE(array_multisort, NULL)
PHP_FE(array_push, first_arg_force_ref)
PHP_FE(array_pop, first_arg_force_ref)
PHP_FE(array_shift, first_arg_force_ref)
PHP_FE(array_unshift, first_arg_force_ref)
PHP_FE(array_splice, first_arg_force_ref)
PHP_FE(array_slice, NULL)
PHP_FE(array_merge, NULL)
PHP_FE(array_keys, NULL)
PHP_FE(array_values, NULL)
PHP_FE(array_count_values, NULL)
PHP_FE(array_reverse, NULL)
PHP_FE(array_pad, NULL)
PHP_FE(array_flip, NULL)

/* Aliases */
PHP_FALIAS(pos, current, first_arg_force_ref)
PHP_FALIAS(sizeof, count, first_arg_allow_ref)

{NULL, NULL, NULL}
};

zend_module_entry array_module_entry = {
"Array Functions", /* extension name */
array_functions, /* function list */
PHP_MINIT(array), /* process startup */
PHP_MSHUTDOWN(array), /* process shutdown */
NULL, /* request startup */
NULL, /* request shutdown */
NULL, /* extension info */
STANDARD_MODULE_PROPERTIES
};

PHP_MINIT_FUNCTION(array)
{
#ifdef ZTS
Expand Down
27 changes: 0 additions & 27 deletions ext/standard/assert.c
Expand Up @@ -53,33 +53,6 @@ php_assert_globals assert_globals;

#define SAFE_STRING(s) ((s)?(s):"")

PHP_MINIT_FUNCTION(assert);
PHP_MSHUTDOWN_FUNCTION(assert);
PHP_RINIT_FUNCTION(assert);
PHP_RSHUTDOWN_FUNCTION(assert);
PHP_MINFO_FUNCTION(assert);

PHP_FUNCTION(assert);
PHP_FUNCTION(assert_options);

static zend_function_entry php_assert_functions[] = {
PHP_FE(assert, NULL)
PHP_FE(assert_options, NULL)
{NULL, NULL, NULL}
};


zend_module_entry assert_module_entry = {
"Assertion",
php_assert_functions,
PHP_MINIT(assert),
PHP_MSHUTDOWN(assert),
PHP_RINIT(assert),
PHP_RSHUTDOWN(assert),
PHP_MINFO(assert),
STANDARD_MODULE_PROPERTIES
};

#define ASSERT_ACTIVE 1
#define ASSERT_CALLBACK 2
#define ASSERT_BAIL 3
Expand Down

0 comments on commit 99e0b36

Please sign in to comment.